Add mount type check in TestOverlayByMountAnnotation.

This is to ensure that the mount is displayed as an overlay to the application.

PiperOrigin-RevId: 570422885
This commit is contained in:
Ayush Ranjan
2023-10-03 10:16:35 -07:00
committed by gVisor bot
parent c74f5866cb
commit 122923b14b
+8
View File
@@ -3121,6 +3121,14 @@ func TestOverlayByMountAnnotation(t *testing.T) {
t.Errorf("%q file created on the host in spite of overlay", testFilePath)
}
got, err := executeCombinedOutput(conf, cont, nil, "/bin/sh", "-c", "mount | grep /submount")
if err != nil {
t.Fatalf("failed to grep mount(1) from container: %v", err)
}
if !strings.Contains(string(got), "type overlay (rw)") {
t.Errorf("expected /submount to be an overlay mount, but it is not. mount(1) reports its type as:\n%s", string(got))
}
// Destroying the container should delete the filestore file.
destroy()
if err := unix.Stat(filestoreFile, &stat); err == nil {