summaryrefslogtreecommitdiff
path: root/testprogs/blackbox/renamedc.sh
blob: 69a05e5388bd2018a90d8b23b48b2cbfbf102ca6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#!/bin/sh

if [ $# -lt 1 ]; then
cat <<EOF
Usage: renamedc.sh PREFIX
EOF
exit 1;
fi

PREFIX="$1"
shift 1

. `dirname $0`/subunit.sh

if [ ! -d $PREFIX/renamedc_test ]; then
	$PYTHON $SRCDIR/source4/setup/provision --host-name=bar --domain=FOO --realm=foo.example.com --targetdir="$PREFIX/renamedc_test" --server-role="dc" --use-ntvfs
fi


testrenamedc() {
	$PYTHON $SRCDIR/source4/scripting/bin/renamedc \
		--oldname="BAR" \
		--newname="RAYMONBAR" \
		-s $PREFIX/renamedc_test/etc/smb.conf
}


testrenamedc2() {
	$PYTHON $SRCDIR/source4/scripting/bin/renamedc \
		--oldname="RAYMONBAR" \
		--newname="BAR" \
		-s $PREFIX/renamedc_test/etc/smb.conf
}

testit "renamedc" testrenamedc
testit "renamedc2" testrenamedc2

if [ $failed -eq 0 ]; then
	rm -rf $PREFIX/renamedc_test
fi

exit $failed