summaryrefslogtreecommitdiff
path: root/src/test/test-socket-bind.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-06-02 00:38:14 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2022-06-02 10:48:31 +0200
commitb1fdcda8765b0f3c059e90b152c13c9797bc9814 (patch)
tree00c628546b1b2144d05089c5fd85a83305358cd7 /src/test/test-socket-bind.c
parent44005a5778ca66848bf7e8dfe4c51ae62919bd69 (diff)
downloadsystemd-b1fdcda8765b0f3c059e90b152c13c9797bc9814.tar.gz
tests: drop pointless checks for root
Testing the error paths is very important. If we are not root, we should try and get a failure, which we should report nicely and mark the test as skipped. After those checks are removed, this is what seems to happen. This way we can see what will happen e.g. in the user manager when we try to perform some bpf ops.
Diffstat (limited to 'src/test/test-socket-bind.c')
-rw-r--r--src/test/test-socket-bind.c3
1 files changed, 0 insertions, 3 deletions
diff --git a/src/test/test-socket-bind.c b/src/test/test-socket-bind.c
index 59d8cc965b..fd1fc7a26b 100644
--- a/src/test/test-socket-bind.c
+++ b/src/test/test-socket-bind.c
@@ -110,9 +110,6 @@ int main(int argc, char *argv[]) {
if (detect_container() > 0)
return log_tests_skipped("test-bpf fails inside LXC and Docker containers: https://github.com/systemd/systemd/issues/9666");
- if (getuid() != 0)
- return log_tests_skipped("not running as root");
-
assert_se(getrlimit(RLIMIT_MEMLOCK, &rl) >= 0);
rl.rlim_cur = rl.rlim_max = MAX(rl.rlim_max, CAN_MEMLOCK_SIZE);
(void) setrlimit_closest(RLIMIT_MEMLOCK, &rl);