mirror of
https://github.com/samba-team/samba.git
synced 2025-03-27 22:50:26 +03:00
functionalprep.sh: Add test for samba-tool add group --special
Test that we can add the special Protected Users group, and that we get an appropriate error message when attempting to add it a second time. We add these tests here so that we can make use of an old provision that does not already have the Protected Users group added. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
parent
bf509bf7df
commit
4f1b7684ed
2
selftest/knownfail.d/samba-tool-group-special
Normal file
2
selftest/knownfail.d/samba-tool-group-special
Normal file
@ -0,0 +1,2 @@
|
||||
^samba4.blackbox.test_special_group.add_special_group.none
|
||||
^samba4.blackbox.test_special_group.add_duplicate_special_group.none
|
@ -211,6 +211,10 @@ plantestsuite(
|
||||
"samba4.blackbox.functionalprep", "none",
|
||||
cmdline('functionalprep.sh', '$PREFIX_ABS/provision'))
|
||||
|
||||
plantestsuite(
|
||||
"samba4.blackbox.test_special_group", "none",
|
||||
cmdline('test_special_group.sh', '$PREFIX_ABS/provision'))
|
||||
|
||||
planpythontestsuite("none", "samba.tests.upgradeprovision")
|
||||
planpythontestsuite("none", "samba.tests.xattr")
|
||||
planpythontestsuite("none", "samba.tests.ntacls")
|
||||
|
52
testprogs/blackbox/test_special_group.sh
Executable file
52
testprogs/blackbox/test_special_group.sh
Executable file
@ -0,0 +1,52 @@
|
||||
#!/bin/sh
|
||||
|
||||
if [ $# -lt 1 ]; then
|
||||
cat <<EOF
|
||||
Usage: $0 PREFIX
|
||||
EOF
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
PREFIX_ABS="$1"
|
||||
shift 1
|
||||
|
||||
failed=0
|
||||
|
||||
. `dirname $0`/subunit.sh
|
||||
. `dirname $0`/common_test_fns.inc
|
||||
|
||||
OLD_RELEASE="release-4-5-0-pre1"
|
||||
old_release_dir="$SRCDIR_ABS/source4/selftest/provisions/$OLD_RELEASE"
|
||||
|
||||
samba_tdbrestore="tdbrestore"
|
||||
if [ -x "$BINDIR/tdbrestore" ]; then
|
||||
samba_tdbrestore="$BINDIR/tdbrestore"
|
||||
fi
|
||||
|
||||
samba_undump="$SRCDIR_ABS/source4/selftest/provisions/undump.sh"
|
||||
|
||||
cleanup_output_directories()
|
||||
{
|
||||
remove_directory $PREFIX_ABS/$OLD_RELEASE
|
||||
}
|
||||
|
||||
undump_old() {
|
||||
$samba_undump $old_release_dir $PREFIX_ABS/$OLD_RELEASE $samba_tdbrestore
|
||||
}
|
||||
|
||||
add_special_group() {
|
||||
$PYTHON $BINDIR/samba-tool group add 'protected users' --special -H tdb://$PREFIX_ABS/$OLD_RELEASE/private/sam.ldb
|
||||
}
|
||||
|
||||
# double-check we cleaned up from the last test run
|
||||
cleanup_output_directories
|
||||
|
||||
testit $OLD_RELEASE undump_old || failed=`expr $failed + 1`
|
||||
|
||||
testit "add_special_group" add_special_group || failed=`expr $failed + 1`
|
||||
|
||||
testit_expect_failure_grep "add_duplicate_special_group" "Failed to add group.*already exists" add_special_group || failed=`expr $failed + 1`
|
||||
|
||||
cleanup_output_directories
|
||||
|
||||
exit $failed
|
Loading…
x
Reference in New Issue
Block a user