diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/groupdel.test | 10 | ||||
-rwxr-xr-x | tests/hostname.test | 4 | ||||
-rwxr-xr-x | tests/link.test | 6 | ||||
-rwxr-xr-x | tests/losetup.test | 21 | ||||
-rwxr-xr-x | tests/rm.test | 6 |
5 files changed, 13 insertions, 34 deletions
diff --git a/tests/groupdel.test b/tests/groupdel.test index d46db53c..6abb4bfc 100755 --- a/tests/groupdel.test +++ b/tests/groupdel.test @@ -10,18 +10,18 @@ arg="&>/dev/null" #testing "name" "command" "result" "infile" "stdin" -testing "groupadd group_name (text)" "groupadd toyTestGroup && +testing "groupdel group_name (text)" "groupadd toyTestGroup && grep '^toyTestGroup:' /etc/group $arg && groupdel toyTestGroup $arg && echo 'yes'" "yes\n" "" "" -testing "groupadd group_name (alphanumeric)" "groupadd toy1Test2Group3 && +testing "groupdel group_name (alphanumeric)" "groupadd toy1Test2Group3 && grep '^toy1Test2Group3:' /etc/group $arg && groupdel toy1Test2Group3 $arg && echo 'yes'" "yes\n" "" "" -testing "groupadd group_name (numeric)" "groupadd 987654321 && +testing "groupdel group_name (numeric)" "groupadd 987654321 && grep '^987654321:' /etc/group $arg && groupdel 987654321 $arg && echo 'yes'" "yes\n" "" "" -testing "groupadd group_name (with ./-)" "groupadd toy.1Test-2Group.3 && +testing "groupdel group_name (with ./-)" "groupadd toy.1Test-2Group.3 && grep '^toy.1Test-2Group.3:' /etc/group $arg && groupdel toy.1Test-2Group.3 $arg && echo 'yes'" "yes\n" "" "" -testing "groupadd group_name with group_id" "groupadd -g 49999 toyTestGroup && +testing "groupdel group_name with group_id" "groupadd -g 49999 toyTestGroup && grep '^toyTestGroup:' /etc/group $arg && groupdel toyTestGroup $arg && echo 'yes'" "yes\n" "" "" diff --git a/tests/hostname.test b/tests/hostname.test index 11948458..56e4a2a3 100755 --- a/tests/hostname.test +++ b/tests/hostname.test @@ -14,5 +14,5 @@ hostnameOut=`$hostnameExe` # New hostname NewHostname="NewHostName.system" -testing "Hostname - Get" "hostname" "$hostnameOut\n" "" "" -testing "Hostname - Set, Get and then Reset" "hostname $NewHostname; hostname; hostname $hostnameOut; hostname" "$NewHostname\n$hostnameOut\n" "" "" +testing "hostname get" "hostname" "$hostnameOut\n" "" "" +testing "hostname set, Get and then Reset" "hostname $NewHostname; hostname; hostname $hostnameOut; hostname" "$NewHostname\n$hostnameOut\n" "" "" diff --git a/tests/link.test b/tests/link.test index 769a7b67..5851129f 100755 --- a/tests/link.test +++ b/tests/link.test @@ -12,15 +12,15 @@ testing "link fails on non-existent file" "link foo/foo baz || echo GOOD" "GOOD\ rm -f foo bar echo file1 > file -testing "ln create_hardlink" "link file hlink && [ file -ef hlink ] && +testing "link create_hardlink" "link file hlink && [ file -ef hlink ] && echo 'yes'; rm -rf hlink" "yes\n" "" "" echo hlink1 > hlink set +e -testing "ln preserves_hardlinks" "link file hlink 2>/dev/null || echo 'yes'; rm -rf hlink" \ +testing "link preserves_hardlinks" "link file hlink 2>/dev/null || echo 'yes'; rm -rf hlink" \ "yes\n" "" "" echo file1 > file -testing "ln create_hardlink_and_remove_sourcefile" "link file hlink && +testing "link create_hardlink_and_remove_sourcefile" "link file hlink && [ file -ef hlink ] && rm -rf file && [ -f hlink ] && echo 'yes'; rm -f file hlink" \ "yes\n" "" "" diff --git a/tests/losetup.test b/tests/losetup.test index 84ac4b1f..651c6933 100755 --- a/tests/losetup.test +++ b/tests/losetup.test @@ -19,27 +19,6 @@ NODE="$(awk '{print $7}')" losetup -f losetup -f -s losetup -f file -testing "cat" "cat && echo yes" "oneyes\n" "" "one" -testing "cat -" "cat - && echo yes" "oneyes\n" "" "one" -testing "cat file1 file2" "cat file1 file2" "one\ntwo\n" "" "" -testing "cat - file" "cat - file1" "zero\none\n" "" "zero\n" -testing "cat file -" "cat file1 -" "one\nzero\n" "" "zero\n" - -testing "cat file1 notfound file2" \ - "cat file1 notfound file2 2>stderr && echo ok ; cat stderr; rm stderr" \ - "one\ntwo\ncat: notfound: No such file or directory\n" "" "" - -testing "cat file1" \ - "cat /proc/self/exe > file1 && cmp /proc/self/exe file1 && echo yes" \ - "yes\n" "" "" - -testing "cat - file1" \ - "cat - file1 | diff -a -U 0 - file1 | tail -n 1" \ - "-hello\n" "" "hello\n" - -testing "cat > /dev/full" \ - "cat - > /dev/full 2>stderr && echo ok; cat stderr; rm stderr" \ - "cat: xwrite: No space left on device\n" "" "zero\n" losetup -d diff --git a/tests/rm.test b/tests/rm.test index 0dca8538..3fe71448 100755 --- a/tests/rm.test +++ b/tests/rm.test @@ -8,15 +8,15 @@ #testing "name" "command" "result" "infile" "stdin" echo "abcdefghijklmnopqrstuvwxyz" > file.txt -testing "Remove text-file" "rm file.txt && [ ! -e file.txt ] && echo 'yes'" "yes\n" "" "" +testing "rm text-file" "rm file.txt && [ ! -e file.txt ] && echo 'yes'" "yes\n" "" "" rm -f file* mkdir dir -testing "Remove empty directory" "rm -r dir && [ ! -d dir ] && echo 'yes'" "yes\n" "" "" +testing "rm empty directory" "rm -r dir && [ ! -d dir ] && echo 'yes'" "yes\n" "" "" rm -rf dir echo "abcdefghijklmnopqrstuvwxyz" > file.txt && chmod 000 file.txt -testing "Remove text file(mode 000)" "rm -f file.txt && [ ! -e file.txt ] && echo 'yes'" \ +testing "rm text file(mode 000)" "rm -f file.txt && [ ! -e file.txt ] && echo 'yes'" \ "yes\n" "" "" rm -f file* |