mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-02 16:29:21 +00:00
replaced usage of powershell commands with linux commands
This commit is contained in:
parent
f0d7e9c9d1
commit
7aa8a497df
@ -616,9 +616,6 @@ func generateWriteFileCmd(content, fullPath string) []string {
|
|||||||
// CheckVolumeModeOfPath check mode of volume
|
// CheckVolumeModeOfPath check mode of volume
|
||||||
func CheckVolumeModeOfPath(f *framework.Framework, pod *v1.Pod, volMode v1.PersistentVolumeMode, path string) {
|
func CheckVolumeModeOfPath(f *framework.Framework, pod *v1.Pod, volMode v1.PersistentVolumeMode, path string) {
|
||||||
if volMode == v1.PersistentVolumeBlock {
|
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
|
// Check if block exists
|
||||||
VerifyExecInPodSucceed(f, pod, fmt.Sprintf("test -b %s", path))
|
VerifyExecInPodSucceed(f, pod, fmt.Sprintf("test -b %s", path))
|
||||||
|
|
||||||
|
@ -551,7 +551,8 @@ func PVWriteReadSingleNodeCheck(client clientset.Interface, timeouts *framework.
|
|||||||
command += " || (mount | grep 'on /mnt/test'; false)"
|
command += " || (mount | grep 'on /mnt/test'; false)"
|
||||||
|
|
||||||
if framework.NodeOSDistroIs("windows") {
|
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})
|
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)
|
e2epod.SetAntiAffinity(&secondNode, actualNodeName)
|
||||||
ginkgo.By(fmt.Sprintf("checking the created volume is readable and retains data on another node %+v", secondNode))
|
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"
|
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)
|
pod = StartInPodWithVolume(client, claim.Namespace, claim.Name, "pvc-reader-node2", command, secondNode)
|
||||||
framework.ExpectNoError(e2epod.WaitForPodSuccessInNamespaceTimeout(client, pod.Name, pod.Namespace, timeouts.PodStartSlow))
|
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{})
|
runningPod, err = client.CoreV1().Pods(pod.Namespace).Get(context.TODO(), pod.Name, metav1.GetOptions{})
|
||||||
|
@ -323,11 +323,7 @@ func (s *subPathTestSuite) DefineTests(driver storageframework.TestDriver, patte
|
|||||||
|
|
||||||
// Create the directory
|
// Create the directory
|
||||||
var command string
|
var command string
|
||||||
if framework.NodeOSDistroIs("windows") {
|
command = fmt.Sprintf("mkdir -p %v; touch %v", l.subPathDir, probeFilePath)
|
||||||
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)
|
|
||||||
}
|
|
||||||
setInitCommand(l.pod, command)
|
setInitCommand(l.pod, command)
|
||||||
testPodContainerRestart(f, l.pod)
|
testPodContainerRestart(f, l.pod)
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user