use File::Slurp qw/slurp/;
use Gruntmaster::Daemon::Constants qw/WA/;
+use Gruntmaster::Daemon::Format qw/copy_from_vm copy_to_vm/;
use Log::Log4perl qw/get_logger/;
use POSIX qw/mkfifo/;
use Try::Tiny;
sub run{
my ($test, $meta) = @_;
get_logger->trace("Running on test $test...");
+ copy_to_vm 'input';
- mkfifo 'fifo1', 0600 or die "$!\n" unless -e 'fifo1';
- mkfifo 'fifo2', 0600 or die "$!\n" unless -e 'fifo2';
-
- my @fds = $ENV{GRUNTMASTER_VM} ? qw,0 /dev/ttyS1 1 >/dev/ttyS1, : qw/0 fifo1 1 >fifo2/;
+ my @fds = $ENV{GRUNTMASTER_VM} ? qw,0 ../fifo1 1 >../fifo2, : qw/0 fifo1 1 >fifo2/;
$meta->{files}{prog}{run}->($meta->{files}{prog}{name}, nonblocking => 1, fds => \@fds, map { $_ => $meta->{$_} } qw/timeout mlimit/);
my $fail;
- @fds = $ENV{GRUNTMASTER_VM} ? qw,1 >/dev/ttyS1 0 /dev/ttyS1, : qw/1 >fifo1 0 fifo2/;
+ @fds = $ENV{GRUNTMASTER_VM} ? qw,1 >../fifo1 0 ../fifo2, : qw/1 >fifo1 0 fifo2/;
try {
$meta->{files}{ver}{run}->($meta->{files}{ver}{name}, fds => [@fds, qw,3 input 4 >result,], args => [$test], map { $_ => $meta->{$_} } qw/timeout mlimit/);
} catch {
$fail = $_;
};
- unlink 'fifo1';
- unlink 'fifo2';
-
die $fail if $fail; ## no critic (RequireCarping)
+ copy_from_vm 'result';
scalar slurp 'result' or 'Ok'
}