s3-test: Enhanced the net registry roundtrip test script
authorVicentiu Ciorbaru <cvicentiu@gmail.com>
Wed, 10 Aug 2011 08:58:25 +0000 (11:58 +0300)
committerMichael Adam <obnox@samba.org>
Mon, 22 Aug 2011 11:59:28 +0000 (13:59 +0200)
The script now supports an rpc mode, which is triggered by the
presence of a fourth command line parameter "rpc"

Signed-off-by: Michael Adam <obnox@samba.org>
source3/script/tests/test_net_registry_roundtrip.sh

index 77b261fbbadb74f664c33c290b6479027426740e..72bc69355740a2cfb833c02037340073c11734ba 100755 (executable)
@@ -15,16 +15,17 @@ fi
 SCRIPTDIR="$1"
 SERVERCONFFILE="$2"
 CONFIGURATION="$3"
+RPC="$4"
 
 NET="$VALGRIND ${NET:-$BINDIR/net} $CONFIGURATION"
 
-
 if test "x${RPC}" = "xrpc" ; then
-       NETREG="${NET} -U${USERNAME}%${PASSWORD} -I ${SERVER_IP} rpc registry"
+       NETCMD="${NET} -U${USERNAME}%${PASSWORD} -I ${SERVER_IP} rpc"
 else
-       NETREG="${NET} registry"
+       NETCMD="${NET}"
 fi
 
+
 incdir=`dirname $0`/../../../testprogs/blackbox
 . $incdir/subunit.sh
 
@@ -72,23 +73,23 @@ conf_roundtrip()
 
     sed -e "$SED_INVALID_PARAMS" $1 >$DIR/conf_in
 
-    conf_roundtrip_step $NET conf drop
+    conf_roundtrip_step $NETCMD conf drop
     test "x$?" = "x0" || {
         return 1
     }
 
-    test -z "$($NET conf list)" 2>>$LOG
+    test -z "$($NETCMD conf list)" 2>>$LOG
     if [ "$?" = "1" ]; then
        echo "ERROR: conf drop failed" | tee -a $LOG
        return 1
     fi
 
-    conf_roundtrip_step $NET conf import $DIR/conf_in
+    conf_roundtrip_step $NETCMD conf import $DIR/conf_in
     test "x$?" = "x0" || {
         return 1
     }
 
-    conf_roundtrip_step $NET conf list > $DIR/conf_exp
+    conf_roundtrip_step $NETCMD conf list > $DIR/conf_exp
     test "x$?" = "x0" || {
         return 1
     }
@@ -99,28 +100,28 @@ conf_roundtrip()
        return 1
     fi
 
-    conf_roundtrip_step $NET -d10 registry export $REGPATH $DIR/conf_exp.reg
+    conf_roundtrip_step $NETCMD -d10 registry export $REGPATH $DIR/conf_exp.reg
     test "x$?" = "x0" || {
         return 1
     }
 
-    conf_roundtrip_step $NET conf drop
+    conf_roundtrip_step $NETCMD conf drop
     test "x$?" = "x0" || {
         return 1
     }
 
-    test -z "$($NET conf list)" 2>>$LOG
+    test -z "$($NETCMD conf list)" 2>>$LOG
     if [ "$?" = "1" ]; then
        echo "ERROR: conf drop failed" | tee -a $LOG
        return 1
     fi
 
-    conf_roundtrip_step $NET registry import $DIR/conf_exp.reg
+    conf_roundtrip_step $NETCMD registry import $DIR/conf_exp.reg
     test "x$?" = "x0" || {
         return 1
     }
 
-    conf_roundtrip_step $NET conf list >$DIR/conf_out
+    conf_roundtrip_step $NETCMD conf list >$DIR/conf_out
     test "x$?" = "x0"  || {
         return 1
     }
@@ -131,7 +132,7 @@ conf_roundtrip()
        return 1
     fi
 
-    conf_roundtrip_step $NET registry export $REGPATH $DIR/conf_out.reg
+    conf_roundtrip_step $NETCMD registry export $REGPATH $DIR/conf_out.reg
     test "x$?" = "x0" || {
         return 1
     }