mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 23:15:14 +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
@ -335,8 +335,9 @@ func invokeStaleDummyVMTestWithStoragePolicy(client clientset.Interface, masterN
|
||||
fnvHash := fnv.New32a()
|
||||
fnvHash.Write([]byte(vmName))
|
||||
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)
|
||||
isVMPresentFlag, _ := nodeInfo.VSphere.IsVMPresent(dummyVMFullName, nodeInfo.DataCenterRef)
|
||||
framework.ExpectNotEqual(isVMPresentFlag, true, errorMsg)
|
||||
isVMPresentFlag, err := nodeInfo.VSphere.IsVMPresent(dummyVMFullName, nodeInfo.DataCenterRef)
|
||||
framework.ExpectNoError(err)
|
||||
framework.ExpectEqual(isVMPresentFlag, false, errorMsg)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user