#!/usr/share/ucs-test/runner bash
# shellcheck shell=bash
## desc: Change the server password and check LDAP-BIND
## bugs: [45090]
## roles-not: [basesystem]
## tags:
##  - SKIP-UCSSCHOOL
##  - basic
##  - apptest
## packages:
##  - univention-bind
## exposure: dangerous
## join: true

# shellcheck source=../../lib/base.sh
. "$TESTLIBPATH/base.sh" || exit 137
# shellcheck source=../../lib/ucr.sh
. "$TESTLIBPATH/ucr.sh" || exit 137
. /usr/share/univention-lib/ucr.sh

# Only with LDAP-BIND
case "$dns_backend" in
ldap) ;;
*) exit 77
esac
# Only when BIND is running/used
systemctl is-active named.service || exit 77

trap ucr_restore EXIT
ucr set server/password/interval=0
set -e -x
/usr/lib/univention-server/server_password_change
dig @127.0.0.1 -p 7777 "$DOMAIN" soa
