summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorMichael Adam <obnox@samba.org>2008-04-01 15:35:12 +0200
committerMichael Adam <obnox@samba.org>2008-04-01 16:16:55 +0200
commit4a99bce73633db42dff632d209e379f45d9aec22 (patch)
tree2cbbdbc2fa3b2ff4b065c2d555a869636afe2ff9 /source3
parenta63c396679f557875e9a949f50c0c1463548cb2b (diff)
downloadsamba-4a99bce73633db42dff632d209e379f45d9aec22.tar.gz
samba-4a99bce73633db42dff632d209e379f45d9aec22.tar.bz2
samba-4a99bce73633db42dff632d209e379f45d9aec22.zip
test: fix net_registry tests to correctly capture output of commands inside one test
so that failure output is not clobbered by output of previous successful commands. Michael (This used to be commit cb3dafe5fd8867b000e01979d4232968d994d376)
Diffstat (limited to 'source3')
-rwxr-xr-xsource3/script/tests/test_net_registry.sh37
1 files changed, 25 insertions, 12 deletions
diff --git a/source3/script/tests/test_net_registry.sh b/source3/script/tests/test_net_registry.sh
index 4c6dd19100..82861bae10 100755
--- a/source3/script/tests/test_net_registry.sh
+++ b/source3/script/tests/test_net_registry.sh
@@ -73,8 +73,11 @@ test_createkey()
BASEKEY=`dirname $KEY`
SUBKEY=`basename $KEY`
- ${NETREG} createkey ${KEY}
+ OUTPUT=`${NETREG} createkey ${KEY}`
if test "x$?" != "x0" ; then
+ echo "ERROR: createkey ${KEY} failed"
+ echo "output:"
+ printf "%s\n" "$OUTPUT"
false
return
fi
@@ -108,14 +111,20 @@ test_deletekey()
BASEKEY=`dirname ${KEY}`
SUBKEY=`basename ${KEY}`
- test_createkey "${KEY}"
+ OUTPUT=`test_createkey "${KEY}"`
if test "x$?" != "x0" ; then
+ printf "%s\n" "${OUTPUT}"
false
return
fi
- ${NETREG} deletekey ${KEY}
+ OUTPUT=`${NETREG} deletekey ${KEY}`
+ if test "x$?" != "x0" ; then
+ printf "%s\n" "${OUTPUT}"
+ false
+ return
+ fi
# check enumerate of basekey does not show key anymore:
OUTPUT=`${NETREG} enumerate ${BASEKEY}`
@@ -148,9 +157,9 @@ test_deletekey_nonexisting()
{
KEY="$1"
- test_deletekey "${KEY}"
-
+ OUTPUT=`test_deletekey "${KEY}"`
if test "x$?" != "x0" ; then
+ printf "%s\n" "${OUTPUT}"
false
return
fi
@@ -170,17 +179,19 @@ test_createkey_with_subkey()
BASENAME=`dirname ${KEY2}`
SUBKEYNAME1=`basename ${KEY2}`
- ${NETREG} createkey ${KEY}
-
+ OUTPUT=`${NETREG} createkey ${KEY}`
if test "x$?" != "x0" ; then
+ echo "ERROR: createkey ${KEY} failed"
+ printf "%s\n" "${OUTPUT}"
false
return
fi
# check we can enumerate to level key
- ${NETREG} enumerate ${KEY}
+ OUTPUT=`${NETREG} enumerate ${KEY}`
if test "x$?" != "x0" ; then
echo "ERROR: failed to enumerate '${KEY}' after creation"
+ printf "%s\n" "${OUTPUT}"
false
return
fi
@@ -194,9 +205,9 @@ test_deletekey_with_subkey()
KEY="$1"
KEY2=`dirname ${KEY}`
- ${NETREG} createkey ${KEY}
-
+ OUTPUT=`${NETREG} createkey ${KEY}`
if test "x$?" != "x0" ; then
+ printf "%s\n" "${OUTPUT}"
false
return
fi
@@ -221,15 +232,17 @@ test_setvalue()
VALTYPE="$3"
VALVALUE="$4"
- test_createkey ${KEY}
+ OUTPUT=`test_createkey ${KEY}`
if test "x$?" != "x0" ; then
+ printf "%s\n" "${OUTPUT}"
false
return
fi
- ${NETREG} setvalue ${KEY} ${VALNAME} ${VALTYPE} ${VALVALUE}
+ OUTPUT=`${NETREG} setvalue ${KEY} ${VALNAME} ${VALTYPE} ${VALVALUE}`
if test "x$?" != "x0" ; then
echo "ERROR: failed to set value testval in key ${KEY}"
+ printf "%s\n" "${OUTPUT}"
false
return
fi