#!/usr/bin/perl -w
-use Test::Command tests => 53;
+use Test::Command tests => 62;
use Test::More;
use Time::HiRes qw(gettimeofday tv_interval);
$cmd->stderr_is_eq("");
}
+# fping --icmp-timestamp ::1
+SKIP: {
+ if($ENV{SKIP_IPV6}) {
+ skip 'Skip IPv6 tests', 3;
+ }
+ my $cmd = Test::Command->new(cmd => "fping --icmp-timestamp ::1");
+ $cmd->exit_is_num(2);
+ $cmd->stdout_is_eq("");
+ $cmd->stderr_like(qr{^::1:.*(not supported|not known)});
+}
+
# fping --print-ttl with IPv6
SKIP: {
if($ENV{SKIP_IPV6}) {
$cmd->stderr_like(qr{cannot change ICMP Timestamp size});
}
+# fping -6 --icmp-timestamp
+SKIP: {
+ if($ENV{SKIP_IPV6}) {
+ skip 'Skip IPv6 tests', 3;
+ }
+ my $cmd = Test::Command->new(cmd => "fping -6 --icmp-timestamp ::1");
+ $cmd->exit_is_num(1);
+ $cmd->stdout_is_eq("");
+ $cmd->stderr_like(qr{ICMP Timestamp is IPv4 only});
+}
+
+# fping --icmp-timestamp -6
+SKIP: {
+ if($ENV{SKIP_IPV6}) {
+ skip 'Skip IPv6 tests', 3;
+ }
+ my $cmd = Test::Command->new(cmd => "fping --icmp-timestamp -6 ::1");
+ $cmd->exit_is_num(1);
+ $cmd->stdout_is_eq("");
+ $cmd->stderr_is_eq("fping: can't specify both -4 and -6\n");
+}
+
# fping -B
SKIP: {
if($^O eq 'darwin') {
} else if (strstr(optparse_state.optlongname, "check-source") != NULL) {
check_source_flag = 1;
} else if (strstr(optparse_state.optlongname, "icmp-timestamp") != NULL) {
+#ifdef IPV6
+ if (hints_ai_family != AF_UNSPEC && hints_ai_family != AF_INET) {
+ fprintf(stderr, "%s: ICMP Timestamp is IPv4 only\n", prog);
+ exit(1);
+ }
+ hints_ai_family = AF_INET;
+#endif
icmp_request_typ = 13;
ping_data_size = ICMP_TIMESTAMP_DATA_SIZE;
} else if (strstr(optparse_state.optlongname, "print-tos") != NULL) {