diff options
author | Thierry Vignaud <thierry.vignaud@gmail.com> | 2020-05-06 11:21:41 +0200 |
---|---|---|
committer | Thierry Vignaud <thierry.vignaud@gmail.com> | 2020-05-06 14:49:46 +0200 |
commit | 98b362639e082a9a3d33f0a29a09d2763e7c10f0 (patch) | |
tree | 9e38bf78d121a9d49c277380aedb81f3866e2363 /t | |
parent | 6222e12fa8cb5e10f19d61b8846a6b6a5d4efaab (diff) | |
download | perl-Hal-Cdroms-98b362639e082a9a3d33f0a29a09d2763e7c10f0.tar perl-Hal-Cdroms-98b362639e082a9a3d33f0a29a09d2763e7c10f0.tar.gz perl-Hal-Cdroms-98b362639e082a9a3d33f0a29a09d2763e7c10f0.tar.bz2 perl-Hal-Cdroms-98b362639e082a9a3d33f0a29a09d2763e7c10f0.tar.xz perl-Hal-Cdroms-98b362639e082a9a3d33f0a29a09d2763e7c10f0.zip |
(get_at_command) split it
Needed for next commit
Diffstat (limited to 't')
-rw-r--r-- | t/24-wait-for-mounted.t | 3 | ||||
-rw-r--r-- | t/helper.pm | 9 |
2 files changed, 9 insertions, 3 deletions
diff --git a/t/24-wait-for-mounted.t b/t/24-wait-for-mounted.t index ef6f006..634ca99 100644 --- a/t/24-wait-for-mounted.t +++ b/t/24-wait-for-mounted.t @@ -23,7 +23,8 @@ my $fake_device = create_fake_media(3); if (!$auto_mounted) { my $tmp_dir = tempdir(CLEANUP => 1); - system("echo 'sleep 4; mount /dev/$fake_device $tmp_dir' | at -M now >& /dev/null"); + my $at = get_at_command(); + system("echo 'sleep 4; mount /dev/$fake_device $tmp_dir' | $at >& /dev/null"); } my $cdroms = Hal::Cdroms->new; diff --git a/t/helper.pm b/t/helper.pm index 538a9ae..10331a1 100644 --- a/t/helper.pm +++ b/t/helper.pm @@ -2,7 +2,11 @@ package helper; use strict; use base 'Exporter'; -our @EXPORT = qw(can_create_fake_media create_fake_media find_mount_point remove_fake_media ); +our @EXPORT = qw(can_create_fake_media create_fake_media find_mount_point get_at_command remove_fake_media ); + +sub get_at_command() { + 'at -M now'; +} sub can_create_fake_media() { system("modprobe -n scsi_debug") == 0; @@ -18,7 +22,8 @@ sub create_fake_media { or die "Unexpected number of scsi_debug devices\n"; my ($_prefix, $device) = split("block/", $paths[0]); if ($o_delay) { - system("echo 'sleep $o_delay; dd if=t/cdroms-test.iso of=/dev/$device conv=nocreat' | at -M now >& /dev/null") == 0 + my $at = get_at_command(); + system("echo 'sleep $o_delay; dd if=t/cdroms-test.iso of=/dev/$device conv=nocreat' | $at >& /dev/null") == 0 or die "Failed to schedule copy of ISO to fake SCSI device\n"; } else { system("dd if=t/cdroms-test.iso of=/dev/$device conv=nocreat >& /dev/null") == 0 |