mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-15 12:34:55 +00:00
ifcfg-rh/tests: add ipv6 hostname legacy support read test
This commit is contained in:
parent
2852b50945
commit
6bf69d0fa1
|
@ -1885,6 +1885,7 @@ EXTRA_DIST += \
|
||||||
src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-dhcp-plus-ip \
|
src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-dhcp-plus-ip \
|
||||||
src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-shared-plus-ip \
|
src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-shared-plus-ip \
|
||||||
src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-dhcp-send-hostname \
|
src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-dhcp-send-hostname \
|
||||||
|
src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-dhcpv6-hostname-fallback \
|
||||||
src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-dhcp6-only \
|
src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-dhcp6-only \
|
||||||
src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-autoip \
|
src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-autoip \
|
||||||
src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-global-gateway \
|
src/settings/plugins/ifcfg-rh/tests/network-scripts/ifcfg-test-wired-global-gateway \
|
||||||
|
|
|
@ -0,0 +1,12 @@
|
||||||
|
# Intel Corporation 82540EP Gigabit Ethernet Controller (Mobile)
|
||||||
|
TYPE=Ethernet
|
||||||
|
DEVICE=eth0
|
||||||
|
HWADDR=00:11:22:33:44:ee
|
||||||
|
BOOTPROTO=dhcp
|
||||||
|
ONBOOT=yes
|
||||||
|
IPV6INIT=yes
|
||||||
|
IPV6_AUTOCONF=yes
|
||||||
|
USERCTL=yes
|
||||||
|
NM_CONTROLLED=yes
|
||||||
|
PEERDNS=no
|
||||||
|
DHCP_HOSTNAME="fully.qualified.domain"
|
|
@ -3916,6 +3916,21 @@ test_read_write_wired_dhcp_send_hostname (void)
|
||||||
g_assert_cmpstr (nm_setting_ip_config_get_dhcp_hostname (s_ip6), ==, dhcp_hostname);
|
g_assert_cmpstr (nm_setting_ip_config_get_dhcp_hostname (s_ip6), ==, dhcp_hostname);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
test_read_wired_dhcpv6_hostname_fallback (void)
|
||||||
|
{
|
||||||
|
gs_unref_object NMConnection *connection = NULL;
|
||||||
|
NMSettingIPConfig *s_ip6;
|
||||||
|
|
||||||
|
connection = _connection_from_file (TEST_IFCFG_DIR"/network-scripts/ifcfg-test-wired-dhcpv6-hostname-fallback",
|
||||||
|
NULL, TYPE_ETHERNET, NULL);
|
||||||
|
|
||||||
|
s_ip6 = nm_connection_get_setting_ip6_config (connection);
|
||||||
|
g_assert (s_ip6);
|
||||||
|
g_assert (nm_setting_ip_config_get_dhcp_send_hostname (s_ip6) == TRUE);
|
||||||
|
g_assert_cmpstr (nm_setting_ip_config_get_dhcp_hostname (s_ip6), ==, "fully.qualified.domain");
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
test_write_wired_static_ip6_only (void)
|
test_write_wired_static_ip6_only (void)
|
||||||
{
|
{
|
||||||
|
@ -8838,6 +8853,7 @@ int main (int argc, char **argv)
|
||||||
g_test_add_func (TPATH "read-dhcp-plus-ip", test_read_wired_dhcp_plus_ip);
|
g_test_add_func (TPATH "read-dhcp-plus-ip", test_read_wired_dhcp_plus_ip);
|
||||||
g_test_add_func (TPATH "read-shared-plus-ip", test_read_wired_shared_plus_ip);
|
g_test_add_func (TPATH "read-shared-plus-ip", test_read_wired_shared_plus_ip);
|
||||||
g_test_add_func (TPATH "read-dhcp-send-hostname", test_read_write_wired_dhcp_send_hostname);
|
g_test_add_func (TPATH "read-dhcp-send-hostname", test_read_write_wired_dhcp_send_hostname);
|
||||||
|
g_test_add_func (TPATH "read-dhcpv6-hostname-fallback", test_read_wired_dhcpv6_hostname_fallback);
|
||||||
g_test_add_func (TPATH "read-global-gateway", test_read_wired_global_gateway);
|
g_test_add_func (TPATH "read-global-gateway", test_read_wired_global_gateway);
|
||||||
g_test_add_func (TPATH "read-global-gateway-ignore", test_read_wired_global_gateway_ignore);
|
g_test_add_func (TPATH "read-global-gateway-ignore", test_read_wired_global_gateway_ignore);
|
||||||
g_test_add_func (TPATH "read-obsolete-gateway-n", test_read_wired_obsolete_gateway_n);
|
g_test_add_func (TPATH "read-obsolete-gateway-n", test_read_wired_obsolete_gateway_n);
|
||||||
|
|
Loading…
Reference in a new issue