summaryrefslogtreecommitdiff
path: root/source3/script/tests
diff options
context:
space:
mode:
authorGregor Beck <gbeck@sernet.de>2010-05-19 11:37:23 +0200
committerMichael Adam <obnox@samba.org>2010-05-21 00:22:45 +0200
commit304271bd8feb77891b57ed4db3b7c4070bfa9a1f (patch)
tree606b6d7cd03ea81e7d22c61259a50d2bea842436 /source3/script/tests
parent12ce1643849a4cbbf1435d4f9ab7b1a951f86d07 (diff)
downloadsamba-304271bd8feb77891b57ed4db3b7c4070bfa9a1f.tar.gz
samba-304271bd8feb77891b57ed4db3b7c4070bfa9a1f.tar.bz2
samba-304271bd8feb77891b57ed4db3b7c4070bfa9a1f.zip
s3: registry: add tests with empty valuename
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3/script/tests')
-rwxr-xr-xsource3/script/tests/test_net_registry.sh38
1 files changed, 25 insertions, 13 deletions
diff --git a/source3/script/tests/test_net_registry.sh b/source3/script/tests/test_net_registry.sh
index 042d921527..241926358e 100755
--- a/source3/script/tests/test_net_registry.sh
+++ b/source3/script/tests/test_net_registry.sh
@@ -237,7 +237,7 @@ test_deletekey_with_subkey()
test_setvalue()
{
KEY="$1"
- VALNAME="$2"
+ VALNAME="${2#_}"
VALTYPE="$3"
VALVALUE="$4"
@@ -248,7 +248,7 @@ test_setvalue()
return
fi
- OUTPUT=`${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}"
@@ -256,7 +256,7 @@ test_setvalue()
return
fi
- OUTPUT=`${NETREG} getvalueraw ${KEY} ${VALNAME}`
+ OUTPUT=`${NETREG} getvalueraw ${KEY} "${VALNAME}"`
if test "x$?" != "x0" ; then
echo "ERROR: failure calling getvalueraw for key ${KEY}"
echo output:
@@ -277,17 +277,17 @@ test_setvalue()
test_deletevalue()
{
KEY="$1"
- VALNAME="$2"
+ VALNAME="${2#_}"
- ${NETREG} deletevalue ${KEY} ${VALNAME}
+ ${NETREG} deletevalue ${KEY} "${VALNAME}"
}
test_deletevalue_nonexisting()
{
KEY="$1"
- VALNAME="$2"
+ VALNAME="${2#_}"
- ${NETREG} deletevalue ${KEY} ${VALNAME}
+ ${NETREG} deletevalue ${KEY} "${VALNAME}"
if test "x$?" = "x0" ; then
echo "ERROR: succeeded deleting value ${VALNAME}"
false
@@ -299,13 +299,13 @@ test_deletevalue_nonexisting()
test_setvalue_twice()
{
KEY="$1"
- VALNAME="$2"
+ VALNAME="${2#_}"
VALTYPE1="$3"
VALVALUE1="$4"
VALTYPE2="$5"
VALVALUE2="$6"
- OUTPUT=`test_setvalue ${KEY} ${VALNAME} ${VALTYPE1} ${VALVALUE1}`
+ OUTPUT=`test_setvalue ${KEY} _"${VALNAME}" ${VALTYPE1} ${VALVALUE1}`
if test "x$?" != "x0" ; then
echo "ERROR: first setvalue call failed"
printf "%s\n" "$OUTPUT"
@@ -313,7 +313,7 @@ test_setvalue_twice()
return
fi
- ${NETREG} setvalue ${KEY} ${VALNAME} ${VALTYPE2} ${VALVALUE2}
+ ${NETREG} setvalue ${KEY} "${VALNAME}" ${VALTYPE2} ${VALVALUE2}
}
give_administrative_rights()
@@ -402,21 +402,33 @@ testit "delete key with subkey" \
failed=`expr $failed + 1`
testit "set value" \
- test_setvalue HKLM/testkey testval sz moin || \
+ test_setvalue HKLM/testkey _testval sz moin || \
failed=`expr $failed + 1`
testit "delete value" \
- test_deletevalue HKLM/testkey testval || \
+ test_deletevalue HKLM/testkey _testval || \
failed=`expr $failed + 1`
testit "delete nonexisting value" \
- test_deletevalue_nonexisting HKLM/testkey testval || \
+ test_deletevalue_nonexisting HKLM/testkey _testval || \
failed=`expr $failed + 1`
testit "set value to different type" \
test_setvalue_twice HKLM/testkey testval sz moin dword 42 || \
failed=`expr $failed + 1`
+testit "set default value" \
+ test_setvalue HKLM/testkey _"" sz 42 || \
+ failed=`expr $failed + 1`
+
+testit "delete default value" \
+ test_deletevalue HKLM/testkey _"" || \
+ failed=`expr $failed + 1`
+
+testit "delete nonexisting default value" \
+ test_deletevalue_nonexisting HKLM/testkey _"" || \
+ failed=`expr $failed + 1`
+
testit "delete key with value" \
test_deletekey HKLM/testkey || \
failed=`expr $failed + 1`