heimdal_build: Improve error and warning handling on old and new compilers
[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 rm -rf $PREFIX/simple-dc
17 testit "simple-dc" $PYTHON $BINDIR/samba-tool domain provision --server-role="dc" --domain=FOO --realm=foo.example.com --domain-sid=S-1-5-21-4177067393-1453636373-93818738 --targetdir=$PREFIX/simple-dc --use-ntvfs
18 samba_tool="./bin/samba-tool"
19
20 CONFIG="--configfile=$PREFIX/simple-dc/etc/smb.conf"
21
22 #two test for creating new user
23 #newuser  account is created with cn=Given Name Initials. Surname
24 #newuser1 account is created using cn=username
25 testit "user add" $PYTHON $samba_tool user create $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="https://www.samba.org" --telephone-number="001122334455" --physical-delivery-office="101" --home-drive="H:" NewUser testp@ssw0Rd
26 testit "user add" $PYTHON $samba_tool user create $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="https://www.samba.org" --telephone-number="001122334455" --physical-delivery-office="101" --home-drive="H:" NewUser1 testp@ssw0Rd
27
28 # check the enable account script
29 testit "enableaccount" $PYTHON $samba_tool user enable $CONFIG NewUser
30 testit "enableaccount" $PYTHON $samba_tool user enable $CONFIG NewUser1
31
32 # check the enable account script
33 testit "setpassword" $PYTHON $samba_tool user setpassword $CONFIG NewUser --newpassword=testp@ssw0Rd2
34 testit "setpassword" $PYTHON $samba_tool user setpassword $CONFIG NewUser1 --newpassword=testp@ssw0Rd2
35
36 # check the setexpiry script
37 testit "noexpiry" $PYTHON $samba_tool user setexpiry $CONFIG NewUser --noexpiry
38 testit "noexpiry" $PYTHON $samba_tool user setexpiry $CONFIG NewUser1 --noexpiry
39 testit "expiry" $PYTHON $samba_tool user setexpiry $CONFIG NewUser --days=7
40 testit "expiry" $PYTHON $samba_tool user setexpiry $CONFIG NewUser1 --days=7
41
42 exit $failed