]> xenbits.xensource.com Git - osstest.git/commitdiff
mg-repro-setup: Check allocation feasibility at the start
authorIan Jackson <iwj@xenproject.org>
Mon, 4 Oct 2021 16:55:48 +0000 (17:55 +0100)
committerIan Jackson <iwj@xenproject.org>
Mon, 4 Oct 2021 17:01:46 +0000 (18:01 +0100)
Signed-off-by: Ian Jackson <iwj@xenproject.org>
mg-repro-setup

index 56d27d4efae7c29519397043e4d00e470d8c628a..895f29963a8fadbfa5e55d10a0dde6c0cc015d4c 100755 (executable)
@@ -260,6 +260,17 @@ if [ "${alloc_idents[*]}" ]; then
                 echo >&2 'cannot hand-allocate in a way that will free'
                 exit 1
         fi
+
+       set +e
+       alloc_output=$(
+               ./mg-allocate --dry-run $duration "${alloc_specs[@]}" 2>&1
+       )
+       alloc_rc=$?
+       set -e
+       test $alloc_rc = 0 ||
+       fail "requested allocation(s) infeasible:
+$alloc_output
+"
 fi
 
 flight=$(./cs-adjust-flight new:$blessing)