summaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorTom Gundersen <teg@jklm.no>2014-07-12 23:15:17 +0200
committerTom Gundersen <teg@jklm.no>2014-07-14 16:49:41 +0200
commit5347925a59530bd4e6616eb8c8d43a02c3e14c46 (patch)
treeed50c42e8785637cd5e74c9aa611818bc12f1c39 /src/network
parent1231c4d238844e77018caf5b5852f01d96373c47 (diff)
test: network - skip if we don't have permissions to create netdevs
Diffstat (limited to 'src/network')
-rw-r--r--src/network/test-network.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/network/test-network.c b/src/network/test-network.c
index 75e70fae14..08b37b10b3 100644
--- a/src/network/test-network.c
+++ b/src/network/test-network.c
@@ -111,15 +111,23 @@ static void test_deserialize_dhcp_routes(void) {
}
}
-static void test_load_config(Manager *manager) {
+static int test_load_config(Manager *manager) {
+ int r;
/* 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
* directly
*
* assert_se(network_should_reload(manager) == true);
*/
- assert_se(manager_load_config(manager) >= 0);
+
+ r = manager_load_config(manager);
+ if (r == -EPERM)
+ return r;
+ assert_se(r >= 0);
+
assert_se(manager_should_reload(manager) == false);
+
+ return 0;
}
static void test_network_get(Manager *manager, struct udev_device *loopback) {
@@ -181,6 +189,7 @@ int main(void) {
_cleanup_manager_free_ Manager *manager = NULL;
struct udev *udev;
struct udev_device *loopback;
+ int r;
test_deserialize_in_addr();
test_deserialize_dhcp_routes();
@@ -188,7 +197,9 @@ int main(void) {
assert_se(manager_new(&manager) >= 0);
- test_load_config(manager);
+ r = test_load_config(manager);
+ if (r == -EPERM)
+ return EXIT_TEST_SKIP;
udev = udev_new();
assert_se(udev);