2019-05-16 08:19:30 -04:00
|
|
|
package context
|
|
|
|
|
|
|
|
import (
|
|
|
|
"testing"
|
|
|
|
|
2020-02-22 12:12:14 -05:00
|
|
|
"gotest.tools/v3/golden"
|
|
|
|
"gotest.tools/v3/icmd"
|
2019-05-16 08:19:30 -04:00
|
|
|
)
|
|
|
|
|
|
|
|
func TestContextList(t *testing.T) {
|
|
|
|
cmd := icmd.Command("docker", "context", "ls")
|
|
|
|
cmd.Env = append(cmd.Env,
|
|
|
|
"DOCKER_CONFIG=./testdata/test-dockerconfig",
|
|
|
|
"KUBECONFIG=./testdata/test-kubeconfig",
|
|
|
|
)
|
|
|
|
result := icmd.RunCmd(cmd).Assert(t, icmd.Expected{
|
|
|
|
Err: icmd.None,
|
|
|
|
ExitCode: 0,
|
|
|
|
})
|
|
|
|
golden.Assert(t, result.Stdout(), "context-ls.golden")
|
|
|
|
}
|