(perl) machines file: support machine lines with multiple spaces between fields

This commit is contained in:
Graham Christensen 2021-10-24 21:24:24 -04:00
parent b817124337
commit 5fbf1470bd
2 changed files with 10 additions and 1 deletions

View file

@ -347,7 +347,7 @@ sub getMachines {
chomp($line);
$line =~ s/\#.*$//g;
next if $line =~ /^\s*$/;
my @tokens = split /\s/, $line;
my @tokens = split /\s+/, $line;
if (!defined($tokens[5]) || $tokens[5] eq "-") {
$tokens[5] = "";

View file

@ -24,6 +24,7 @@ root@ip x86_64-darwin /sshkey 15 15 big-parallel,kvm,nixos-test - base64key
root@baz aarch64-darwin /sshkey 4 1 big-parallel
root@bux i686-linux,x86_64-linux /var/sshkey 1 1 kvm,nixos-test benchmark
root@lotsofspace i686-linux,x86_64-linux /var/sshkey 1 1 kvm,nixos-test benchmark
|;
close $fh;
@ -53,6 +54,14 @@ is(Hydra::Helper::Nix::getMachines(), {
'supportedFeatures' => [ "kvm", "nixos-test", "benchmark" ],
'mandatoryFeatures' => [ "benchmark" ],
},
'root@lotsofspace' => {
'systemTypes' => [ "i686-linux", "x86_64-linux" ],
'sshKeys' => '/var/sshkey',
'maxJobs' => 1,
'speedFactor' => 1,
'supportedFeatures' => [ "kvm", "nixos-test", "benchmark" ],
'mandatoryFeatures' => [ "benchmark" ],
},
}, ":)");