mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-07 16:00:21 +01:00
ifnet: add testcase for incorrect config
Missing config_<name> line (containing method, i.e. dhcp, ...) should fail with error 'Unknown config for <name>'.
This commit is contained in:
parent
9f026283c6
commit
4bb50e4380
2 changed files with 14 additions and 0 deletions
|
|
@ -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 ();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue