|
Lines 188-193
user_add_name_with_spaces_body() {
Link Here
|
| 188 |
atf_check -s exit:1 -o empty grep "^test user:.*" $HOME/master.passwd |
188 |
atf_check -s exit:1 -o empty grep "^test user:.*" $HOME/master.passwd |
| 189 |
} |
189 |
} |
| 190 |
|
190 |
|
|
|
191 |
atf_test_case user_add_name_with_spaces_and_gid_specified |
| 192 |
user_add_name_with_spaces_and_gid_specified_body() { |
| 193 |
populate_etc_skel |
| 194 |
gid=12345 |
| 195 |
user_name="test user" |
| 196 |
# pw useradd should fail because of the space in the user |
| 197 |
# name, not because the group doesn't exist. |
| 198 |
atf_check -s exit:65 -e match:"invalid character" \ |
| 199 |
${PW} useradd "${user_name}" -g ${gid} |
| 200 |
atf_check -s exit:1 -o empty grep "^${user_name}:.*" $HOME/master.passwd |
| 201 |
# Try again with the -n option which uses a slightly different code path. |
| 202 |
atf_check -s exit:65 -e match:"invalid character" \ |
| 203 |
${PW} useradd -n "${user_name}" -g ${gid} |
| 204 |
atf_check -s exit:1 -o empty grep "^${user_name}:.*" $HOME/master.passwd |
| 205 |
# Make sure the user isn't added even if the group exists |
| 206 |
atf_check -s exit:0 ${PW} groupadd blafasel -g ${gid} |
| 207 |
atf_check -s exit:65 -e match:"invalid character" \ |
| 208 |
${PW} useradd "${user_name}" -g ${gid} |
| 209 |
atf_check -s exit:1 -o empty grep "^${user_name}:.*" $HOME/master.passwd |
| 210 |
# Try again with the -n option. |
| 211 |
atf_check -s exit:65 -e match:"invalid character" \ |
| 212 |
${PW} useradd -n "${user_name}" -g ${gid} |
| 213 |
atf_check -s exit:1 -o empty grep "^${user_name}:.*" $HOME/master.passwd |
| 214 |
} |
| 215 |
|
| 191 |
atf_test_case user_add_expiration |
216 |
atf_test_case user_add_expiration |
| 192 |
user_add_expiration_body() { |
217 |
user_add_expiration_body() { |
| 193 |
populate_etc_skel |
218 |
populate_etc_skel |
|
Lines 428-433
atf_init_test_cases() {
Link Here
|
| 428 |
atf_add_test_case user_add_password_expiration_date_relative |
453 |
atf_add_test_case user_add_password_expiration_date_relative |
| 429 |
atf_add_test_case user_add_name_too_long |
454 |
atf_add_test_case user_add_name_too_long |
| 430 |
atf_add_test_case user_add_name_with_spaces |
455 |
atf_add_test_case user_add_name_with_spaces |
|
|
456 |
atf_add_test_case user_add_name_with_spaces_and_gid_specified |
| 431 |
atf_add_test_case user_add_expiration |
457 |
atf_add_test_case user_add_expiration |
| 432 |
atf_add_test_case user_add_invalid_user_entry |
458 |
atf_add_test_case user_add_invalid_user_entry |
| 433 |
atf_add_test_case user_add_invalid_group_entry |
459 |
atf_add_test_case user_add_invalid_group_entry |
| 434 |
- |
|
|