- 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> Thu Jan 26 14:02:11 UTC 2023 - Franck Bui <fbui@suse.com>

View File

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