Skip to content

Commit

Permalink
Change exec command shells to sh
Browse files Browse the repository at this point in the history
Signed-off-by: Niladri Halder <[email protected]>
  • Loading branch information
niladrih committed Dec 9, 2021
1 parent 94f50f4 commit f3a00af
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
4 changes: 2 additions & 2 deletions tests/nfs_claim_released_pv.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ var _ = Describe("TEST RECLAIM OF RELEASED NFS PV", func() {
Expect(err).To(BeNil(), "while fetching nfs-server pod")

appFileName = "/mnt/store1/" + time.Now().Format("20060102150405")
_, stdErr, err := Client.Exec([]string{"/bin/bash", "-c", "touch " + appFileName}, podList.Items[0].Name, "busybox", applicationNamespace)
_, stdErr, err := Client.Exec([]string{"/bin/sh", "-c", "touch " + appFileName}, podList.Items[0].Name, "busybox", applicationNamespace)
Expect(err).To(BeNil(), "while creating a file=%s err={%s}", appFileName, stdErr)
})
})
Expand Down Expand Up @@ -269,7 +269,7 @@ var _ = Describe("TEST RECLAIM OF RELEASED NFS PV", func() {
podList, err := Client.listPods(applicationNamespace, appLabel)
Expect(err).To(BeNil(), "while fetching nfs-server pod")

_, stdErr, err := Client.Exec([]string{"/bin/bash", "-c", "ls " + appFileName}, podList.Items[0].Name, "busybox", applicationNamespace)
_, stdErr, err := Client.Exec([]string{"/bin/sh", "-c", "ls " + appFileName}, podList.Items[0].Name, "busybox", applicationNamespace)
Expect(err).To(BeNil(), "while checking a file=%s err={%s}", appFileName, stdErr)
})
})
Expand Down
6 changes: 3 additions & 3 deletions tests/nfs_server_file_permissions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ var _ = Describe("TEST NFS SERVER FILE PERMISSIONS", func() {
}, 90, 5).Should(Equal(corev1.PodRunning))

By("exec-ing in the NFS server Pod and checking file permissions")
stdout, stderr, err := Client.Exec([]string{"/bin/bash", "-c", "stat --printf=%u ${SHARED_DIRECTORY}"}, pod.Name, pod.Spec.Containers[0].Name, pod.Namespace)
stdout, stderr, err := Client.Exec([]string{"/bin/sh", "-c", "stat --printf=%u ${SHARED_DIRECTORY}"}, pod.Name, pod.Spec.Containers[0].Name, pod.Namespace)
Expect(err).To(BeNil(), "when exec-ing into the NFS "+
"server container in pod {%s} in namespace "+
"{%s}", pod.Name, pod.Namespace,
Expand All @@ -194,7 +194,7 @@ var _ = Describe("TEST NFS SERVER FILE PERMISSIONS", func() {
"check owner's UID",
)

stdout, stderr, err = Client.Exec([]string{"/bin/bash", "-c", "stat --printf=%g ${SHARED_DIRECTORY}"}, pod.Name, pod.Spec.Containers[0].Name, pod.Namespace)
stdout, stderr, err = Client.Exec([]string{"/bin/sh", "-c", "stat --printf=%g ${SHARED_DIRECTORY}"}, pod.Name, pod.Spec.Containers[0].Name, pod.Namespace)
Expect(err).To(BeNil(), "when exec-ing into the NFS "+
"server container in pod {%s} in namespace "+
"{%s}", pod.Name, pod.Namespace,
Expand All @@ -208,7 +208,7 @@ var _ = Describe("TEST NFS SERVER FILE PERMISSIONS", func() {
"check owner's GID",
)

stdout, stderr, err = Client.Exec([]string{"/bin/bash", "-c", "stat --printf=%04a ${SHARED_DIRECTORY}"}, pod.Name, pod.Spec.Containers[0].Name, pod.Namespace)
stdout, stderr, err = Client.Exec([]string{"/bin/sh", "-c", "stat --printf=%04a ${SHARED_DIRECTORY}"}, pod.Name, pod.Spec.Containers[0].Name, pod.Namespace)
Expect(err).To(BeNil(), "when exec-ing into the NFS "+
"server container in pod {%s} in namespace "+
"{%s}", pod.Name, pod.Namespace,
Expand Down
6 changes: 3 additions & 3 deletions tests/nfs_server_param_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ var _ = Describe("TEST NFS SERVER CONFIGURATION", func() {
Expect(err).To(BeNil(), "while fetching nfs-server pod")

// check if grace period is set or not
stdOut, stdErr, err := Client.Exec([]string{"/bin/bash", "-c", "cat " + procNfsGraceFile},
stdOut, stdErr, err := Client.Exec([]string{"/bin/sh", "-c", "cat " + procNfsGraceFile},
podList.Items[0].Name,
"nfs-server",
openebsNamespace,
Expand All @@ -214,7 +214,7 @@ var _ = Describe("TEST NFS SERVER CONFIGURATION", func() {
Expect(stdOut[:len(stdOut)-1]).To(Equal(scGraceTime), "while verifying grace time")

// check if lease period is set or not
stdOut, stdErr, err = Client.Exec([]string{"/bin/bash", "-c", "cat " + procNfsLeaseFile},
stdOut, stdErr, err = Client.Exec([]string{"/bin/sh", "-c", "cat " + procNfsLeaseFile},
podList.Items[0].Name,
"nfs-server",
openebsNamespace,
Expand All @@ -223,7 +223,7 @@ var _ = Describe("TEST NFS SERVER CONFIGURATION", func() {
Expect(stdOut[:len(stdOut)-1]).To(Equal(scLeaseTime), "while verifying lease time")

// check if export config is set or not
stdOut, stdErr, err = Client.Exec([]string{"/bin/bash", "-c", "cat " + exportFile},
stdOut, stdErr, err = Client.Exec([]string{"/bin/sh", "-c", "cat " + exportFile},
podList.Items[0].Name,
"nfs-server",
openebsNamespace,
Expand Down
6 changes: 3 additions & 3 deletions tests/non_root_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ var _ = Describe("TEST NON ROOT USER ACCESSING NFS VOLUME", func() {
listPods, err := Client.listPods(openebsNamespace, nfsServerLabel)
Expect(err).To(BeNil(), "while fetching NFS Server details")

_, stdErr, err := Client.Exec([]string{"/bin/bash", "-c", "chmod o=rx /nfsshare"}, listPods.Items[0].Name, "nfs-server", openebsNamespace)
_, stdErr, err := Client.Exec([]string{"/bin/sh", "-c", "chmod o=rx /nfsshare"}, listPods.Items[0].Name, "nfs-server", openebsNamespace)
Expect(err).To(BeNil(), "while updating permissions of NFS volume stderror {%s}", stdErr)
})
})
Expand Down Expand Up @@ -204,7 +204,7 @@ var _ = Describe("TEST NON ROOT USER ACCESSING NFS VOLUME", func() {
By("Accesing volume via exec API")

stdOut, stdError, err := Client.Exec(
[]string{"/bin/bash", "-c", "touch /mnt/store1/testvolume"},
[]string{"/bin/sh", "-c", "touch /mnt/store1/testvolume"},
podList.Items[0].Name,
"busybox",
applicationNamespace)
Expand Down Expand Up @@ -267,7 +267,7 @@ var _ = Describe("TEST NON ROOT USER ACCESSING NFS VOLUME", func() {
Expect(err).To(BeNil(), "while listing pods")
By("Accesing volume via exec API")
stdOut, stdError, err := Client.Exec(
[]string{"/bin/bash", "-c", "touch /mnt/store1/testvolume"},
[]string{"/bin/sh", "-c", "touch /mnt/store1/testvolume"},
podList.Items[0].Name,
"busybox",
applicationNamespace)
Expand Down

0 comments on commit f3a00af

Please sign in to comment.