summary refs log tree commit diff
path: root/src/initrd
diff options
context:
space:
mode:
Diffstat (limited to 'src/initrd')
-rw-r--r--src/initrd/nm-initrd-generator.c4
-rw-r--r--src/initrd/nm-initrd-generator.h2
-rw-r--r--src/initrd/nmi-cmdline-reader.c62
-rw-r--r--src/initrd/tests/test-cmdline-reader.c153
4 files changed, 160 insertions, 61 deletions
diff --git a/src/initrd/nm-initrd-generator.c b/src/initrd/nm-initrd-generator.c
index c916459d..0ff3428e 100644
--- a/src/initrd/nm-initrd-generator.c
+++ b/src/initrd/nm-initrd-generator.c
@@ -95,7 +95,7 @@ main (int argc, char *argv[])
 	int errsv;
 
 	option_context = g_option_context_new ("-- [ip=...] [rd.route=...] [bridge=...] [bond=...] [team=...] [vlan=...] "
-	                                       "[bootdev=...] [nameserver=...] [rd.peerdns=...] [rd.bootif=...] [BOOTIF=...] ... ");
+	                                       "[bootdev=...] [nameserver=...] [rd.peerdns=...] [rd.bootif=...] [BOOTIF=...] [rd.znet=...] ... ");
 
 	g_option_context_set_summary (option_context, "Generate early NetworkManager configuration.");
 	g_option_context_set_description (option_context,
@@ -127,7 +127,7 @@ main (int argc, char *argv[])
 		return 1;
 	}
 
-	connections = nmi_cmdline_reader_parse (sysfs_dir, remaining);
+	connections = nmi_cmdline_reader_parse (sysfs_dir, (const char *const*) remaining);
 	g_hash_table_foreach (connections, output_conn, connections_dir);
 	g_hash_table_destroy (connections);
 
diff --git a/src/initrd/nm-initrd-generator.h b/src/initrd/nm-initrd-generator.h
index dab6fb64..7ff9a92e 100644
--- a/src/initrd/nm-initrd-generator.h
+++ b/src/initrd/nm-initrd-generator.h
@@ -41,6 +41,6 @@ GHashTable *nmi_ibft_read (const char *sysfs_dir);
 
 gboolean nmi_ibft_update_connection_from_nic (NMConnection *connection, GHashTable *nic, GError **error);
 
-GHashTable *nmi_cmdline_reader_parse (const char *sysfs_dir, char **argv);
+GHashTable *nmi_cmdline_reader_parse (const char *sysfs_dir, const char *const*argv);
 
 #endif  /* __NM_INITRD_GENERATOR_H__ */
diff --git a/src/initrd/nmi-cmdline-reader.c b/src/initrd/nmi-cmdline-reader.c
index 7a3af8d6..8ae6aa36 100644
--- a/src/initrd/nmi-cmdline-reader.c
+++ b/src/initrd/nmi-cmdline-reader.c
@@ -690,6 +690,43 @@ parse_rd_peerdns (GHashTable *connections, char *argument)
 }
 
 static void
+parse_rd_znet (GHashTable *connections, char *argument)
+{
+	const char *nettype;
+	const char *subchannels[4] = { 0, 0, 0, 0 };
+	const char *tmp;
+	NMConnection *connection;
+	NMSettingWired *s_wired;
+
+	nettype = get_word (&argument, ',');
+	subchannels[0] = get_word (&argument, ',');
+	subchannels[1] = get_word (&argument, ',');
+	if (!nm_streq0 (nettype, "ctc"))
+		subchannels[2] = get_word (&argument, ',');
+
+	connection = get_conn (connections, NULL, NM_SETTING_WIRED_SETTING_NAME);
+	s_wired = nm_connection_get_setting_wired (connection);
+	g_object_set (s_wired,
+	              NM_SETTING_WIRED_S390_NETTYPE, nettype,
+	              NM_SETTING_WIRED_S390_SUBCHANNELS, &subchannels,
+	              NULL);
+
+	while ((tmp = get_word (&argument, ',')) != NULL) {
+		char *val;
+
+		val = strchr (tmp, '=');
+		if (val) {
+			gs_free char *key = NULL;
+
+			key = g_strndup (tmp, val - tmp);
+			val[0] = '\0';
+			val++;
+			nm_setting_wired_add_s390_option (s_wired, key, val);
+		}
+	}
+}
+
+static void
 _normalize_conn (gpointer key, gpointer value, gpointer user_data)
 {
 	NMConnection *connection = value;
@@ -698,20 +735,24 @@ _normalize_conn (gpointer key, gpointer value, gpointer user_data)
 }
 
 GHashTable *
-nmi_cmdline_reader_parse (const char *sysfs_dir, char **argv)
+nmi_cmdline_reader_parse (const char *sysfs_dir, const char *const*argv)
 {
 	GHashTable *connections;
 	const char *tag;
-	char *argument;
 	gboolean ignore_bootif = FALSE;
 	gboolean neednet = FALSE;
-	char *bootif = NULL;
+	gs_free char *bootif_val = NULL;
 	int i;
 
 	connections = g_hash_table_new_full (nm_str_hash, g_str_equal, g_free, g_object_unref);
 
 	for (i = 0; argv[i]; i++) {
-		argument = argv[i];
+		gs_free char *argument_clone = NULL;
+		char *argument;
+
+		argument_clone = g_strdup (argv[i]);
+		argument = argument_clone;
+
 		tag = get_word (&argument, '=');
 		if (strcmp (tag, "ip") == 0)
 			parse_ip (connections, sysfs_dir, argument);
@@ -735,15 +776,20 @@ nmi_cmdline_reader_parse (const char *sysfs_dir, char **argv)
 			ignore_bootif = !_nm_utils_ascii_str_to_bool (argument, TRUE);
 		else if (strcmp (tag, "rd.neednet") == 0)
 			neednet = _nm_utils_ascii_str_to_bool (argument, TRUE);
-		else if (strcasecmp (tag, "BOOTIF") == 0)
-			bootif = argument;
+		else if (strcmp (tag, "rd.znet") == 0)
+			parse_rd_znet (connections, argument);
+		else if (strcasecmp (tag, "BOOTIF") == 0) {
+			nm_clear_g_free (&bootif_val);
+			bootif_val = g_strdup (argument);
+		}
 	}
 
 	if (ignore_bootif)
-		bootif = NULL;
-	if (bootif) {
+		nm_clear_g_free (&bootif_val);
+	if (bootif_val) {
 		NMConnection *connection;
 		NMSettingWired *s_wired;
+		const char *bootif = bootif_val;
 
 		if (   !nm_utils_hwaddr_valid (bootif, ETH_ALEN)
 		    && g_str_has_prefix (bootif, "01-")
diff --git a/src/initrd/tests/test-cmdline-reader.c b/src/initrd/tests/test-cmdline-reader.c
index 9bae73a2..a8a6e825 100644
--- a/src/initrd/tests/test-cmdline-reader.c
+++ b/src/initrd/tests/test-cmdline-reader.c
@@ -39,14 +39,14 @@ static void
 test_auto (void)
 {
 	gs_unref_hashtable GHashTable *connections = NULL;
-	gs_strfreev char **argv = g_strdupv ((char *[]){ "ip=auto", NULL });
+	const char *const*ARGV = NM_MAKE_STRV ("ip=auto");
 	NMConnection *connection;
 	NMSettingConnection *s_con;
 	NMSettingWired *s_wired;
 	NMSettingIPConfig *s_ip4;
 	NMSettingIPConfig *s_ip6;
 
-	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", argv);
+	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", ARGV);
 	g_assert (connections);
 	g_assert_cmpint (g_hash_table_size (connections), ==, 1);
 
@@ -91,13 +91,13 @@ static void
 test_if_auto_with_mtu (void)
 {
 	gs_unref_hashtable GHashTable *connections = NULL;
-	gs_strfreev char **argv = g_strdupv ((char *[]){ "ip=eth0:auto:1666", NULL });
+	const char *const*ARGV = NM_MAKE_STRV ("ip=eth0:auto:1666");
 	NMConnection *connection;
 	NMSettingWired *s_wired;
 	NMSettingIPConfig *s_ip4;
 	NMSettingIPConfig *s_ip6;
 
-	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", argv);
+	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", ARGV);
 	g_assert (connections);
 	g_assert_cmpint (g_hash_table_size (connections), ==, 1);
 
@@ -126,12 +126,12 @@ static void
 test_if_dhcp6 (void)
 {
 	gs_unref_hashtable GHashTable *connections = NULL;
-	gs_strfreev char **argv = g_strdupv ((char *[]){ "ip=eth1:dhcp6", NULL });
+	const char *const*ARGV = NM_MAKE_STRV ("ip=eth1:dhcp6");
 	NMConnection *connection;
 	NMSettingIPConfig *s_ip4;
 	NMSettingIPConfig *s_ip6;
 
-	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", argv);
+	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", ARGV);
 	g_assert (connections);
 	g_assert_cmpint (g_hash_table_size (connections), ==, 1);
 	connection = g_hash_table_lookup (connections, "eth1");
@@ -155,13 +155,13 @@ static void
 test_if_auto_with_mtu_and_mac (void)
 {
 	gs_unref_hashtable GHashTable *connections = NULL;
-	gs_strfreev char **argv = g_strdupv ((char *[]){ "ip=eth2:auto6:2048:00:53:ef:12:34:56", NULL });
+	const char *const*ARGV = NM_MAKE_STRV ("ip=eth2:auto6:2048:00:53:ef:12:34:56");
 	NMConnection *connection;
 	NMSettingWired *s_wired;
 	NMSettingIPConfig *s_ip4;
 	NMSettingIPConfig *s_ip6;
 
-	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", argv);
+	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", ARGV);
 	g_assert (connections);
 	g_assert_cmpint (g_hash_table_size (connections), ==, 1);
 
@@ -191,16 +191,15 @@ static void
 test_if_ip4_manual (void)
 {
 	gs_unref_hashtable GHashTable *connections = NULL;
-	gs_strfreev char **argv = g_strdupv ((char *[]){
-		"ip=192.0.2.2::192.0.2.1:255.255.255.0:"
-		"hostname0.example.com:eth3::192.0.2.53",
-		"ip=203.0.113.2::203.0.113.1:26:"
-		"hostname1.example.com:eth4", NULL });
+	const char *const*ARGV = NM_MAKE_STRV ("ip=192.0.2.2::192.0.2.1:255.255.255.0:"
+	                                       "hostname0.example.com:eth3::192.0.2.53",
+	                                       "ip=203.0.113.2::203.0.113.1:26:"
+	                                       "hostname1.example.com:eth4");
 	NMConnection *connection;
 	NMSettingIPConfig *s_ip4;
 	NMIPAddress *ip_addr;
 
-	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", argv);
+	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", ARGV);
 	g_assert (connections);
 	g_assert_cmpint (g_hash_table_size (connections), ==, 2);
 
@@ -248,16 +247,13 @@ static void
 test_if_ip6_manual (void)
 {
 	gs_unref_hashtable GHashTable *connections = NULL;
-	gs_strfreev char **argv = g_strdupv ((char *[]){
-		"ip=[2001:0db8::02]/64::[2001:0db8::01]::"
-		"hostname0.example.com:eth4::[2001:0db8::53]",
-		NULL
-	});
+	const char *const*ARGV = NM_MAKE_STRV ("ip=[2001:0db8::02]/64::[2001:0db8::01]::"
+	                                       "hostname0.example.com:eth4::[2001:0db8::53]");
 	NMConnection *connection;
 	NMSettingIPConfig *s_ip6;
 	NMIPAddress *ip_addr;
 
-	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", argv);
+	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", ARGV);
 	g_assert (connections);
 	g_assert_cmpint (g_hash_table_size (connections), ==, 1);
 
@@ -286,17 +282,16 @@ static void
 test_multiple (void)
 {
 	gs_unref_hashtable GHashTable *connections = NULL;
-	gs_strfreev char **argv = g_strdupv ((char *[]){ "ip=192.0.2.2:::::eth0",
-	                                                 "ip=[2001:db8::2]:::::eth0",
-	                                                 "BOOTIF=00:53:AB:cd:02:03",
-	                                                 NULL });
+	const char *const*ARGV = NM_MAKE_STRV ("ip=192.0.2.2:::::eth0",
+	                                       "ip=[2001:db8::2]:::::eth0",
+	                                       "BOOTIF=00:53:AB:cd:02:03");
 	NMConnection *connection;
 	NMSettingWired *s_wired;
 	NMSettingIPConfig *s_ip4;
 	NMSettingIPConfig *s_ip6;
 	NMIPAddress *ip_addr;
 
-	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", argv);
+	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", ARGV);
 	g_assert (connections);
 	g_assert_cmpint (g_hash_table_size (connections), ==, 1);
 
@@ -332,11 +327,10 @@ static void
 test_some_more (void)
 {
 	gs_unref_hashtable GHashTable *connections = NULL;
-	gs_strfreev char **argv = g_strdupv ((char *[]){ "bootdev=eth1", "hail", "nameserver=[2001:DB8:3::53]",
-	                                                 "satan", "nameserver=192.0.2.53", "worship",
-	                                                 "BOOTIF=01-00-53-AB-cd-02-03", "doom", "rd.peerdns=0",
-	                                                 "rd.route=[2001:DB8:3::/48]:[2001:DB8:2::1]:ens10",
-	                                                 NULL });
+	const char *const*ARGV = NM_MAKE_STRV ("bootdev=eth1", "hail", "nameserver=[2001:DB8:3::53]",
+	                                       "satan", "nameserver=192.0.2.53", "worship",
+	                                       "BOOTIF=01-00-53-AB-cd-02-03", "doom", "rd.peerdns=0",
+	                                       "rd.route=[2001:DB8:3::/48]:[2001:DB8:2::1]:ens10");
 	NMConnection *connection;
 	NMSettingConnection *s_con;
 	NMSettingWired *s_wired;
@@ -344,7 +338,7 @@ test_some_more (void)
 	NMSettingIPConfig *s_ip6;
 	NMIPRoute *ip_route;
 
-	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", argv);
+	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", ARGV);
 	g_assert (connections);
 	g_assert_cmpint (g_hash_table_size (connections), ==, 2);
 
@@ -415,9 +409,9 @@ static void
 test_no_bootif (void)
 {
 	gs_unref_hashtable GHashTable *connections = NULL;
-	gs_strfreev char **argv = g_strdupv ((char *[]){ "BOOTIF=01-00-53-AB-cd-02-03", "rd.bootif=0", NULL });
+	const char *const*ARGV = NM_MAKE_STRV ("BOOTIF=01-00-53-AB-cd-02-03", "rd.bootif=0");
 
-	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", argv);
+	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", ARGV);
 	g_assert (connections);
 	g_assert_cmpint (g_hash_table_size (connections), ==, 0);
 }
@@ -426,10 +420,9 @@ static void
 test_bond (void)
 {
 	gs_unref_hashtable GHashTable *connections = NULL;
-	gs_strfreev char **argv = g_strdupv ((char *[]){ "rd.route=192.0.2.53::bong0",
-	                                                 "bond=bong0:eth0,eth1:mode=balance-rr",
-	                                                 "nameserver=203.0.113.53",
-	                                                 NULL });
+	const char *const*ARGV = NM_MAKE_STRV ("rd.route=192.0.2.53::bong0",
+	                                       "bond=bong0:eth0,eth1:mode=balance-rr",
+	                                       "nameserver=203.0.113.53");
 	NMConnection *connection;
 	NMSettingConnection *s_con;
 	NMSettingIPConfig *s_ip4;
@@ -438,7 +431,7 @@ test_bond (void)
 	NMIPRoute *ip_route;
 	const char *master_uuid;
 
-	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", argv);
+	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", ARGV);
 	g_assert (connections);
 	g_assert_cmpint (g_hash_table_size (connections), ==, 3);
 
@@ -509,7 +502,7 @@ static void
 test_bond_default (void)
 {
 	gs_unref_hashtable GHashTable *connections = NULL;
-	gs_strfreev char **argv = g_strdupv ((char *[]){ "bond", NULL });
+	const char *const*ARGV = NM_MAKE_STRV ("bond");
 	NMConnection *connection;
 	NMSettingConnection *s_con;
 	NMSettingIPConfig *s_ip4;
@@ -517,7 +510,7 @@ test_bond_default (void)
 	NMSettingBond *s_bond;
 	const char *master_uuid;
 
-	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", argv);
+	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", ARGV);
 	g_assert (connections);
 	g_assert_cmpint (g_hash_table_size (connections), ==, 2);
 
@@ -569,7 +562,7 @@ static void
 test_bridge (void)
 {
 	gs_unref_hashtable GHashTable *connections = NULL;
-	gs_strfreev char **argv = g_strdupv ((char *[]){ "bridge=bridge0:eth0,eth1", "rd.route=192.0.2.53::bridge0", NULL });
+	const char *const*ARGV = NM_MAKE_STRV ("bridge=bridge0:eth0,eth1", "rd.route=192.0.2.53::bridge0");
 	NMConnection *connection;
 	NMSettingConnection *s_con;
 	NMSettingIPConfig *s_ip4;
@@ -578,7 +571,7 @@ test_bridge (void)
 	NMIPRoute *ip_route;
 	const char *master_uuid;
 
-	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", argv);
+	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", ARGV);
 	g_assert (connections);
 	g_assert_cmpint (g_hash_table_size (connections), ==, 3);
 
@@ -646,7 +639,7 @@ static void
 test_bridge_default (void)
 {
 	gs_unref_hashtable GHashTable *connections = NULL;
-	gs_strfreev char **argv = g_strdupv ((char *[]){ "bridge", NULL });
+	const char *const*ARGV = NM_MAKE_STRV ("bridge");
 	NMConnection *connection;
 	NMSettingConnection *s_con;
 	NMSettingIPConfig *s_ip4;
@@ -654,7 +647,7 @@ test_bridge_default (void)
 	NMSettingBridge *s_bridge;
 	const char *master_uuid;
 
-	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", argv);
+	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", ARGV);
 	g_assert (connections);
 	g_assert_cmpint (g_hash_table_size (connections), ==, 2);
 
@@ -704,7 +697,7 @@ static void
 test_team (void)
 {
 	gs_unref_hashtable GHashTable *connections = NULL;
-	gs_strfreev char **argv = g_strdupv ((char *[]){ "team=team0:eth0,eth1", "ip=team0:dhcp6", NULL });
+	const char *const*ARGV = NM_MAKE_STRV ("team=team0:eth0,eth1", "ip=team0:dhcp6");
 	NMConnection *connection;
 	NMSettingConnection *s_con;
 	NMSettingIPConfig *s_ip4;
@@ -712,7 +705,7 @@ test_team (void)
 	NMSettingTeam *s_team;
 	const char *master_uuid;
 
-	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", argv);
+	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", ARGV);
 	g_assert (connections);
 	g_assert_cmpint (g_hash_table_size (connections), ==, 3);
 
@@ -774,10 +767,10 @@ static void
 test_ibft (void)
 {
 	gs_unref_hashtable GHashTable *connections = NULL;
-	gs_strfreev char **argv = g_strdupv ((char *[]){ "ip=ibft", NULL });
+	const char *const*ARGV = NM_MAKE_STRV ("ip=ibft");
 	NMConnection *connection;
 
-	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", argv);
+	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", ARGV);
 	g_assert (connections);
 	g_assert_cmpint (g_hash_table_size (connections), ==, 2);
 
@@ -796,13 +789,72 @@ static void
 test_ignore_extra (void)
 {
 	gs_unref_hashtable GHashTable *connections = NULL;
-	gs_strfreev char **argv = g_strdupv ((char *[]){ "blabla", "extra", "lalala", NULL });
+	const char *const*ARGV = NM_MAKE_STRV ("blabla", "extra", "lalala");
 
-	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", argv);
+	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", ARGV);
 	g_assert (connections);
 	g_assert_cmpint (g_hash_table_size (connections), ==, 0);
 }
 
+static void
+test_rd_znet (void)
+{
+	gs_unref_hashtable GHashTable *connections = NULL;
+	const char *const*const ARGV = NM_MAKE_STRV ("ip=10.11.12.13::10.11.12.1:24:foo.example.com:enc800:none",
+	                                             "rd.znet=ctc,0.0.0800,0.0.0801,layer2=0,portno=1");
+	GHashTableIter h_iter;
+	NMConnection *connection;
+	NMSettingWired *s_wired;
+	const char *const*v_subchannels;
+	const NMUtilsNamedValue s390_options[] = {
+		{ .name = "layer2", .value_str = "0" },
+		{ .name = "portno", .value_str = "1" },
+	};
+	int i_s390_options_keys;
+
+	connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", ARGV);
+	g_assert (connections);
+	g_assert_cmpint (g_hash_table_size (connections), ==, 1);
+
+	g_hash_table_iter_init (&h_iter, connections);
+	if (!g_hash_table_iter_next (&h_iter, NULL, (gpointer *) &connection))
+		g_assert_not_reached ();
+	if (g_hash_table_iter_next (&h_iter, NULL, NULL))
+		g_assert_not_reached ();
+
+	g_assert (NM_IS_CONNECTION (connection));
+	s_wired = nm_connection_get_setting_wired (connection);
+	g_assert (NM_IS_SETTING_WIRED (s_wired));
+
+	v_subchannels = nm_setting_wired_get_s390_subchannels (s_wired);
+	g_assert (v_subchannels);
+	g_assert_cmpstr (v_subchannels[0], ==, "0.0.0800");
+	g_assert_cmpstr (v_subchannels[1], ==, "0.0.0801");
+	g_assert_cmpstr (v_subchannels[2], ==, NULL);
+
+	g_assert_cmpint (nm_setting_wired_get_num_s390_options (s_wired), ==, G_N_ELEMENTS (s390_options));
+	for (i_s390_options_keys = 0; i_s390_options_keys < G_N_ELEMENTS (s390_options); i_s390_options_keys++) {
+		const NMUtilsNamedValue *s390_option = &s390_options[i_s390_options_keys];
+		const char *k;
+		const char *v;
+		const char *v2;
+
+		g_assert (s390_option->name);
+		g_assert (s390_option->value_str);
+		v = nm_setting_wired_get_s390_option_by_key (s_wired, s390_option->name);
+		g_assert (v);
+		g_assert_cmpstr (v, ==, s390_option->value_str);
+
+		if (!nm_setting_wired_get_s390_option (s_wired, i_s390_options_keys, &k, &v2))
+			g_assert_not_reached ();
+		g_assert_cmpstr (k, ==, s390_option->name);
+		g_assert (v == v2);
+		g_assert_cmpstr (v2, ==, s390_option->value_str);
+	}
+
+	nmtst_assert_connection_verifies_without_normalization (connection);
+}
+
 NMTST_DEFINE ();
 
 int main (int argc, char **argv)
@@ -825,6 +877,7 @@ int main (int argc, char **argv)
 	g_test_add_func ("/initrd/cmdline/bridge/default", test_bridge_default);
 	g_test_add_func ("/initrd/cmdline/ibft", test_ibft);
 	g_test_add_func ("/initrd/cmdline/ignore_extra", test_ignore_extra);
+	g_test_add_func ("/initrd/cmdline/rd_zdnet", test_rd_znet);
 
 	return g_test_run ();
 }