- systemd-testsuite: move the integration tests in a dedicated sub directory.

OBS-URL: https://build.opensuse.org/package/show/Base:System/systemd?expand=0&rev=1343
This commit is contained in:
Franck Bui 2023-01-26 16:14:53 +00:00 committed by Git OBS Bridge
parent b630827444
commit 97cb083365
2 changed files with 27 additions and 18 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Thu Jan 26 16:13:43 UTC 2023 - Franck Bui <fbui@suse.com>
- systemd-testsuite: move the integration tests in a dedicated sub directory.
-------------------------------------------------------------------
Thu Jan 26 14:02:11 UTC 2023 - Franck Bui <fbui@suse.com>

View File

@ -557,24 +557,24 @@ Requires: systemd-portable
Requires: xz
%description testsuite
This package contains the unit tests as well as the extended
testsuite. The unit tests are used to check various internal functions
used by systemd whereas the extended testsuite is used to test various
functionalities of systemd and all its components.
This package contains the unit tests as well as the extended testsuite. The unit
tests are used to check various internal functions used by systemd whereas the
extended testsuite is used to test various functionalities of systemd and all
its components.
Note that the extended testsuite only works with UID=0.
Note that you need root privileges to run the extended testsuite.
Run the following python script to run all unit tests at once:
$ %{_testsuitedir}/run-unit-tests.py
To run the full extended testsuite do the following:
$ NO_BUILD=1 TEST_NESTED_VM=1 %{_testsuitedir}/test/run-integration-tests.sh
$ NO_BUILD=1 TEST_NESTED_VM=1 %{_testsuitedir}/integration-tests/run-integration-tests.sh
Or to run one specific integration test:
$ NO_BUILD=1 TEST_NESTED_VM=1 make -C %{_testsuitedir}/test/TEST-01-BASIC clean setup run
$ NO_BUILD=1 TEST_NESTED_VM=1 make -C %{_testsuitedir}/integration-tests/TEST-01-BASIC clean setup run
For more details on the available options to run the extended
testsuite, please refer to %{_testsuitedir}/test/README.testsuite.
For more details on the available options to run the extended testsuite, please
refer to %{_testsuitedir}/integration-tests/README.testsuite.
%endif
%if %{with experimental}
@ -942,14 +942,18 @@ rm -f %{buildroot}%{_unitdir}/systemd-journald-audit.socket
rm -f %{buildroot}%{_unitdir}/sockets.target.wants/systemd-journald-audit.socket
%if %{with testsuite}
cp -a test %{buildroot}%{_testsuitedir}/
# When the tests are installed, the effective testdata directory is in
# %{_testsuitedir}, the other one, which is actually a symlink, is only useful
# when the tests are run directly from the source.
rm %{buildroot}%{_testsuitedir}/test/testdata
# kbd-model-map became a dangling symlink, drop it.
rm %{buildroot}%{_testsuitedir}/test/test-keymap-util/kbd-model-map
find %{buildroot}%{_testsuitedir}/ -name .git\* -exec rm -fr {} \;
# -Dinstall_test took care of installing the unit tests only (those in
# src/tests) and testdata directory. Here we copy the integration tests
# including also all related scripts used to prepare and run the integration
# tests in dedicated VMs. During the copy, all symlinks are replaced by the
# files they point to making sure we won't try to embed dangling symlinks.
mkdir -p %{buildroot}%{_testsuitedir}/integration-tests
tar -cO \
--dereference \
--exclude=testdata \
--exclude-vcs \
--exclude-vcs-ignores \
-C test/ . | tar -xC %{buildroot}%{_testsuitedir}/integration-tests
%endif
%if %{without bootstrap}
@ -1387,7 +1391,7 @@ fi
%if %{with testsuite}
%files testsuite
%defattr(-,root,root)
%doc %{_testsuitedir}/test/README.testsuite
%doc %{_testsuitedir}/integration-tests/README.testsuite
%{_testsuitedir}
%endif