diff options
author | Jan Synacek <jsynacek@redhat.com> | 2014-12-10 10:20:11 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2014-12-10 13:36:10 +0100 |
commit | 0eb3cc88504b5d8f740764047ac5162b67992386 (patch) | |
tree | 541783ac0192d5022d88c0291042cf6f9a66afdb /test | |
parent | 536bfdab4cca38916ec8b112a6f80b0c068cc806 (diff) |
test: fix some tests when running inside a container
Diffstat (limited to 'test')
-rwxr-xr-x | test/udev-test.pl | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/udev-test.pl b/test/udev-test.pl index 14f11df8af..3e05b61777 100755 --- a/test/udev-test.pl +++ b/test/udev-test.pl @@ -27,6 +27,7 @@ my $udev_dev = "test/dev"; my $udev_run = "test/run"; my $udev_rules_dir = "$udev_run/udev/rules.d"; my $udev_rules = "$udev_rules_dir/udev-test.rules"; +my $EXIT_TEST_SKIP = 77; my @tests = ( { @@ -1485,6 +1486,13 @@ if (!($<==0)) { exit; } +# skip the test when running in a container +system("systemd-detect-virt", "-c", "-q"); +if ($? >> 8 == 0) { + print "Running in a container, skipping the test.\n"; + exit($EXIT_TEST_SKIP); +} + udev_setup(); my $test_num = 1; |