#!/usr/share/ucs-test/runner bash
# shellcheck shell=bash
## desc: Check local config
## exposure: safe
## packages:
##  - univention-samba-local-config
## roles:
##  - domaincontroller_master
##  - domaincontroller_backup
##  - domaincontroller_slave
##  - memberserver
## bugs:
##  - 28722

eval "$(ucr shell)"

# shellcheck source=../../lib/random.sh
. "$TESTLIBPATH/random.sh" || exit 137
# shellcheck source=../../lib/base.sh
. "$TESTLIBPATH/base.sh" || exit 137

value="$(random_string)"

ucr set "samba/global/options/netbios aliases=$value"
trap 'ucr unset samba/global/options/"netbios aliases"' INT TERM EXIT

result="$(echo ""  | testparm -vv 2>&1 | sed -ne 's|[ \t]*netbios aliases = ||p')"
[ "$result" = "$value" ] ||
	fail_test 1 "netbios aliases is set to $result; expected $value"

exit "$RETVAL"
