]> CyberLeo.Net >> Repos - FreeBSD/releng/10.2.git/blob - usr.sbin/pw/tests/pw_lock.sh
- Copy stable/10@285827 to releng/10.2 in preparation for 10.2-RC1
[FreeBSD/releng/10.2.git] / usr.sbin / pw / tests / pw_lock.sh
1 # $FreeBSD$
2
3 # Import helper functions
4 . $(atf_get_srcdir)/helper_functions.shin
5
6 # Test locking and unlocking a user account
7 atf_test_case user_locking cleanup
8 user_locking_body() {
9         populate_etc_skel
10         ${PW} useradd test || atf_fail "Creating test user"
11         ${PW} lock test || atf_fail "Locking the user"
12         atf_check -s exit:0 -o match:"^test:\*LOCKED\*\*:1001:" \
13                 grep "^test:\*LOCKED\*\*:1001:" $HOME/master.passwd
14         ${PW} unlock test || atf_fail "Locking the user"
15         atf_check -s exit:0 -o match:"^test:\*:1001:" \
16                 grep "^test:\*:1001:" $HOME/master.passwd
17 }
18
19
20 atf_init_test_cases() {
21         atf_add_test_case user_locking
22 }