FreeBSD Bugzilla – Attachment 150412 Details for
Bug 195834
[patch] Additional mod user tests for /usr/sbin/pw
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
pw_usermod.diff (text/plain), 2.78 KB, created by
oneil.rs
on 2014-12-09 21:59:06 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
oneil.rs
Created:
2014-12-09 21:59:06 UTC
Size:
2.78 KB
patch
obsolete
>Index: Makefile >=================================================================== >--- Makefile (revision 275656) >+++ Makefile (working copy) >@@ -5,11 +5,12 @@ > > TESTSDIR= ${TESTSBASE}/usr.sbin/pw > >-ATF_TESTS_SH= pw_etcdir pw_lock pw_groupmod pw_useradd pw_userdel >+ATF_TESTS_SH= pw_etcdir pw_lock pw_groupmod pw_useradd pw_userdel pw_usermod > > TEST_METADATA.pw_groupmod+= required_user="root" > TEST_METADATA.pw_useradd+= required_user="root" > TEST_METADATA.pw_userdel+= required_user="root" >+TEST_METADATA.pw_usermod+= required_user="root" > > FILES= group helper_functions.shin master.passwd > FILESDIR= ${TESTSDIR} >Index: pw_usermod.sh >=================================================================== >--- pw_usermod.sh (revision 0) >+++ pw_usermod.sh (working copy) >@@ -0,0 +1,56 @@ >+# $FreeBSD$ >+ >+# Import helper functions >+. $(atf_get_srcdir)/helper_functions.shin >+ >+# Test mod user >+atf_test_case user_mod >+user_mod_body() { >+ populate_etc_skel >+ >+ atf_check -s exit:67 -e match:"no such user" ${PW} usermod test >+ atf_check -s exit:0 ${PW} useradd test >+ atf_check -s exit:0 ${PW} usermod test >+ atf_check -s exit:0 -o match:"^test:.*" \ >+ grep "^test:.*" $HOME/master.passwd >+} >+ >+# Test mod user with comments >+atf_test_case user_mod_comments >+user_mod_comments_body() { >+ populate_etc_skel >+ >+ atf_check -s exit:0 ${PW} useradd test -c "Test User,home,123,456" >+ atf_check -s exit:0 ${PW} usermod test -c "Test User,work,123,456" >+ atf_check -s exit:0 -o match:"^test:.*:Test User,work,123,456:" \ >+ grep "^test:.*:Test User,work,123,456:" $HOME/master.passwd >+} >+ >+# Test mod user with invalid comments >+atf_test_case user_mod_comments_invalid >+user_mod_comments_invalid_body() { >+ populate_etc_skel >+ >+ atf_check -s exit:0 ${PW} useradd test >+ atf_check -s exit:65 -e match:"invalid character" \ >+ ${PW} usermod test -c "Test User,work,123:456,456" >+ atf_check -s exit:1 -o empty \ >+ grep "^test:.*:Test User,work,123:456,456:" $HOME/master.passwd >+} >+ >+# Test mod user name with -l >+atf_test_case user_mod_name >+user_mod_name_body() { >+ populate_etc_skel >+ >+ atf_check -s exit:0 ${PW} useradd foo >+ atf_check -s exit:0 ${PW} usermod foo -l "bar" >+ atf_check -s exit:0 -o match:"^bar:.*" \ >+ grep "^bar:.*" $HOME/master.passwd >+} >+atf_init_test_cases() { >+ atf_add_test_case user_mod >+ atf_add_test_case user_mod_comments >+ atf_add_test_case user_mod_comments_invalid >+ atf_add_test_case user_mod_name >+} > >Property changes on: pw_usermod.sh >___________________________________________________________________ >Added: svn:executable >## -0,0 +1 ## >+* >\ No newline at end of property >Added: svn:mime-type >## -0,0 +1 ## >+text/plain >\ No newline at end of property >Added: svn:keywords >## -0,0 +1 ## >+FreeBSD=%H >\ No newline at end of property >Added: svn:eol-style >## -0,0 +1 ## >+native >\ No newline at end of property
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 195834
: 150412