libcompose: github.com/bdwilliams/libcompose/integration Index | Files

package integration

import "github.com/bdwilliams/libcompose/integration"

Index

Package Files

requirements.go

Variables

var (
    IsWindows = testRequirement{
        func() bool { return runtime.GOOS == "windows" },
        "Test requires a Windows daemon",
    }
    IsLinux = testRequirement{
        func() bool { return runtime.GOOS == "linux" },
        "Test requires a Linux daemon",
    }
    Network = testRequirement{
        func() bool {
            // Set a timeout on the GET at 15s
            var timeout = 15 * time.Second
            var url = "https://hub.docker.com"

            client := http.Client{
                Timeout: timeout,
            }

            resp, err := client.Get(url)
            if err != nil && strings.Contains(err.Error(), "use of closed network connection") {
                panic(fmt.Sprintf("Timeout for GET request on %s", url))
            }
            if resp != nil {
                resp.Body.Close()
            }
            return err == nil
        },
        "Test requires network availability, environment variable set to none to run in a non-network enabled mode.",
    }
)

List test requirements

func DaemonVersionIs Uses

func DaemonVersionIs(version string) testRequirement

Package integration imports 7 packages (graph). Updated 2017-11-19. Refresh now. Tools for package owners. This is a dead-end fork (no commits since the fork).