From 122923b14baccecd65b751f881d1d50700de5706 Mon Sep 17 00:00:00 2001 From: Ayush Ranjan Date: Tue, 3 Oct 2023 10:12:01 -0700 Subject: [PATCH] Add mount type check in TestOverlayByMountAnnotation. This is to ensure that the mount is displayed as an overlay to the application. PiperOrigin-RevId: 570422885 --- runsc/container/container_test.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/runsc/container/container_test.go b/runsc/container/container_test.go index debfaf8f5..6a9f4d777 100644 --- a/runsc/container/container_test.go +++ b/runsc/container/container_test.go @@ -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 {