Strictly speaking this is a Debian-specific function. But it is
called by selecthost. TestSupport does not `use Osstest::Debian'
right now. As a result, currently, if $suite is not set or
TftpDiVersion_$suite is not set, the program will crash with
Undefined subroutine &Osstest::TestSupport::cfg_tftp_di_version called at Osstest/TestSupport.pm line 865.
Fix this by moving cfg_tftp_di_version to TestSupport, where it is
needed.
It would be possible to make the boundary between Osstest::TestSupport
and Osstest::Debian firmer by having selecthost explicitly call a
selecthost_do_debian_things (perhaps optionally, or as specified by
the caller).
But would be quite a palaver. It is much more convenient to fudge the
issue. (Of course if we have similar requirements for other OS's we
can put them in TestSupport too, provided they're not too big and
tangly.)
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
v2: Change `use' in getconfig_TftpDiVersion_suite
preseed_hook_cmds
di_installcmdline_core
di_vg_name
- cfg_tftp_di_version
);
%EXPORT_TAGS = ( );
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) = @_;
git_massage_url
sshopts authorized_keys
+ cfg_tftp_di_version
remote_perl_script_open remote_perl_script_done
host_reboot target_reboot target_reboot_hard
target_choose_vg target_umount_lv target_await_down
return $authkeys;
}
+sub cfg_tftp_di_version ($) {
+ my ($suite) = @_;
+ $suite //= 'x def suite'; # will not find $c{...}
+ return $c{"TftpDiVersion_$suite"} // $c{TftpDiVersion};
+}
+
#---------- webspace for installer ----------
sub await_webspace_fetch_byleaf ($$$$$) {
getconfig_TftpDiVersion_suite () {
perl -e '
use Osstest;
- use Osstest::Debian;
+ use Osstest::TestSupport;
readglobalconfig();
print cfg_tftp_di_version($ARGV[0]) or die $!;
' "$1"