2 # Blackbox tests for samba-tool ntacl get/set on member server
3 # Copyright (C) 2018 Björn Baumbach <bb@sernet.de>
7 Usage: test_net_ads_dns.sh PREFIX
16 samba4bindir="$BINDIR"
17 samba_tool="$samba4bindir/samba-tool"
19 testfile="$PREFIX/ntacl_testfile"
21 # acl from samba_tool/ntacl.py tests
22 acl="O:DAG:DUD:P(A;OICI;0x001f01ff;;;DA)(A;OICI;0x001f01ff;;;EA)(A;OICIIO;0x001f01ff;;;CO)(A;OICI;0x001f01ff;;;DA)(A;OICI;0x001f01ff;;;SY)(A;OICI;0x001200a9;;;AU)(A;OICI;0x001200a9;;;ED)S:AI(OU;CIIDSA;WP;f30e3bbe-9ff0-11d1-b603-0000f80367c1;bf967aa5-0de6-11d0-a285-00aa003049e2;WD)(OU;CIIDSA;WP;f30e3bbf-9ff0-11d1-b603-0000f80367c1;bf967aa5-0de6-11d0-a285-00aa003049e2;WD)"
24 . `dirname $0`/subunit.sh
27 export UID_WRAPPER_ROOT
34 retacl=$($samba_tool ntacl get "$testfile" --as-sddl) || return $?
36 test "$retacl" = "$exptextedacl"
44 $samba_tool ntacl set "$acl" "$testfile"
47 # work around include error - s4-loadparm does not allow missing include files
49 # Unable to load file /home/bbaumba/src/git/samba/st/ad_member/lib/server.conf
50 # File "bin/python/samba/netcmd/__init__.py", line 183, in _run
51 # return self.run(*args, **kwargs)
52 # File "bin/python/samba/netcmd/ntacl.py", line 175, in run
53 # lp = sambaopts.get_loadparm()
54 # File "bin/python/samba/getopt.py", line 92, in get_loadparm
55 # self._lp.load(os.getenv("SMB_CONF_PATH"))
56 # Processing section "[global]"
57 touch "$(dirname $SMB_CONF_PATH)/error_inject.conf"
58 touch "$(dirname $SMB_CONF_PATH)/delay_inject.conf"
62 testit "set_ntacl" test_set_acl "$testfile" "$acl" || failed=`expr $failed + 1`
64 testit "get_ntacl" test_get_acl "$testfile" "$acl" || failed=`expr $failed + 1`