@@ -162,7 +162,22 @@ our $logm_prefix= '';
# When runvar_access_restrict is called, it will limit reading
# of non-synth runvars to ones which match these glob patterns.
-our @accessible_runvar_pats = qw(test-host-setup-runvars-will-appear-here);
+# The initial list is the runvars whih affect how a test host is
+# set up, and for test jobs it isn't modified. synth runvars
+# which are read-modify-write by host setup must be listed too.
+our @accessible_runvar_pats =
+ qw(
+ *_dmrestrict *buildjob
+ arch console di_version dom0_mem enable_xsm freebsd_distpath
+ linux_boot_append os suite toolstack xen_boot_append xenable_xsm
+ host *_host
+ host_console *_host_console
+ host_hostflagadjust *_host_hostflagadjust
+ host_hostflags *_host_hostflags
+ host_linux_boot_append *_host_linux_boot_append
+ host_ip *_host_ip
+ host_power_install *_host_power_install
+ );
#---------- test script startup ----------
@@ -1274,6 +1289,12 @@ sub selecthost ($;$$) {
return $child;
}
+ #----- if we're sharing an actual host, make sure we do it right -----
+
+ if ($isprep) {
+ runvar_access_restrict();
+ }
+
#----- calculation of the host's properties -----
# Firstly, hardcoded defaults
@@ -64,18 +64,14 @@ sub sharetype_add ($$) {
}
sub compute_test_sharetype () {
- $sharetype =
- "test-$flight/$r{arch}/$r{xenbuildjob}/$r{kernbuildjob}/$r{buildjob}";
-
- sharetype_add('suite', $ho->{Suite});
- sharetype_add('di', $ho->{DiVersion});
-
- foreach my $runvar (qw(freebsd_distpath freebsdbuildjob
- xenable_xsm toolstack kernkind
- xen_boot_append toolstack)) {
- my $val = $r{$runvar};
- die "$runvar $val ?" if defined $val && $val =~ m{[,/\%\\]};
- sharetype_add($runvar, $val);
+ $sharetype = "test-$flight";
+ my %done;
+ foreach my $key (runvar_glob(@accessible_runvar_pats)) {
+ next if runvar_is_synth($key);
+ my $val = $r{$key};
+ next if $done{$key}++;
+ $val =~ s{[^\"-\~]|\%}{ sprintf "%%%02x", ord $& }ge;
+ $sharetype .= "!$key=$r{$key}";
}
return $sharetype;