Skip to content

Commit 990199a

Browse files
Test to ensure nosuid,nodev,noexec are set on /etc/reolv.conf mount.
Signed-off-by: Vinayak Goyal <[email protected]>
1 parent ae4dbb6 commit 990199a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

pkg/cri/server/sandbox_run_linux_test.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,14 @@ func getRunPodSandboxTestData() (*runtime.PodSandboxConfig, *imagespec.ImageConf
9191
assert.NotEqual(t, "", spec.Process.SelinuxLabel)
9292
assert.NotEqual(t, "", spec.Linux.MountLabel)
9393
}
94+
95+
assert.Contains(t, spec.Mounts, runtimespec.Mount{
96+
Source: "/test/root/sandboxes/test-id/resolv.conf",
97+
Destination: resolvConfPath,
98+
Type: "bind",
99+
Options: []string{"rbind", "ro", "nosuid", "nodev", "noexec"},
100+
})
101+
94102
}
95103
return config, imageConfig, specCheck
96104
}

0 commit comments

Comments
 (0)