diff options
| author | Baptiste Daroussin <bapt@FreeBSD.org> | 2015-09-12 11:41:31 +0000 |
|---|---|---|
| committer | Baptiste Daroussin <bapt@FreeBSD.org> | 2015-09-12 11:41:31 +0000 |
| commit | 430410d05f881bc2ae65f2496dd92e9037c5e861 (patch) | |
| tree | aa0082efdb567c3df714ea47489f4c6e568c39da /pw/tests/pw_usermod.sh | |
| parent | cc666f9d1a91a808b95a347674765342e3a354ef (diff) | |
| parent | 17f7f400f6dbf25f9155ce177eea1092f54d2f25 (diff) | |
| download | pw-darwin-430410d05f881bc2ae65f2496dd92e9037c5e861.tar.gz pw-darwin-430410d05f881bc2ae65f2496dd92e9037c5e861.zip | |
Merge from head
Diffstat (limited to 'pw/tests/pw_usermod.sh')
| -rwxr-xr-x | pw/tests/pw_usermod.sh | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/pw/tests/pw_usermod.sh b/pw/tests/pw_usermod.sh index dbc6481..006bb2c 100755 --- a/pw/tests/pw_usermod.sh +++ b/pw/tests/pw_usermod.sh @@ -119,6 +119,41 @@ user_mod_rename_too_long_body() { -l name_very_very_very_very_very_long } +atf_test_case user_mod_h +user_mod_h_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo + atf_check -s exit:0 ${PW} usermod foo -h 0 <<- EOF + $(echo a) + EOF + atf_check -s exit:0 -o not-match:"^foo:\*:.*" \ + grep "^foo" ${HOME}/master.passwd + atf_check -s exit:0 ${PW} usermod foo -h - <<- EOF + $(echo b) + EOF + atf_check -s exit:0 -o match:"^foo:\*:.*" \ + grep "^foo" ${HOME}/master.passwd + atf_check -e inline:"pw: '-h' expects a file descriptor or '-'\n" \ + -s exit:64 ${PW} usermod foo -h a <<- EOF + $(echo a) + EOF +} + +atf_test_case user_mod_H +user_mod_H_body() { + populate_etc_skel + + atf_check -s exit:0 ${PW} useradd foo + atf_check -s exit:0 ${PW} usermod foo -H 0 <<- EOF + $(echo a) + EOF + atf_check -s exit:0 -o match:"^foo:a:.*" \ + grep "^foo" ${HOME}/master.passwd + atf_check -s exit:64 -e inline:"pw: '-H' expects a file descriptor\n" \ + ${PW} usermod foo -H - +} + atf_init_test_cases() { atf_add_test_case user_mod atf_add_test_case user_mod_noupdate @@ -130,4 +165,6 @@ atf_init_test_cases() { atf_add_test_case user_mod_name_noupdate atf_add_test_case user_mod_rename atf_add_test_case user_mod_rename_too_long + atf_add_test_case user_mod_h + atf_add_test_case user_mod_H } |
