本文整理匯總了Golang中github.com/jimmidyson/minishift/test/integration/util.MinikubeRunner.SetEnvFromEnvCmdOutput方法的典型用法代碼示例。如果您正苦於以下問題:Golang MinikubeRunner.SetEnvFromEnvCmdOutput方法的具體用法?Golang MinikubeRunner.SetEnvFromEnvCmdOutput怎麽用?Golang MinikubeRunner.SetEnvFromEnvCmdOutput使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類github.com/jimmidyson/minishift/test/integration/util.MinikubeRunner
的用法示例。
在下文中一共展示了MinikubeRunner.SetEnvFromEnvCmdOutput方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: TestClusterEnv
func TestClusterEnv(t *testing.T) {
minikubeRunner := util.MinikubeRunner{
Args: *args,
BinaryPath: *binaryPath,
T: t}
minikubeRunner.EnsureRunning()
dockerEnvVars := minikubeRunner.RunCommand("docker-env", true)
if err := minikubeRunner.SetEnvFromEnvCmdOutput(dockerEnvVars); err != nil {
t.Fatalf("Error: No environment variables were found in docker-env command output: ", dockerEnvVars)
}
path, err := exec.LookPath("docker")
var output []byte
dockerPs := func() error {
cmd := exec.Command(path, "ps")
output, err = cmd.CombinedOutput()
return err
}
if err := commonutil.RetryAfter(5, dockerPs, 3*time.Second); err != nil {
t.Fatalf("Error running command: %s. Error: %s Output: %s", "docker ps", err, output)
}
}