From 7cda69caeb5b2ee61d41d28b611c47ec6127847f Mon Sep 17 00:00:00 2001 From: Quentin Monnet Date: Tue, 30 Nov 2021 00:16:31 +0000 Subject: [PATCH] ci: add folding markers to avoid getting output out of sections MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move commands to existing sections, or add markers for new sections when no surrounding existing section is relevant. This is to avoid having logs outside of subsection for the “vmtest” step of the GitHub action. --- travis-ci/vmtest/run.sh | 14 ++++++++------ travis-ci/vmtest/run_vmtest.sh | 6 ++++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/travis-ci/vmtest/run.sh b/travis-ci/vmtest/run.sh index 8d65eb2..c0e9e7c 100755 --- a/travis-ci/vmtest/run.sh +++ b/travis-ci/vmtest/run.sh @@ -301,11 +301,11 @@ if [[ $SKIPIMG -eq 0 && ! -v ROOTFSVERSION ]]; then ROOTFSVERSION="$(newest_rootfs_version)" fi +travis_fold start vmlinux_setup "Preparing Linux image" + echo "Kernel release: $KERNELRELEASE" >&2 echo -travis_fold start vmlinux_setup "Preparing Linux image" - if (( SKIPIMG )); then echo "Not extracting root filesystem" >&2 else @@ -475,12 +475,17 @@ set -eux echo 'Running setup commands' ${setup_envvars} -set +e; ${setup_cmd}; exitstatus=\$?; set -e +set +e +${setup_cmd}; exitstatus=\$? +echo -e '$(travis_fold start collect_status "Collect status")' +set -e # If setup command did not write its exit status to /exitstatus, do it now if [[ -s /exitstatus ]]; then echo setup_cmd:\$exitstatus > /exitstatus fi chmod 644 /exitstatus +echo -e '$(travis_fold end collect_status)' +echo -e '$(travis_fold start shutdown Shutdown)' HERE fi @@ -488,12 +493,9 @@ guestfish --remote \ upload "$tmp" /etc/rcS.d/S50-run-tests : \ chmod 755 /etc/rcS.d/S50-run-tests -fold_shutdown="$(travis_fold start shutdown Shutdown)" cat <"$tmp" #!/bin/sh -echo -e '${fold_shutdown}' - poweroff HERE guestfish --remote \ diff --git a/travis-ci/vmtest/run_vmtest.sh b/travis-ci/vmtest/run_vmtest.sh index 8bf501a..a846d46 100755 --- a/travis-ci/vmtest/run_vmtest.sh +++ b/travis-ci/vmtest/run_vmtest.sh @@ -35,11 +35,13 @@ else ${VMTEST_ROOT}/prepare_selftests.sh fi +travis_fold start adduser_to_kvm "Add user ${USER}" +sudo adduser "${USER}" kvm +travis_fold stop adduser_to_kvm + # Escape whitespace characters. setup_cmd=$(sed 's/\([[:space:]]\)/\\\1/g' <<< "${VMTEST_SETUPCMD}") -sudo adduser "${USER}" kvm - if [[ "${KERNEL}" = 'LATEST' ]]; then if [[ "$CHECKOUT_KERNEL" == "1" ]]; then sudo -E sudo -E -u "${USER}" "${VMTEST_ROOT}/run.sh" -b travis-ci/vmtest/bpf-next -o -d ~ -s "${setup_cmd}" ~/root.img