]> xenbits.xensource.com Git - people/royger/osstest.git/commitdiff
mg-repro-setup: New mode --autoalloc
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 17 May 2019 17:32:20 +0000 (17:32 +0000)
committerIan Jackson <ian.jackson@eu.citrix.com>
Fri, 21 Jun 2019 14:21:00 +0000 (15:21 +0100)
This just involves turning autoalloc on and statictask off.
It is most useful with mg-transient-task, as documented.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
mg-repro-setup

index 45c56f6af3fb6250a7722d6076daa4fcd1df49f4..b55f021e4011b873cafa56fc68db87509f79b378 100755 (executable)
@@ -28,7 +28,7 @@ usage () { cat <<END
  HOSTSPEC is
    [<ident>=][reuse:]<hostname>    host must be allocated, skip host-install
    [<ident>=]wipe:<hostname>       host must be allocated, wipe it
-   [<ident>=]alloc:<resource-spec> \`mg-allocate <resource-spec>', and wipe
+   [<ident>=]alloc:<resource-spec> \`mg-allocate <resource-spec>', and wipe[*]
    none:                           no hosts (should be only HOSTPSEC)
    (default <ident> is \`host')
 
@@ -42,6 +42,13 @@ usage () { cat <<END
    -E... -f... -P       as for mg-execute-flight
    --autoalloc-nofree   allocate hosts as for production, but keep them
                          (specify no HOSTSPECS; remember to deallocate later)
+   --autoalloc          use hosts as for production (specify no HOSTSPECS)
+                         and free them afterwards[*]
+
+ [*] If \$OSSTEST_TASK is set on entry, it will be used for these
+     allocations.  So, in particular,
+        ./mg-transient-task ./mg-repro-setup .... alloc:...
+     will allocate as specified, but discard the hosts when done.
 
  REBUILD is
    --rebuild [-B<blessing>] [-r...]
@@ -104,6 +111,8 @@ skipcapture=true
 autoalloc=false
 statictask=true
 
+if [ "x$OSSTEST_TASK" != x ]; then statictask=false; fi
+
 while true; do
        case "$1" in
        -*)                     ;;
@@ -117,6 +126,7 @@ while true; do
        -t?*)           duration=${arg#-t}              ;;
        --rogue)        duration=''                     ;;
        --capture)      skipcapture=false               ;;
+       --autoalloc)        autoalloc=true; statictask=false ;;
        --autoalloc-nofree) autoalloc=true; statictask=true ;;
        -l*)            logfile=${arg#-l}               ;;
        -r^*|-r!*)      adjustsets+=("${arg#-r}")       ;;
@@ -297,7 +307,7 @@ if [ "${alloc_idents[*]}" ]; then
        progressf "\n"
        if $autoalloc; then
                echo >&2 \
- 'warning: --autoalloc-nofree and HOSTSPECs are do not work well together'
+ 'warning: --autoalloc[-nofree] and HOSTSPECs are do not work well together'
        fi
 fi