diff options
Diffstat (limited to 'test/test-functions')
-rw-r--r-- | test/test-functions | 104 |
1 files changed, 30 insertions, 74 deletions
diff --git a/test/test-functions b/test/test-functions index be6eb1d..69a0e58 100644 --- a/test/test-functions +++ b/test/test-functions @@ -208,7 +208,7 @@ BASICTOOLS=( mount mountpoint mv - nc + ncat nproc ping pkill @@ -570,7 +570,7 @@ run_qemu() { ${TEST_MATCH_TESTCASE:+"systemd.setenv=TEST_MATCH_TESTCASE=$TEST_MATCH_TESTCASE"} ) - if ! get_bool "$INTERACTIVE_DEBUG" && ! get_bool "$TEST_SKIP_SHUTDOWN"; then + if ! get_bool "$TEST_SHELL" && ! get_bool "$TEST_SKIP_SHUTDOWN"; then kernel_params+=( "panic=1" "softlockup_panic=1" @@ -664,7 +664,7 @@ run_nspawn() { ${TEST_MATCH_TESTCASE:+"systemd.setenv=TEST_MATCH_TESTCASE=$TEST_MATCH_TESTCASE"} ) - if get_bool "$INTERACTIVE_DEBUG"; then + if get_bool "$TEST_SHELL"; then nspawn_options+=("--console=interactive") elif ! get_bool "$TEST_SKIP_SHUTDOWN"; then kernel_params+=("systemd.wants=end.service") @@ -1453,10 +1453,31 @@ install_missing_libraries() { [[ -e "$libgcc_s" ]] && inst_library "$libgcc_s" done < <(ldconfig -p | awk '/\/libgcc_s.so.1$/ { print $4 }') - local lib path + local lib path libs # A number of dependencies is now optional via dlopen, so the install # script will not pick them up, since it looks at linkage. - for lib in libcryptsetup libidn libidn2 pwquality libqrencode tss2-esys tss2-rc tss2-mu tss2-tcti-device libfido2 libbpf libelf libdw xkbcommon p11-kit-1 libarchive libgcrypt libkmod; do + libs=( + libarchive + libbpf + libcryptsetup + libdw + libelf + libfido2 + libgcrypt + libidn + libidn2 + libip4tc + libkmod + libqrencode + p11-kit-1 + pwquality + tss2-esys + tss2-mu + tss2-rc + tss2-tcti-device + xkbcommon + ) + for lib in "${libs[@]}"; do ddebug "Searching for $lib via pkg-config" if pkg-config --exists "$lib"; then path="$(pkg-config --variable=libdir "$lib")" @@ -1860,74 +1881,6 @@ check_result_qemu() { return $ret } -check_result_nspawn_unittests() { - local workspace="${1:?}" - local ret=1 - - [[ -e "$workspace/testok" ]] && ret=0 - - if [[ -s "$workspace/failed" ]]; then - ret=$((ret + 1)) - echo "=== Failed test log ===" - cat "$workspace/failed" - else - if [[ -s "$workspace/skipped" ]]; then - echo "=== Skipped test log ==" - cat "$workspace/skipped" - # We might have only skipped tests - that should not fail the job - ret=0 - fi - if [[ -s "$workspace/testok" ]]; then - echo "=== Passed tests ===" - cat "$workspace/testok" - fi - fi - - get_bool "${TIMED_OUT:=}" && ret=1 - check_coverage_reports "$workspace" || ret=5 - - save_journal "$workspace/var/log/journal" $ret - echo "${JOURNAL_LIST:-"No journals were saved"}" - - _umount_dir "${initdir:?}" - - return $ret -} - -check_result_qemu_unittests() { - local ret=1 - - mount_initdir - [[ -e "${initdir:?}/testok" ]] && ret=0 - - if [[ -s "$initdir/failed" ]]; then - ret=$((ret + 1)) - echo "=== Failed test log ===" - cat "$initdir/failed" - else - if [[ -s "$initdir/skipped" ]]; then - echo "=== Skipped test log ==" - cat "$initdir/skipped" - # We might have only skipped tests - that should not fail the job - ret=0 - fi - if [[ -s "$initdir/testok" ]]; then - echo "=== Passed tests ===" - cat "$initdir/testok" - fi - fi - - get_bool "${TIMED_OUT:=}" && ret=1 - check_coverage_reports "$initdir" || ret=5 - - save_journal "$initdir/var/log/journal" $ret - echo "${JOURNAL_LIST:-"No journals were saved"}" - - _umount_dir "$initdir" - - return $ret -} - create_rc_local() { dinfo "Create rc.local" mkdir -p "${initdir:?}/etc/rc.d" @@ -2015,6 +1968,7 @@ EOF install_config_files() { dinfo "Install config files" inst /etc/sysconfig/init || : + inst /etc/hosts inst /etc/passwd inst /etc/shadow inst_any /etc/login.defs /usr/etc/login.defs @@ -2051,7 +2005,7 @@ install_debug_tools() { dinfo "Install debug tools" image_install -o "${DEBUGTOOLS[@]}" - if get_bool "$INTERACTIVE_DEBUG"; then + if get_bool "$TEST_SHELL"; then # Set default TERM from vt220 to linux, so at least basic key shortcuts work local getty_override="${initdir:?}/etc/systemd/system/serial-getty@.service.d" mkdir -p "$getty_override" @@ -3027,6 +2981,8 @@ inst_recursive() { while read -r item; do if [[ -d "$item" ]]; then inst_dir "$item" + elif [[ -L "$item" ]]; then + inst_symlink "$item" elif [[ -f "$item" ]]; then inst_simple "$item" fi |