diff mbox

[OSSTEST,11/11] mg-repro-setup: Use --progress-fd

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

Commit Message

Ian Jackson April 18, 2017, 3:56 p.m. UTC
Also, print a sensible message if allocation fails.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
---
 mg-repro-setup | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)
diff mbox

Patch

diff --git a/mg-repro-setup b/mg-repro-setup
index af679d0..0b3137a 100755
--- a/mg-repro-setup
+++ b/mg-repro-setup
@@ -48,6 +48,8 @@  badusage () { echo >&2 "bad usage"; usage >&2; exit 126; }
 
 set -e -o posix
 
+. ./mgi-common
+
 mgexecflags=()
 adjustsets=()
 adjusts=()
@@ -171,9 +173,11 @@  progress "new flight is $flight"
 if [ "${alloc_idents[*]}" ]; then
 	progress "allocating ${alloc_idents[*]} ..."
 	alloc_output=tmp/$flight.allocations
-	./mg-allocate --stdout-output >$alloc_output $duration 2>&3 \
+	./mg-allocate \
+		--stdout-output >$alloc_output 5>&2 --progress-fd=5 2>&3 \
 		--info-base="[repro] $flight.$job $testid" \
-		"${alloc_specs[@]}"
+		$duration "${alloc_specs[@]}" ||
+                fail "allocation failed."
 	exec <$alloc_output
 	progressf "allocated"
 	for ident in ${alloc_idents[*]}; do
@@ -201,6 +205,7 @@  if $skipcapture; then adjrunvar skip_testids "capture-logs*"; fi
 progress "executing ..."
 
 OSSTEST_NOALLOCATE=1 \
-./mg-execute-flight -B$blessing -f$refflight "${mgexecflags[@]}" $flight
+./mg-execute-flight -B$blessing -f$refflight --progress-fd=2 \
+	"${mgexecflags[@]}" $flight
 
 progress "complete (see tmp/$flight.*)"