diff options
| author | Michael Biebl <biebl@debian.org> | 2016-01-20 16:26:51 +0100 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2016-01-20 16:26:51 +0100 |
| commit | 494f296a3baab08522617b24b1f126d8f9a17502 (patch) | |
| tree | c8ef32fb0dd1c4ff35a0b38e787abb58692de0cd /src/dhcp-manager/tests | |
| parent | 54f6333410ffd570e62717d9e77c5c987175e397 (diff) | |
Imported Upstream version 1.1.90 upstream/1.1.90
Diffstat (limited to 'src/dhcp-manager/tests')
| -rw-r--r-- | src/dhcp-manager/tests/Makefile.am | 6 | ||||
| -rw-r--r-- | src/dhcp-manager/tests/Makefile.in | 24 | ||||
| -rw-r--r-- | src/dhcp-manager/tests/test-dhcp-dhclient.c | 76 | ||||
| -rw-r--r-- | src/dhcp-manager/tests/test-dhcp-utils.c | 43 |
4 files changed, 91 insertions, 58 deletions
diff --git a/src/dhcp-manager/tests/Makefile.am b/src/dhcp-manager/tests/Makefile.am index 4c4c7e81..5c7f9ba2 100644 --- a/src/dhcp-manager/tests/Makefile.am +++ b/src/dhcp-manager/tests/Makefile.am @@ -1,13 +1,13 @@ AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ - -I${top_builddir}/include \ + -I$(top_srcdir)/shared \ + -I${top_builddir}/shared \ -I${top_srcdir}/libnm-core \ -I${top_builddir}/libnm-core \ -I$(top_srcdir)/src/dhcp-manager \ -I$(top_srcdir)/src \ -I$(top_srcdir)/src/platform \ -DG_LOG_DOMAIN=\""NetworkManager"\" \ - -DNETWORKMANAGER_COMPILATION \ + -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ $(GLIB_CFLAGS) \ -DTESTDIR="\"$(abs_srcdir)\"" diff --git a/src/dhcp-manager/tests/Makefile.in b/src/dhcp-manager/tests/Makefile.in index c98dbd5f..3bc370b8 100644 --- a/src/dhcp-manager/tests/Makefile.in +++ b/src/dhcp-manager/tests/Makefile.in @@ -409,7 +409,6 @@ BLUEZ5_LIBS = @BLUEZ5_LIBS@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ -CKDB_PATH = @CKDB_PATH@ CODE_COVERAGE_CFLAGS = @CODE_COVERAGE_CFLAGS@ CODE_COVERAGE_ENABLED = @CODE_COVERAGE_ENABLED@ CODE_COVERAGE_LDFLAGS = @CODE_COVERAGE_LDFLAGS@ @@ -421,8 +420,6 @@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DBUS_CFLAGS = @DBUS_CFLAGS@ -DBUS_GLIB_100_CFLAGS = @DBUS_GLIB_100_CFLAGS@ -DBUS_GLIB_100_LIBS = @DBUS_GLIB_100_LIBS@ DBUS_LIBS = @DBUS_LIBS@ DBUS_SYS_DIR = @DBUS_SYS_DIR@ DEFS = @DEFS@ @@ -432,6 +429,7 @@ DHCPCD_PATH = @DHCPCD_PATH@ DISTRO_NETWORK_SERVICE = @DISTRO_NETWORK_SERVICE@ DLLTOOL = @DLLTOOL@ DNSMASQ_PATH = @DNSMASQ_PATH@ +DNSSEC_TRIGGER_SCRIPT = @DNSSEC_TRIGGER_SCRIPT@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ @@ -486,16 +484,13 @@ INTROSPECTION_MAKEFILE = @INTROSPECTION_MAKEFILE@ INTROSPECTION_SCANNER = @INTROSPECTION_SCANNER@ INTROSPECTION_TYPELIBDIR = @INTROSPECTION_TYPELIBDIR@ IPTABLES_PATH = @IPTABLES_PATH@ -IWMX_SDK_CFLAGS = @IWMX_SDK_CFLAGS@ -IWMX_SDK_LIBS = @IWMX_SDK_LIBS@ KERNEL_FIRMWARE_DIR = @KERNEL_FIRMWARE_DIR@ LCOV = @LCOV@ LD = @LD@ LDFLAGS = @LDFLAGS@ +LIBAUDIT_CFLAGS = @LIBAUDIT_CFLAGS@ +LIBAUDIT_LIBS = @LIBAUDIT_LIBS@ LIBDL = @LIBDL@ -LIBGCRYPT_CFLAGS = @LIBGCRYPT_CFLAGS@ -LIBGCRYPT_CONFIG = @LIBGCRYPT_CONFIG@ -LIBGCRYPT_LIBS = @LIBGCRYPT_LIBS@ LIBICONV = @LIBICONV@ LIBINTL = @LIBINTL@ LIBM = @LIBM@ @@ -532,6 +527,8 @@ NEWT_LIBS = @NEWT_LIBS@ NM = @NM@ NMEDIT = @NMEDIT@ NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT = @NM_CONFIG_DEFAULT_AUTH_POLKIT_TEXT@ +NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT = @NM_CONFIG_DEFAULT_LOGGING_AUDIT_TEXT@ +NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT = @NM_CONFIG_LOGGING_BACKEND_DEFAULT_TEXT@ NM_MAJOR_VERSION = @NM_MAJOR_VERSION@ NM_MICRO_VERSION = @NM_MICRO_VERSION@ NM_MINOR_VERSION = @NM_MINOR_VERSION@ @@ -560,7 +557,6 @@ POLKIT_LIBS = @POLKIT_LIBS@ POSUB = @POSUB@ PPPD_PATH = @PPPD_PATH@ PPPD_PLUGIN_DIR = @PPPD_PLUGIN_DIR@ -PPPOE_PATH = @PPPOE_PATH@ QT_CFLAGS = @QT_CFLAGS@ QT_LIBS = @QT_LIBS@ RANLIB = @RANLIB@ @@ -575,6 +571,8 @@ SYSTEMD_200_CFLAGS = @SYSTEMD_200_CFLAGS@ SYSTEMD_200_LIBS = @SYSTEMD_200_LIBS@ SYSTEMD_INHIBIT_CFLAGS = @SYSTEMD_INHIBIT_CFLAGS@ SYSTEMD_INHIBIT_LIBS = @SYSTEMD_INHIBIT_LIBS@ +SYSTEMD_JOURNAL_CFLAGS = @SYSTEMD_JOURNAL_CFLAGS@ +SYSTEMD_JOURNAL_LIBS = @SYSTEMD_JOURNAL_LIBS@ SYSTEMD_LOGIN_CFLAGS = @SYSTEMD_LOGIN_CFLAGS@ SYSTEMD_LOGIN_LIBS = @SYSTEMD_LOGIN_LIBS@ SYSTEM_CA_PATH = @SYSTEM_CA_PATH@ @@ -635,6 +633,7 @@ mkdir_p = @mkdir_p@ nmbinary = @nmbinary@ nmconfdir = @nmconfdir@ nmdatadir = @nmdatadir@ +nmlibdir = @nmlibdir@ nmrundir = @nmrundir@ nmstatedir = @nmstatedir@ oldincludedir = @oldincludedir@ @@ -642,6 +641,7 @@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ +runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ @@ -658,15 +658,15 @@ with_netconfig = @with_netconfig@ with_resolvconf = @with_resolvconf@ with_valgrind = @with_valgrind@ AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ - -I${top_builddir}/include \ + -I$(top_srcdir)/shared \ + -I${top_builddir}/shared \ -I${top_srcdir}/libnm-core \ -I${top_builddir}/libnm-core \ -I$(top_srcdir)/src/dhcp-manager \ -I$(top_srcdir)/src \ -I$(top_srcdir)/src/platform \ -DG_LOG_DOMAIN=\""NetworkManager"\" \ - -DNETWORKMANAGER_COMPILATION \ + -DNETWORKMANAGER_COMPILATION=NM_NETWORKMANAGER_COMPILATION_INSIDE_DAEMON \ -DNM_VERSION_MAX_ALLOWED=NM_VERSION_NEXT_STABLE \ $(GLIB_CFLAGS) \ -DTESTDIR="\"$(abs_srcdir)\"" diff --git a/src/dhcp-manager/tests/test-dhcp-dhclient.c b/src/dhcp-manager/tests/test-dhcp-dhclient.c index 459915e3..f9e1e1eb 100644 --- a/src/dhcp-manager/tests/test-dhcp-dhclient.c +++ b/src/dhcp-manager/tests/test-dhcp-dhclient.c @@ -20,12 +20,11 @@ #include "config.h" -#include <glib.h> #include <string.h> #include <unistd.h> #include <arpa/inet.h> -#include "gsystem-local-alloc.h" +#include "nm-default.h" #include "NetworkManagerUtils.h" #include "nm-dhcp-dhclient-utils.h" #include "nm-dhcp-utils.h" @@ -34,6 +33,8 @@ #include "nm-platform.h" #include "nm-macros-internal.h" +#include "nm-test-utils.h" + #define DEBUG 1 static void @@ -41,6 +42,7 @@ test_config (const char *orig, const char *expected, gboolean ipv6, const char *hostname, + const char *fqdn, const char *dhcp_client_id, GBytes *expected_new_client_id, const char *iface, @@ -60,6 +62,7 @@ test_config (const char *orig, client_id, anycast_addr, hostname, + fqdn, "/path/to/dhclient.conf", orig, &new_client_id); @@ -104,7 +107,7 @@ static const char *orig_missing_expected = \ static void test_orig_missing (void) { - test_config (NULL, orig_missing_expected, FALSE, NULL, NULL, NULL, "eth0", NULL); + test_config (NULL, orig_missing_expected, FALSE, NULL, NULL, NULL, NULL, "eth0", NULL); } /*******************************************/ @@ -133,7 +136,7 @@ static void test_override_client_id (void) { test_config (override_client_id_orig, override_client_id_expected, - FALSE, NULL, + FALSE, NULL, NULL, "11:22:33:44:55:66", NULL, "eth0", @@ -162,7 +165,7 @@ static void test_quote_client_id (void) { test_config (NULL, quote_client_id_expected, - FALSE, NULL, + FALSE, NULL, NULL, "1234", NULL, "eth0", @@ -191,7 +194,7 @@ static void test_ascii_client_id (void) { test_config (NULL, ascii_client_id_expected, - FALSE, NULL, + FALSE, NULL, NULL, "qb:cd:ef:12:34:56", NULL, "eth0", @@ -220,7 +223,7 @@ static void test_hex_single_client_id (void) { test_config (NULL, hex_single_client_id_expected, - FALSE, NULL, + FALSE, NULL, NULL, "ab:cd:e:12:34:56", NULL, "eth0", @@ -257,7 +260,7 @@ test_existing_hex_client_id (void) new_client_id = g_bytes_new (bytes, sizeof (bytes)); test_config (existing_hex_client_id_orig, existing_hex_client_id_expected, - FALSE, NULL, + FALSE, NULL, NULL, NULL, new_client_id, "eth0", @@ -297,12 +300,41 @@ test_existing_ascii_client_id (void) memcpy (buf + 1, EACID, STRLEN (EACID)); new_client_id = g_bytes_new (buf, sizeof (buf)); test_config (existing_ascii_client_id_orig, existing_ascii_client_id_expected, - FALSE, NULL, + FALSE, NULL, NULL, NULL, new_client_id, "eth0", NULL); } +/*******************************************/ + +static const char *fqdn_expected = \ + "# Created by NetworkManager\n" + "\n" + "send fqdn.fqdn \"foo.bar.com\"; # added by NetworkManager\n" + "send fqdn.encoded on;\n" + "send fqdn.server-update on;\n" + "\n" + "option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;\n" + "option ms-classless-static-routes code 249 = array of unsigned integer 8;\n" + "option wpad code 252 = string;\n" + "\n" + "also request rfc3442-classless-static-routes;\n" + "also request ms-classless-static-routes;\n" + "also request static-routes;\n" + "also request wpad;\n" + "also request ntp-servers;\n\n"; + +static void +test_fqdn (void) +{ + test_config (NULL, fqdn_expected, + FALSE, NULL, + "foo.bar.com", NULL, + NULL, + "eth0", + NULL); +} /*******************************************/ @@ -330,7 +362,7 @@ static void test_override_hostname (void) { test_config (override_hostname_orig, override_hostname_expected, - FALSE, "blahblah", + FALSE, "blahblah", NULL, NULL, NULL, "eth0", @@ -359,7 +391,7 @@ static void test_override_hostname6 (void) { test_config (override_hostname6_orig, override_hostname6_expected, - TRUE, "blahblah.local", + TRUE, "blahblah.local", NULL, NULL, NULL, "eth0", @@ -382,7 +414,7 @@ test_nonfqdn_hostname6 (void) /* Non-FQDN hostname can't be used with dhclient */ test_config (NULL, nonfqdn_hostname6_expected, TRUE, "blahblah", - NULL, + NULL, NULL, NULL, "eth0", NULL); @@ -419,6 +451,7 @@ test_existing_alsoreq (void) FALSE, NULL, NULL, NULL, + NULL, "eth0", NULL); } @@ -455,7 +488,7 @@ static void test_existing_multiline_alsoreq (void) { test_config (existing_multiline_alsoreq_orig, existing_multiline_alsoreq_expected, - FALSE, NULL, + FALSE, NULL, NULL, NULL, NULL, "eth0", @@ -653,7 +686,7 @@ test_read_lease_ip4_config_basic (void) /* Date from before the least expiration */ now = g_date_time_new_utc (2013, 11, 1, 19, 55, 32); - leases = nm_dhcp_dhclient_read_lease_ip_configs ("wlan0", contents, FALSE, now); + leases = nm_dhcp_dhclient_read_lease_ip_configs ("wlan0", -1, contents, FALSE, now); g_assert_cmpint (g_slist_length (leases), ==, 2); /* IP4Config #1 */ @@ -665,6 +698,7 @@ test_read_lease_ip4_config_basic (void) g_assert (inet_aton ("192.168.1.180", (struct in_addr *) &expected_addr)); addr = nm_ip4_config_get_address (config, 0); g_assert_cmpint (addr->address, ==, expected_addr); + g_assert_cmpint (addr->peer_address, ==, expected_addr); g_assert_cmpint (addr->plen, ==, 24); /* Gateway */ @@ -687,6 +721,7 @@ test_read_lease_ip4_config_basic (void) g_assert (inet_aton ("10.77.52.141", (struct in_addr *) &expected_addr)); addr = nm_ip4_config_get_address (config, 0); g_assert_cmpint (addr->address, ==, expected_addr); + g_assert_cmpint (addr->peer_address, ==, expected_addr); g_assert_cmpint (addr->plen, ==, 8); /* Gateway */ @@ -725,7 +760,7 @@ test_read_lease_ip4_config_expired (void) /* Date from *after* the lease expiration */ now = g_date_time_new_utc (2013, 12, 1, 19, 55, 32); - leases = nm_dhcp_dhclient_read_lease_ip_configs ("wlan0", contents, FALSE, now); + leases = nm_dhcp_dhclient_read_lease_ip_configs ("wlan0", -1, contents, FALSE, now); g_assert (leases == NULL); g_date_time_unref (now); @@ -747,7 +782,7 @@ test_read_lease_ip4_config_expect_failure (gconstpointer user_data) /* Date from before the least expiration */ now = g_date_time_new_utc (2013, 11, 1, 1, 1, 1); - leases = nm_dhcp_dhclient_read_lease_ip_configs ("wlan0", contents, FALSE, now); + leases = nm_dhcp_dhclient_read_lease_ip_configs ("wlan0", -1, contents, FALSE, now); g_assert (leases == NULL); g_date_time_unref (now); @@ -756,14 +791,12 @@ test_read_lease_ip4_config_expect_failure (gconstpointer user_data) /*******************************************/ +NMTST_DEFINE (); + int main (int argc, char **argv) { - g_test_init (&argc, &argv, NULL); - -#if !GLIB_CHECK_VERSION (2, 35, 0) - g_type_init (); -#endif + nmtst_init_with_logging (&argc, &argv, NULL, "DEFAULT"); g_test_add_func ("/dhcp/dhclient/orig_missing", test_orig_missing); g_test_add_func ("/dhcp/dhclient/override_client_id", test_override_client_id); @@ -772,6 +805,7 @@ main (int argc, char **argv) g_test_add_func ("/dhcp/dhclient/hex_single_client_id", test_hex_single_client_id); g_test_add_func ("/dhcp/dhclient/existing-hex-client-id", test_existing_hex_client_id); g_test_add_func ("/dhcp/dhclient/existing-ascii-client-id", test_existing_ascii_client_id); + g_test_add_func ("/dhcp/dhclient/fqdn", test_fqdn); g_test_add_func ("/dhcp/dhclient/override_hostname", test_override_hostname); g_test_add_func ("/dhcp/dhclient/override_hostname6", test_override_hostname6); g_test_add_func ("/dhcp/dhclient/nonfqdn_hostname6", test_nonfqdn_hostname6); diff --git a/src/dhcp-manager/tests/test-dhcp-utils.c b/src/dhcp-manager/tests/test-dhcp-utils.c index 618188df..49987c40 100644 --- a/src/dhcp-manager/tests/test-dhcp-utils.c +++ b/src/dhcp-manager/tests/test-dhcp-utils.c @@ -19,15 +19,14 @@ #include "config.h" -#include <glib.h> #include <netinet/in.h> #include <arpa/inet.h> #include <string.h> #include <nm-utils.h> +#include "nm-default.h" #include "nm-dhcp-utils.h" -#include "nm-logging.h" #include "nm-platform.h" #include "nm-test-utils.h" @@ -88,7 +87,7 @@ test_generic_options (void) const char *expected_route2_gw = "10.1.1.1"; options = fill_table (generic_options, NULL); - ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0); + ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0); g_assert (ip4_config); /* IP4 address */ @@ -96,7 +95,7 @@ test_generic_options (void) address = nm_ip4_config_get_address (ip4_config, 0); g_assert (inet_pton (AF_INET, expected_addr, &tmp) > 0); g_assert (address->address == tmp); - g_assert (address->peer_address == 0); + g_assert (address->peer_address == tmp); g_assert_cmpint (address->plen, ==, 24); /* Gateway */ @@ -159,7 +158,7 @@ test_wins_options (void) options = fill_table (generic_options, NULL); options = fill_table (data, options); - ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0); + ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0); g_assert (ip4_config); /* IP4 address */ @@ -186,7 +185,7 @@ test_vendor_option_metered (void) }; options = fill_table (generic_options, NULL); - ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0); + ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0); g_assert (ip4_config); g_assert (nm_ip4_config_get_metered (ip4_config) == FALSE); g_hash_table_destroy (options); @@ -194,7 +193,7 @@ test_vendor_option_metered (void) options = fill_table (generic_options, NULL); options = fill_table (data, options); - ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0); + ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0); g_assert (ip4_config); g_assert (nm_ip4_config_get_metered (ip4_config) == TRUE); g_hash_table_destroy (options); @@ -246,7 +245,7 @@ test_classless_static_routes_1 (void) options = fill_table (generic_options, NULL); options = fill_table (data, options); - ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0); + ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0); g_assert (ip4_config); /* IP4 routes */ @@ -274,7 +273,7 @@ test_classless_static_routes_2 (void) options = fill_table (generic_options, NULL); options = fill_table (data, options); - ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0); + ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0); g_assert (ip4_config); /* IP4 routes */ @@ -303,7 +302,7 @@ test_fedora_dhclient_classless_static_routes (void) options = fill_table (generic_options, NULL); options = fill_table (data, options); - ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0); + ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0); g_assert (ip4_config); /* IP4 routes */ @@ -335,7 +334,7 @@ test_dhclient_invalid_classless_routes_1 (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*ignoring invalid classless static routes*"); - ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0); + ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0); g_assert (ip4_config); g_test_assert_expected_messages (); @@ -366,7 +365,7 @@ test_dhcpcd_invalid_classless_routes_1 (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*ignoring invalid classless static routes*"); - ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0); + ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0); g_assert (ip4_config); g_test_assert_expected_messages (); @@ -399,7 +398,7 @@ test_dhclient_invalid_classless_routes_2 (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*ignoring invalid classless static routes*"); - ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0); + ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0); g_assert (ip4_config); g_test_assert_expected_messages (); @@ -432,7 +431,7 @@ test_dhcpcd_invalid_classless_routes_2 (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*ignoring invalid classless static routes*"); - ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0); + ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0); g_assert (ip4_config); g_test_assert_expected_messages (); @@ -465,7 +464,7 @@ test_dhclient_invalid_classless_routes_3 (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*ignoring invalid classless static routes*"); - ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0); + ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0); g_assert (ip4_config); g_test_assert_expected_messages (); @@ -493,7 +492,7 @@ test_dhcpcd_invalid_classless_routes_3 (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*DHCP provided invalid classless static route*"); - ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0); + ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0); g_assert (ip4_config); g_test_assert_expected_messages (); @@ -519,7 +518,7 @@ test_dhclient_gw_in_classless_routes (void) options = fill_table (generic_options, NULL); options = fill_table (data, options); - ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0); + ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0); g_assert (ip4_config); /* IP4 routes */ @@ -547,7 +546,7 @@ test_dhcpcd_gw_in_classless_routes (void) options = fill_table (generic_options, NULL); options = fill_table (data, options); - ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0); + ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0); g_assert (ip4_config); /* IP4 routes */ @@ -575,7 +574,7 @@ test_escaped_domain_searches (void) options = fill_table (generic_options, NULL); options = fill_table (data, options); - ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0); + ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0); g_assert (ip4_config); /* domain searches */ @@ -602,7 +601,7 @@ test_invalid_escaped_domain_searches (void) g_test_expect_message ("NetworkManager", G_LOG_LEVEL_WARNING, "*invalid domain search*"); - ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0); + ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0); g_assert (ip4_config); g_test_assert_expected_messages (); @@ -623,7 +622,7 @@ test_ip4_missing_prefix (const char *ip, guint32 expected_prefix) g_hash_table_insert (options, "ip_address", (gpointer) ip); g_hash_table_remove (options, "subnet_mask"); - ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0); + ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0); g_assert (ip4_config); g_assert_cmpint (nm_ip4_config_get_num_addresses (ip4_config), ==, 1); @@ -668,7 +667,7 @@ test_ip4_prefix_classless (void) g_hash_table_insert (options, "ip_address", "172.16.54.22"); g_hash_table_insert (options, "subnet_mask", "255.255.252.0"); - ip4_config = nm_dhcp_utils_ip4_config_from_options ("eth0", options, 0); + ip4_config = nm_dhcp_utils_ip4_config_from_options (1, "eth0", options, 0); g_assert (ip4_config); g_assert_cmpint (nm_ip4_config_get_num_addresses (ip4_config), ==, 1); |