diff mbox

[OSSTEST,2/9] mg-schema-test-database: Wrap some withtest psql_do in subshells

Message ID 1482259082-30767-3-git-send-email-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ian Jackson Dec. 20, 2016, 6:37 p.m. UTC
Otherwise it takes effect for the rest of the script, which is not
what is wanted !  As it happens, there are no accesses to the real db
after this point, so this bug is latent.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 mg-schema-test-database | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/mg-schema-test-database b/mg-schema-test-database
index a82c044..0517ca3 100755
--- a/mg-schema-test-database
+++ b/mg-schema-test-database
@@ -509,19 +509,20 @@  END
 	printf "borrow..."
 
 	for task in $tasks; do
-		withtest psql_do <<END
+		(withtest psql_do <<END
 			BEGIN;
 			UPDATE resources
 				SET owntaskid = $(taskid magic idle)
 				WHERE owntaskid = $(borrowtaskid $task);
 			COMMIT;
 END
+                )
 	done
-	withtest psql_do <<END
+	(withtest psql_do <<END
 		DELETE FROM tasks
 			WHERE type='xdbref' AND refkey='$dbname';
 END
-
+        )
 	printf "\n"
 
 	cat <<END