diff options
author | Rahat Mahmood <rahat@google.com> | 2021-03-11 16:47:49 -0800 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2021-03-11 16:49:36 -0800 |
commit | c5667022b6617d732e0c0bcb8ca3b58d588ceafb (patch) | |
tree | c112e83b4dcee9923cb99f1fe33b10251e1e58b2 /runsc/container/container_test.go | |
parent | a82bd04e2ab3230a9ed09b297812b58d00784fe5 (diff) |
Report filesystem-specific mount options.
PiperOrigin-RevId: 362406813
Diffstat (limited to 'runsc/container/container_test.go')
-rw-r--r-- | runsc/container/container_test.go | 12 |
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) } |