Merge pull request #79945 from misterikkit/vsphere-e2e

More consistent env var handling in vsphere e2e test
This commit is contained in:
Kubernetes Prow Robot 2019-07-16 15:24:18 -07:00 committed by GitHub
commit 77a7366486
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 8 deletions

View File

@ -18,7 +18,6 @@ package vsphere
import (
"context"
"os"
"github.com/onsi/ginkgo"
"github.com/onsi/gomega"
@ -45,9 +44,7 @@ var _ = utils.SIGDescribe("Node Unregister [Feature:vsphere] [Slow] [Disruptive]
namespace = f.Namespace.Name
framework.ExpectNoError(framework.WaitForAllNodesSchedulable(client, framework.TestContext.NodeSchedulableTimeout))
framework.ExpectNoError(err)
workingDir = os.Getenv("VSPHERE_WORKING_DIR")
gomega.Expect(workingDir).NotTo(gomega.BeEmpty())
workingDir = GetAndExpectStringEnvVar("VSPHERE_WORKING_DIR")
})
ginkgo.It("node unregister", func() {
@ -111,8 +108,7 @@ var _ = utils.SIGDescribe("Node Unregister [Feature:vsphere] [Slow] [Disruptive]
// Sanity test that pod provisioning works
ginkgo.By("Sanity check for volume lifecycle")
scParameters := make(map[string]string)
storagePolicy := os.Getenv("VSPHERE_SPBM_GOLD_POLICY")
gomega.Expect(storagePolicy).NotTo(gomega.BeEmpty(), "Please set VSPHERE_SPBM_GOLD_POLICY system environment")
storagePolicy := GetAndExpectStringEnvVar("VSPHERE_SPBM_GOLD_POLICY")
scParameters[SpbmStoragePolicy] = storagePolicy
invokeValidPolicyTest(f, client, namespace, scParameters)
})

View File

@ -64,8 +64,8 @@ var _ = utils.SIGDescribe("Volume Operations Storm [Feature:vsphere]", func() {
client = f.ClientSet
namespace = f.Namespace.Name
gomega.Expect(GetReadySchedulableNodeInfos()).NotTo(gomega.BeEmpty())
if os.Getenv("VOLUME_OPS_SCALE") != "" {
volume_ops_scale, err = strconv.Atoi(os.Getenv("VOLUME_OPS_SCALE"))
if scale := os.Getenv("VOLUME_OPS_SCALE"); scale != "" {
volume_ops_scale, err = strconv.Atoi(scale)
framework.ExpectNoError(err)
} else {
volume_ops_scale = DEFAULT_VOLUME_OPS_SCALE