Commit 4bb50e43 authored by Jiří Klimeš's avatar Jiří Klimeš
Browse files

ifnet: add testcase for incorrect config

Missing config_<name> line (containing method, i.e. dhcp, ...) should
fail with error 'Unknown config for <name>'.
parent 9f026283
......@@ -35,6 +35,8 @@ config_eth6=("192.168.4.{1..101}/24")
config_eth7=( "dhcp" )
auto_eth7="true"
# missing config_eth8
auto_eth8="true"
config_myxjtu2=("202.117.16.121/24 brd 202.117.16.255")
routes_myxjtu2=("default via 202.117.16.1")
......
......@@ -356,6 +356,17 @@ test_delete_connection ()
unlink (SUP_GEN_NAME);
}
static void
test_missing_config ()
{
GError *error = NULL;
NMConnection *connection;
connection = ifnet_update_connection_from_config_block ("eth8", &error);
ASSERT (connection == NULL && error != NULL, "get connection",
"get connection should fail with 'Unknown config for eth8'");
}
static void
run_all (gboolean run)
{
......@@ -378,6 +389,7 @@ run_all (gboolean run)
test_update_connection ();
test_add_connection ();
test_delete_connection ();
test_missing_config ();
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment