test-execute: Skip when /sys is read-only

The test depends on /sys being writable, so let's skip it when /sys
is read-only.
This commit is contained in:
Daan De Meyer
2023-01-25 09:39:13 +01:00
committed by Luca Boccassi
parent d173c9ebb0
commit 34b5977015

View File

@@ -1227,6 +1227,9 @@ int main(int argc, char *argv[]) {
if (r == -ENOMEDIUM)
return log_tests_skipped("cgroupfs not available");
if (path_is_read_only_fs("/sys") > 0)
return log_tests_skipped("/sys is mounted read-only");
_cleanup_free_ char *unit_dir = NULL, *unit_paths = NULL;
assert_se(get_testdata_dir("test-execute/", &unit_dir) >= 0);
assert_se(runtime_dir = setup_fake_runtime_dir());