mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
Merge pull request #13082 from ddstreet/minor
Minor fixes in test framework
This commit is contained in:
@@ -6,9 +6,7 @@ RUN_IN_UNPRIVILEGED_CONTAINER=${RUN_IN_UNPRIVILEGED_CONTAINER:-yes}
|
||||
. $TEST_BASE_DIR/test-functions
|
||||
|
||||
test_setup() {
|
||||
create_empty_image
|
||||
mkdir -p $TESTDIR/root
|
||||
mount ${LOOPDEV}p1 $TESTDIR/root
|
||||
create_empty_image_rootdir
|
||||
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
@@ -31,9 +29,6 @@ EOF
|
||||
setup_testsuite
|
||||
)
|
||||
setup_nspawn_root
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
}
|
||||
|
||||
do_test "$@"
|
||||
|
||||
@@ -25,13 +25,11 @@ check_result_qemu() {
|
||||
|
||||
|
||||
test_setup() {
|
||||
create_empty_image
|
||||
create_empty_image_rootdir
|
||||
echo -n test >$TESTDIR/keyfile
|
||||
cryptsetup -q luksFormat --pbkdf pbkdf2 --pbkdf-force-iterations 1000 ${LOOPDEV}p2 $TESTDIR/keyfile
|
||||
cryptsetup luksOpen ${LOOPDEV}p2 varcrypt <$TESTDIR/keyfile
|
||||
mkfs.ext4 -L var /dev/mapper/varcrypt
|
||||
mkdir -p $TESTDIR/root
|
||||
mount ${LOOPDEV}p1 $TESTDIR/root
|
||||
mkdir -p $TESTDIR/root/var
|
||||
mount /dev/mapper/varcrypt $TESTDIR/root/var
|
||||
|
||||
@@ -76,20 +74,23 @@ EOF
|
||||
/dev/mapper/varcrypt /var ext4 defaults 0 1
|
||||
EOF
|
||||
)
|
||||
}
|
||||
|
||||
cleanup_root_var() {
|
||||
ddebug "umount $TESTDIR/root/var"
|
||||
umount $TESTDIR/root/var
|
||||
cryptsetup luksClose /dev/mapper/varcrypt
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
mountpoint $TESTDIR/root/var && umount $TESTDIR/root/var
|
||||
[[ -b /dev/mapper/varcrypt ]] && cryptsetup luksClose /dev/mapper/varcrypt
|
||||
}
|
||||
|
||||
test_cleanup() {
|
||||
[ -d $TESTDIR/root/var ] && mountpoint $TESTDIR/root/var && umount $TESTDIR/root/var
|
||||
[[ -b /dev/mapper/varcrypt ]] && cryptsetup luksClose /dev/mapper/varcrypt
|
||||
umount $TESTDIR/root 2>/dev/null || true
|
||||
[[ $LOOPDEV ]] && losetup -d $LOOPDEV
|
||||
return 0
|
||||
# ignore errors, so cleanup can continue
|
||||
cleanup_root_var || true
|
||||
_test_cleanup
|
||||
}
|
||||
|
||||
test_setup_cleanup() {
|
||||
cleanup_root_var
|
||||
_test_setup_cleanup
|
||||
}
|
||||
|
||||
do_test "$@"
|
||||
|
||||
@@ -6,9 +6,7 @@ TEST_NO_QEMU=1
|
||||
. $TEST_BASE_DIR/test-functions
|
||||
|
||||
test_setup() {
|
||||
create_empty_image
|
||||
mkdir -p $TESTDIR/root
|
||||
mount ${LOOPDEV}p1 $TESTDIR/root
|
||||
create_empty_image_rootdir
|
||||
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
@@ -46,9 +44,6 @@ EOF
|
||||
setup_testsuite
|
||||
)
|
||||
setup_nspawn_root
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
}
|
||||
|
||||
do_test "$@"
|
||||
|
||||
@@ -5,9 +5,7 @@ TEST_DESCRIPTION="Journal-related tests"
|
||||
. $TEST_BASE_DIR/test-functions
|
||||
|
||||
test_setup() {
|
||||
create_empty_image
|
||||
mkdir -p $TESTDIR/root
|
||||
mount ${LOOPDEV}p1 $TESTDIR/root
|
||||
create_empty_image_rootdir
|
||||
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
@@ -48,9 +46,6 @@ EOF
|
||||
setup_testsuite
|
||||
)
|
||||
setup_nspawn_root
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
}
|
||||
|
||||
do_test "$@"
|
||||
|
||||
@@ -5,9 +5,7 @@ TEST_DESCRIPTION="Resource limits-related tests"
|
||||
. $TEST_BASE_DIR/test-functions
|
||||
|
||||
test_setup() {
|
||||
create_empty_image
|
||||
mkdir -p $TESTDIR/root
|
||||
mount ${LOOPDEV}p1 $TESTDIR/root
|
||||
create_empty_image_rootdir
|
||||
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
@@ -44,9 +42,6 @@ EOF
|
||||
setup_testsuite
|
||||
)
|
||||
setup_nspawn_root
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
}
|
||||
|
||||
do_test "$@"
|
||||
|
||||
@@ -16,9 +16,7 @@ SETUP_SELINUX=yes
|
||||
KERNEL_APPEND="$KERNEL_APPEND selinux=1 security=selinux"
|
||||
|
||||
test_setup() {
|
||||
create_empty_image
|
||||
mkdir -p $TESTDIR/root
|
||||
mount ${LOOPDEV}p1 $TESTDIR/root
|
||||
create_empty_image_rootdir
|
||||
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
@@ -100,9 +98,6 @@ EOF
|
||||
ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.service
|
||||
ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
|
||||
ln -s /dev/null $initdir/etc/systemd/system/systemd-resolved.service
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
}
|
||||
|
||||
do_test "$@"
|
||||
|
||||
@@ -8,9 +8,7 @@ TEST_NO_QEMU=1
|
||||
NSPAWN_TIMEOUT=30s
|
||||
|
||||
test_setup() {
|
||||
create_empty_image
|
||||
mkdir -p $TESTDIR/root
|
||||
mount ${LOOPDEV}p1 $TESTDIR/root
|
||||
create_empty_image_rootdir
|
||||
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
@@ -42,9 +40,6 @@ EOF
|
||||
setup_testsuite
|
||||
)
|
||||
setup_nspawn_root
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
}
|
||||
|
||||
do_test "$@"
|
||||
|
||||
@@ -8,9 +8,7 @@ QEMU_TIMEOUT=180
|
||||
FSTYPE=ext4
|
||||
|
||||
test_setup() {
|
||||
create_empty_image
|
||||
mkdir -p $TESTDIR/root
|
||||
mount ${LOOPDEV}p1 $TESTDIR/root
|
||||
create_empty_image_rootdir
|
||||
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
@@ -72,9 +70,6 @@ EOF
|
||||
ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.service
|
||||
ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
|
||||
ln -s /dev/null $initdir/etc/systemd/system/systemd-resolved.service
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
}
|
||||
|
||||
do_test "$@"
|
||||
|
||||
@@ -7,9 +7,7 @@ TEST_NO_NSPAWN=1
|
||||
QEMU_TIMEOUT=180
|
||||
|
||||
test_setup() {
|
||||
create_empty_image
|
||||
mkdir -p $TESTDIR/root
|
||||
mount ${LOOPDEV}p1 $TESTDIR/root
|
||||
create_empty_image_rootdir
|
||||
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
@@ -40,9 +38,6 @@ EOF
|
||||
ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.service
|
||||
ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
|
||||
ln -s /dev/null $initdir/etc/systemd/system/systemd-resolved.service
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
}
|
||||
|
||||
do_test "$@"
|
||||
|
||||
@@ -5,9 +5,7 @@ TEST_DESCRIPTION="https://github.com/systemd/systemd/issues/2467"
|
||||
. $TEST_BASE_DIR/test-functions
|
||||
|
||||
test_setup() {
|
||||
create_empty_image
|
||||
mkdir -p $TESTDIR/root
|
||||
mount ${LOOPDEV}p1 $TESTDIR/root
|
||||
create_empty_image_rootdir
|
||||
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
@@ -54,9 +52,6 @@ EOF
|
||||
ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.service
|
||||
ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
|
||||
ln -s /dev/null $initdir/etc/systemd/system/systemd-resolved.service
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
}
|
||||
|
||||
do_test "$@"
|
||||
|
||||
@@ -6,9 +6,7 @@ TEST_NO_NSPAWN=1
|
||||
. $TEST_BASE_DIR/test-functions
|
||||
|
||||
test_setup() {
|
||||
create_empty_image
|
||||
mkdir -p $TESTDIR/root
|
||||
mount ${LOOPDEV}p1 $TESTDIR/root
|
||||
create_empty_image_rootdir
|
||||
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
@@ -65,9 +63,6 @@ EOF
|
||||
chmod 0755 $initdir/test-fail-on-restart.sh
|
||||
setup_testsuite
|
||||
)
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
}
|
||||
|
||||
do_test "$@"
|
||||
|
||||
@@ -6,9 +6,7 @@ TEST_NO_QEMU=1
|
||||
. $TEST_BASE_DIR/test-functions
|
||||
|
||||
test_setup() {
|
||||
create_empty_image
|
||||
mkdir -p $TESTDIR/root
|
||||
mount ${LOOPDEV}p1 $TESTDIR/root
|
||||
create_empty_image_rootdir
|
||||
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
@@ -93,9 +91,6 @@ EOF
|
||||
)
|
||||
|
||||
setup_nspawn_root
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
}
|
||||
|
||||
do_test "$@"
|
||||
|
||||
@@ -6,9 +6,7 @@ TEST_NO_NSPAWN=1
|
||||
. $TEST_BASE_DIR/test-functions
|
||||
|
||||
test_setup() {
|
||||
create_empty_image
|
||||
mkdir -p $TESTDIR/root
|
||||
mount ${LOOPDEV}p1 $TESTDIR/root
|
||||
create_empty_image_rootdir
|
||||
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
@@ -185,9 +183,6 @@ EOF
|
||||
chmod 0755 $initdir/test-nspawn.sh
|
||||
setup_testsuite
|
||||
)
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
}
|
||||
|
||||
do_test "$@"
|
||||
|
||||
@@ -6,9 +6,7 @@ TEST_NO_NSPAWN=1
|
||||
. $TEST_BASE_DIR/test-functions
|
||||
|
||||
test_setup() {
|
||||
create_empty_image
|
||||
mkdir -p $TESTDIR/root
|
||||
mount ${LOOPDEV}p1 $TESTDIR/root
|
||||
create_empty_image_rootdir
|
||||
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
@@ -81,9 +79,6 @@ chmod +x $initdir/test-machine-id-setup.sh
|
||||
ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.service
|
||||
ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
|
||||
ln -s /dev/null $initdir/etc/systemd/system/systemd-resolved.service
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
}
|
||||
|
||||
do_test "$@"
|
||||
|
||||
@@ -25,8 +25,4 @@ test_setup() {
|
||||
setup_nspawn_root
|
||||
}
|
||||
|
||||
test_cleanup() {
|
||||
return 0
|
||||
}
|
||||
|
||||
do_test "$@"
|
||||
|
||||
@@ -8,8 +8,6 @@ TEST_NO_QEMU=1
|
||||
|
||||
test_setup() {
|
||||
create_empty_image
|
||||
mkdir -p $TESTDIR/root
|
||||
mount ${LOOPDEV}p1 $TESTDIR/root
|
||||
|
||||
# Create what will eventually be our root filesystem onto an overlay
|
||||
(
|
||||
@@ -39,13 +37,6 @@ test_setup() {
|
||||
ln -s /dev/null $initdir/etc/systemd/system/systemd-resolved.service
|
||||
|
||||
setup_nspawn_root
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
}
|
||||
|
||||
test_cleanup() {
|
||||
return 0
|
||||
}
|
||||
|
||||
do_test "$@"
|
||||
|
||||
@@ -7,9 +7,7 @@ TEST_NO_NSPAWN=1
|
||||
QEMU_TIMEOUT=300
|
||||
|
||||
test_setup() {
|
||||
create_empty_image
|
||||
mkdir -p $TESTDIR/root
|
||||
mount ${LOOPDEV}p1 $TESTDIR/root
|
||||
create_empty_image_rootdir
|
||||
|
||||
(
|
||||
LOG_LEVEL=5
|
||||
@@ -39,9 +37,6 @@ EOF
|
||||
|
||||
setup_testsuite
|
||||
)
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
}
|
||||
|
||||
do_test "$@"
|
||||
|
||||
@@ -6,9 +6,7 @@ TEST_DESCRIPTION="FailureAction= operation"
|
||||
QEMU_TIMEOUT=180
|
||||
|
||||
test_setup() {
|
||||
create_empty_image
|
||||
mkdir -p $TESTDIR/root
|
||||
mount ${LOOPDEV}p1 $TESTDIR/root
|
||||
create_empty_image_rootdir
|
||||
|
||||
(
|
||||
LOG_LEVEL=5
|
||||
@@ -39,9 +37,6 @@ EOF
|
||||
ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.service
|
||||
ln -s /dev/null $initdir/etc/systemd/system/systemd-networkd.socket
|
||||
ln -s /dev/null $initdir/etc/systemd/system/systemd-resolved.service
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
}
|
||||
|
||||
do_test "$@"
|
||||
|
||||
@@ -8,9 +8,7 @@ QEMU_TIMEOUT=180
|
||||
UNIFIED_CGROUP_HIERARCHY=yes
|
||||
|
||||
test_setup() {
|
||||
create_empty_image
|
||||
mkdir -p $TESTDIR/root
|
||||
mount ${LOOPDEV}p1 $TESTDIR/root
|
||||
create_empty_image_rootdir
|
||||
|
||||
(
|
||||
LOG_LEVEL=5
|
||||
@@ -41,9 +39,6 @@ EOF
|
||||
|
||||
setup_testsuite
|
||||
)
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
}
|
||||
|
||||
do_test "$@"
|
||||
|
||||
@@ -5,9 +5,7 @@ TEST_DESCRIPTION="test changing main PID"
|
||||
. $TEST_BASE_DIR/test-functions
|
||||
|
||||
test_setup() {
|
||||
create_empty_image
|
||||
mkdir -p $TESTDIR/root
|
||||
mount ${LOOPDEV}p1 $TESTDIR/root
|
||||
create_empty_image_rootdir
|
||||
|
||||
(
|
||||
LOG_LEVEL=5
|
||||
@@ -40,9 +38,6 @@ EOF
|
||||
setup_testsuite
|
||||
)
|
||||
setup_nspawn_root
|
||||
|
||||
ddebug "umount $TESTDIR/root"
|
||||
umount $TESTDIR/root
|
||||
}
|
||||
|
||||
do_test "$@"
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user