]> xenbits.xensource.com Git - people/liuw/rumprun.git/commitdiff
Add -S / sudo also to rumpstop
authorAntti Kantee <pooka@iki.fi>
Thu, 23 Apr 2015 14:37:02 +0000 (14:37 +0000)
committerAntti Kantee <pooka@iki.fi>
Thu, 23 Apr 2015 14:37:02 +0000 (14:37 +0000)
app-tools/rumpstop
tests/runtests.sh

index 3d23e52ed8664e953e80254ab253fafd0f9abb69..79e53a1b83a620499ba84ceb5b8da9ae2d728930 100755 (executable)
@@ -7,6 +7,12 @@ die ()
         exit 1
 }
 
+unset sudo
+if [ "$1" = '-S' ]; then
+        shift
+        [ $(id -u) -ne 0 ] && sudo=sudo
+fi
+
 [ $# -eq 1 ] || die usage: rumpstop guest_spec
 
 stack=${1%%:*}
@@ -17,7 +23,7 @@ qemu)
        kill ${guest}
        ;;
 xen)
-       xl destroy ${guest}
+       ${sudo} xl destroy ${guest}
        ;;
 *)
        die invalid stack spec \"${stack}\"
index 0502777b801309d96657e736f0261caaee8fc7b0..ea6d4a2f2da84b315523b03416fd4a05ab06751e 100755 (executable)
@@ -96,7 +96,7 @@ runguest ()
                        sleep 1
                done
 
-               ${RUMPSTOP} ${cookie}
+               ${RUMPSTOP} ${OPT_SUDO} ${cookie}
        fi
 
        echo ">> Result: ${TEST_RESULT} (${TEST_ECODE})"