replaced usage of powershell commands with linux commands

This commit is contained in:
Mauricio Poppe 2021-04-05 18:19:27 +00:00
parent f0d7e9c9d1
commit 7aa8a497df
3 changed files with 3 additions and 12 deletions

View File

@ -616,9 +616,6 @@ func generateWriteFileCmd(content, fullPath string) []string {
// CheckVolumeModeOfPath check mode of volume
func CheckVolumeModeOfPath(f *framework.Framework, pod *v1.Pod, volMode v1.PersistentVolumeMode, path string) {
if volMode == v1.PersistentVolumeBlock {
// NOTE: gcepd-csi doesn't support a block volume in windows, this method won't
// be called because the test is skipped
// Check if block exists
VerifyExecInPodSucceed(f, pod, fmt.Sprintf("test -b %s", path))

View File

@ -551,7 +551,8 @@ func PVWriteReadSingleNodeCheck(client clientset.Interface, timeouts *framework.
command += " || (mount | grep 'on /mnt/test'; false)"
if framework.NodeOSDistroIs("windows") {
command = "select-string 'hello world' /mnt/test/data"
// agnhost doesn't support mount
command = "grep 'hello world' /mnt/test/data"
}
RunInPodWithVolume(client, timeouts, claim.Namespace, claim.Name, "pvc-volume-tester-reader", command, e2epod.NodeSelection{Name: actualNodeName})
@ -596,9 +597,6 @@ func PVMultiNodeCheck(client clientset.Interface, timeouts *framework.TimeoutCon
e2epod.SetAntiAffinity(&secondNode, actualNodeName)
ginkgo.By(fmt.Sprintf("checking the created volume is readable and retains data on another node %+v", secondNode))
command = "grep 'hello world' /mnt/test/data"
if framework.NodeOSDistroIs("windows") {
command = "select-string 'hello world' /mnt/test/data"
}
pod = StartInPodWithVolume(client, claim.Namespace, claim.Name, "pvc-reader-node2", command, secondNode)
framework.ExpectNoError(e2epod.WaitForPodSuccessInNamespaceTimeout(client, pod.Name, pod.Namespace, timeouts.PodStartSlow))
runningPod, err = client.CoreV1().Pods(pod.Namespace).Get(context.TODO(), pod.Name, metav1.GetOptions{})

View File

@ -323,11 +323,7 @@ func (s *subPathTestSuite) DefineTests(driver storageframework.TestDriver, patte
// Create the directory
var command string
if framework.NodeOSDistroIs("windows") {
command = fmt.Sprintf("mkdir -p %v; New-Item -itemtype File -path %v", l.subPathDir, probeFilePath)
} else {
command = fmt.Sprintf("mkdir -p %v; touch %v", l.subPathDir, probeFilePath)
}
command = fmt.Sprintf("mkdir -p %v; touch %v", l.subPathDir, probeFilePath)
setInitCommand(l.pod, command)
testPodContainerRestart(f, l.pod)
})