Browse Source

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
tags/debian/1.53
Felipe Sateler 3 years ago
parent
commit
7696f9178a
1 changed files with 1 additions and 2 deletions
  1. +1
    -2
      t/helpers.pm

+ 1
- 2
t/helpers.pm View File

@@ -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): $!");



Loading…
Cancel
Save