diff options
| author | Simon J. Gerraty <sjg@FreeBSD.org> | 2015-05-27 01:19:58 +0000 |
|---|---|---|
| committer | Simon J. Gerraty <sjg@FreeBSD.org> | 2015-05-27 01:19:58 +0000 |
| commit | d8b9e0faa3460c476b2e30e33f85d3c45d75832b (patch) | |
| tree | 718a4865bc637195eba03ee314533bf4505046c9 /pw/tests/pw_groupdel.sh | |
| parent | 07f6546979612511fa7f69bea50fe257e8ae562a (diff) | |
| parent | 31af648934ea1701d783359919da4009225e7477 (diff) | |
| download | pw-darwin-d8b9e0faa3460c476b2e30e33f85d3c45d75832b.tar.gz pw-darwin-d8b9e0faa3460c476b2e30e33f85d3c45d75832b.zip | |
Merge sync of head
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 +} |
