[SCM] Samba Shared Repository - branch v3-2-test updated - release-3-2-0pre2-613-gc04a234

Michael Adam obnox at samba.org
Tue Apr 1 14:17:56 GMT 2008


The branch, v3-2-test has been updated
       via  c04a234f8f6fbdf8e54c69414024d84aa71fec45 (commit)
       via  8f0c25f01f11857d24556346dc2758549919eba3 (commit)
       via  dba9db5ae6581df18591eebd19d3649bed0d9367 (commit)
       via  cb3dafe5fd8867b000e01979d4232968d994d376 (commit)
       via  388a40931f1559b134317ef0c85c7cf2598e17fe (commit)
       via  0bd50e450baf633ea9d653341f3ce9d81bfdd83f (commit)
       via  7a23dab1eaf3116079a89cdf348cabc659608031 (commit)
       via  8b015c91c9b10c208fe61cefd71ddc9f4fcbec61 (commit)
       via  06dfb0cf7cd39e1072534fc32e79a4b4f6e49cb6 (commit)
       via  c0c41184277044eb856f91c025f645c198cac188 (commit)
       via  b6122406fe938fdaf373ff45214db79de06eb989 (commit)
      from  2d50a1fef022023588e9963131951f8f3e4c7c23 (commit)

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-test


- Log -----------------------------------------------------------------
commit c04a234f8f6fbdf8e54c69414024d84aa71fec45
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 1 15:51:51 2008 +0200

    test: add diagnostic message to net_registry test.
    
    Michael

commit 8f0c25f01f11857d24556346dc2758549919eba3
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 1 15:50:24 2008 +0200

    test: fix net_registry test "set value to different type" to track error count
    
    missing backslash in call... :-}
    
    Michael

commit dba9db5ae6581df18591eebd19d3649bed0d9367
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 1 15:43:35 2008 +0200

    test: some cosmetics to net_registry tests.
    
    Michael

commit cb3dafe5fd8867b000e01979d4232968d994d376
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 1 15:35:12 2008 +0200

    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

commit 388a40931f1559b134317ef0c85c7cf2598e17fe
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 1 15:19:05 2008 +0200

    test: fix use of printf in net_registry tests.
    
    actually 'printf "%s\n"' is the proper replacement of 'echo -e'
    
    Michael

commit 0bd50e450baf633ea9d653341f3ce9d81bfdd83f
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 1 15:55:59 2008 +0200

    po/genmsg: be more portable, use 'printf "%s"' instead of 'echo -n'
    
    Michael

commit 7a23dab1eaf3116079a89cdf348cabc659608031
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 1 15:54:34 2008 +0200

    mkversion: be more portable, use 'print "%s"' instead of 'echo -n'
    
    Michael

commit 8b015c91c9b10c208fe61cefd71ddc9f4fcbec61
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 1 15:53:54 2008 +0200

    installswat: be more portable, use 'printf "%s"' instead of 'echo -n'
    
    Michael

commit 06dfb0cf7cd39e1072534fc32e79a4b4f6e49cb6
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 1 15:52:54 2008 +0200

    configure: be more portable, use 'printf "%s"' instead of "echo -n"
    
    Michael

commit c0c41184277044eb856f91c025f645c198cac188
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 1 13:45:55 2008 +0200

    test: be more portable. replace 'echo -n' by 'printf "%s"' in test_functions.sh
    
    Michael

commit b6122406fe938fdaf373ff45214db79de06eb989
Author: Michael Adam <obnox at samba.org>
Date:   Tue Apr 1 13:43:20 2008 +0200

    test: be more portable: replace 'echo -n' by 'printf "%s"' in selftest.sh
    
    Michael

-----------------------------------------------------------------------

Summary of changes:
 source/configure.in                      |    2 +-
 source/po/genmsg                         |    2 +-
 source/script/installswat.sh             |    4 +-
 source/script/mkversion.sh               |    8 ++--
 source/script/tests/selftest.sh          |    2 +-
 source/script/tests/test_functions.sh    |    6 +-
 source/script/tests/test_net_registry.sh |   69 ++++++++++++++++++------------
 7 files changed, 54 insertions(+), 39 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source/configure.in b/source/configure.in
index bcfad68..ce3fcc9 100644
--- a/source/configure.in
+++ b/source/configure.in
@@ -1077,7 +1077,7 @@ AC_CHECK_HEADERS(execinfo.h libexc.h libunwind.h)
 AC_CHECK_FUNCS(backtrace_symbols)
 AC_CHECK_LIB(exc, trace_back_stack)
 
-echo -n "checking for GPFS GPL libs... "
+printf "%s" "checking for GPFS GPL libs... "
 save_LIBS="$LIBS"
 LIBS="$LIBS -lgpfs_gpl"
 AC_TRY_LINK([#include <gpfs_gpl.h>],
diff --git a/source/po/genmsg b/source/po/genmsg
index 14bfa97..543200a 100755
--- a/source/po/genmsg
+++ b/source/po/genmsg
@@ -30,7 +30,7 @@ $XGETTEXT --default-domain="i18n_swat" \
   $FILES
 
 for lang in $LANGS; do
-  echo -n $lang
+  printf "%s" "$lang"
   mv ${lang}.msg ${lang}.msg.old
   $MSGMERGE --width=${WIDTH} ${lang}.msg.old i18n_swat.po -o ${lang}.msg
 done
diff --git a/source/script/installswat.sh b/source/script/installswat.sh
index 567bfa1..40596f3 100755
--- a/source/script/installswat.sh
+++ b/source/script/installswat.sh
@@ -10,13 +10,13 @@ case $0 in
 	*uninstall*)
 		echo "Removing SWAT from $DESTDIR/$SWATDIR "
 		echo "Removing the Samba Web Administration Tool "
-		echo -n "Removed "
+		printf "%s" "Removed "
 		mode='uninstall'
 		;;
 	*)
 		echo "Installing SWAT in $DESTDIR/$SWATDIR "
 		echo "Installing the Samba Web Administration Tool "
-		echo -n "Installing "
+		printf "%s" "Installing "
 		mode='install'
 		;;
 esac
diff --git a/source/script/mkversion.sh b/source/script/mkversion.sh
index 877138f..b678476 100755
--- a/source/script/mkversion.sh
+++ b/source/script/mkversion.sh
@@ -73,10 +73,10 @@ if test x"${SAMBA_VERSION_IS_GIT_SNAPSHOT}" = x"yes";then
     if test x"${HAVEVER}" != x"yes" -a -d "${SOURCE_DIR}../.git";then
 	HAVEGIT=no
 	GIT_INFO=`git show --pretty=format:"%h%n%ct%n%H%n%cd" --stat HEAD 2>/dev/null`
-	GIT_COMMIT_ABBREV=`echo -e "${GIT_INFO}" | sed -n 1p`
-	GIT_COMMIT_TIME=`echo -e "${GIT_INFO}" | sed -n 2p`
-	GIT_COMMIT_FULLREV=`echo -e "${GIT_INFO}" | sed -n 3p`
-	GIT_COMMIT_DATE=`echo -e "${GIT_INFO}" | sed -n 4p`
+	GIT_COMMIT_ABBREV=`printf "%s" "${GIT_INFO}" | sed -n 1p`
+	GIT_COMMIT_TIME=`printf "%s" "${GIT_INFO}" | sed -n 2p`
+	GIT_COMMIT_FULLREV=`printf "%s" "${GIT_INFO}" | sed -n 3p`
+	GIT_COMMIT_DATE=`printf "%s" "${GIT_INFO}" | sed -n 4p`
 	if test -n "${GIT_COMMIT_ABBREV}";then
 	    HAVEGIT=yes
             HAVEVER=yes
diff --git a/source/script/tests/selftest.sh b/source/script/tests/selftest.sh
index 2f2cb7b..492a2c3 100755
--- a/source/script/tests/selftest.sh
+++ b/source/script/tests/selftest.sh
@@ -107,7 +107,7 @@ fi
 ## 
 ## create the test directory layout
 ##
-echo -n "CREATE TEST ENVIRONMENT IN '$PREFIX'"...
+printf "%s" "CREATE TEST ENVIRONMENT IN '$PREFIX'"...
 /bin/rm -rf $PREFIX/*
 mkdir -p $PRIVATEDIR $LIBDIR $PIDDIR $LOCKDIR $LOGDIR
 mkdir -p $SOCKET_WRAPPER_DIR
diff --git a/source/script/tests/test_functions.sh b/source/script/tests/test_functions.sh
index d707c30..407d46a 100644
--- a/source/script/tests/test_functions.sh
+++ b/source/script/tests/test_functions.sh
@@ -42,7 +42,7 @@ samba3_check_or_start() {
 		mkfifo $SERVER_TEST_FIFO
 
 		rm -f $NMBD_TEST_LOG
-		echo -n "STARTING NMBD..."
+		printf "%s" "STARTING NMBD..."
 		((
 			if test x"$NMBD_MAXTIME" = x; then
 			    NMBD_MAXTIME=2700
@@ -74,7 +74,7 @@ samba3_check_or_start() {
 		echo  "DONE"
 
 		rm -f $WINBINDD_TEST_LOG
-		echo -n "STARTING WINBINDD..."
+		printf "%s" "STARTING WINBINDD..."
 		((
 			if test x"$WINBINDD_MAXTIME" = x; then
 			    WINBINDD_MAXTIME=2700
@@ -106,7 +106,7 @@ samba3_check_or_start() {
 		echo  "DONE"
 
 		rm -f $SMBD_TEST_LOG
-		echo -n "STARTING SMBD..."
+		printf "%s" "STARTING SMBD..."
 		((
 			if test x"$SMBD_MAXTIME" = x; then
 			    SMBD_MAXTIME=2700
diff --git a/source/script/tests/test_net_registry.sh b/source/script/tests/test_net_registry.sh
index fd9275a..9ea78cf 100755
--- a/source/script/tests/test_net_registry.sh
+++ b/source/script/tests/test_net_registry.sh
@@ -30,6 +30,7 @@ test_enumerate_nonexisting()
 {
 	KEY="$1"
 	${NETREG} enumerate ${KEY}
+
 	if test "x$?" = "x0" ; then
 		echo "ERROR: enumerate succeeded with key '${KEY}'"
 		false
@@ -53,16 +54,17 @@ test_create_existing()
 {
 	KEY="HKLM"
 	EXPECTED="createkey opened existing ${KEY}"
+
 	OUTPUT=`${NETREG} createkey ${KEY}`
 	if test "x$?" = "x0" ; then
 		if test "$OUTPUT" = "$EXPECTED" ; then
 			true
 		else
 			echo "got '$OUTPUT', expected '$EXPECTED'"
-			false;
+			false
 		fi
 	else
-		printf "%s" "$OUTPUT"
+		printf "%s\n" "$OUTPUT"
 		false
 	fi
 }
@@ -73,8 +75,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
@@ -84,17 +89,17 @@ test_createkey()
 	if test "x$?" != "x0" ; then
 		echo "ERROR: failed to enumerate key '${BASEKEY}'"
 		echo "output:"
-		printf "%s" "$OUTPUT"
+		printf "%s\n" "$OUTPUT"
 		false
 		return
 	fi
 
 	EXPECTED="Keyname = ${SUBKEY}"
-	printf "%s" "$OUTPUT" | grep '^Keyname' | grep ${SUBKEY}
+	printf "%s\n" "$OUTPUT" | grep '^Keyname' | grep ${SUBKEY}
 	if test "x$?" != "x0" ; then
 		echo "ERROR: did not find expexted '$EXPECTED' in output"
 		echo "output:"
-		printf "%s" "$OUTPUT"
+		printf "%s\n" "$OUTPUT"
 		false
 	fi
 
@@ -108,29 +113,34 @@ 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}`
 	if test "x$?" != "x0" ; then
-		printf "%s" "$OUTPUT"
+		printf "%s\n" "$OUTPUT"
 		false
 		return
 	fi
 
 	UNEXPECTED="Keyname = ${SUBKEY}"
-	printf "%s" "$OUTPUT" | 'grep ^Keyname' | grep ${SUBKEY}
+	printf "%s\n" "$OUTPUT" | 'grep ^Keyname' | grep ${SUBKEY}
 	if test "x$?" = "x0" ; then
 		echo "ERROR: found '$UNEXPECTED' after delete in output"
 		echo "output:"
-		printf "%s" "$OUTPUT"
+		printf "%s\n" "$OUTPUT"
 		false
 	fi
 
@@ -148,9 +158,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 +180,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 +206,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
@@ -206,7 +218,7 @@ test_deletekey_with_subkey()
 	if test "x$?" = "x0" ; then
 		echo "ERROR: delete of key with subkey succeeded"
 		echo "output:"
-		printf "%s" "$OUTPUT"
+		printf "%s\n" "$OUTPUT"
 		false
 		return
 	fi
@@ -221,15 +233,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
@@ -238,12 +252,12 @@ test_setvalue()
 	if test "x$?" != "x0" ; then
 		echo "ERROR: failure calling enumerate for key ${KEY}"
 		echo output:
-		printf "%s" "${OUTPUT}"
+		printf "%s\n" "${OUTPUT}"
 		false
 		return
 	fi
 
-	printf "%s" "$OUTPUT" | {
+	printf "%s\n" "$OUTPUT" | {
 	FOUND=0
 	while read LINE ; do
 		SEARCH1=`echo $LINE | grep '^Valuename' | grep ${VALNAME}`
@@ -261,7 +275,7 @@ test_setvalue()
 	if test "x$FOUND" != "x1" ; then
 		echo "ERROR: did not find value '${VALNAME}' with enumerate"
 		echo "enumerate output:"
-		printf "%s" "$OUTPUT"
+		printf "%s\n" "$OUTPUT"
 		false
 		return
 	fi
@@ -301,7 +315,8 @@ test_setvalue_twice()
 
 	OUTPUT=`test_setvalue ${KEY} ${VALNAME} ${VALTYPE1} ${VALVALUE1}`
 	if test "x$?" != "x0" ; then
-		printf "%s" "$OUTPUT"
+		echo "ERROR: first setvalue call failed"
+		printf "%s\n" "$OUTPUT"
 		false
 		return
 	fi
@@ -366,7 +381,7 @@ testit "delete nonexisting value" \
 	test_deletevalue_nonexisting HKLM/testkey testval || \
 	failed=`expr $failed + 1`
 
-testit "set value to different type"
+testit "set value to different type" \
 	test_setvalue_twice HKLM/testkey testval sz moin dword 42 || \
 	failed=`expr $failed + 1`
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list