aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-08-29 00:44:33 +0200
committerAndreas Guldstrand <andreas.guldstrand@gmail.com>2016-08-29 00:44:33 +0200
commitd2136f1f38da8496be8bb205859a1d93d98bf9ad (patch)
treed8db92878f41a386ab92fe79c6e0cea44d0f5d14
parent48a47d41831ea9c40014c29c68d6e9b020fe8b0a (diff)
downloadsbotools2-d2136f1f38da8496be8bb205859a1d93d98bf9ad.tar.xz
22-race.t: remove race test for read_config
-rwxr-xr-xt/22-race.t21
1 files changed, 3 insertions, 18 deletions
diff --git a/t/22-race.t b/t/22-race.t
index c1298df..7de17fd 100755
--- a/t/22-race.t
+++ b/t/22-race.t
@@ -11,7 +11,7 @@ use Capture::Tiny qw/ capture_merged /;
use File::Temp 'tempdir';
use Cwd;
-plan tests => 8;
+plan tests => 7;
sub emulate_race {
my ($file, $caller) = @_;
@@ -33,22 +33,7 @@ sub emulate_race {
is ($exit, 6, 'open_fh returned exit value 6');
}
-# 2: emulate race in open_fh called by read_config
-{
- my $conf_file = "/etc/sbotools/sbotools.conf";
- system('mkdir', '-p', '/etc/sbotools');
- system('mv', $conf_file, "$conf_file.bak");
- system('touch', $conf_file);
-
- emulate_race($conf_file, 'Util::open_fh');
- my $out = capture_merged { SBO::Lib::read_config(); };
-
- is ($out, "Unable to open $conf_file.\n", 'read_config output correct');
-
- system('mv', "$conf_file.bak", $conf_file) if -e "$conf_file.bak";
-}
-
-# 3-4: emulate race in open_fh by get_slack_version
+# 2-3: emulate race in open_fh by get_slack_version
{
my $sv_file = '/etc/slackware-version';
capture_merged {
@@ -68,7 +53,7 @@ sub emulate_race {
system('mv', "$sv_file.bak", $sv_file) if -e "$sv_file.bak";
}
-# 5-8: emulate races in git_sbo_tree
+# 4-7: emulate races in git_sbo_tree
SKIP: {
my $tempdir = tempdir(CLEANUP => 1);