runsc/container_test: hide host /etc in test containers
The host /etc can contain config files which affect tests. For example, bash reads /etc/passwd and if it is too big a test can fail by timeout. PiperOrigin-RevId: 293670637
This commit is contained in:
parent
6bd59b4e08
commit
615d661112
|
@ -119,6 +119,13 @@ func NewSpecWithArgs(args ...string) *specs.Spec {
|
|||
Capabilities: specutils.AllCapabilities(),
|
||||
},
|
||||
Mounts: []specs.Mount{
|
||||
// Hide the host /etc to avoid any side-effects.
|
||||
// For example, bash reads /etc/passwd and if it is
|
||||
// very big, tests can fail by timeout.
|
||||
{
|
||||
Type: "tmpfs",
|
||||
Destination: "/etc",
|
||||
},
|
||||
// Root is readonly, but many tests want to write to tmpdir.
|
||||
// This creates a writable mount inside the root. Also, when tmpdir points
|
||||
// to "/tmp", it makes the the actual /tmp to be mounted and not a tmpfs
|
||||
|
|
Loading…
Reference in New Issue