diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-04-10 17:21:18 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-04-10 17:21:18 -0400 |
commit | cbe22206143a04f573e5cfbc8c839ddf2fd8c5dc (patch) | |
tree | 7131b525c6d0eab1d08b3cef1de780a2f33a72a5 /src | |
parent | d24b90cb5da42f0bdf3cc8078d44f489815bb062 (diff) | |
parent | ad43ccb09675b0fa21bbeffc88adf79be1edde27 (diff) |
Merge pull request #3008 from evverx/udev-test-ignore-some-mount-errors
tests: ignore some mount errors in test-udev
Diffstat (limited to 'src')
-rw-r--r-- | src/test/test-udev.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/test/test-udev.c b/src/test/test-udev.c index 8522e9925c..e5f0d00b94 100644 --- a/src/test/test-udev.c +++ b/src/test/test-udev.c @@ -39,12 +39,13 @@ static int fake_filesystems(void) { const char *src; const char *target; const char *error; + bool ignore_mount_error; } fakefss[] = { - { "test/tmpfs/sys", "/sys", "failed to mount test /sys" }, - { "test/tmpfs/dev", "/dev", "failed to mount test /dev" }, - { "test/run", "/run", "failed to mount test /run" }, - { "test/run", "/etc/udev/rules.d", "failed to mount empty /etc/udev/rules.d" }, - { "test/run", UDEVLIBEXECDIR "/rules.d","failed to mount empty " UDEVLIBEXECDIR "/rules.d" }, + { "test/tmpfs/sys", "/sys", "failed to mount test /sys", false }, + { "test/tmpfs/dev", "/dev", "failed to mount test /dev", false }, + { "test/run", "/run", "failed to mount test /run", false }, + { "test/run", "/etc/udev/rules.d", "failed to mount empty /etc/udev/rules.d", true }, + { "test/run", UDEVLIBEXECDIR "/rules.d", "failed to mount empty " UDEVLIBEXECDIR "/rules.d", true }, }; unsigned int i; int err; @@ -66,8 +67,10 @@ static int fake_filesystems(void) { err = mount(fakefss[i].src, fakefss[i].target, NULL, MS_BIND, NULL); if (err < 0) { err = -errno; - fprintf(stderr, "%s %m\n", fakefss[i].error); - return err; + fprintf(stderr, "%s %m%s\n", fakefss[i].error, fakefss[i].ignore_mount_error ? ", ignoring" : ""); + if (!fakefss[i].ignore_mount_error) + return err; + err = 0; } } out: |