summaryrefslogtreecommitdiff
path: root/src/nspawn/test-nspawn-util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nspawn/test-nspawn-util.c')
-rw-r--r--src/nspawn/test-nspawn-util.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/nspawn/test-nspawn-util.c b/src/nspawn/test-nspawn-util.c
new file mode 100644
index 0000000000..7d55db8934
--- /dev/null
+++ b/src/nspawn/test-nspawn-util.c
@@ -0,0 +1,19 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+
+#include "nspawn-util.h"
+#include "string-util.h"
+#include "tests.h"
+
+TEST(systemd_installation_has_version) {
+ static const unsigned versions[] = {0, 231, PROJECT_VERSION, 999};
+ int r;
+
+ for (size_t i = 0; i < ELEMENTSOF(versions); i++) {
+ r = systemd_installation_has_version(saved_argv[1], versions[i]);
+ assert_se(r >= 0);
+ log_info("%s has systemd >= %u: %s",
+ saved_argv[1] ?: "Current installation", versions[i], yes_no(r));
+ }
+}
+
+DEFINE_TEST_MAIN(LOG_DEBUG);