mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-07-23 04:00:39 +08:00
commands01: Add INET6 test cases
This commit is contained in:
parent
cae4d0aff7
commit
3d8f9799c4
@ -118,21 +118,47 @@ test_ifconfig_lo0(void)
|
|||||||
"255.255.255.0",
|
"255.255.255.0",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
char *lo0_inet6[] = {
|
||||||
|
"ifconfig",
|
||||||
|
"lo0",
|
||||||
|
"inet6",
|
||||||
|
"::1",
|
||||||
|
"prefixlen",
|
||||||
|
"128",
|
||||||
|
NULL
|
||||||
|
};
|
||||||
char *status[] = {
|
char *status[] = {
|
||||||
"ifconfig",
|
"ifconfig",
|
||||||
"lo0",
|
"lo0",
|
||||||
"inet",
|
"inet",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
char *status_inet6[] = {
|
||||||
|
"ifconfig",
|
||||||
|
"lo0",
|
||||||
|
"inet6",
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
exit_code = rtems_bsd_command_ifconfig(ARGC(lo0), lo0);
|
exit_code = rtems_bsd_command_ifconfig(ARGC(lo0), lo0);
|
||||||
assert(exit_code == EX_OK);
|
assert(exit_code == EX_OK);
|
||||||
|
|
||||||
|
exit_code = rtems_bsd_command_ifconfig(ARGC(lo0_inet6), lo0_inet6);
|
||||||
|
assert(exit_code == EX_OK);
|
||||||
|
|
||||||
rtems_resource_snapshot_take(&snapshot);
|
rtems_resource_snapshot_take(&snapshot);
|
||||||
|
|
||||||
exit_code = rtems_bsd_command_ifconfig(ARGC(status), status);
|
exit_code = rtems_bsd_command_ifconfig(ARGC(status), status);
|
||||||
assert(exit_code == EX_OK);
|
assert(exit_code == EX_OK);
|
||||||
|
|
||||||
|
exit_code = rtems_bsd_command_ifconfig(ARGC(status_inet6), status_inet6);
|
||||||
|
assert(exit_code == EX_OK);
|
||||||
|
|
||||||
|
rtems_resource_snapshot_take(&snapshot);
|
||||||
|
|
||||||
|
exit_code = rtems_bsd_command_ifconfig(ARGC(status_inet6), status_inet6);
|
||||||
|
assert(exit_code == EX_OK);
|
||||||
|
|
||||||
assert(rtems_resource_snapshot_check(&snapshot));
|
assert(rtems_resource_snapshot_check(&snapshot));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,6 +202,30 @@ test_ping(void)
|
|||||||
assert(rtems_resource_snapshot_check(&snapshot));
|
assert(rtems_resource_snapshot_check(&snapshot));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
test_ping6(void)
|
||||||
|
{
|
||||||
|
rtems_resource_snapshot snapshot;
|
||||||
|
int exit_code;
|
||||||
|
char *ping6[] = {
|
||||||
|
"ping6",
|
||||||
|
"-c",
|
||||||
|
"1",
|
||||||
|
"::1",
|
||||||
|
NULL
|
||||||
|
};
|
||||||
|
|
||||||
|
exit_code = rtems_bsd_command_ping6(ARGC(ping6), ping6);
|
||||||
|
assert(exit_code == EXIT_SUCCESS);
|
||||||
|
|
||||||
|
rtems_resource_snapshot_take(&snapshot);
|
||||||
|
|
||||||
|
exit_code = rtems_bsd_command_ping6(ARGC(ping6), ping6);
|
||||||
|
assert(exit_code == EXIT_SUCCESS);
|
||||||
|
|
||||||
|
assert(rtems_resource_snapshot_check(&snapshot));
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_netstat(void)
|
test_netstat(void)
|
||||||
{
|
{
|
||||||
@ -230,6 +280,7 @@ test_main(void)
|
|||||||
test_ifconfig_lo0();
|
test_ifconfig_lo0();
|
||||||
test_route_with_lo0();
|
test_route_with_lo0();
|
||||||
test_ping();
|
test_ping();
|
||||||
|
test_ping6();
|
||||||
test_netstat();
|
test_netstat();
|
||||||
|
|
||||||
rtems_stack_checker_report_usage_with_plugin(NULL,
|
rtems_stack_checker_report_usage_with_plugin(NULL,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user