Skip to contentSkip to conversation

ts-hosts-allocate-Standalone: abort if the host to use has changed

PATCH In review Ian Campbell 2 participants 3 messages Feb 12, 2014 – Mar 17, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ts-hosts-allocate-Standalone: abort if the host to use has changed

When a job has been run once then the selected host is stored in a runvar and used from then on. This means that if you try to run on a different host (by changing the config or by changing OSSTEST_HOST_HOST) then you may be surprised when things happen to the original host and not the new one.

Abort when this is detected.

Changing host requires you to run:
./cs-adjust-flight -v $flight runvar-del $job host
$flight = standalone by default
$job = test-x-y-z or build-x etc
host = the literal string host (not either of the host names)

---
 ts-hosts-allocate-Standalone | 8 ++++++++
 1 file changed, 8 insertions(+)
ts-hosts-allocate-Standalone +8 -0
index 4ce0c0d..88a5d28 100755
@@ -31,5 +31,13 @@ foreach my $ident (@ARGV) {
     $host ||= $c{"TestHost_$ident"};
     $host ||= $c{TestHost};
     $host || die "need host setting for $ident";
+
+    my $expected = $ENV{'OSSTEST_HOST_'.uc $ident}
+                   || $c{"TestHost_$ident"}
+                   || $c{TestHost};
+
+    die "$ident configuration mismatch $r{$ident} != $expected"
+	if $r{$ident} && $r{$ident} ne $expected;
+
     store_runvar($ident, $host);
 }
Signature · 1 line
1.8.5.2
#1 lore raw

Ping?

(TBH, I thought you had replied to this, but I can't find any mails, sorry if I've just misplaced them)

Quoted 36 lines · Ian Campbell

When a job has been run once then the selected host is stored in a runvar and used from then on. This means that if you try to run on a different host (by changing the config or by changing OSSTEST_HOST_HOST) then you may be surprised when things happen to the original host and not the new one.

Abort when this is detected.

Changing host requires you to run:
./cs-adjust-flight -v $flight runvar-del $job host
$flight = standalone by default
$job = test-x-y-z or build-x etc
host = the literal string host (not either of the host names)

---
 ts-hosts-allocate-Standalone | 8 ++++++++
 1 file changed, 8 insertions(+)
ts-hosts-allocate-Standalone +8 -0
index 4ce0c0d..88a5d28 100755
@@ -31,5 +31,13 @@ foreach my $ident (@ARGV) {
     $host ||= $c{"TestHost_$ident"};
     $host ||= $c{TestHost};
     $host || die "need host setting for $ident";
+
+    my $expected = $ENV{'OSSTEST_HOST_'.uc $ident}
+                   || $c{"TestHost_$ident"}
+                   || $c{TestHost};
+
+    die "$ident configuration mismatch $r{$ident} != $expected"
+	if $r{$ident} && $r{$ident} ne $expected;
+
     store_runvar($ident, $host);
 }
Acked-by
#2 lore raw

Ian Campbell writes ("Re: [PATCH OSSTEST] ts-hosts-allocate-Standalone: abort if the host to use has changed"):

Quoted 15 lines

Ping?

(TBH, I thought you had replied to this, but I can't find any mails, sorry if I've just misplaced them)

Quoted 9 lines · Ian Campbell

When a job has been run once then the selected host is stored in a runvar and used from then on. This means that if you try to run on a different host (by changing the config or by changing OSSTEST_HOST_HOST) then you may be surprised when things happen to the original host and not the new one.

Abort when this is detected.

Changing host requires you to run:
./cs-adjust-flight -v $flight runvar-del $job host