summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Sateler <fsateler@debian.org>2018-08-15 23:51:56 -0300
committerFelipe Sateler <fsateler@debian.org>2018-08-15 23:51:56 -0300
commit7696f9178a99ad3f2543a8209b2371fe5a355d78 (patch)
tree4a415edbd0fa9ea51b30064240a259a32bc72f7a
parent5e68389bddd66b2dc2ee3f8296b24e041e0d1bf9 (diff)
tests: only load Linux::Clone if not testing on real system
'use' directive is evaluated at compile time, so having it inside an 'if' statement does not have the expected effect. Use the 'use if' directive instead. This fixes running the autopkgtests in clean systems without Linux::Clone module
-rw-r--r--t/helpers.pm3
1 files changed, 1 insertions, 2 deletions
diff --git a/t/helpers.pm b/t/helpers.pm
index db0eb96..8600cd4 100644
--- a/t/helpers.pm
+++ b/t/helpers.pm
@@ -1,4 +1,5 @@
use File::Temp qw(tempdir); # in core since perl 5.6.1
+use if !$ENV{'TEST_ON_REAL_SYSTEM'}, "Linux::Clone"; # neither in core nor in Debian :-/
sub bind_mount_tmp {
my ($dir) = @_;
@@ -15,8 +16,6 @@ sub bind_mount_tmp {
# thus do not bindmount a tmpdir on /lib/systemd.
sub test_setup() {
unless ($ENV{'TEST_ON_REAL_SYSTEM'}) {
- use Linux::Clone; # neither in core nor in Debian :-/
-
open(my $fh, '<', "/proc/$$/mountinfo")
or BAIL_OUT("Cannot open(/proc/$$/mountinfo): $!");