s3:test: correctly react to each failing step in the net registry roundtrip tests
authorMichael Adam <obnox@samba.org>
Fri, 4 Mar 2011 22:17:02 +0000 (23:17 +0100)
committerMichael Adam <obnox@samba.org>
Sat, 5 Mar 2011 00:31:33 +0000 (01:31 +0100)
source3/script/tests/test_net_registry_roundtrip.sh

index a50e18e6d987a9f67c2a9b64dd0996c6c493f0d5..ad07f2bc596039fdbc9c387e3fd98744350b92f0 100755 (executable)
@@ -73,6 +73,10 @@ conf_roundtrip()
     sed -e "$SED_INVALID_PARAMS" $1 >$DIR/conf_in
 
     conf_roundtrip_step $NET conf drop
+    test "x$?" = "x0" || {
+        return 1
+    }
+
     test -z "$($NET conf list)" 2>>$LOG
     if [ "$?" = "1" ]; then
        echo "ERROR: conf drop failed" | tee -a $LOG
@@ -80,7 +84,14 @@ conf_roundtrip()
     fi
 
     conf_roundtrip_step $NET conf import $DIR/conf_in
+    test "x$?" = "x0" || {
+        return 1
+    }
+
     conf_roundtrip_step $NET conf list > $DIR/conf_exp
+    test "x$?" = "x0" || {
+        return 1
+    }
 
     grep "\[global\]" $DIR/conf_exp >/dev/null 2>>$LOG
     if [ "$?" = "1" ]; then
@@ -89,8 +100,15 @@ conf_roundtrip()
     fi
 
     conf_roundtrip_step $NET -d10 registry export $REGPATH $DIR/conf_exp.reg
+    test "x$?" = "x0" || {
+        return 1
+    }
 
     conf_roundtrip_step $NET conf drop
+    test "x$?" = "x0" || {
+        return 1
+    }
+
     test -z "$($NET conf list)" 2>>$LOG
     if [ "$?" = "1" ]; then
        echo "ERROR: conf drop failed" | tee -a $LOG
@@ -98,8 +116,15 @@ conf_roundtrip()
     fi
 
     conf_roundtrip_step $NET registry import $DIR/conf_exp.reg
+    test "x$?" = "x0" || {
+        return 1
+    }
 
     conf_roundtrip_step $NET conf list >$DIR/conf_out
+    test "x$?" = "x0"  || {
+        return 1
+    }
+
     diff -q $DIR/conf_out $DIR/conf_exp  >> $LOG
     if [ "$?" = "1" ]; then
        echo "ERROR: registry import => conf export failed"  | tee -a $LOG
@@ -107,6 +132,10 @@ conf_roundtrip()
     fi
 
     conf_roundtrip_step $NET registry export $REGPATH $DIR/conf_out.reg
+    test "x$?" = "x0" || {
+        return 1
+    }
+
     diff -q $DIR/conf_out.reg $DIR/conf_exp.reg >>$LOG
     if [ "$?" = "1" ]; then
        echo "Error: registry import => registry export failed" | tee -a $LOG