auth/gensec: remove unused gensec_[un]wrap_packets() hooks
[Samba.git] / testprogs / blackbox / renamedc.sh
blob4f187a4aaf5c0188b0805ffebb43f76c2f83f98c
1 #!/bin/sh
3 if [ $# -lt 1 ]; then
4 cat <<EOF
5 Usage: renamedc.sh PREFIX
6 EOF
7 exit 1;
8 fi
10 PREFIX="$1"
11 shift 1
13 samba4bindir="$BINDIR"
14 ldbsearch="ldbsearch"
15 if [ -x "$samba4bindir/ldbsearch" ]; then
16 ldbsearch="$samba4bindir/ldbsearch"
19 . `dirname $0`/subunit.sh
21 if [ ! -d $PREFIX/renamedc_test ]; then
22 mkdir -p $PREFIX/renamedc_test
25 testprovision() {
26 $PYTHON $BINDIR/samba-tool domain provision --host-name=bar --domain=FOO --realm=foo.example.com --targetdir="$PREFIX/renamedc_test" --server-role="dc" --use-ntvfs
29 testrenamedc() {
30 $PYTHON $SRCDIR/source4/scripting/bin/renamedc \
31 --oldname="BAR" \
32 --newname="RAYMONBAR" \
33 -s $PREFIX/renamedc_test/etc/smb.conf
36 confirmrenamedc() {
37 $ldbsearch -H $PREFIX/renamedc_test/private/sam.ldb -s base -b 'cn=RAYMONBAR,ou=domain controllers,dc=foo,dc=example,dc=com'
40 confirmrenamedc_server() {
41 $ldbsearch -H $PREFIX/renamedc_test/private/sam.ldb -s base -b 'cn=RAYMONBAR,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=configuration,dc=foo,dc=example,dc=com'
44 confirmrenamedc_sAMAccountName() {
45 $ldbsearch -H $PREFIX/renamedc_test/private/sam.ldb -s base -b 'cn=RAYMONBAR,ou=domain controllers,dc=foo,dc=example,dc=com' sAMAccountName | grep 'sAMAccountName: RAYMONBAR\$'
48 confirmrenamedc_dNSHostName() {
49 $ldbsearch -H $PREFIX/renamedc_test/private/sam.ldb -s base -b 'cn=RAYMONBAR,ou=domain controllers,dc=foo,dc=example,dc=com' dNSHostName | grep 'dNSHostName: RAYMONBAR.foo.example.com'
52 confirmrenamedc_rootdse_dnsHostName() {
53 $ldbsearch -H $PREFIX/renamedc_test/private/sam.ldb -s base -b '' dNSHostName | grep 'dnsHostName: RAYMONBAR.foo.example.com'
56 confirmrenamedc_rootdse_dsServiceName() {
57 $ldbsearch -H $PREFIX/renamedc_test/private/sam.ldb --show-binary -s base -b '' dsServiceName | grep 'dsServiceName: CN=NTDS Settings,CN=RAYMONBAR,CN=Servers,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=foo,DC=example,DC=com'
60 testrenamedc2() {
61 $PYTHON $SRCDIR/source4/scripting/bin/renamedc \
62 --oldname="RAYMONBAR" \
63 --newname="BAR" \
64 -s $PREFIX/renamedc_test/etc/smb.conf
67 dbcheck() {
68 $BINDIR/samba-tool dbcheck --cross-ncs -s $PREFIX/renamedc_test/etc/smb.conf
72 testit "renameprovision" testprovision || failed=`expr $failed + 1`
73 testit "renamedc" testrenamedc || failed=`expr $failed + 1`
74 testit "confirmrenamedc" confirmrenamedc || failed=`expr $failed + 1`
75 testit "confirmrenamedc_server" confirmrenamedc_server || failed=`expr $failed + 1`
76 testit "confirmrenamedc_sAMAccountName" confirmrenamedc_sAMAccountName || failed=`expr $failed + 1`
77 testit "confirmrenamedc_dNSHostName" confirmrenamedc_dNSHostName || failed=`expr $failed + 1`
78 testit "confirmrenamedc_rootdse_dnsHostName" confirmrenamedc_rootdse_dnsHostName || failed=`expr $failed + 1`
79 testit "confirmrenamedc_rootdse_dsServiceName" confirmrenamedc_rootdse_dsServiceName || failed=`expr $failed + 1`
80 testit "dbcheck" dbcheck || failed=`expr $failed + 1`
81 testit "renamedc2" testrenamedc2 || failed=`expr $failed + 1`
83 if [ $failed -eq 0 ]; then
84 rm -rf $PREFIX/renamedc_test
87 exit $failed