Lines Matching +full:foo +full:- +full:bar
10 atf_check -s exit:67 -e match:"no such user" ${PW} usermod test
11 atf_check -s exit:0 ${PW} useradd test
12 atf_check -s exit:0 ${PW} usermod test
13 atf_check -s exit:0 -o match:"^test:.*" \
17 # Test modifying a user with option -N
22 atf_check -s exit:67 -e match:"no such user" ${PW} usermod test -N
23 atf_check -s exit:0 ${PW} useradd test
24 atf_check -s exit:0 -o match:"^test:.*" ${PW} usermod test -N
25 atf_check -s exit:0 -o match:"^test:.*" \
34 atf_check -s exit:0 ${PW} useradd test -c "Test User,home,123,456"
35 atf_check -s exit:0 ${PW} usermod test -c "Test User,work,123,456"
36 atf_check -s exit:0 -o match:"^test:.*:Test User,work,123,456:" \
40 # Test modifying a user with comments with option -N
45 atf_check -s exit:0 ${PW} useradd test -c "Test User,home,123,456"
46 atf_check -s exit:0 -o match:"^test:.*:Test User,work,123,456:" \
47 ${PW} usermod test -c "Test User,work,123,456" -N
48 atf_check -s exit:0 -o match:"^test:.*:Test User,home,123,456:" \
57 atf_check -s exit:0 ${PW} useradd test
58 atf_check -s exit:65 -e match:"invalid character" \
59 ${PW} usermod test -c "Test User,work,123:456,456"
60 atf_check -s exit:1 -o empty \
62 atf_check -s exit:0 -o match:"^test:\*" \
66 # Test modifying a user with invalid comments with option -N
71 atf_check -s exit:0 ${PW} useradd test
72 atf_check -s exit:65 -e match:"invalid character" \
73 ${PW} usermod test -c "Test User,work,123:456,456" -N
74 atf_check -s exit:1 -o empty \
76 atf_check -s exit:0 -o match:"^test:\*" \
80 # Test modifying a user name with -l
85 atf_check -s exit:0 ${PW} useradd foo
86 atf_check -s exit:0 ${PW} usermod foo -l "bar"
87 atf_check -s exit:0 -o match:"^bar:.*" \
88 grep "^bar:.*" $HOME/master.passwd
91 # Test modifying a user name with -l with option -N
96 atf_check -s exit:0 ${PW} useradd foo
97 atf_check -s exit:0 -o match:"^bar:.*" ${PW} usermod foo -l "bar" -N
98 atf_check -s exit:0 -o match:"^foo:.*" \
99 grep "^foo:.*" $HOME/master.passwd
106 atf_check -s exit:0 ${PW} groupadd test1
107 atf_check -s exit:0 ${PW} groupadd test2
108 atf_check -s exit:0 ${PW} useradd foo -G test1,test2
109 atf_check -o match:"foo" -s exit:0 ${PW} groupshow test1
110 atf_check -o match:"foo" -s exit:0 ${PW} groupshow test2
111 atf_check -s exit:0 ${PW} usermod foo -l bar
112 atf_check -o match:"bar" -s exit:0 ${PW} groupshow test1
113 atf_check -o match:"bar" -s exit:0 ${PW} groupshow test2
120 atf_check -s exit:0 ${PW} groupadd test1
121 atf_check -s exit:0 ${PW} groupadd test2
122 atf_check -s exit:0 ${PW} groupadd test3
123 atf_check -s exit:0 ${PW} groupadd test4
124 atf_check -s exit:0 ${PW} useradd foo -G test1,test2
125 atf_check -o match:"foo" -s exit:0 ${PW} groupshow test1
126 atf_check -o match:"foo" -s exit:0 ${PW} groupshow test2
127 atf_check -s exit:0 ${PW} usermod foo -G test3,test4
128 atf_check -s exit:0 -o inline:"test3\ntest4\n" \
129 awk -F\: '$4 == "foo" { print $1 }' ${HOME}/group
130 atf_check -s exit:0 ${PW} usermod foo -G ""
131 atf_check -s exit:0 -o empty \
132 awk -F\: '$4 == "foo" { print $1 }' ${HOME}/group
139 atf_check -s exit:0 ${PW} useradd foo
140 atf_check -s exit:0 ${PW} usermod foo -l bar
141 atf_check -s exit:0 -o match:"^bar:.*" \
142 grep "^bar:.*" ${HOME}/master.passwd
149 atf_check -s exit:0 ${PW} useradd foo
150 atf_check -s exit:64 -e match:"too long" ${PW} usermod foo \
151 -l name_very_very_very_very_very_long
158 atf_check -s exit:0 ${PW} useradd foo
159 atf_check -s exit:0 ${PW} usermod foo -h 0 <<- EOF
162 passhash=`awk -F ':' '/^foo:/ {print $2}' $HOME/master.passwd`
163 atf_check -s exit:0 -o inline:$passhash \
165 atf_check -s exit:0 ${PW} usermod foo -h - <<- EOF
168 atf_check -s exit:0 -o match:"^foo:\*:.*" \
169 grep "^foo" ${HOME}/master.passwd
170 atf_check -e inline:"pw: Bad file descriptor 'a': invalid\n" \
171 -s exit:64 ${PW} usermod foo -h a <<- EOF
180 atf_check -s exit:0 ${PW} useradd foo
181 atf_check -s exit:0 ${PW} usermod foo -H 0 <<- EOF
184 atf_check -s exit:0 -o match:"^foo:a:.*" \
185 grep "^foo" ${HOME}/master.passwd
186 atf_check -s exit:64 -e inline:"pw: -H expects a file descriptor\n" \
187 ${PW} usermod foo -H -
194 mkdir -p ${HOME}/home
195 atf_check -s exit:0 ${RPW} useradd foo -m
196 test -d ${HOME}/home/foo || atf_fail "Directory not created"
197 atf_check -s exit:0 ${RPW} usermod foo -l bar -d /home/bar -m
198 test -d ${HOME}/home/bar || atf_fail "Directory not created"
205 atf_check -s exit:0 ${PW} useradd foo
206 atf_check -s exit:0 ${PW} usermod foo -u 5000
213 atf_check -s exit:0 ${PW} useradd foo
214 atf_check -s exit:1 -e match:"pw: Invalid value for default password" \
215 ${PW} usermod foo -w invalid_value
222 atf_check -s exit:0 ${PW} useradd foo
223 atf_check -s exit:0 ${PW} usermod foo -w no
224 atf_check -s exit:0 -o match:"^foo:\*" grep "^foo:" $HOME/master.passwd
231 atf_check -s exit:0 ${PW} useradd foo
232 atf_check -s exit:0 ${PW} usermod foo -w none
233 atf_check -s exit:0 -o match:"^foo::" grep "^foo:" $HOME/master.passwd
240 atf_check -s exit:0 ${PW} useradd foo
241 password=`${PW} usermod foo -w random | cat`
242 passhash=`awk -F ':' '/^foo:/ {print $2}' $HOME/master.passwd`
243 atf_check -s exit:0 -o inline:$passhash \
251 atf_check -s exit:0 ${PW} useradd foo
252 atf_check -s exit:0 ${PW} usermod foo -w yes
253 passhash=`awk -F ':' '/^foo:/ {print $2}' $HOME/master.passwd`
254 atf_check -s exit:0 -o inline:$passhash \
255 $(atf_get_srcdir)/crypt $passhash "foo"
262 mkdir -p ${HOME}/home
263 mkdir -p ${HOME}/skel
265 atf_check -s exit:0 ${RPW} useradd foo
266 ! test -d ${HOME}/home/foo || atf_fail "Directory should not have been created"
267 atf_check -s exit:0 ${RPW} usermod foo -m -k /skel
268 test -d ${HOME}/home/foo || atf_fail "Directory should have been created"
269 test -f ${HOME}/home/foo/.file || atf_fail "Skell files not added"
271 atf_check -s exit:0 ${RPW} usermod foo -m -k /skel
272 test -f ${HOME}/home/foo/.file2 || atf_fail "Skell files not added"
273 echo > ${HOME}/home/foo/.file2
274 atf_check -s exit:0 ${RPW} usermod foo -m -k /skel
275 atf_check -s exit:0 -o inline:"\n" cat ${HOME}/home/foo/.file2