summaryrefslogtreecommitdiffhomepage
path: root/runsc/container/container_test.go
diff options
context:
space:
mode:
authorRahat Mahmood <rahat@google.com>2021-03-11 16:47:49 -0800
committergVisor bot <gvisor-bot@google.com>2021-03-11 16:49:36 -0800
commitc5667022b6617d732e0c0bcb8ca3b58d588ceafb (patch)
treec112e83b4dcee9923cb99f1fe33b10251e1e58b2 /runsc/container/container_test.go
parenta82bd04e2ab3230a9ed09b297812b58d00784fe5 (diff)
Report filesystem-specific mount options.
PiperOrigin-RevId: 362406813
Diffstat (limited to 'runsc/container/container_test.go')
-rw-r--r--runsc/container/container_test.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/runsc/container/container_test.go b/runsc/container/container_test.go
index a15de02c7..5a0c468a4 100644
--- a/runsc/container/container_test.go
+++ b/runsc/container/container_test.go
@@ -1601,12 +1601,12 @@ func TestReadonlyRoot(t *testing.T) {
}
// Read mounts to check that root is readonly.
- out, err := executeCombinedOutput(c, "/bin/sh", "-c", "mount | grep ' / '")
+ out, err := executeCombinedOutput(c, "/bin/sh", "-c", "mount | grep ' / ' | grep -o -e '(.*)'")
if err != nil {
t.Fatalf("exec failed: %v", err)
}
- t.Logf("root mount: %q", out)
- if !strings.Contains(string(out), "(ro)") {
+ t.Logf("root mount options: %q", out)
+ if !strings.Contains(string(out), "ro") {
t.Errorf("root not mounted readonly: %q", out)
}
@@ -1659,13 +1659,13 @@ func TestReadonlyMount(t *testing.T) {
}
// Read mounts to check that volume is readonly.
- cmd := fmt.Sprintf("mount | grep ' %s '", dir)
+ cmd := fmt.Sprintf("mount | grep ' %s ' | grep -o -e '(.*)'", dir)
out, err := executeCombinedOutput(c, "/bin/sh", "-c", cmd)
if err != nil {
t.Fatalf("exec failed, err: %v", err)
}
- t.Logf("mount: %q", out)
- if !strings.Contains(string(out), "(ro)") {
+ t.Logf("mount options: %q", out)
+ if !strings.Contains(string(out), "ro") {
t.Errorf("volume not mounted readonly: %q", out)
}