X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=tests%2Fgroupadd.test;h=091dccf743ce6aeb96448370ce37da4bb736eb28;hb=12adb4113d7c269f26c53292f91079b7c2fee3d1;hp=0395e01af38835e70c7d278f533dc46d9d01b4eb;hpb=dec4669fa1285945910ffd47ff5830f250e1c1ed;p=android-x86%2Fexternal-toybox.git diff --git a/tests/groupadd.test b/tests/groupadd.test index 0395e01a..091dccf7 100755 --- a/tests/groupadd.test +++ b/tests/groupadd.test @@ -15,33 +15,33 @@ arg="&>/dev/null" #testing "name" "command" "result" "infile" "stdin" -testing "groupadd group_name (text)" "groupadd toyTestGroup && +testing "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 "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 "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 "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" "" "" _s210=`echo $_s70$_s70$_s70` -testing "groupadd group_name (long string)" "groupadd $_s210 && +testing "group_name (long string)" "groupadd $_s210 && grep '^$_s210:' /etc/group $arg && groupdel $_s210 $arg && echo 'yes'" \ "yes\n" "" "" -testing "groupadd group_name with group_id" "groupadd -g 49999 toyTestGroup && +testing "group_name with group_id" "groupadd -g 49999 toyTestGroup && grep '^toyTestGroup:' /etc/group $arg && groupdel toyTestGroup $arg && echo 'yes'" "yes\n" "" "" -testing "groupadd group_name with group_id (system_group)" \ +testing "group_name with group_id (system_group)" \ "groupadd -g 49999 -S toyTestGroup && grep '^toyTestGroup:' /etc/group $arg && groupdel toyTestGroup $arg && echo 'yes'" "yes\n" "" "" -testing "groupadd group_name (system_group)" "groupadd -S toyTestGroup && +testing "group_name (system_group)" "groupadd -S toyTestGroup && grep '^toyTestGroup:' /etc/group $arg && groupdel toyTestGroup $arg && echo 'yes'" "yes\n" "" "" -testing "groupadd group_name (add/del user)" "groupadd toyTestGroup && +testing "group_name (add/del user)" "groupadd toyTestGroup && grep '^toyTestGroup:' /etc/group $arg && groupadd $USER toyTestGroup && grep '^toyTestGroup:.*:.*:.*$USER.*' /etc/group $arg && groupdel $USER toyTestGroup $arg || groupdel toyTestGroup && @@ -50,7 +50,7 @@ testing "groupadd group_name (add/del user)" "groupadd toyTestGroup && echo "Testing to add single group multiple times after removing it..." for each in {01..20} do - testing "groupadd group_name ($each)" "groupadd toyTestGroup && + testing "group_name ($each)" "groupadd toyTestGroup && grep '^toyTestGroup:' /etc/group $arg && groupdel toyTestGroup $arg && echo 'yes'" "yes\n" "" "" done