summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-05-27 14:06:12 (GMT)
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2014-05-27 14:06:12 (GMT)
commit1eb587f55c2f06c398bf2bc9ee51158dd7bdbc0f (patch)
tree7ffaae121c27205ea47e375ee7c2983de84b2db4
parent8bf5bbc1d965c07d6f05cd7eb75c7eada1319b22 (diff)
downloadkolab-scripts-1eb587f55c2f06c398bf2bc9ee51158dd7bdbc0f.tar.gz
Add extra scripts to test setting a mail server after the user has initially been created
-rwxr-xr-xucs-3.0/tests/15-set-debuglevels.sh4
-rwxr-xr-xucs-3.0/tests/16-create-john-no-mailserver.sh26
-rwxr-xr-xucs-3.0/tests/17-set-john-mailserver.sh21
3 files changed, 51 insertions, 0 deletions
diff --git a/ucs-3.0/tests/15-set-debuglevels.sh b/ucs-3.0/tests/15-set-debuglevels.sh
new file mode 100755
index 0000000..7a5d67a
--- /dev/null
+++ b/ucs-3.0/tests/15-set-debuglevels.sh
@@ -0,0 +1,4 @@
+#!/bin/bash
+
+ucr set listener/debug/level='3'
+/etc/init.d/univention-directory-listener restart
diff --git a/ucs-3.0/tests/16-create-john-no-mailserver.sh b/ucs-3.0/tests/16-create-john-no-mailserver.sh
new file mode 100755
index 0000000..146c072
--- /dev/null
+++ b/ucs-3.0/tests/16-create-john-no-mailserver.sh
@@ -0,0 +1,26 @@
+#!/bin/bash
+
+eval "$(ucr shell)"
+
+if [ "${server_role}" != "domaincontroller_master" ]; then
+ echo "SKIPPED - This system is not a master domain controller."
+ exit 0
+fi
+
+imap_server=$(ldapsearch -x -H ldap://${ldap_server_name}:${ldap_server_port} -D "${ldap_hostdn}" -y /etc/machine.secret -LLL "(univentionService=IMAP)" cn | grep ^cn | awk '{print $2}' | head -n 1)
+
+if [ -z "${imap_server}" ]; then
+ echo "FAILED - No IMAP server found"
+ exit 1
+fi
+
+univention-directory-manager users/user create \
+ --set password=Welcome2KolabSystems \
+ --set "username=doe" \
+ --set "lastname=Doe" \
+ --set "e-mail=doe@${domainname}" \
+ --set "mailPrimaryAddress=doe@${domainname}" \
+ --set "mailAlternativeAddress=ceo@${domainname}" \
+ --position "cn=users,${ldap_base}"
+
+ldapsearch -x -H ldap://${ldap_server_name}:${ldap_server_port} -b "${ldap_base}" -LLL -D "${ldap_hostdn}" -y /etc/machine.secret "(uid=doe)" entrydn univentionMailHomeServer
diff --git a/ucs-3.0/tests/17-set-john-mailserver.sh b/ucs-3.0/tests/17-set-john-mailserver.sh
new file mode 100755
index 0000000..5249278
--- /dev/null
+++ b/ucs-3.0/tests/17-set-john-mailserver.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+eval "$(ucr shell)"
+
+if [ "${server_role}" != "domaincontroller_master" ]; then
+ echo "SKIPPED - This system is not a master domain controller."
+ exit 0
+fi
+
+imap_server=$(ldapsearch -x -H ldap://${ldap_server_name}:${ldap_server_port} -D "${ldap_hostdn}" -y /etc/machine.secret -LLL "(univentionService=IMAP)" cn | grep ^cn | awk '{print $2}' | head -n 1)
+
+if [ -z "${imap_server}" ]; then
+ echo "FAILED - No IMAP server found"
+ exit 1
+fi
+
+univention-directory-manager users/user modify \
+ --dn="uid=doe,cn=users,${ldap_base}" \
+ --set "mailHomeServer=${imap_server}.${domainname}"
+
+ldapsearch -x -H ldap://${ldap_server_name}:${ldap_server_port} -b "${ldap_base}" -LLL -D "${ldap_hostdn}" -y /etc/machine.secret "(uid=doe)" entrydn univentionMailHomeServer