diff options
author | 2014-12-10 06:43:16 +0000 | |
---|---|---|
committer | 2014-12-10 06:43:16 +0000 | |
commit | e55e3502008b47514b4e52bfe0416ac4625a128e (patch) | |
tree | 1ab069d8f9454b1d813752344a49e4f339875234 /pw/tests/pw_groupdel.sh | |
parent | 164700bfc553029e369b0aeca106acffc404bece (diff) | |
parent | b4ea158866fbdc9a9c5b75c0f10ca72ccb0733f4 (diff) | |
download | pw-darwin-e55e3502008b47514b4e52bfe0416ac4625a128e.tar.gz pw-darwin-e55e3502008b47514b4e52bfe0416ac4625a128e.tar.zst pw-darwin-e55e3502008b47514b4e52bfe0416ac4625a128e.zip |
MFhead @ r275663
Diffstat (limited to 'pw/tests/pw_groupdel.sh')
-rwxr-xr-x | pw/tests/pw_groupdel.sh | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/pw/tests/pw_groupdel.sh b/pw/tests/pw_groupdel.sh new file mode 100755 index 0000000..75b063a --- /dev/null +++ b/pw/tests/pw_groupdel.sh @@ -0,0 +1,24 @@ +# $FreeBSD$ + +# Import helper functions +. $(atf_get_srcdir)/helper_functions.shin + + +# Test to make sure we do not accidentially delete wheel when trying to delete +# an unknown group +atf_test_case group_do_not_delete_wheel_if_group_unknown +group_do_not_delete_wheel_if_group_unknown_head() { + atf_set "descr" "Make sure we do not consider gid 0 an unknown group" +} +group_do_not_delete_wheel_if_group_unknown_body() { + populate_etc_skel + atf_check -s exit:0 -o inline:"wheel:*:0:root\n" -x ${PW} groupshow wheel + atf_check -e inline:"pw: -g expects a number\n" -s exit:64 -x \ + ${PW} groupdel -g I_do_not_exist + atf_check -s exit:0 -o inline:"wheel:*:0:root\n" -x ${PW} groupshow wheel +} + + +atf_init_test_cases() { + atf_add_test_case group_do_not_delete_wheel_if_group_unknown +} |