summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rwxr-xr-xsource4/selftest/tests.sh3
-rwxr-xr-xsource4/setup/tests/blackbox_group.sh73
-rwxr-xr-xsource4/setup/tests/blackbox_newuser.sh10
3 files changed, 84 insertions, 2 deletions
diff --git a/source4/selftest/tests.sh b/source4/selftest/tests.sh
index adbd8e8b9b..d8f1ef68eb 100755
--- a/source4/selftest/tests.sh
+++ b/source4/selftest/tests.sh
@@ -514,4 +514,5 @@ plantestsuite "blackbox.provision.py" none PYTHON="$PYTHON" $samba4srcdir/setup/
plantestsuite "blackbox.provision-backend.py" none PYTHON="$PYTHON" $samba4srcdir/setup/tests/blackbox_provision-backend.sh "$PREFIX/provision"
plantestsuite "blackbox.upgradeprovision.py" none PYTHON="$PYTHON" $samba4srcdir/setup/tests/blackbox_upgradeprovision.sh "$PREFIX/provision"
plantestsuite "blackbox.setpassword.py" none PYTHON="$PYTHON" $samba4srcdir/setup/tests/blackbox_setpassword.sh "$PREFIX/provision"
-plantestsuite "blackbox.newuser.py" none PYTHON="$PYTHON" $samba4srcdir/setup/tests/blackbox_newuser.sh "$PREFIX/provision"
+plantestsuite "blackbox.newuser.py" none PYTHON="$PYTHON" $samba4srcdir/setup/tests/blackbox_newuser.sh "$PREFIX/provision"
+plantestsuite "blackbox.group.py" none PYTHON="$PYTHON" $samba4srcdir/setup/tests/blackbox_group.sh "$PREFIX/provision"
diff --git a/source4/setup/tests/blackbox_group.sh b/source4/setup/tests/blackbox_group.sh
new file mode 100755
index 0000000000..f1d37b7692
--- /dev/null
+++ b/source4/setup/tests/blackbox_group.sh
@@ -0,0 +1,73 @@
+#!/bin/sh
+
+if [ $# -lt 1 ]; then
+cat <<EOF
+Usage: blackbox_group.sh PREFIX
+EOF
+exit 1;
+fi
+
+PREFIX="$1"
+shift 1
+
+. `dirname $0`/../../../testprogs/blackbox/subunit.sh
+
+
+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
+net="./bin/net"
+
+CONFIG="--configfile=$PREFIX/simple-dc/etc/smb.conf"
+
+#creation of two test subjects
+testit "newuser" $net newuser $CONFIG --given-name="User" --surname="Tester" --initial="UT" testuser testp@ssw0Rd
+testit "newuser" $net newuser $CONFIG --given-name="User1" --surname="Tester" --initial="UT" testuser1 testp@ssw0Rd
+
+#test creation of six different groups
+testit "group add" $net group add $CONFIG --group-scope='Domain' --group-type='Security' --description='DomainSecurityGroup' --mail-address='dsg@samba.org' --notes='Notes' dsg
+testit "group add" $net group add $CONFIG --group-scope='Global' --group-type='Security' --description='GlobalSecurityGroup' --mail-address='gsg@samba.org' --notes='Notes' gsg
+testit "group add" $net group add $CONFIG --group-scope='Universal' --group-type='Security' --description='UniversalSecurityGroup' --mail-address='usg@samba.org' --notes='Notes' usg
+testit "group add" $net group add $CONFIG --group-scope='Domain' --group-type='Distribution' --description='DomainDistributionGroup' --mail-address='ddg@samba.org' --notes='Notes' ddg
+testit "group add" $net group add $CONFIG --group-scope='Global' --group-type='Distribution' --description='GlobalDistributionGroup' --mail-address='gdg@samba.org' --notes='Notes' gdg
+testit "group add" $net group add $CONFIG --group-scope='Universal' --group-type='Distribution' --description='UniversalDistributionGroup' --mail-address='udg@samba.org' --notes='Notes' udg
+
+#test adding test users to all groups by their username
+testit "group addmembers" $net group addmembers $CONFIG dsg newuser,newuser1
+testit "group addmembers" $net group addmembers $CONFIG gsg newuser,newuser1
+testit "group addmembers" $net group addmembers $CONFIG usg newuser,newuser1
+testit "group addmembers" $net group addmembers $CONFIG ddg newuser,newuser1
+testit "group addmembers" $net group addmembers $CONFIG gdg newuser,newuser1
+testit "group addmembers" $net group addmembers $CONFIG udg newuser,newuser1
+
+#test removing test users from all groups by their username
+testit "group removemembers" $net group removemembers $CONFIG dsg newuser,newuser1
+testit "group removemembers" $net group removemembers $CONFIG gsg newuser,newuser1
+testit "group removemembers" $net group removemembers $CONFIG usg newuser,newuser1
+testit "group removemembers" $net group removemembers $CONFIG ddg newuser,newuser1
+testit "group removemembers" $net group removemembers $CONFIG gdg newuser,newuser1
+testit "group removemembers" $net group removemembers $CONFIG udg newuser,newuser1
+
+#test adding test users to all groups by their cn
+#testit "group addmembers" $net group addmembers $CONFIG dsg "User UT. Tester,User1 UT. Tester"
+#testit "group addmembers" $net group addmembers $CONFIG gsg "User UT. Tester,User1 UT. Tester"
+#testit "group addmembers" $net group addmembers $CONFIG usg "User UT. Tester,User1 UT. Tester"
+#testit "group addmembers" $net group addmembers $CONFIG ddg "User UT. Tester,User1 UT. Tester"
+#testit "group addmembers" $net group addmembers $CONFIG gdg "User UT. Tester,User1 UT. Tester"
+#testit "group addmembers" $net group addmembers $CONFIG udg "User UT. Tester,User1 UT. Tester"
+
+#test removing test users from all groups by their cn
+#testit "group removemembers" $net group removemembers $CONFIG dsg "User UT. Tester,User1 UT. Tester"
+#testit "group removemembers" $net group removemembers $CONFIG gsg "User UT. Tester,User1 UT. Tester"
+#testit "group removemembers" $net group removemembers $CONFIG usg "User UT. Tester,User1 UT. Tester"
+#testit "group removemembers" $net group removemembers $CONFIG ddg "User UT. Tester,User1 UT. Tester"
+#testit "group removemembers" $net group removemembers $CONFIG gdg "User UT. Tester,User1 UT. Tester"
+#testit "group removemembers" $net group removemembers $CONFIG ugg "User UT. Tester,User1 UT. Tester"
+
+#test deletion of the groups
+testit "group delete" $net group delete $CONFIG dsg
+testit "group delete" $net group delete $CONFIG gsg
+testit "group delete" $net group delete $CONFIG usg
+testit "group delete" $net group delete $CONFIG ddg
+testit "group delete" $net group delete $CONFIG gdg
+testit "group delete" $net group delete $CONFIG udg
+
+exit $failed
diff --git a/source4/setup/tests/blackbox_newuser.sh b/source4/setup/tests/blackbox_newuser.sh
index 113b667b59..a295522e6e 100755
--- a/source4/setup/tests/blackbox_newuser.sh
+++ b/source4/setup/tests/blackbox_newuser.sh
@@ -18,16 +18,24 @@ net="./bin/net"
CONFIG="--configfile=$PREFIX/simple-dc/etc/smb.conf"
-testit "newuser" $net newuser $CONFIG testuser testp@ssw0Rd
+#two test for creating new user
+#newuser account is created with cn=Given Name Initials. Surname
+#newuser1 account is created using cn=username
+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
+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
# check the enable account script
testit "enableaccount" $net enableaccount $CONFIG testuser
+testit "enableaccount" $net enableaccount $CONFIG testuser1
# check the enable account script
testit "setpassword" $net setpassword $CONFIG testuser --newpassword=testp@ssw0Rd2
+testit "setpassword" $net setpassword $CONFIG testuser1 --newpassword=testp@ssw0Rd2
# check the setexpiry script
testit "noexpiry" $net setexpiry $CONFIG testuser --noexpiry
+testit "noexpiry" $net setexpiry $CONFIG testuser1 --noexpiry
testit "expiry" $net setexpiry $CONFIG testuser --days=7
+testit "expiry" $net setexpiry $CONFIG testuser1 --days=7
exit $failed