summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-10-31 13:10:12 +0100
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-10-31 13:20:14 +0100
commit3d8f9799c449414c6965c2712ffc7d7a97b39bb5 (patch)
tree59ff65590b6d62a6210b232fc62846e070138eb7
parentPING6(8): Add TODO (diff)
downloadrtems-libbsd-3d8f9799c449414c6965c2712ffc7d7a97b39bb5.tar.bz2
commands01: Add INET6 test cases
-rw-r--r--testsuite/commands01/test_main.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/testsuite/commands01/test_main.c b/testsuite/commands01/test_main.c
index b5d81f68..06e27a5c 100644
--- a/testsuite/commands01/test_main.c
+++ b/testsuite/commands01/test_main.c
@@ -118,21 +118,47 @@ test_ifconfig_lo0(void)
"255.255.255.0",
NULL
};
+ char *lo0_inet6[] = {
+ "ifconfig",
+ "lo0",
+ "inet6",
+ "::1",
+ "prefixlen",
+ "128",
+ NULL
+ };
char *status[] = {
"ifconfig",
"lo0",
"inet",
NULL
};
+ char *status_inet6[] = {
+ "ifconfig",
+ "lo0",
+ "inet6",
+ NULL
+ };
exit_code = rtems_bsd_command_ifconfig(ARGC(lo0), lo0);
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);
exit_code = rtems_bsd_command_ifconfig(ARGC(status), status);
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));
}
@@ -177,6 +203,30 @@ test_ping(void)
}
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
test_netstat(void)
{
rtems_resource_snapshot snapshot;
@@ -230,6 +280,7 @@ test_main(void)
test_ifconfig_lo0();
test_route_with_lo0();
test_ping();
+ test_ping6();
test_netstat();
rtems_stack_checker_report_usage_with_plugin(NULL,