Change in osmo-bsc[master]: tweak handover_tests.sh

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

neels gerrit-no-reply at lists.osmocom.org
Tue Jan 5 22:28:44 UTC 2021


neels has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/21966 )


Change subject: tweak handover_tests.sh
......................................................................

tweak handover_tests.sh

We decided not to keep the handover_test script expected outputs
(osmo-bsc's logging output) in the source tree. Hence do not fail the
handover_tests when the output differs, just show a diff (if at all).

Change-Id: I3e9e123b41be71d1fcd9576b0bd38d2fd32353b4
---
M tests/handover/handover_tests.sh
1 file changed, 11 insertions(+), 18 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/66/21966/1

diff --git a/tests/handover/handover_tests.sh b/tests/handover/handover_tests.sh
index 68a8e2d..240b789 100755
--- a/tests/handover/handover_tests.sh
+++ b/tests/handover/handover_tests.sh
@@ -19,24 +19,17 @@
 	set +e
 	"$build_dir"/handover_test "$test_path" > "$got_out" 2> "$got_err"
 	rc=$?
-	if [ "x$rc" = "x0" ]; then
-		expect_out="$test_path.ok"
-		expect_err="$test_path.err"
-		if [ "x$update" = "x-u" ]; then
-			cp "$got_out" "$expect_out"
-			cp "$got_err" "$expect_err"
-		else
-			if [ -f "$expect_out" ]; then
-				diff -u "$expect_out" "$got_out"
-				rc=$?
-			fi
-			if [ -f "$expect_err" ]; then
-				diff -u "$expect_err" "$got_err"
-				rc2=$?
-			fi
-			if [ "x$rc" = "x0" ]; then
-				rc=$rc2
-			fi
+	expect_out="$test_path.ok"
+	expect_err="$test_path.err"
+	if [ "x$rc" = "x0" -a  "x$update" = "x-u" ]; then
+		cp "$got_out" "$expect_out"
+		cp "$got_err" "$expect_err"
+	else
+		if [ -f "$expect_out" ]; then
+			diff -u "$expect_out" "$got_out" >&2
+		fi
+		if [ -f "$expect_err" ]; then
+			diff -u "$expect_err" "$got_err" >&2
 		fi
 	fi
 	rm "$got_out"

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/21966
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I3e9e123b41be71d1fcd9576b0bd38d2fd32353b4
Gerrit-Change-Number: 21966
Gerrit-PatchSet: 1
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210105/116b0026/attachment.htm>


More information about the gerrit-log mailing list