Debian Codegraph @

ci/test-10-option-u-x.pl

raw
1 #!/usr/bin/perl -w
2
3 use Test::Command tests => 12;
4
5 # -u show targets that are unreachable
6 # -v show version
7
8 # fping -u
9 {
10 my $cmd = Test::Command->new(cmd => "fping -r0 -u 8.8.0.0 127.0.0.1");
11 $cmd->exit_is_num(1);
12 $cmd->stdout_is_eq("8.8.0.0\n");
13 $cmd->stderr_is_eq("");
14 }
15
16 # fping -v
17 {
18 my $cmd = Test::Command->new(cmd => "fping -v");
19 $cmd->exit_is_num(0);
20 $cmd->stdout_like(qr{ping: Version [45]\.\d+(-rc\d+)?});
21 $cmd->stderr_is_eq("");
22 }
23
24 # fping -x
25 {
26 my $cmd = Test::Command->new(cmd => "fping -x 1 8.8.0.0 127.0.0.1");
27 $cmd->exit_is_num(0);
28 $cmd->stdout_is_eq("Enough hosts reachable (required: 1, reachable: 1)\n");
29 $cmd->stderr_is_eq("");
30 }
31
32 # fping -x
33 {
34 my $cmd = Test::Command->new(cmd => "fping -x 2 8.8.0.0 127.0.0.1");
35 $cmd->exit_is_num(1);
36 $cmd->stdout_is_eq("Not enough hosts reachable (required: 2, reachable: 1)\n");
37 $cmd->stderr_is_eq("");
38 }