LUBackupRemove: Use node allocation lock
[ganeti-local] / autotools / testrunner
index d933613..cc963c7 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 #
 
-# Copyright (C) 2010 Google Inc.
+# Copyright (C) 2010, 2011 Google Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -22,7 +22,19 @@ set -e
 
 filename=$1
 
+execasroot() {
+  local fname=$1
+  shift
+  if [[ -z "$FAKEROOT" ]]; then
+    echo "WARNING: FAKEROOT variable not set, skipping $fname" >&2
+  else
+    exec "$FAKEROOT" "$@"
+  fi
+}
+
 case "$filename" in
+  *-runasroot.py) execasroot $filename $PYTHON "$@" ;;
   *.py) exec $PYTHON "$@" ;;
+  *-runasroot) execasroot $filename "$@" ;;
   *) exec "$@" ;;
 esac