xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Ian Jackson <ian.jackson@eu.citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Ian Jackson <Ian.Jackson@eu.citrix.com>
Subject: [OSSTEST PATCH 2/3] mg-schema-test-database: New --max-flight option
Date: Mon, 3 Jul 2017 17:59:26 +0100	[thread overview]
Message-ID: <1499101167-24191-3-git-send-email-ian.jackson@eu.citrix.com> (raw)
In-Reply-To: <1499101167-24191-1-git-send-email-ian.jackson@eu.citrix.com>

This can be useful when testing things which involve old data, rather
than things which just involve new data.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
 mg-schema-test-database | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/mg-schema-test-database b/mg-schema-test-database
index 9be0625..286010d 100755
--- a/mg-schema-test-database
+++ b/mg-schema-test-database
@@ -4,7 +4,7 @@
 #
 #
 #  ./mg-schema-test-database create [_SUFFIX] [TASK...] \
-#		[-fMINFLIGHT | -f-NUMFLIGHTS] \
+#		[-fMINFLIGHT | -f-NUMFLIGHTS] [--max-flight=MAXFLIGHT] \
 #		[-hCTRL_DAEMONS_HOST] [-fOWNER_D_PORT[,QUEUE_D_PORT]]
 #
 # does `drop' and then creates
@@ -231,6 +231,7 @@ create)
 
 	tasks=''
 	minflight=-100
+	maxflightcond='1=1'
 	for arg in "$@"; do
 		case "$arg" in
 		*@*)
@@ -251,6 +252,9 @@ create)
 			;;
 		_*)	suffix="$arg"
 			;;
+		--max-flight=*)
+			maxflightcond="flight <= ${arg#*=}"
+			;;
 		-f*)	minflight="${arg#-f}"
 			;;
 		-h*)	ctrlhost="${arg#-h}"
@@ -471,7 +475,9 @@ END
 		schema_updates)	continue ;;
 		esac
 		case " $ftables " in
-		*" $table "*)	condition="flight >= $minflight" ;;
+		*" $table "*)
+ condition="flight >= $minflight AND $maxflightcond"
+				;;
 		*)		condition="1=1" ;;
 		esac
 		each_copy_table $table "$condition"
-- 
2.1.4


_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel

  parent reply	other threads:[~2017-07-03 16:59 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-03 16:59 [OSSTEST PATCH 0/3] Schema tidying following recent changes Ian Jackson
2017-07-03 16:59 ` [OSSTEST PATCH 1/3] mg-schema-test-database: Apply updates, regardless of compatibility Ian Jackson
2017-07-03 16:59 ` Ian Jackson [this message]
2017-07-03 16:59 ` [OSSTEST PATCH 3/3] db schema: Make the testid column NOT NLLL Ian Jackson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1499101167-24191-3-git-send-email-ian.jackson@eu.citrix.com \
    --to=ian.jackson@eu.citrix.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).