summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan HorĂ¡k <dan@danny.cz>2019-09-21 17:31:48 +0200
committerThomas Haller <thaller@redhat.com>2019-09-27 09:29:41 +0200
commitce0d7c4efe994c278c06f4a8b9f199b9c4672bb9 (patch)
treea6deff6906e3aab93d9df20351c69538a2bc6548
parent68d6d2bd126831a78abcdaaf47a3fe1336aea921 (diff)
downloadNetworkManager-ce0d7c4efe994c278c06f4a8b9f199b9c4672bb9.tar.gz
nm-initrd-generator - add test for rd.znet
(cherry picked from commit df07539105c2ad1e43f0f7c59adb68e213a78232)
-rw-r--r--src/initrd/tests/test-cmdline-reader.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/initrd/tests/test-cmdline-reader.c b/src/initrd/tests/test-cmdline-reader.c
index 9bae73a281..a486bb7eac 100644
--- a/src/initrd/tests/test-cmdline-reader.c
+++ b/src/initrd/tests/test-cmdline-reader.c
@@ -803,6 +803,18 @@ test_ignore_extra (void)
g_assert_cmpint (g_hash_table_size (connections), ==, 0);
}
+static void
+test_rd_znet (void)
+{
+ gs_unref_hashtable GHashTable *connections = NULL;
+ gs_strfreev char **argv = g_strdupv ((char *[]){ "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=0", NULL });
+
+ connections = nmi_cmdline_reader_parse (TEST_INITRD_DIR "/sysfs", argv);
+ g_assert (connections);
+ g_assert_cmpint (g_hash_table_size (connections), ==, 1);
+}
+
NMTST_DEFINE ();
int main (int argc, char **argv)
@@ -825,6 +837,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 ();
}