|
97 | 97 | } |
98 | 98 |
|
99 | 99 | # fping -Q |
100 | | -{ |
| 100 | +SKIP: { |
| 101 | +if($^O eq 'darwin') { |
| 102 | + skip 'On macOS, -Q tests are unreliable', 3; |
| 103 | +} |
101 | 104 | my $cmd = Test::Command->new(cmd => "fping -Q 1 -p 400 -c 4 127.0.0.1"); |
102 | 105 | $cmd->exit_is_num(0); |
103 | 106 | $cmd->stdout_is_eq(""); |
|
107 | 110 | }); |
108 | 111 | } |
109 | 112 |
|
110 | | -# fping -Q (longer test to show two time stamps and reset statistics) |
111 | | -{ |
112 | | -my $cmd = Test::Command->new(cmd => "fping -Q 1 -p 550 -c 5 127.0.0.1"); |
| 113 | +# fping -Q (fractional time) |
| 114 | +SKIP: { |
| 115 | +if($^O eq 'darwin') { |
| 116 | + skip 'On macOS, -Q tests are unreliable', 3; |
| 117 | +} |
| 118 | +my $cmd = Test::Command->new(cmd => "fping -Q0.5 -p 200 -c 4 127.0.0.1"); |
113 | 119 | $cmd->exit_is_num(0); |
114 | 120 | $cmd->stdout_is_eq(""); |
115 | 121 | $cmd->stderr_like(qr{\[\d+:\d+:\d+\] |
116 | | -127\.0\.0\.1 : xmt/rcv/%loss = 2/2/0%, min/avg/max = \d\.\d+/\d\.\d+/\d\.\d+ |
117 | | -\[\d+:\d+:\d+\] |
118 | | -127\.0\.0\.1 : xmt/rcv/%loss = 2/2/0%, min/avg/max = \d\.\d+/\d\.\d+/\d\.\d+ |
119 | | -127\.0\.0\.1 : xmt/rcv/%loss = 5/5/0%, min/avg/max = \d\.\d+/\d\.\d+/\d\.\d+ |
| 122 | +127\.0\.0\.1 : xmt/rcv/%loss = 3/3/0%, min/avg/max = \d\.\d+/\d\.\d+/\d\.\d+ |
| 123 | +127\.0\.0\.1 : xmt/rcv/%loss = 4/4/0%, min/avg/max = \d\.\d+/\d\.\d+/\d\.\d+ |
120 | 124 | }); |
121 | 125 | } |
122 | 126 |
|
123 | | -# fping -Q n ignores non-number characters after the number, except for keywords |
124 | | -{ |
125 | | -my $cmd = Test::Command->new(cmd => "fping -Q 1whatever -p 550 -c 5 127.0.0.1"); |
| 127 | +# fping -Q (longer test to show two time stamps and reset statistics) |
| 128 | +SKIP: { |
| 129 | +if($^O eq 'darwin') { |
| 130 | + skip 'On macOS, -Q tests are unreliable', 3; |
| 131 | +} |
| 132 | +my $cmd = Test::Command->new(cmd => "fping -Q 1 -p 550 -c 5 127.0.0.1"); |
126 | 133 | $cmd->exit_is_num(0); |
127 | 134 | $cmd->stdout_is_eq(""); |
128 | 135 | $cmd->stderr_like(qr{\[\d+:\d+:\d+\] |
|
134 | 141 | } |
135 | 142 |
|
136 | 143 | # fping -Q n ignores unknown keywords |
137 | | -{ |
138 | | -my $cmd = Test::Command->new(cmd => "fping -Q 1,not_a_keyword -p 550 -c 5 127.0.0.1"); |
| 144 | +SKIP: { |
| 145 | +if($^O eq 'darwin') { |
| 146 | + skip 'On macOS, -Q tests are unreliable', 3; |
| 147 | +} |
| 148 | +my $cmd = Test::Command->new(cmd => "fping -Q 0.5,not_a_keyword -p 300 -c 5 127.0.0.1"); |
139 | 149 | $cmd->exit_is_num(0); |
140 | 150 | $cmd->stdout_is_eq(""); |
141 | 151 | $cmd->stderr_like(qr{\[\d+:\d+:\d+\] |
|
147 | 157 | } |
148 | 158 |
|
149 | 159 | # fping -Q n,cumulative |
150 | | -{ |
151 | | -my $cmd = Test::Command->new(cmd => "fping -Q 1,cumulative -p 550 -c 5 127.0.0.1"); |
| 160 | +SKIP: { |
| 161 | +if($^O eq 'darwin') { |
| 162 | + skip 'On macOS, -Q tests are unreliable', 3; |
| 163 | +} |
| 164 | +my $cmd = Test::Command->new(cmd => "fping -Q 0.5,cumulative -p 300 -c 5 127.0.0.1"); |
152 | 165 | $cmd->exit_is_num(0); |
153 | 166 | $cmd->stdout_is_eq(""); |
154 | 167 | $cmd->stderr_like(qr{\[\d+:\d+:\d+\] |
|
160 | 173 | } |
161 | 174 |
|
162 | 175 | # fping -Q -o |
163 | | -{ |
164 | | -my $cmd = Test::Command->new(cmd => "fping -c4 -Q1 -p550 -o 8.8.8.7"); |
| 176 | +SKIP: { |
| 177 | +if($^O eq 'darwin') { |
| 178 | + skip 'On macOS, -Q tests are unreliable', 3; |
| 179 | +} |
| 180 | +my $cmd = Test::Command->new(cmd => "fping -c4 -Q0.5 -p300 -o 8.8.8.7"); |
165 | 181 | $cmd->exit_is_num(1); |
166 | 182 | $cmd->stdout_is_eq(""); |
167 | 183 | $cmd->stderr_like(qr{\[\d+:\d+:\d+\] |
168 | | -8\.8\.8\.7 : xmt/rcv/%loss = 1/0/100%, outage\(ms\) = 55\d |
| 184 | +8\.8\.8\.7 : xmt/rcv/%loss = 1/0/100%, outage\(ms\) = 30\d |
169 | 185 | \[\d+:\d+:\d+\] |
170 | | -8\.8\.8\.7 : xmt/rcv/%loss = 2/0/100%, outage\(ms\) = 110\d |
171 | | -8\.8\.8\.7 : xmt/rcv/%loss = 4/0/100%, outage\(ms\) = 220\d |
| 186 | +8\.8\.8\.7 : xmt/rcv/%loss = 2/0/100%, outage\(ms\) = 60\d |
| 187 | +8\.8\.8\.7 : xmt/rcv/%loss = 4/0/100%, outage\(ms\) = 120\d |
172 | 188 | }); |
173 | 189 | } |
174 | 190 |
|
175 | 191 | # fping -Q n,cumulative -o |
176 | | -{ |
177 | | -my $cmd = Test::Command->new(cmd => "fping -c4 -Q1,cumulative -p550 -o 8.8.8.7"); |
| 192 | +SKIP: { |
| 193 | +if($^O eq 'darwin') { |
| 194 | + skip 'On macOS, -Q tests are unreliable', 3; |
| 195 | +} |
| 196 | +my $cmd = Test::Command->new(cmd => "fping -c4 -Q0.5,cumulative -p300 -o 8.8.8.7"); |
178 | 197 | $cmd->exit_is_num(1); |
179 | 198 | $cmd->stdout_is_eq(""); |
180 | 199 | $cmd->stderr_like(qr{\[\d+:\d+:\d+\] |
181 | | -8\.8\.8\.7 : xmt/rcv/%loss = 1/0/100%, outage\(ms\) = 55\d |
| 200 | +8\.8\.8\.7 : xmt/rcv/%loss = 1/0/100%, outage\(ms\) = 30\d |
182 | 201 | \[\d+:\d+:\d+\] |
183 | | -8\.8\.8\.7 : xmt/rcv/%loss = 3/0/100%, outage\(ms\) = 165\d |
184 | | -8\.8\.8\.7 : xmt/rcv/%loss = 4/0/100%, outage\(ms\) = 220\d |
| 202 | +8\.8\.8\.7 : xmt/rcv/%loss = 3/0/100%, outage\(ms\) = 90\d |
| 203 | +8\.8\.8\.7 : xmt/rcv/%loss = 4/0/100%, outage\(ms\) = 120\d |
185 | 204 | }); |
186 | 205 | } |
187 | 206 |
|
| 207 | + |
0 commit comments