Change in osmo-hlr[master]: fix upgrade test in presence of ~/.sqliterc

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/.

osmith gerrit-no-reply at lists.osmocom.org
Mon Nov 25 13:00:56 UTC 2019


osmith has submitted this change. ( https://gerrit.osmocom.org/c/osmo-hlr/+/16019 )

Change subject: fix upgrade test in presence of ~/.sqliterc
......................................................................

fix upgrade test in presence of ~/.sqliterc

db_upgrade_test.sh:

- If an ~/.sqliterc file exists, it causes output of '-- Loading resources from
  ~/.sqliterc'. Use -batch option to omit that.

- To make sure that column headers are off when required, add -noheaders in
  some places.

Change-Id: I279a39984563594a4a3914b2ce3d803ad9468fe8
---
M tests/db_upgrade/db_upgrade_test.sh
1 file changed, 6 insertions(+), 6 deletions(-)

Approvals:
  Jenkins Builder: Verified
  osmith: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve



diff --git a/tests/db_upgrade/db_upgrade_test.sh b/tests/db_upgrade/db_upgrade_test.sh
index bf56c56..8e2b498 100755
--- a/tests/db_upgrade/db_upgrade_test.sh
+++ b/tests/db_upgrade/db_upgrade_test.sh
@@ -11,21 +11,21 @@
 
 dump_sorted_schema(){
 	db_file="$1"
-	tables="$(sqlite3 "$db_file" "SELECT name FROM sqlite_master WHERE type = 'table' order by name")"
+	tables="$(sqlite3 -batch -noheader "$db_file" "SELECT name FROM sqlite_master WHERE type = 'table' order by name")"
 	for table in $tables; do
 		echo
 		echo "Table: $table"
-		sqlite3 -header "$db_file" "SELECT name,type,\"notnull\",dflt_value,pk FROM PRAGMA_TABLE_INFO('$table') order by name;"
+		sqlite3 -batch -header "$db_file" "SELECT name,type,\"notnull\",dflt_value,pk FROM PRAGMA_TABLE_INFO('$table') order by name;"
 		echo
 		echo "Table $table contents:"
-		columns="$(sqlite3 "$db_file" "SELECT name FROM PRAGMA_TABLE_INFO('$table') order by name;")"
-		sqlite3 -header "$db_file" "SELECT $(echo $columns | sed 's/ /,/g') from $table;"
+		columns="$(sqlite3 -batch -noheader "$db_file" "SELECT name FROM PRAGMA_TABLE_INFO('$table') order by name;")"
+		sqlite3 -batch -header "$db_file" "SELECT $(echo $columns | sed 's/ /,/g') from $table;"
 	done
 }
 
 rm -f "$db"
 echo "Creating db in schema version 0"
-sqlite3 "$db" < "$srcdir/hlr_db_v0.sql"
+sqlite3 -batch "$db" < "$srcdir/hlr_db_v0.sql"
 
 echo
 echo "Version 0 db:"
@@ -61,7 +61,7 @@
 		-n OsmoHLR -p 4258 \
 		-r "$osmo_hlr -c $cfg -l $mint_db" \
 		"$srcdir/create_subscribers.vty"
-	sqlite3 "$mint_db" < "$srcdir/create_subscribers_step2.sql"
+	sqlite3 -batch "$mint_db" < "$srcdir/create_subscribers_step2.sql"
 
 	set +x
 	test_dump="$builddir/test.dump"

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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-Change-Id: I279a39984563594a4a3914b2ce3d803ad9468fe8
Gerrit-Change-Number: 16019
Gerrit-PatchSet: 3
Gerrit-Owner: neels <nhofmeyr at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith <osmith at sysmocom.de>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191125/097a53e6/attachment.htm>


More information about the gerrit-log mailing list