Follow-up for the previous commit.
}
return 0;
#else
+ log_info("No compression feature is enabled, skipping tests.");
return EXIT_TEST_SKIP;
#endif
}
return 0;
#else
+ log_info("/* XZ and LZ4 tests skipped */");
return EXIT_TEST_SKIP;
#endif
}
log_set_max_level(LOG_DEBUG);
/* journal_file_open requires a valid machine id */
- if (access("/etc/machine-id", F_OK) != 0)
+ if (access("/etc/machine-id", F_OK) != 0) {
+ log_info("/etc/machine-id not found, skipping tests.");
return EXIT_TEST_SKIP;
+ }
arg_keep = argc > 1;
dual_timestamp previous_ts = DUAL_TIMESTAMP_NULL;
/* journal_file_open requires a valid machine id */
- if (access("/etc/machine-id", F_OK) != 0)
+ if (access("/etc/machine-id", F_OK) != 0) {
+ log_info("/etc/machine-id not found, skipping tests.");
return EXIT_TEST_SKIP;
+ }
log_set_max_level(LOG_DEBUG);
uint64_t p;
/* journal_file_open requires a valid machine id */
- if (access("/etc/machine-id", F_OK) != 0)
+ if (access("/etc/machine-id", F_OK) != 0) {
+ log_info("/etc/machine-id not found, skipping tests.");
return EXIT_TEST_SKIP;
+ }
log_set_max_level(LOG_DEBUG);
arg_keep = argc > 1;
/* journal_file_open requires a valid machine id */
- if (access("/etc/machine-id", F_OK) != 0)
+ if (access("/etc/machine-id", F_OK) != 0) {
+ log_info("/etc/machine-id not found, skipping tests.");
return EXIT_TEST_SKIP;
+ }
test_non_empty();
test_empty();
int r;
r = sd_bus_open_user(&bus);
- if (r < 0)
+ if (r < 0) {
+ log_info("Failed to connect to bus, skipping tests.");
exit(EXIT_TEST_SKIP);
+ }
bus->message_version = 2; /* dirty hack to enable gvariant */
uint64_t u64;
r = sd_bus_default_user(&bus);
- if (r < 0)
+ if (r < 0) {
+ log_info("Failed to connect to bus, skipping tests.");
return EXIT_TEST_SKIP;
+ }
r = sd_bus_message_new_method_call(bus, &m, "foobar.waldo", "/", "foobar.waldo", "Piep");
assert_se(r >= 0);
int r;
r = sd_bus_open_user(&bus);
- if (r < 0)
+ if (r < 0) {
+ log_info("Failed to connect to bus, skipping tests.");
return EXIT_TEST_SKIP;
+ }
assert_se(match_add(slots, &root, "arg2='wal\\'do',sender='foo',type='signal',interface='bar.x',", 1) >= 0);
assert_se(match_add(slots, &root, "arg2='wal\\'do2',sender='foo',type='signal',interface='bar.x',", 2) >= 0);
assert_se(manager_new(&manager) >= 0);
r = test_load_config(manager);
- if (r == -EPERM)
+ if (r == -EPERM) {
+ log_info_errno(r, "Skipping tests: %m");
return EXIT_TEST_SKIP;
+ }
assert_se(sd_device_new_from_syspath(&loopback, "/sys/class/net/lo") >= 0);
assert_se(loopback);
assert_se(architecture_from_string(architecture_to_string(1)) == 1);
v = detect_virtualization();
- if (IN_SET(v, -EPERM, -EACCES))
+ if (IN_SET(v, -EPERM, -EACCES)) {
+ log_info_errno(v, "Skipping tests: %m");
return EXIT_TEST_SKIP;
+ }
assert_se(v >= 0);
unit_dump(u, stdout, NULL);
r = bpf_firewall_compile(u);
- if (IN_SET(r, -ENOTTY, -ENOSYS, -EPERM ))
- /* Kernel doesn't support the necessary bpf bits, or masked out via seccomp? */
+ if (IN_SET(r, -ENOTTY, -ENOSYS, -EPERM)) {
+ log_info_errno(r, "Kernel doesn't support the necessary bpf bits, or masked out via seccomp? Skipping tests: %m");
return EXIT_TEST_SKIP;
+ }
assert_se(r >= 0);
assert(u->ip_bpf_ingress);
r = get_user_creds(&name, &uid, NULL, NULL, NULL, 0);
if (r < 0) {
log_full_errno(r == -ESRCH ? LOG_NOTICE : LOG_ERR,
- r, "Failed to resolve \"%s\": %m", name);
+ r, "Failed to resolve \"%s\"%s: %m", name,
+ r == -ESRCH ? ", skipping tests" : "");
return r == -ESRCH ? EXIT_TEST_SKIP : EXIT_FAILURE;
}
/* skip test if module cannot be loaded */
r = load_module("ipip");
- if (r < 0)
+ if (r < 0) {
+ log_info_errno(r, "Skipping tests: failed to load module 'ipip': %m");
return EXIT_TEST_SKIP;
+ }
- if (getuid() != 0)
+ r = load_module("sit");
+ if (r < 0) {
+ log_info_errno(r, "Skipping tests: failed to load module 'sit': %m");
return EXIT_TEST_SKIP;
+ }
+
+ if (getuid() != 0) {
+ log_info("Skipping tests: not root");
+ return EXIT_TEST_SKIP;
+ }
/* IPIP tunnel */
assert_se(sd_rtnl_message_new_link(rtnl, &m, RTM_NEWLINK, 0) >= 0);
assert_se((m = sd_netlink_message_unref(m)) == NULL);
- r = load_module("sit");
- if (r < 0)
- return EXIT_TEST_SKIP;
-
/* sit */
assert_se(sd_rtnl_message_new_link(rtnl, &n, RTM_NEWLINK, 0) >= 0);
assert_se(n);
uint8_t *p;
#if HAVE_VALGRIND_VALGRIND_H
- if (RUNNING_ON_VALGRIND)
+ if (RUNNING_ON_VALGRIND) {
+ puts("This test cannot run on valgrind, skipping tests.");
return EXIT_TEST_SKIP;
+ }
#endif
#ifdef __SANITIZE_ADDRESS__
+ puts("Address sanitization is enabled, skipping tests.");
return EXIT_TEST_SKIP;
#endif
sigbus_install();