diff options
author | Tom Gundersen <teg@jklm.no> | 2016-11-28 20:42:40 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2016-11-28 20:42:40 +0100 |
commit | b76d99d9e66f965b79dade55ab719d54a17e709c (patch) | |
tree | e0d45453cbd3ad9c958de54d040d614ea5e88f35 /src/network/test-network.c | |
parent | dc3b8afb93f188f212218487ab62fd3f12a2b58f (diff) |
networkd: move event loop handling out of the manager (#4723)
This will allow us to have several managers sharing an event loop
and running in parallel, as if they were running in separate processes.
The long term-aim is to allow networkd to be split into separate
processes, so restructure the code to make this simpler.
For now we drop the exit-on-idle logic, as this was anyway severely
restricted at the moment. Once split, we will revisit this as it may
then make more sense again.
Diffstat (limited to 'src/network/test-network.c')
-rw-r--r-- | src/network/test-network.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/network/test-network.c b/src/network/test-network.c index 93184a7f88..64d2f23fc1 100644 --- a/src/network/test-network.c +++ b/src/network/test-network.c @@ -186,6 +186,7 @@ static void test_address_equality(void) { int main(void) { _cleanup_manager_free_ Manager *manager = NULL; + sd_event *event; struct udev *udev; struct udev_device *loopback; int r; @@ -194,11 +195,16 @@ int main(void) { test_deserialize_dhcp_routes(); test_address_equality(); - assert_se(manager_new(&manager) >= 0); + r = sd_event_default(&event); + assert_se(r >= 0); + + assert_se(manager_new(&manager, event) >= 0); r = test_load_config(manager); - if (r == -EPERM) + if (r == -EPERM) { + sd_event_unref(event); return EXIT_TEST_SKIP; + } udev = udev_new(); assert_se(udev); @@ -213,4 +219,5 @@ int main(void) { udev_device_unref(loopback); udev_unref(udev); + sd_event_unref(event); } |