factory_etcdir = $(datadir)/factory/etc
factory_pamdir = $(datadir)/factory/etc/pam.d
bootlibdir = $(prefix)/lib/systemd/boot/efi
+testsdir = $(prefix)/lib/systemd/tests
# And these are the special ones for /
rootprefix=@rootprefix@
dist_rootlibexec_DATA =
tests=
manual_tests =
+TEST_DATA_FILES =
TEST_EXTENSIONS = .py
PY_LOG_COMPILER = $(PYTHON)
DISABLE_HARD_ERRORS = yes
-DLIBDIR=\"$(libdir)\" \
-DROOTLIBDIR=\"$(rootlibdir)\" \
-DROOTLIBEXECDIR=\"$(rootlibexecdir)\" \
- -DTEST_DIR=\"$(abs_top_srcdir)/test\" \
-I $(top_srcdir)/src \
-I $(top_builddir)/src/basic \
-I $(top_srcdir)/src/basic \
-I $(top_srcdir)/src/libsystemd/sd-device \
-I $(top_srcdir)/src/libsystemd/sd-id128 \
-I $(top_srcdir)/src/libsystemd-network \
+ -DABS_SRC_DIR=\"$(abs_top_srcdir)\" \
+ -DABS_BUILD_DIR=\"$(abs_top_builddir)\" \
$(OUR_CPPFLAGS)
AM_CFLAGS = $(OUR_CFLAGS)
src/basic/format-util.h \
src/basic/nss-util.h \
src/basic/khash.h \
- src/basic/khash.c
+ src/basic/khash.c \
+ src/basic/journal-importer.h \
+ src/basic/journal-importer.c
nodist_libbasic_la_SOURCES = \
src/basic/errno-from-name.h \
test-rlimit-util \
test-signal-util \
test-selinux \
- test-sizeof
+ test-sizeof \
+ test-journal-importer
if HAVE_ACL
tests += \
test-seccomp
endif
-EXTRA_DIST += \
+TEST_DATA_FILES += \
test/a.service \
test/basic.target \
test/b.service \
test/test-execute/exec-restrict-namespaces-yes.service \
test/test-execute/exec-restrict-namespaces-mnt.service \
test/test-execute/exec-restrict-namespaces-mnt-blacklist.service \
+ test/test-execute/exec-read-only-path-succeed.service \
+ test/test-execute/exec-privatedevices-yes-capability-sys-rawio.service \
+ test/test-execute/exec-privatedevices-no-capability-sys-rawio.service \
test/bus-policy/hello.conf \
test/bus-policy/methods.conf \
test/bus-policy/ownerships.conf \
test_arphrd_list_LDADD = \
libsystemd-shared.la
+test_journal_importer_SOURCES = \
+ src/test/test-journal-importer.c
+
+test_journal_importer_LDADD = \
+ libsystemd-shared.la
+
+TEST_DATA_FILES += \
+ test/journal-data/journal-1.txt \
+ test/journal-data/journal-2.txt
+
# ------------------------------------------------------------------------------
## .PHONY so it always rebuilds it
.PHONY: coverage lcov-run lcov-report coverage-sync
test/sys
endif
-# packed sysfs test tree
-test/sys: test/sys.tar.xz
- -rm -rf test/sys
+# sysfs test tree
+test/sys: test/sys-script.py
+ -rm -rf $@
$(AM_V_at)$(MKDIR_P) $(dir $@)
- $(AM_V_GEN)tar -C test/ -xJf $(top_srcdir)/test/sys.tar.xz
- -touch test/sys
+ $(AM_V_GEN)$(top_srcdir)/test/sys-script.py $(dir $@)
+ -touch $@
test-sys-distclean:
-rm -rf test/sys
DISTCLEAN_LOCAL_HOOKS += test-sys-distclean
EXTRA_DIST += \
- test/sys.tar.xz \
+ test/sys-script.py \
test/udev-test.pl \
test/hwdb-test.sh \
test/rule-syntax-check.py \
test_dns_packet_CPPFLAGS = \
$(AM_CPPFLAGS) \
- -DRESOLVE_TEST_DIR=\"$(abs_top_srcdir)/src/resolve/test-data\"
+ -I $(top_srcdir)/src/test
test_dns_packet_CFLAGS = \
$(AM_CFLAGS) \
$(GCRYPT_LIBS) \
-lm
-EXTRA_DIST += \
- src/resolve/test-data/_openpgpkey.fedoraproject.org.pkts \
- src/resolve/test-data/fedoraproject.org.pkts \
- src/resolve/test-data/gandi.net.pkts \
- src/resolve/test-data/google.com.pkts \
- src/resolve/test-data/root.pkts \
- src/resolve/test-data/sw1a1aa-sw1a2aa-sw1a2ab-sw1a2ac.find.me.uk.pkts \
- src/resolve/test-data/teamits.com.pkts \
- src/resolve/test-data/zbyszek@fedoraproject.org.pkts \
- src/resolve/test-data/_443._tcp.fedoraproject.org.pkts \
- src/resolve/test-data/kyhwana.org.pkts \
- src/resolve/test-data/fake-caa.pkts
+TEST_DATA_FILES += \
+ test/test-resolve/_openpgpkey.fedoraproject.org.pkts \
+ test/test-resolve/fedoraproject.org.pkts \
+ test/test-resolve/gandi.net.pkts \
+ test/test-resolve/google.com.pkts \
+ test/test-resolve/root.pkts \
+ test/test-resolve/sw1a1aa-sw1a2aa-sw1a2ab-sw1a2ac.find.me.uk.pkts \
+ test/test-resolve/teamits.com.pkts \
+ test/test-resolve/zbyszek@fedoraproject.org.pkts \
+ test/test-resolve/_443._tcp.fedoraproject.org.pkts \
+ test/test-resolve/kyhwana.org.pkts \
+ test/test-resolve/fake-caa.pkts
+
+EXTRA_DIST += $(TEST_DATA_FILES)
test_dnssec_SOURCES = \
src/resolve/test-dnssec.c \
src/network/networkd-link.c \
src/network/networkd-link-bus.c \
src/network/networkd-ipv4ll.c \
+ src/network/networkd-ipv6-proxy-ndp.h \
+ src/network/networkd-ipv6-proxy-ndp.c \
src/network/networkd-dhcp4.c \
src/network/networkd-dhcp6.c \
src/network/networkd-ndisc.h \
SED_PROCESS = \
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
$(SED) $(subst '|,-e 's|@,$(subst =,\@|,$(subst |',|g',$(substitutions)))) \
+ -e '/^\#\# /d' \
< $< > $@
units/%: units/%.in
if $(LIBTOOL) --mode=execute file $$f | grep -q shell; then \
echo -e "$${x}Skipping non-binary $$f"; else \
echo -e "$${x}Running $$f"; \
- $(LIBTOOL) --mode=execute valgrind -q --leak-check=full --max-stackframe=5242880 --error-exitcode=55 $(builddir)/$$f ; fi; \
+ $(AM_TESTS_ENVIRONMENT) $(LIBTOOL) --mode=execute valgrind -q --leak-check=full --max-stackframe=5242880 --error-exitcode=55 $(builddir)/$$f ; fi; \
x="\n\n"; \
done
test-libsystemd-sym \
test-libudev-sym
+.PHONY: install-tests
+install-tests: $(tests) $(TEST_DATA_FILES)
+ for f in $(tests); do \
+ if [ -x $(top_builddir)/.libs/$$f ]; then \
+ install -D -m 755 $(top_builddir)/.libs/$$f $(DESTDIR)/$(testsdir)/$$f; \
+ else \
+ install -D -m 755 $(top_builddir)/$$f $(DESTDIR)/$(testsdir)/$$f; \
+ fi; \
+ done
+ for f in $(TEST_DATA_FILES); do \
+ install -D -m 644 $(top_srcdir)/$$f $(DESTDIR)/$(testsdir)/testdata/$${f#test/}; \
+ done
+
+
.PHONY: cppcheck
cppcheck:
cppcheck --enable=all -q $(top_srcdir)