Skip to contentSkip to conversation

Fix TftpDiVersion plumbing

PATCH In review Ian Jackson 1 participant 8 messages Mar 18, 2016

lore
Share & tools
lore
#0 lore raw

cover Fix TftpDiVersion plumbing

Recent updates to TftpDiVersion_* which were intended to affect only jessie in fact affect jobs using other suites, because much of the code still looked simply at TftpDiVersion rather than TftpDiVersion_<suite>.

This is responsible for the persistent ARM regressions in the xen-4.3-testing tests.

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel

#1 lore raw

PATCH 1/6 Debian: Provide cfg_tftp_di_version

And a shell function to do the same thing.

No callers yet.

---
 Osstest/Debian.pm |    7 +++++++
 cri-getconfig     |    9 +++++++++
 2 files changed, 16 insertions(+)
Osstest/Debian.pm +7 -0
index d3eff1e..f3c2f63 100644
@@ -46,6 +46,7 @@ BEGIN {
                       preseed_hook_cmds
                       di_installcmdline_core
                       di_vg_name
+                      cfg_tftp_di_version
                       );
     %EXPORT_TAGS = ( );
 
@@ -1358,6 +1359,12 @@ sub preseed_hook_cmds () {
     return $preseed;
 }
 
+sub cfg_tftp_di_version ($) {
+    my ($suite) = @_;
+    $suite //= 'x def suite'; # will not find $c{...}
+    return $c{"TftpDiVersion_$suite"} // $c{TftpDiVersion};
+}
+
 sub debian_guest_suite ($) {
     my ($gho) = @_;
 
cri-getconfig +9 -0
index 7b75700..8b76f32 100644
@@ -25,6 +25,15 @@ getconfig () {
         '
 }
 
+getconfig_TftpDiVersion_suite () {
+	perl -e '
+		use Osstest;
+		use Osstest::Debian;
+		readglobalconfig();
+		print cfg_tftp_di_version($ARGV[0]) or die $!;
+	' "$1"
+}
+
 getrepos() {
 	local repos=`getconfig Repos`
 	if [ -z "$repos" ] ; then
Signature · 7 lines
1.7.10.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#2 lore raw

PATCH 2/6 make-flight: Use getconfig_TftpDiVersion_suite

In reply to Ian Jackson

No functional change.

---
 make-flight |    5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)
make-flight +1 -4
index 8acfcb9..19b42d0 100755
@@ -49,11 +49,8 @@ esac
 
 # Pick default Debian Installer version to correspond to the chosen
 # suite.
-if [ -z "$defdi_version" -a -n "$defsuite" ] ; then
-    defdi_version=`getconfig TftpDiVersion_$defsuite`
-fi
 if [ -z "$defdi_version" ] ; then
-    defdi_version=`getconfig TftpDiVersion`
+    defdi_version=`getconfig_TftpDiVersion_suite $defsuite`
 fi
 
 guest_di_version=$defdi_version
Signature · 7 lines
1.7.10.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#3 lore raw

PATCH 3/6 mg-debian-installer-update: Use getconfig_TftpDiVersion_suite

In reply to Ian Jackson

The computed value of the tftpdiversion' shell variable is used only to see if it is equal to current'; if so, we update it.

Whether this is done should depend on the effective TftpDiVersion for the specific suite, not on the default global. So use getconfig_TftpDiVersion_suite.

---
 mg-debian-installer-update |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mg-debian-installer-update +1 -1
index 7e3fb20..c969f1e 100755
@@ -59,7 +59,7 @@ case ${suite}_${arch} in
         ;;
 esac
 
-tftpdiversion=`getconfig TftpDiVersion`
+tftpdiversion=`getconfig_TftpDiVersion_suite $suite`
 dstroot=`getconfig TftpPath`/`getconfig TftpDiBase`/
 date=`date +%Y-%m-%d`
 dst=$arch/$date-$suite
Signature · 7 lines
1.7.10.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#4 lore raw

PATCH 4/6 mg-debian-installer-update: Print a TftpDiVersion_$suite setting too

In reply to Ian Jackson

The human running this script might want to update a suite-specific value, or the global value. Print an example of the suite-specific value too.

No functional change other than to example config output.

---
 mg-debian-installer-update |    1 +
 1 file changed, 1 insertion(+)
mg-debian-installer-update +1 -0
index c969f1e..0d4f772 100755
@@ -178,4 +178,5 @@ if [ x$tftpdiversion = xcurrent ]; then
 fi
 
 echo "TftpDiVersion $date"
+echo "TftpDiVersion_$suite $date"
 echo >&2 "downloaded $dstroot/$dst"
Signature · 7 lines
1.7.10.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#5 lore raw

PATCH 5/6 standalone-reset: Use suite-specific TftpDiVersion

In reply to Ian Jackson

If the config specifies a specific d-i version for the suite in use, it should be honoured.

---
 standalone-reset |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
standalone-reset +1 -1
index e58ba68..bd34782 100755
@@ -97,8 +97,8 @@ else
 	ensure_dir "$tftp$tftptmp"
 
 	dibase=`getconfig TftpDiBase`
-	diver=`getconfig TftpDiVersion`
 	suite=`getconfig DebianSuite`
+	diver=`getconfig_TftpDiVersion_suite $suite`
 	firmware=`getconfig DebianNonfreeFirmware`
 
 	if [ "x$diver" = xcurrent ]; then
Signature · 7 lines
1.7.10.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#6 lore raw

PATCH 6/6 Various: Honour suite-specific TftpDiVersion

In reply to Ian Jackson

Replace references to $c{TftpDiVersion} in the general osstest code with calls to cfg_tftp_di_version. This means that the suite-specific d-i version will, in general, be honoured (as is correct).

In preseed_create, we also honour $ho->{DiVersion}. Often this won't be set, but it might be (for example, by selecthost finding di_version runvars).

---
 Osstest/Debian.pm      |    5 +++--
 Osstest/TestSupport.pm |    3 ++-
 2 files changed, 5 insertions(+), 3 deletions(-)
Osstest/Debian.pm +3 -2
index f3c2f63..1e4900b 100644
@@ -1010,7 +1010,8 @@ sub preseed_create ($$;@) {
     my $suite= $ho->{Suite};
 
     my $d_i= $ho->{Tftp}{Path}.'/'.$ho->{Tftp}{DiBase}.'/'.$r{arch}.'/'.
-	$c{TftpDiVersion}.'-'.$ho->{Suite};
+	($ho->{DiVersion} // cfg_tftp_di_version($ho->{Suite}))
+	.'-'.$ho->{Suite};
 
     preseed_hook_installscript($ho, $sfx,
           '/lib/partman/init.d', '000override-parted-devices', <<END);
@@ -1384,7 +1385,7 @@ sub debian_guest_di_version ($) {
     $gho->{DiVersion} //= guest_var($gho,'di_version',undef);
 
     if (!$gho->{DiVersion}) {
-	$gho->{DiVersion} = $c{TftpDiVersion};
+	$gho->{DiVersion} = cfg_tftp_di_version(debian_guest_suite($gho));
 	store_runvar("$gho->{Guest}_di_version", $gho->{DiVersion});
     }
 
Osstest/TestSupport.pm +2 -1
index 0b3e18a..572d657 100644
@@ -862,7 +862,8 @@ sub selecthost ($) {
     };
     if (defined $job) {
 	$ho->{Suite} = target_var($ho, "suite") // $c{DebianSuite};
-	$ho->{DiVersion} = target_var($ho, "di_version") // $c{TftpDiVersion};
+	$ho->{DiVersion} = target_var($ho, "di_version")
+	    // cfg_tftp_di_version($ho->{Suite});
     }
 
     #----- handle hosts which are themselves guests (nested) -----
Signature · 7 lines
1.7.10.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel
#7 lore raw

[OSSTEST PATCH 7/6] make-flight: Set debianhvm_suite for Debian HVM tests

In reply to Ian Jackson

do_hvm_debian_test_one uses usual_debianhvm_image which honours the prevailing value of $guestsuite. However, it does not provide an explicit suite setting in the runvars.

As a consequence, the test code will expect the image to install whatever the default suite is. If guestsuite is not the default suite, there is a mismatch. At the very least, the wrong suite-specific workarounds will be applied.

---
 make-flight |    1 +
 1 file changed, 1 insertion(+)
make-flight +1 -0
index 19b42d0..f324f6a 100755
@@ -341,6 +341,7 @@ do_hvm_debian_test_one () {
     test-debianhvm $toolstack $xenarch $dom0arch $qemuu_runvar \
     enable_xsm=$xsm                             \
     $stubdom_runvar $testvars                   \
+    debianhvm_suite=$guestsuite			\
     debianhvm_image=$(usual_debianhvm_image $arch) \
     debianhvm_iso_kernel=/$iso_dir/vmlinuz \
     debianhvm_iso_ramdisk=/$iso_dir/initrd.gz \
Signature · 7 lines
1.7.10.4


_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xen.org/xen-devel