]> xenbits.xensource.com Git - osstest.git/commitdiff
runvar access: Introduce effects_gone_before_share_reuse
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 21 Aug 2020 11:36:10 +0000 (12:36 +0100)
committerIan Jackson <iwj@xenproject.org>
Wed, 7 Oct 2020 16:48:33 +0000 (17:48 +0100)
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 <ian.jackson@eu.citrix.com>
Osstest/Debian.pm
Osstest/TestSupport.pm

index ae3c1d3340ad649ee5466c80298303081f0f68de..01930e1f6b30f2c296a65301586fa79c52faf9b1 100644 (file)
@@ -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;
 }
index c6bd6714b1c80026c4799febbb84ba10a0519359..752c36c563fa2ea6f8038c73e2d6352be6bdad4f 100644 (file)
@@ -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 "*";