chiark / gitweb /
userv service seems to work now
authorIan Jackson <ian@davenant.greenend.org.uk>
Mon, 2 Jul 2007 16:35:39 +0000 (17:35 +0100)
committerIan Jackson <ian@davenant.greenend.org.uk>
Mon, 2 Jul 2007 16:35:39 +0000 (17:35 +0100)
debian/changelog
doc/README.userv
xen/on-testbed
xen/userv-target

index 2cf9dee842d44683fc5c9d9762a75ca4549f2b9b..f34aabc0b63702bb828e69f6f8552268ddc2ed6c 100644 (file)
@@ -1,6 +1,8 @@
 autopkgtest (0.9.0~iwj) unstable; urgency=low
 
-  * WIP userv service.
+  * WIP userv service use by adt-virt-xenlvm.
+  * userv service for testbed invocation now provided and
+    at least somewhat tested.
   * New print-execute-command command for virtualisation servers.
   * Do not demand vg or distro information for initscript to work.
   * autopkgtest-xenlvm now Recommends: lvm2 and debootstrap.
index 9db81e3bff8f51f125610130f0f2176f598ae023..5d98580e479f13a0287aaf0f0cc4120e88737fb0 100644 (file)
@@ -11,11 +11,30 @@ adt-xenlvm-with-testbed and adt-xenlvm-on-testbed) but not the ability
 to create new testbeds.
 
 To make this feature available:
- * Install userv
+ * Install userv.
  * Create a group named AdtXenUs containing the users which should
-   be able to manipulate and use the testbed.  (This group can start
-   out empty but should exist before setting up the testbed for
-   the first time.)
- * 
+   be able to manipulate and use the testbed.
+ * Run adt-xenlvm-setup.  NB that the group can be empty at this
+   point but should exist before setting up the testbed, or the
+   testbed setup will not be correct.
 
-The configuration as supplied does not make it 
+Typically adt-xenlvm-setup ought to be run periodically anyway to
+make sure that the snapshot doesn't get too out of date.
+
+
+Client interface
+----------------
+
+The service is as invoked as
+  userv [-Ddistro=<distro> -Dnominum=<nominum>] root adt-xenlvm-testbed <act>
+where <act> is either
+  with
+       Starts adt-xenlvm-with-testbed, prints `y', waits for
+       eof on stdin, and then exits adt-xenlvm-with-testbed.
+  pon0
+       Prints the command that ought to be run to execute
+       commands on the testbed.  The output is a command and
+       arguments, each followed by a null byte.  These should
+       be put into an array of strings and passed to exec,
+       with the actual command to be run added as a final
+       argument (in sh syntax).
index 60eabd5afe3a025aed9c2dcc1324fa5779f32062..24611fd8f6c9dc751dbf8ed85ae6bc17343010a3 100755 (executable)
@@ -3,11 +3,13 @@ set -e
 . ${ADT_XENLVM_SHARE:=/usr/share/autopkgtest/xenlvm}/justconfig
 while test $# -gt $nonoptargs; do shift; done
 
+: "$1"
+
 case "$1" in
-x--print-command)      ppfx=echo; shift        ;;
-x--print0-command)     ppfx=ppfx0; shift       ;;
-x--)                   shift                   ;;
-x-*)                   fail "invalid instead-of-command options \`$1'" ;;
+--print-command)       ppfx=echo; shift        ;;
+--print0-command)      ppfx=ppfx0; shift       ;;
+--)                    shift                   ;;
+-*)                    fail "invalid instead-of-command options \`$1'" ;;
 esac
 
 ppfx0 () { for x in "$@"; do printf '%s\0' "$x"; done; }
index 9c9ec02261eeba6d439d78c01e5a5710bdefdf4e..8ba9d1a50261cbea2aea0f6e090ea84f1b938405 100755 (executable)
@@ -2,19 +2,21 @@
 set -e
 fail () { printf >&2 "%s: %s\n" "$0" "$*"; exit 127; }
 
-. /etc/lsb-release
+if test -f /etc/lsb-release; then . /etc/lsb-release; fi
 
-d="${USERV_U_distro-$DISTRIB_CODENAME}"
-n="${USERV_U_nominum-adt}"
+d="${USERV_U_distro:-$DISTRIB_CODENAME}"
+n="${USERV_U_nominum:-adt}"
 
-case "$dn" in
+nd="${n}_${d}"
+
+case "$nd" in
 */*|.*|*.*|*_*_*)      fail 'dangerous format in distro or nominum'    ;;
 adt*)  ;;
 *)     fail 'userv adtxenlvm only supports nominums starting with adt' ;;
 esac
 
-dndir=/var/lib/autopkgtest/xenlvm/"$dn"
-test -d "$dndir" || fail 'unknown distro or nominum'
+nddir=/var/lib/autopkgtest/xenlvm/"$nd"
+test -d "$nddir" || fail 'unknown distro or nominum'
 
 run () {
        base="$1"; shift
@@ -22,7 +24,7 @@ run () {
 }
 
 case "$1" in
-with)  adt-xenlvm-with-testbed sh -c 'echo y && exec cat' ;;
+with)  run adt-xenlvm-with-testbed sh -c 'echo y && exec cat' ;;
 pon0)  run adt-xenlvm-on-testbed -- --print0-command ;;
 *)     fail 'unknown mode'
 esac