1
0
mirror of https://github.com/systemd/systemd synced 2025-09-29 08:44:45 +02:00

Compare commits

..

No commits in common. "172e8cf505f868b95a9bf2ee21eec34ce0f464b3" and "b88e59988688a4f50ceb0072e0f583cbb6149f9d" have entirely different histories.

13 changed files with 98 additions and 70 deletions

View File

@ -217,14 +217,16 @@ endif
############################################################ ############################################################
if git.found()
custom_target( custom_target(
'update-man-rules', 'update-man-rules',
output : 'update-man-rules', output : 'update-man-rules',
command : ['sh', '-c', command : ['sh', '-c',
'cd @0@ && '.format(meson.build_root()) + 'cd @0@ && '.format(meson.build_root()) +
'python3 @0@/tools/update-man-rules.py $(find @0@ -wholename "*/man/*.xml") >t && '.format(project_source_root) + 'python3 @0@/tools/update-man-rules.py $(git ls-files ":/man/*.xml") >t && '.format(project_source_root) +
'mv t @0@/rules/meson.build'.format(meson.current_source_dir())], 'mv t @0@/rules/meson.build'.format(meson.current_source_dir())],
depend_files : custom_entities_ent) depend_files : custom_entities_ent)
endif
############################################################ ############################################################

View File

@ -97,7 +97,7 @@ if [ ! -f "$BUILDDIR"/build.ninja ] ; then
fi fi
cd "$BUILDDIR" cd "$BUILDDIR"
ninja "$@" ninja
if [ "$WITH_TESTS" = 1 ] ; then if [ "$WITH_TESTS" = 1 ] ; then
for id in 1 2 3; do for id in 1 2 3; do
getent group $id > /dev/null || groupadd -g $id testgroup$id getent group $id > /dev/null || groupadd -g $id testgroup$id

View File

@ -745,4 +745,4 @@ global:
sd_event_source_set_ratelimit; sd_event_source_set_ratelimit;
sd_event_source_get_ratelimit; sd_event_source_get_ratelimit;
sd_event_source_is_ratelimited; sd_event_source_is_ratelimited;
} LIBSYSTEMD_247; } LIBSYSTEMD_246;

View File

@ -135,8 +135,3 @@ the Github CI status.
To add new dependencies or new binaries to the packages used during the tests, To add new dependencies or new binaries to the packages used during the tests,
a merge request can be sent to: https://salsa.debian.org/systemd-team/systemd a merge request can be sent to: https://salsa.debian.org/systemd-team/systemd
targeting the 'upstream-ci' branch. targeting the 'upstream-ci' branch.
The cloud-side infrastructure, that is hooked into the Github interface, is
located at:
https://git.launchpad.net/autopkgtest-cloud/

View File

@ -7,10 +7,19 @@ TEST_REQUIRE_INSTALL_TESTS=0
. $TEST_BASE_DIR/test-functions . $TEST_BASE_DIR/test-functions
test_append_files() { test_create_image() {
create_empty_image_rootdir
# Create what will eventually be our root filesystem onto an overlay
(
LOG_LEVEL=5
setup_basic_environment
mask_supporting_services
# install tests manually so the test is functional even when -Dinstall-tests=false # install tests manually so the test is functional even when -Dinstall-tests=false
mkdir -p $1/usr/lib/systemd/tests/testdata/units/ mkdir -p $initdir/usr/lib/systemd/tests/testdata/units/
cp -v $(dirname $0)/../units/{testsuite-01,end}.service $1/usr/lib/systemd/tests/testdata/units/ cp -v $(dirname $0)/../units/{testsuite-01,end}.service $initdir/usr/lib/systemd/tests/testdata/units/
)
} }
do_test "$@" 01 do_test "$@" 01

View File

@ -16,27 +16,34 @@ test -f /usr/share/selinux/devel/include/system/systemd.if || exit 0
SETUP_SELINUX=yes SETUP_SELINUX=yes
KERNEL_APPEND="$KERNEL_APPEND selinux=1 security=selinux" KERNEL_APPEND="$KERNEL_APPEND selinux=1 security=selinux"
test_append_files() { test_create_image() {
create_empty_image_rootdir
# Create what will eventually be our root filesystem onto an overlay
( (
setup_selinux LOG_LEVEL=5
setup_basic_environment
mask_supporting_services
local _modules_dir=/var/lib/selinux local _modules_dir=/var/lib/selinux
rm -rf $1/$_modules_dir rm -rf $initdir/$_modules_dir
if ! cp -ar $_modules_dir $1/$_modules_dir; then if ! cp -ar $_modules_dir $initdir/$_modules_dir; then
dfatal "Failed to copy $_modules_dir" dfatal "Failed to copy $_modules_dir"
exit 1 exit 1
fi fi
local _policy_headers_dir=/usr/share/selinux/devel local _policy_headers_dir=/usr/share/selinux/devel
rm -rf $1/$_policy_headers_dir rm -rf $initdir/$_policy_headers_dir
inst_dir /usr/share/selinux inst_dir /usr/share/selinux
if ! cp -ar $_policy_headers_dir $1/$_policy_headers_dir; then if ! cp -ar $_policy_headers_dir $initdir/$_policy_headers_dir; then
dfatal "Failed to copy $_policy_headers_dir" dfatal "Failed to copy $_policy_headers_dir"
exit 1 exit 1
fi fi
mkdir $1/systemd-test-module mkdir $initdir/systemd-test-module
cp systemd_test.te $1/systemd-test-module cp systemd_test.te $initdir/systemd-test-module
cp systemd_test.if $1/systemd-test-module cp systemd_test.if $initdir/systemd-test-module
dracut_install -o sesearch dracut_install -o sesearch
dracut_install runcon dracut_install runcon
dracut_install checkmodule semodule semodule_package m4 make load_policy sefcontext_compile dracut_install checkmodule semodule semodule_package m4 make load_policy sefcontext_compile

View File

@ -7,6 +7,16 @@ TEST_NO_NSPAWN=1
. $TEST_BASE_DIR/test-functions . $TEST_BASE_DIR/test-functions
QEMU_TIMEOUT=300 QEMU_TIMEOUT=300
FSTYPE=ext4 FSTYPE=ext4
TEST_FORCE_NEWIMAGE=1
test_create_image() {
create_empty_image_rootdir
# Create what will eventually be our root filesystem onto an overlay
(
LOG_LEVEL=5
setup_basic_environment
)
mask_supporting_services
}
do_test "$@" 08 do_test "$@" 08

View File

@ -6,10 +6,17 @@ TEST_NO_NSPAWN=1
. $TEST_BASE_DIR/test-functions . $TEST_BASE_DIR/test-functions
test_append_files() { test_create_image() {
create_empty_image_rootdir
# Create what will eventually be our root filesystem onto an overlay
( (
../create-busybox-container $1/testsuite-13.nc-container LOG_LEVEL=5
initdir="$1/testsuite-13.nc-container" dracut_install nc ip md5sum setup_basic_environment
mask_supporting_services
../create-busybox-container $initdir/testsuite-13.nc-container
initdir="$initdir/testsuite-13.nc-container" dracut_install nc ip md5sum
) )
} }

View File

@ -6,8 +6,16 @@ TEST_NO_NSPAWN=1
. $TEST_BASE_DIR/test-functions . $TEST_BASE_DIR/test-functions
test_append_files() { test_create_image() {
printf "556f48e837bc4424a710fa2e2c9d3e3c\ne3d\n" >$1/etc/machine-id create_empty_image_rootdir
# Create what will eventually be our root filesystem onto an overlay
(
LOG_LEVEL=5
setup_basic_environment
mask_supporting_services
printf "556f48e837bc4424a710fa2e2c9d3e3c\ne3d\n" >$initdir/etc/machine-id
)
} }
do_test "$@" 14 do_test "$@" 14

View File

@ -3,7 +3,6 @@ set -e
TEST_DESCRIPTION="cryptsetup systemd setup" TEST_DESCRIPTION="cryptsetup systemd setup"
IMAGE_NAME="cryptsetup" IMAGE_NAME="cryptsetup"
TEST_NO_NSPAWN=1 TEST_NO_NSPAWN=1
TEST_FORCE_NEWIMAGE=1
. $TEST_BASE_DIR/test-functions . $TEST_BASE_DIR/test-functions

View File

@ -7,8 +7,15 @@ TEST_NO_NSPAWN=1
. $TEST_BASE_DIR/test-functions . $TEST_BASE_DIR/test-functions
QEMU_TIMEOUT=300 QEMU_TIMEOUT=300
test_append_files() { test_create_image() {
create_empty_image_rootdir
# Create what will eventually be our root filesystem onto an overlay
( (
LOG_LEVEL=5
setup_basic_environment
mask_supporting_services
instmods dummy instmods dummy
generate_module_dependencies generate_module_dependencies
) )

View File

@ -13,8 +13,16 @@ command -v veritysetup >/dev/null 2>&1 || exit 0
command -v sfdisk >/dev/null 2>&1 || exit 0 command -v sfdisk >/dev/null 2>&1 || exit 0
# Need loop devices for systemd-dissect # Need loop devices for systemd-dissect
test_append_files() { test_create_image() {
create_empty_image_rootdir
# Create what will eventually be our root filesystem onto an overlay
# If some pieces are missing from the host, skip rather than fail
( (
LOG_LEVEL=5
setup_basic_environment
mask_supporting_services
instmods loop =block instmods loop =block
instmods squashfs =squashfs instmods squashfs =squashfs
instmods dm_verity =md instmods dm_verity =md

View File

@ -17,11 +17,6 @@ TIMED_OUT= # will be 1 after run_* if *_TIMEOUT is set and test timed out
UNIFIED_CGROUP_HIERARCHY="${UNIFIED_CGROUP_HIERARCHY:-default}" UNIFIED_CGROUP_HIERARCHY="${UNIFIED_CGROUP_HIERARCHY:-default}"
EFI_MOUNT="${EFI_MOUNT:-$(bootctl -x 2>/dev/null || echo /boot)}" EFI_MOUNT="${EFI_MOUNT:-$(bootctl -x 2>/dev/null || echo /boot)}"
QEMU_MEM="${QEMU_MEM:-512M}" QEMU_MEM="${QEMU_MEM:-512M}"
# Note that defining a different IMAGE_NAME in a test setup script will only result
# in default.img being copied and renamed. It can then be extended by defining
# a test_append_files() function. The $1 parameter will be the root directory.
# To force creating a new image from scratch (eg: to encrypt it), also define
# TEST_FORCE_NEWIMAGE=1 in the test setup script.
IMAGE_NAME=${IMAGE_NAME:-default} IMAGE_NAME=${IMAGE_NAME:-default}
TEST_REQUIRE_INSTALL_TESTS="${TEST_REQUIRE_INSTALL_TESTS:-1}" TEST_REQUIRE_INSTALL_TESTS="${TEST_REQUIRE_INSTALL_TESTS:-1}"
TEST_PARALLELIZE="${TEST_PARALLELIZE:-0}" TEST_PARALLELIZE="${TEST_PARALLELIZE:-0}"
@ -2070,43 +2065,24 @@ test_setup() {
mount_initdir mount_initdir
else else
if [ ! -e "$IMAGE_PUBLIC" ]; then if [ ! -e "$IMAGE_PUBLIC" ]; then
# default.img is the base that every test uses and optionally appends to
if [ ! -e "${IMAGESTATEDIR}/default.img" ] || [ -n "${TEST_FORCE_NEWIMAGE}" ]; then
# Create the backing public image, but then completely unmount # Create the backing public image, but then completely unmount
# it and drop the loopback device responsible for it, since we're # it and drop the loopback device responsible for it, since we're
# going to symlink/copy the image and mount it again from # going to symlink/copy the image and mount it again from
# elsewhere. # elsewhere.
local image_old=${IMAGE_PUBLIC}
if [ -z "${TEST_FORCE_NEWIMAGE}" ]; then
IMAGE_PUBLIC="${IMAGESTATEDIR}/default.img"
fi
test_create_image test_create_image
test_setup_cleanup test_setup_cleanup
umount_loopback umount_loopback
cleanup_loopdev cleanup_loopdev
IMAGE_PUBLIC="${image_old}"
fi
if [ "${IMAGE_NAME}" != "default" ] && [ -z "${TEST_FORCE_NEWIMAGE}" ]; then
cp -v "$(realpath "${IMAGESTATEDIR}/default.img")" "$IMAGE_PUBLIC"
fi
fi
local hook_defined=1
if declare -f -F test_append_files > /dev/null; then
hook_defined=$?
fi fi
echo "Reusing existing cached image $IMAGE_PUBLIC → $(realpath $IMAGE_PUBLIC)" echo "Reusing existing cached image $IMAGE_PUBLIC → $(realpath $IMAGE_PUBLIC)"
if [ ${TEST_PARALLELIZE} -ne 0 ] || [ ${hook_defined} -eq 0 ]; then if [ ${TEST_PARALLELIZE} -ne 0 ]; then
cp -v "$(realpath $IMAGE_PUBLIC)" "$IMAGE_PRIVATE" cp -v "$(realpath $IMAGE_PUBLIC)" "$IMAGE_PRIVATE"
else else
ln -sv "$(realpath $IMAGE_PUBLIC)" "$IMAGE_PRIVATE" ln -sv "$(realpath $IMAGE_PUBLIC)" "$IMAGE_PRIVATE"
fi fi
mount_initdir mount_initdir
if [ ${hook_defined} -eq 0 ]; then
test_append_files "$initdir"
fi
fi fi
setup_nspawn_root setup_nspawn_root