8
BEGIN { require "test.conf.pl"; }
12
my $mon = PGM::Test->new(tag => 'mon', host => $config{mon}{host}, cmd => $config{mon}{cmd});
13
my $sim = PGM::Test->new(tag => 'sim', host => $config{sim}{host}, cmd => $config{sim}{cmd});
14
my $app = PGM::Test->new(tag => 'app', host => $config{app}{host}, cmd => $config{app}{cmd});
21
$mon = $sim = $app = undef;
25
$SIG{'INT'} = sub { print "interrupt caught.\n"; close_ssh(); };
27
$mon->say ("filter $config{app}{ip}");
28
print "mon: ready.\n";
30
$app->say ("set network $config{app}{network}");
31
$app->say ("create ao");
32
$app->say ("bind ao");
33
$app->say ("connect ao");
34
$app->say ("listen ao");
36
$sim->say ("set network $config{sim}{network}");
37
$sim->say ("create ao");
38
$sim->say ("bind ao");
39
$sim->say ("connect ao");
41
print "sim: publish APDU.\n";
42
$sim->say ("send ao ringo x 1000");
44
print "app: wait for data ...\n";
45
my $data = $app->wait_for_data;
46
print "app: received data [$data].\n";
48
my $ref_data = "ringo" x 1000;
49
die "incoming data corrupt\n" unless ($data == $ref_data);
51
print "test completed successfully.\n";