diff options
author | Gregor Beck <gbeck@sernet.de> | 2010-05-19 12:20:10 +0200 |
---|---|---|
committer | Michael Adam <obnox@samba.org> | 2010-05-21 00:22:45 +0200 |
commit | 12ce1643849a4cbbf1435d4f9ab7b1a951f86d07 (patch) | |
tree | ac7a1244446c87c473960c4dc0c6589d53100fd9 /source3 | |
parent | 0a173444ac7bba8d69bbc80792215930ce65fdc3 (diff) | |
download | samba-12ce1643849a4cbbf1435d4f9ab7b1a951f86d07.tar.gz samba-12ce1643849a4cbbf1435d4f9ab7b1a951f86d07.tar.xz samba-12ce1643849a4cbbf1435d4f9ab7b1a951f86d07.zip |
s3: registry: let test_setvalue use getvalueraw instead of enumerate
simplifies code, prerequisite to handle empty valuenames
Signed-off-by: Michael Adam <obnox@samba.org>
Diffstat (limited to 'source3')
-rwxr-xr-x | source3/script/tests/test_net_registry.sh | 28 |
1 files changed, 6 insertions, 22 deletions
diff --git a/source3/script/tests/test_net_registry.sh b/source3/script/tests/test_net_registry.sh index 52a78bc339..042d921527 100755 --- a/source3/script/tests/test_net_registry.sh +++ b/source3/script/tests/test_net_registry.sh @@ -256,38 +256,22 @@ test_setvalue() return fi - OUTPUT=`${NETREG} enumerate ${KEY}` + OUTPUT=`${NETREG} getvalueraw ${KEY} ${VALNAME}` if test "x$?" != "x0" ; then - echo "ERROR: failure calling enumerate for key ${KEY}" + echo "ERROR: failure calling getvalueraw for key ${KEY}" echo output: printf "%s\n" "${OUTPUT}" false return fi - printf "%s\n" "$OUTPUT" | { - FOUND=0 - while read LINE ; do - SEARCH1=`echo $LINE | grep '^Valuename' | grep ${VALNAME}` - if test "x$?" = "x0" ; then - read LINE - read LINE - SEARCH2=`echo $LINE | grep '^Value ' | grep ${VALVALUE}` - if test "x$?" = "x0" ; then - FOUND=1 - break - fi - fi - done - - if test "x$FOUND" != "x1" ; then - echo "ERROR: did not find value '${VALNAME}' with enumerate" - echo "enumerate output:" - printf "%s\n" "$OUTPUT" + if test "x${OUTPUT}" != "x${VALVALUE}" ; then + echo "ERROR: failure retrieving value ${VALNAME} for key ${KEY}" + printf "expected: %s\ngot: %s\n" "${VALVALUE}" "${OUTPUT}" false return fi - } + } test_deletevalue() |