chiark / gitweb /
final touches, we hope
authorIan Jackson <ian@anarres>
Fri, 6 Oct 2006 19:45:53 +0000 (20:45 +0100)
committerIan Jackson <ian@anarres>
Fri, 6 Oct 2006 19:45:53 +0000 (20:45 +0100)
debian/changelog
debian/control
xen/Makefile
xen/README
xen/cleanup
xen/fixups-inside
xen/on-testbed
xen/readconfig.in
xen/setup
xen/with-testbed

index 25aac38d45d0d8cd2edd0e41fb3ff823d87df59d..82599527ad8e6b1a46810fccbb98bd2bbca8ae2a 100644 (file)
@@ -1,8 +1,9 @@
-autopkgtest (0.6.0~0iwj-wip0) edgy; urgency=low
+autopkgtest (0.6.0) edgy; urgency=low
 
-  * Work-in-progress for Xen support.
+  * autopkgtest-xenlvm: new package with Xen/LVM management
+    scripts productised.  Not yet glued into autopkgtest proper.
 
- -- Ian Jackson <iwj@ubuntu.com>  Tue, 26 Sep 2006 18:05:50 +0100
+ -- Ian Jackson <iwj@ubuntu.com>  Fri,  6 Oct 2006 20:45:41 +0100
 
 autopkgtest (0.5.3) dapper; urgency=low
 
index c6bce1688ee48a185ae8342a1596031df2349b26..7f9efb6e0509f5cb3f7c0962764cd81174196093 100644 (file)
@@ -30,4 +30,4 @@ Description: Xen/LVM2 based testbed snapshot system
  .
  You will need a working Xen setup to make use of this software.  Your
  network administrator will need to provide support for the testbeds'
- networking requirements.  See the README for details
+ networking requirements.  See the README for documentation.
index 0a192ac91167566d3d75f93d331f209e03360602..0eefa8b4c8c2429458d22267666746917eb14bed 100644 (file)
@@ -24,7 +24,7 @@ include ../settings.make
 
 programs =     cleanup setup on-testbed with-testbed
 shareprograms =        fixups fixups-inside
-sharefiles =   readconfig
+sharefiles =   readconfig justconfig
 
 exec_prefix =  adt-xenlvm-
 
index edba52d68c63cb82972bb2a4ef6c658a2fff9ced..e8d8adc054f29c72c3f816187c0952d19d5861fc 100644 (file)
@@ -144,6 +144,17 @@ adt_debootstrap_mirrors            <empty string>
 adt_debootstrap_script         <empty string>
        Third and fourth arguments to debootstrap.
 
+adt_setup_hook                 <config> with _config replaced with
+                                _setuphook, as for adt_fw_hook
+       Program to run at last moment before we freeze the image.
+       Will be invoked with one argument: the directory containing
+       the root of the testbed.  In the future more arguments may be
+       defined, so the hook script should not fail if more are
+       supplied.  The supplied hook value will be split at
+       whitespace before execution as if
+               $adt_setup_hook /path/to/root
+       was run from within a shellscript.
+
 ---------- Tuning parameters ----------
 
 adt_fs_type            ext3
index 8ce632510852d2e3d72c6dbc32ef18d738b0b7eb..76a9a23e7901a21e3187ff0606b91599a7be1c63 100755 (executable)
@@ -8,10 +8,7 @@ mkdir -p $adt_play $snap
 try () { printf "%s\n" "- $*"; "$@" >/dev/null 2>&1 ||:; }
 
 n=0
-while x xm destroy $adt_xmname 2>/dev/null; do
-    sleep $n
-    n=$(( $n+1 ))
-done
+if xm destroy $adt_xmname 2>/dev/null; then sleep 5; fi
 try umount $lvm_baselv_namepath
 try dmsetup remove $adt_devmapper_cowdev
 rm -f $lvm_fslink_ptr
index 2a38051e2d70ecbd437708996340c305ebd36f3d..eca190e5fd6778f87831c2905cccb142fa6d1303 100755 (executable)
@@ -42,7 +42,8 @@ END
 
 echo $adt_guest_hostname >/etc/hostname
 
-perl -i~ -wne '
+essc=/etc/ssh/sshd_config
+perl -wne '
     BEGIN {
         $pep= PermitEmptyPasswords;
        $want= "$pep no\n";
@@ -57,6 +58,7 @@ perl -i~ -wne '
         print $want or die $! unless $done;
         print $o or die $!;
     }
-' /etc/ssh/sshd_config
+' $essc >$essc.new
+mv $essc.new $essc
 
 echo '---)'
index 0fb2459ef78c83a377b9f4c61c8be96bf451e10e..74f94da809d9b7e340fcfd70b910e075fdd991e3 100755 (executable)
@@ -1,9 +1,6 @@
 #!/bin/bash
 set -e
-exec 10>&1 >/dev/null
-. ${ADT_XENLVM_SHARE:=/usr/share/autopkgtest/xenlvm}/readconfig
-exec >&10
-exec 10>&-
+. ${ADT_XENLVM_SHARE:=/usr/share/autopkgtest/xenlvm}/justconfig
 while test $# -gt $nonoptargs; do shift; done
 
 ssh $adt_ssh_keyident_args $adt_guest_ipaddr "$@"
index c63748cf2340f99dc4bfb79767dc8d3dd6e73340..35648094d947b9fea7870c8b5d0b4ef28207e271 100644 (file)
@@ -184,34 +184,41 @@ ipaddr_from_hostname () {
 ipaddr_from_hostname guest
 ipaddr_from_hostname host
 
-printf "looking for firewall hook ... "
-case "$adt_fw_hook" in
-'')
-       case "$adt_config" in
-       *_config)
-               adt_fw_hook=${adt_config%_config}_fwhook
-               if test -e "$adt_fw_hook"; then
-                       echo "default exists: $adt_fw_hook"
-               else
-                       echo "default $adt_fw_hook is not a file, so: none"
-                       adt_fw_hook=''
-               fi
-               ;;
-       *)
-               echo "not specified, not computable from config, so: none"
-               adt_fw_hook=''
-               ;;
-       esac
-       ;;
-*)
-       if test -e "$adt_fw_hook"; then
-               echo "exists: $adt_fw_hook"
-       else
-               echo "specified as $adt_fw_hook, but not a file, so: none"
-               adt_fw_hook=''
-       fi
-       ;;
-esac
+search_hook () {
+ eval '
+  printf "looking for '$2' hook ... "
+  case "$adt_'$1'_hook" in
+  "")
+    case "$adt_config" in
+    *_config)
+      adt_'$1'_hook=${adt_config%_config}_'$3'
+      if test -e "$adt_'$1'_hook"; then
+             echo "default exists: $adt_'$1'_hook"
+      else
+             echo "default $adt_'$1'_hook is not a file, so: none"
+             adt_'$1'_hook=""
+      fi
+      ;;
+    *)
+      echo "not specified, not computable from config, so: none"
+      adt_'$1'_hook=""
+      ;;
+    esac
+    ;;
+  *)
+    if test -e "$adt_'$1'_hook"; then
+      echo "exists: $adt_'$1'_hook"
+    else
+      echo "specified as $adt_'$1'_hook, but not a file, so: none"
+      adt_'$1'_hook=""
+    fi
+    ;;
+  esac
+ '
+}
+
+search_hook fw firewall fwhook
+search_hook setup setup setuphook
 
 boolean_config () {
   eval '
index b33048d6bff333a9cf30127bd1761163ac6fcfcc..f97f5aff25179a3f6d9977429fd9873f5afbe589 100755 (executable)
--- a/xen/setup
+++ b/xen/setup
@@ -27,12 +27,6 @@ x debootstrap \
        "$adt_distro" "$adt_play/base"          \
        "$adt_debootstrap_mirrors" "$adt_debootstrap_script"
 
-#x pbuilder create                                                     \
-#      --configfile /usr/share/autopkgtest/xenlvm/pbuilderrc           \
-#      --distribution "$adt_distro"                                    \
-#      --no-targz --buildplace $adt_play/base                          \
-#      $adt_pbuilder_args   --debootstrapopts --variant=''
-
 $ADT_XENLVM_SHARE/fixups "$@"
 
 echo "
@@ -57,6 +51,10 @@ ramdisk = "$adt_ramdisk"
 END
 fi
 
+if [ "x$adt_setup_hook" != x ]; then
+       $adt_setup_hook ${adt_play}/base
+fi
+
 x umount $lvm_baselv_namepath
 
 mkdir -p ${lvm_fslink_dirpath}
index 89515d9ac4702710db8f453f2013e6e734aa810b..578b7242ede8b123a31e825d61bc45f5d90ce902 100755 (executable)
@@ -2,11 +2,7 @@
 set -e
 
 trap 'exit 127' 0
-
-exec 10>&1 >/dev/null
-. ${ADT_XENLVM_SHARE:=/usr/share/autopkgtest/xenlvm}/readconfig
-exec >&10 10>&-
-
+. ${ADT_XENLVM_SHARE:=/usr/share/autopkgtest/xenlvm}/justconfig
 while test $# -gt $nonoptargs; do shift; done
 
 ${ADT_XENLVM_SHARE}/cleanup >/dev/null