summaryrefslogtreecommitdiff
path: root/src/network/test-network.c
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-04-15 14:21:44 +0200
committerTom Gundersen <teg@jklm.no>2014-04-19 18:41:58 +0200
commit505f8da7325591defe5f751f328bd26915267602 (patch)
tree5f4ff2ad396ab7666ac45ed2e1a9f3ff1f13b62b /src/network/test-network.c
parentd1ca51b153d7854d49400289ddedc7d493458f71 (diff)
networkd: tie links to rtnl rather than udev
This essentially swaps the roles of rtnl and udev in networkd. After this change libudev is only used for waiting for udev to initialize devices and to get udev-specific information needed for some [Match] attributes. This in particular simplifies the code in containers where udev is not really useful, but also simplifies things and reduces round-trips in the non-container case.
Diffstat (limited to 'src/network/test-network.c')
-rw-r--r--src/network/test-network.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/src/network/test-network.c b/src/network/test-network.c
index 9c372c7798..38d57cc6a6 100644
--- a/src/network/test-network.c
+++ b/src/network/test-network.c
@@ -21,13 +21,6 @@
#include "networkd.h"
-static void test_link(Manager *manager, struct udev_device *loopback) {
- Link *link = NULL;
-
- assert_se(link_new(manager, loopback, &link) >= 0);
- assert_se(link);
-}
-
static void test_load_config(Manager *manager) {
/* TODO: should_reload, is false if the config dirs do not exist, so
* so we can't do this test here, move it to a test for paths_check_timestamps
@@ -41,10 +34,11 @@ static void test_load_config(Manager *manager) {
static void test_network_get(Manager *manager, struct udev_device *loopback) {
Network *network;
+ const struct ether_addr mac = {};
/* let's assume that the test machine does not have a .network file
that applies to the loopback device... */
- assert_se(network_get(manager, loopback, &network) == -ENOENT);
+ assert_se(network_get(manager, loopback, "lo", &mac, &network) == -ENOENT);
assert_se(!network);
}
@@ -66,11 +60,9 @@ int main(void) {
test_network_get(manager, loopback);
- test_link(manager, loopback);
-
assert_se(manager_udev_listen(manager) >= 0);
- assert_se(manager_udev_enumerate_links(manager) >= 0);
assert_se(manager_rtnl_listen(manager) >= 0);
+ assert_se(manager_rtnl_enumerate_links(manager) >= 0);
udev_device_unref(loopback);
udev_unref(udev);