From: Ian Jackson Date: Fri, 6 Oct 2006 19:45:53 +0000 (+0100) Subject: final touches, we hope X-Git-Tag: converted-from-bzr~64^2~4 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=311d9570015a31b6d587541c2492afeb15a42372;p=autopkgtest.git final touches, we hope --- diff --git a/debian/changelog b/debian/changelog index 25aac38..8259952 100644 --- a/debian/changelog +++ b/debian/changelog @@ -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 Tue, 26 Sep 2006 18:05:50 +0100 + -- Ian Jackson Fri, 6 Oct 2006 20:45:41 +0100 autopkgtest (0.5.3) dapper; urgency=low diff --git a/debian/control b/debian/control index c6bce16..7f9efb6 100644 --- a/debian/control +++ b/debian/control @@ -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. diff --git a/xen/Makefile b/xen/Makefile index 0a192ac..0eefa8b 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -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- diff --git a/xen/README b/xen/README index edba52d..e8d8adc 100644 --- a/xen/README +++ b/xen/README @@ -144,6 +144,17 @@ adt_debootstrap_mirrors adt_debootstrap_script Third and fourth arguments to debootstrap. +adt_setup_hook 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 diff --git a/xen/cleanup b/xen/cleanup index 8ce6325..76a9a23 100755 --- a/xen/cleanup +++ b/xen/cleanup @@ -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 diff --git a/xen/fixups-inside b/xen/fixups-inside index 2a38051..eca190e 100755 --- a/xen/fixups-inside +++ b/xen/fixups-inside @@ -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 '---)' diff --git a/xen/on-testbed b/xen/on-testbed index 0fb2459..74f94da 100755 --- a/xen/on-testbed +++ b/xen/on-testbed @@ -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 "$@" diff --git a/xen/readconfig.in b/xen/readconfig.in index c63748c..3564809 100644 --- a/xen/readconfig.in +++ b/xen/readconfig.in @@ -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 ' diff --git a/xen/setup b/xen/setup index b33048d..f97f5af 100755 --- 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} diff --git a/xen/with-testbed b/xen/with-testbed index 89515d9..578b724 100755 --- a/xen/with-testbed +++ b/xen/with-testbed @@ -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