Skip to content

Commit d1ed739

Browse files
containers/volumes: Apply fix documented in docker-run
1 parent a178569 commit d1ed739

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tests/containers/volumes.pm

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,12 @@ sub run {
3636
# Create Dockerfile with VOLUME defined
3737
assert_script_run("echo -e 'FROM registry.opensuse.org/opensuse/busybox:latest\\nVOLUME /$test_dir' > $test_dir/Dockerfile");
3838

39+
if ($runtime eq "docker") {
40+
my $selinux_enabled = script_run("test -d /sys/fs/selinux") == 0;
41+
# Apply fix suggested in docker-run(1)
42+
assert_script_run("chcon -Rt svirt_sandbox_file_t test_dir") if $selinux_enabled;
43+
}
44+
3945
# Build image
4046
assert_script_run("$runtime build -t $test_image -f $test_dir/Dockerfile $test_dir/");
4147

0 commit comments

Comments
 (0)