aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <thierry.vignaud@gmail.com>2020-05-06 15:00:56 +0200
committerThierry Vignaud <thierry.vignaud@gmail.com>2020-05-07 09:10:58 +0200
commit69aef3521c66dbd1a3c54058672f0e9e64ea8b44 (patch)
tree723fd184408d13779c6dc04fe5076711701156b2
parenta778a504018b7e254f84292991cca898e86ff055 (diff)
downloadperl-Hal-Cdroms-69aef3521c66dbd1a3c54058672f0e9e64ea8b44.tar
perl-Hal-Cdroms-69aef3521c66dbd1a3c54058672f0e9e64ea8b44.tar.gz
perl-Hal-Cdroms-69aef3521c66dbd1a3c54058672f0e9e64ea8b44.tar.bz2
perl-Hal-Cdroms-69aef3521c66dbd1a3c54058672f0e9e64ea8b44.tar.xz
perl-Hal-Cdroms-69aef3521c66dbd1a3c54058672f0e9e64ea8b44.zip
Simplify by not using at command
-rw-r--r--t/24-wait-for-mounted.t3
-rw-r--r--t/helper.pm9
2 files changed, 2 insertions, 10 deletions
diff --git a/t/24-wait-for-mounted.t b/t/24-wait-for-mounted.t
index 634ca99..72555b0 100644
--- a/t/24-wait-for-mounted.t
+++ b/t/24-wait-for-mounted.t
@@ -23,8 +23,7 @@ my $fake_device = create_fake_media(3);
if (!$auto_mounted) {
my $tmp_dir = tempdir(CLEANUP => 1);
- my $at = get_at_command();
- system("echo 'sleep 4; mount /dev/$fake_device $tmp_dir' | $at >& /dev/null");
+ system("(sleep 4; mount /dev/$fake_device $tmp_dir)&");
}
my $cdroms = Hal::Cdroms->new;
diff --git a/t/helper.pm b/t/helper.pm
index bd3e453..ae7c902 100644
--- a/t/helper.pm
+++ b/t/helper.pm
@@ -1,14 +1,9 @@
package helper;
use strict;
-use Config;
use base 'Exporter';
our @EXPORT = qw(can_create_fake_media create_fake_media find_mount_point get_at_command remove_fake_media );
-sub get_at_command() {
- $Config{myuname} =~ /linux/i ? 'at -M now' : 'at now';
-}
-
sub can_create_fake_media() {
system("modprobe -n scsi_debug") == 0;
}
@@ -23,9 +18,7 @@ sub create_fake_media {
or die "Unexpected number of scsi_debug devices\n";
my ($_prefix, $device) = split("block/", $paths[0]);
if ($o_delay) {
- my $at = get_at_command();
- $at .= " >& /dev/null"; # comment for debugging
- system("echo 'sleep $o_delay; dd if=t/cdroms-test.iso of=/dev/$device conv=nocreat' | $at") == 0
+ system("(sleep $o_delay; dd if=t/cdroms-test.iso of=/dev/$device conv=nocreat >& /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