aboutsummaryrefslogtreecommitdiffstats
path: root/tests/lib/ippool_test.c
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2017-12-04 12:52:23 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2017-12-04 13:25:02 +0100
commit9c0f4f49e9b15b55cd9baa42c1ba191903664397 (patch)
tree624b14e37d54fb93809a716cb0d67aa3ece381b0 /tests/lib/ippool_test.c
parentac51c7e68e64740568c6843499cb3a352e3e549e (diff)
tests: Split ipv6 specific tests into a new test group
This way they can be easily disabled later on when IPv6 support is made optional. Change-Id: I3906dbf55ccf1650083398e08ac870add0bbdcef
Diffstat (limited to 'tests/lib/ippool_test.c')
-rw-r--r--tests/lib/ippool_test.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/tests/lib/ippool_test.c b/tests/lib/ippool_test.c
index 5b3227c..8d3f46c 100644
--- a/tests/lib/ippool_test.c
+++ b/tests/lib/ippool_test.c
@@ -113,14 +113,17 @@ static void test_pool_sizes(void)
/* 65534 addresses [0.1..255.254] */
test_pool_size("192.168.0.0/16", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, NULL, 0, 65534);
- /* 256 prefixes of /64 each */
- test_pool_size("2001:DB8::/56", 0, NULL, 0, 256);
-
/* 253 addresses [1..254] & exclude 192.168.23.1/24 */
char *blacklist[] = {"176.16.222.10/24", "192.168.23.1/24", "192.168.38.2/24"};
test_pool_size("192.168.23.0/24", IPPOOL_NONETWORK | IPPOOL_NOBROADCAST, blacklist, 3, 253);
}
+static void test_pool_sizes_v6(void)
+{
+ /* 256 prefixes of /64 each */
+ test_pool_size("2001:DB8::/56", 0, NULL, 0, 256);
+}
+
int main(int argc, char **argv)
{
osmo_init_logging(&log_info);
@@ -129,6 +132,10 @@ int main(int argc, char **argv)
srand(time(NULL));
- test_pool_sizes();
+ if (argc < 2 || strcmp(argv[1], "-v6")) {
+ test_pool_sizes();
+ } else {
+ test_pool_sizes_v6();
+ }
return 0;
}