make test modules for net group set of commands and modification to the newuser to...
[samba.git] / source4 / setup / tests / blackbox_newuser.sh
1 #!/bin/sh
2
3 if [ $# -lt 1 ]; then
4 cat <<EOF
5 Usage: blackbox_newuser.sh PREFIX
6 EOF
7 exit 1;
8 fi
9
10 PREFIX="$1"
11 shift 1
12
13 . `dirname $0`/../../../testprogs/blackbox/subunit.sh
14
15
16 testit "simple-dc" $PYTHON ./setup/provision --server-role="dc" --domain=FOO --realm=foo.example.com --domain-sid=S-1-5-21-4177067393-1453636373-93818738 --targetdir=$PREFIX/simple-dc
17 net="./bin/net"
18
19 CONFIG="--configfile=$PREFIX/simple-dc/etc/smb.conf"
20
21 #two test for creating new user
22 #newuser  account is created with cn=Given Name Initials. Surname
23 #newuser1 account is created using cn=username
24 testit "newuser" $net newuser $CONFIG --given-name="User" --surname="Tester" --initials="T" --profile-path="\\\\myserver\\my\\profile" --script-path="\\\\myserver\\my\\script" --home-directory="\\\\myserver\\my\\homedir" --job-title="Tester" --department="Testing" --company="Samba.org" --description="Description" --mail-address="tester@samba.org" --internet-address="http://samba.org" --telephone-number="001122334455" --physical-delivery-office="101" --home-drive="H:" testuser testp@ssw0Rd
25 testit "newuser" $net newuser $CONFIG --use-username-as-cn --given-name="User1" --surname="Tester1" --initials="UT1" --profile-path="\\\\myserver\\my\\profile" --script-path="\\\\myserver\\my\\script" --home-directory="\\\\myserver\\my\\homedir" --job-title="Tester" --department="Testing" --company="Samba.org" --description="Description" --mail-address="tester@samba.org" --internet-address="http://samba.org" --telephone-number="001122334455" --physical-delivery-office="101" --home-drive="H:" testuser1 testp@ssw0Rd
26
27 # check the enable account script
28 testit "enableaccount" $net enableaccount $CONFIG testuser
29 testit "enableaccount" $net enableaccount $CONFIG testuser1
30
31 # check the enable account script
32 testit "setpassword" $net setpassword $CONFIG testuser --newpassword=testp@ssw0Rd2
33 testit "setpassword" $net setpassword $CONFIG testuser1 --newpassword=testp@ssw0Rd2
34
35 # check the setexpiry script
36 testit "noexpiry" $net setexpiry $CONFIG testuser --noexpiry
37 testit "noexpiry" $net setexpiry $CONFIG testuser1 --noexpiry
38 testit "expiry" $net setexpiry $CONFIG testuser --days=7
39 testit "expiry" $net setexpiry $CONFIG testuser1 --days=7
40
41 exit $failed