#!/usr/share/ucs-test/runner bash
# shellcheck shell=bash
## desc: "Perform a 'net rpc testjoin'"
## exposure: safe
## tags:
##  - skip_admember
## bugs: [35590]
## roles-not: [memberserver]
## packages:
##  - winbind
##  - univention-samba

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

echo "Initiating a net rpc testjoin"
win_dom="$(ucr get windows/domain)"

if [ ! "$(net rpc testjoin)" = "Join to '$win_dom' is OK" ] ; then
   fail_fast 110 "The RPC testjoin did not report that join to $win_dom is OK"
fi

exit $RETVAL
