diff options
| author | Michael Biebl <biebl@debian.org> | 2017-11-07 00:14:39 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2017-11-07 00:14:39 +0100 |
| commit | 90e8691111889a7b5f3c812f5a41f15a8a058913 (patch) | |
| tree | f101a879eca27c34a9bfa5f3da52266b22539a36 /src/tests/test-general.c | |
| parent | bdb6eeb0670658255c2a4c3c501c0a27fa8cfe55 (diff) | |
New upstream version 1.9.90 upstream/1.9.90
Diffstat (limited to 'src/tests/test-general.c')
| -rw-r--r-- | src/tests/test-general.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/tests/test-general.c b/src/tests/test-general.c index 37bbc5ca..d36a26ef 100644 --- a/src/tests/test-general.c +++ b/src/tests/test-general.c @@ -272,6 +272,32 @@ test_nm_utils_log_connection_diff (void) /*****************************************************************************/ +static void +do_test_sysctl_ip_conf (int addr_family, + const char *iface, + const char *property) +{ + char path[NM_UTILS_SYSCTL_IP_CONF_PATH_BUFSIZE]; + const char *pp; + + pp = nm_utils_sysctl_ip_conf_path (addr_family, path, iface, property); + g_assert (pp == path); + g_assert (path[0] == '/'); + + g_assert (nm_utils_sysctl_ip_conf_is_path (addr_family, path, iface, property)); + g_assert (nm_utils_sysctl_ip_conf_is_path (addr_family, path, NULL, property)); +} + +static void +test_nm_utils_sysctl_ip_conf_path (void) +{ + do_test_sysctl_ip_conf (AF_INET6, "a", "mtu"); + do_test_sysctl_ip_conf (AF_INET6, "eth0", "mtu"); + do_test_sysctl_ip_conf (AF_INET6, "e23456789012345", "mtu"); +} + +/*****************************************************************************/ + static NMConnection * _match_connection_new (void) { @@ -1716,6 +1742,8 @@ main (int argc, char **argv) g_test_add_func ("/general/nm_utils_ip6_address_same_prefix", test_nm_utils_ip6_address_same_prefix); g_test_add_func ("/general/nm_utils_log_connection_diff", test_nm_utils_log_connection_diff); + g_test_add_func ("/general/nm_utils_sysctl_ip_conf_path", test_nm_utils_sysctl_ip_conf_path); + g_test_add_func ("/general/exp10", test_nm_utils_exp10); g_test_add_func ("/general/connection-match/basic", test_connection_match_basic); |