[SCM] Samba Shared Repository - branch v3-3-test updated - release-3-2-0pre2-2897-g1734f93

Michael Adam obnox at samba.org
Tue Jun 17 22:20:41 GMT 2008


The branch, v3-3-test has been updated
       via  1734f9305a38eff05f0147d9c7391ef34085e7b2 (commit)
       via  9fe99c69f35b005b66c1eacb5d999cc73f1bb521 (commit)
      from  b8e1d62b8e8f724b855c8ab9801abee0b2791e36 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-3-test


- Log -----------------------------------------------------------------
commit 1734f9305a38eff05f0147d9c7391ef34085e7b2
Author: Michael Adam <obnox at samba.org>
Date:   Tue Jun 17 23:54:15 2008 +0200

    testsuite: give admin rights to testuser only for the "net rpc registry" test.
    
    Remove the user from BUILTIN\Administrators at the end of the tests.
    Note: BUILTIN\Administrators is not deletet at the end because that
    functionality is not implemented.
    
    Michael

commit 9fe99c69f35b005b66c1eacb5d999cc73f1bb521
Author: Michael Adam <obnox at samba.org>
Date:   Tue Jun 17 23:51:23 2008 +0200

    testsuite: don't give the testuser administrative rights globally.
    
    It breaks RPC-SAMBA3-GETUSERNAME for reasons I have not quite
    understood yet. Somhow loosing rights fails when the user
    belogns to BUILTIN\Administrators at some point.
    
    Michael

-----------------------------------------------------------------------

Summary of changes:
 source/script/tests/selftest.sh          |    9 ------
 source/script/tests/test_net_registry.sh |   41 ++++++++++++++++++++++++++++++
 2 files changed, 41 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/script/tests/selftest.sh b/source/script/tests/selftest.sh
index 5cec6d6..15e48b0 100755
--- a/source/script/tests/selftest.sh
+++ b/source/script/tests/selftest.sh
@@ -293,15 +293,6 @@ START=`date`
  bin/smbclient $CONFIGURATION -L $SERVER_IP -U% -p 139 | head -2
  MAKE_TEST_BINARY=""
 
- MAKE_TEST_BINARY="bin/net"
- printf "%s" "GIVING USER ${USERNAME} ADMINISTRATIVE RIGHTS..."
- bin/net -s $SERVERCONFFILE sam createbuiltingroup \
-   Administrators > /dev/null 2>&1 ||  exit 1
- bin/net -s $SERVERCONFFILE sam addmem \
-   BUILTIN\\Administrators $USERNAME > /dev/null 2>&1 || exit 1
- echo "DONE"
- MAKE_TEST_BINARY=""
-
  failed=0
 
  . $SCRIPTDIR/tests_$SUBTESTS.sh
diff --git a/source/script/tests/test_net_registry.sh b/source/script/tests/test_net_registry.sh
index b263ecb..4fe6db4 100755
--- a/source/script/tests/test_net_registry.sh
+++ b/source/script/tests/test_net_registry.sh
@@ -329,6 +329,41 @@ test_setvalue_twice()
 	${NETREG} setvalue ${KEY} ${VALNAME} ${VALTYPE2} ${VALVALUE2}
 }
 
+give_administrative_rights()
+{
+	bin/net -s $SERVERCONFFILE sam createbuiltingroup Administrators
+	if test "x$?" != "x0" ; then
+		echo "ERROR: creating builtin group Administrators"
+		false
+		return
+	fi
+
+	bin/net -s $SERVERCONFFILE sam addmem BUILTIN\\Administrators $USERNAME
+	if test "x$?" != "x0" ; then
+		echo "ERROR: adding user $USERNAME to BUILTIN\\Administrators"
+		false
+	else
+		true
+	fi
+}
+
+take_administrative_rights()
+{
+	bin/net -s $SERVERCONFFILE sam delmem BUILTIN\\Administrators $USERNAME
+	if test "x$?" != "x0" ; then
+		echo "ERROR: removing user $USERNAME from BUILTIN\\Administrators"
+		false
+	else
+		true
+	fi
+}
+
+if test "x${RPC}" = "xrpc" ; then
+testit "giving user ${USERNAME} administrative rights" \
+	give_administrative_rights || \
+	failed=`expr $failed +1`
+fi
+
 testit "enumerate HKLM" \
 	test_enumerate HKLM || \
 	failed=`expr $failed + 1`
@@ -396,5 +431,11 @@ testit "delete key with value" \
 	test_deletekey HKLM/testkey || \
 	failed=`expr $failed + 1`
 
+if test "x${RPC}" = "xrpc" ; then
+testit "taking administrative rights from user ${USERNAME}" \
+	take_administrative_rights || \
+	failed=`expr $failed +1`
+fi
+
 testok $0 $failed
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list