mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-07 11:13:48 +00:00
nit: Fix invokeStaleDummyVMTestWithStoragePolicy()
There were nits in invokeStaleDummyVMTestWithStoragePolicy() like - The error message didn't contain necessary space - IsVMPresent() can return an error, but lack of the error handling - IsVMPresent() returns true/false, but didn't use ExpectEqual() and less code readability This fixes those things.
This commit is contained in:
parent
3c31a0026a
commit
d964569e1e
@ -337,6 +337,7 @@ func invokeStaleDummyVMTestWithStoragePolicy(client clientset.Interface, masterN
|
|||||||
dummyVMFullName := dummyVMPrefixName + "-" + fmt.Sprint(fnvHash.Sum32())
|
dummyVMFullName := dummyVMPrefixName + "-" + fmt.Sprint(fnvHash.Sum32())
|
||||||
errorMsg := "Dummy VM - " + vmName + " is still present. Failing the test.."
|
errorMsg := "Dummy VM - " + vmName + " is still present. Failing the test.."
|
||||||
nodeInfo := TestContext.NodeMapper.GetNodeInfo(masterNode)
|
nodeInfo := TestContext.NodeMapper.GetNodeInfo(masterNode)
|
||||||
isVMPresentFlag, _ := nodeInfo.VSphere.IsVMPresent(dummyVMFullName, nodeInfo.DataCenterRef)
|
isVMPresentFlag, err := nodeInfo.VSphere.IsVMPresent(dummyVMFullName, nodeInfo.DataCenterRef)
|
||||||
framework.ExpectNotEqual(isVMPresentFlag, true, errorMsg)
|
framework.ExpectNoError(err)
|
||||||
|
framework.ExpectEqual(isVMPresentFlag, false, errorMsg)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user