diff options
author | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-02-14 18:23:33 +0100 |
---|---|---|
committer | Andreas Guldstrand <andreas.guldstrand@gmail.com> | 2016-02-14 18:24:20 +0100 |
commit | f789d9ce3b44fad6adade5a833d948b555062d49 (patch) | |
tree | 56d8b32014b2d2485838b920e813aeaf90b87715 /t/12-readme.t | |
parent | 6a6a04123cc06ef8abd21549998e0d186d5b3934 (diff) | |
download | sbotools2-f789d9ce3b44fad6adade5a833d948b555062d49.tar.xz |
Add test for useradd/groupadd commands in README
Diffstat (limited to 't/12-readme.t')
-rwxr-xr-x | t/12-readme.t | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/t/12-readme.t b/t/12-readme.t index 7db99a3..b3207b3 100755 --- a/t/12-readme.t +++ b/t/12-readme.t @@ -11,7 +11,7 @@ use lib "$RealBin/../SBO-Lib/lib"; use Test::Execute; if ($ENV{TEST_INSTALL}) { - plan tests => 5; + plan tests => 6; } else { plan skip_all => 'Only run these tests if TEST_INSTALL=1'; } @@ -28,6 +28,7 @@ sub cleanup { system(qw!rm -rf /tmp/SBo/envsettingtest2-1.0!); system(qw!rm -rf /tmp/package-envsettingtest!); system(qw!rm -rf /tmp/package-envsettingtest2!); + system(qw/ userdel test /); }; } @@ -77,6 +78,15 @@ script (qw/ sboinstall envsettingtest2 /, { input => "n\ny\ny\nFOO=quux\ny\ny\nn script (qw/ sboinstall envsettingtest2 /, { input => "y\nFOO=bar\ny\ny\nFOO=quux\ny\ny", expected => qr{It looks like envsettingtest has options.*Please supply any options here.*It looks like envsettingtest2 has options.*Please supply any options here.*Install queue: envsettingtest envsettingtest2.*Cleaning for envsettingtest2-1[.]0}s }); script (qw/ sboremove envsettingtest2 /, { input => "y\ny\ny", test => 0 }); +# 6: sboinstall commandinreadme +SKIP: { + skip "Only run useradd/groupadd commands under Travis CI", 1 unless (defined $ENV{TRAVIS} and $ENV{TRAVIS} eq 'true'); + + script (qw/ sboinstall commandinreadme /, { input => "y\ny\ny", expected => qr{It looks like this slackbuild requires the following command\(s\) to be run first:.*groupadd -g 200 test.*useradd -u 200 -g 200 -d /tmp test.*Shall I run them prior to building.*}s }); + script (qw/ sboremove commandinreadme /, { input => "y\ny", test => 0 }); + capture_merged { system(qw/ userdel test /); }; +} + # Cleanup END { set_lo('delete'); |