From: Ian Jackson Date: Fri, 21 Aug 2020 11:36:10 +0000 (+0100) Subject: runvar access: Introduce effects_gone_before_share_reuse X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=7cf78d1f96661c0ff8cdf2fea0183f4a5f0ed6a9;p=osstest.git runvar access: Introduce effects_gone_before_share_reuse The syslog server, and its port, is used for things that happen in this job, but the syslog server is torn down and a new one started, when the host is reused. Signed-off-by: Ian Jackson --- diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm index ae3c1d3..01930e1 100644 --- a/Osstest/Debian.pm +++ b/Osstest/Debian.pm @@ -727,10 +727,12 @@ sub di_installcmdline_core ($$;@) { push @cl, "priority=$debconf_priority"; push @cl, "rescue/enable=true" if $xopts{RescueMode}; - if ($r{syslog_server}) { - $r{syslog_server} =~ m/:(\d+)$/ or die "$r{syslog_server} ?"; - push @cl, "log_host=$`", "log_port=$1"; - } + effects_gone_before_share_reuse(sub { + if ($r{syslog_server}) { + $r{syslog_server} =~ m/:(\d+)$/ or die "$r{syslog_server} ?"; + push @cl, "log_host=$`", "log_port=$1"; + } + }); return @cl; } diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index c6bd671..752c36c 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -144,6 +144,7 @@ BEGIN { gitcache_setup @accessible_runvar_pats sharing_for_build + effects_gone_before_share_reuse ); %EXPORT_TAGS = ( ); @@ -3173,6 +3174,11 @@ END sub sharing_for_build () { @accessible_runvar_pats = qw(*); }; +sub effects_gone_before_share_reuse ($) { + local @accessible_runvar_pats = qw(*); + $_[0](); +} + sub runvar_access_restrict () { # restricts runvars to those in @accessible_runvar_pats return if "@accessible_runvar_pats" eq "*";