ci: run tmt e2e tests on GitHub-hosted runners with nested KVM#29
ci: run tmt e2e tests on GitHub-hosted runners with nested KVM#29coiby wants to merge 10 commits into
Conversation
There was a problem hiding this comment.
Code Review
This pull request refactors the test scripts to standardize log file paths using a dynamic $XTRACE_LOG variable and updates the target kernel version in the auto-bisect test. However, using the local $XTRACE_LOG path inside a remote SSH command in tests/kab_criu/test.sh will fail because the directory structure does not exist on the remote host; you should use a remote log path and then copy it back via scp. Additionally, several variables like $SERVER_SSH_KEY and $KAB_SCRIPT should be double-quoted to prevent word splitting and globbing issues.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
| XTRACE_LOG=$TMT_PLAN_DATA/test.log | ||
| # 2. Start kab.sh on Target if not already running and no checkpoint exists | ||
| if ! ssh_cmd "pgrep -f $KAB_SCRIPT" >/dev/null 2>&1 && ! ssh_cmd "ls /var/local/kernel-auto-bisect/dump/core-*.img" >/dev/null 2>&1; then | ||
| echo "Starting kab.sh..." | ||
| ssh_cmd "setsid bash -x $KAB_SCRIPT </dev/null &>/root/test.log &" | ||
| ssh_cmd "setsid bash -x $KAB_SCRIPT </dev/null &>$XTRACE_LOG &" | ||
| fi |
There was a problem hiding this comment.
The $XTRACE_LOG variable contains a local path on the client (e.g., /var/tmp/tmt/...). Since this command is executed on the remote target host via ssh_cmd, the remote shell will attempt to redirect output to this local path. Because the directory structure does not exist on the remote host, the redirection will fail, preventing kab.sh from starting or logging correctly.
Instead, use a standard remote path (like /root/test.log) for execution on the target host, and then copy it back to the local $XTRACE_LOG path.
| XTRACE_LOG=$TMT_PLAN_DATA/test.log | |
| # 2. Start kab.sh on Target if not already running and no checkpoint exists | |
| if ! ssh_cmd "pgrep -f $KAB_SCRIPT" >/dev/null 2>&1 && ! ssh_cmd "ls /var/local/kernel-auto-bisect/dump/core-*.img" >/dev/null 2>&1; then | |
| echo "Starting kab.sh..." | |
| ssh_cmd "setsid bash -x $KAB_SCRIPT </dev/null &>/root/test.log &" | |
| ssh_cmd "setsid bash -x $KAB_SCRIPT </dev/null &>$XTRACE_LOG &" | |
| fi | |
| REMOTE_LOG=/root/test.log | |
| XTRACE_LOG=$TMT_PLAN_DATA/test.log | |
| # 2. Start kab.sh on Target if not already running and no checkpoint exists | |
| if ! ssh_cmd "pgrep -f $KAB_SCRIPT" >/dev/null 2>&1 && ! ssh_cmd "ls /var/local/kernel-auto-bisect/dump/core-*.img" >/dev/null 2>&1; then | |
| echo "Starting kab.sh..." | |
| ssh_cmd "setsid bash -x $KAB_SCRIPT </dev/null &>$REMOTE_LOG &" | |
| fi |
| wait_time=$((wait_time + 10)) | ||
| done | ||
|
|
||
| scp "${ssh_opts[@]}" "${TARGET_HOST}:${XTRACE_LOG}" "$XTRACE_LOG" |
There was a problem hiding this comment.
| if [[ -f "$SERVER_SSH_KEY" ]]; then | ||
| ssh_opts+=(-o IdentitiesOnly=yes -i $SERVER_SSH_KEY) | ||
| fi |
There was a problem hiding this comment.
The variable $SERVER_SSH_KEY should be double-quoted to prevent word splitting and globbing if the path contains spaces or special characters.
| if [[ -f "$SERVER_SSH_KEY" ]]; then | |
| ssh_opts+=(-o IdentitiesOnly=yes -i $SERVER_SSH_KEY) | |
| fi | |
| if [[ -f "$SERVER_SSH_KEY" ]]; then | |
| ssh_opts+=(-o IdentitiesOnly=yes -i "$SERVER_SSH_KEY") | |
| fi |
| XTRACE_LOG=$TMT_PLAN_DATA/test.log | ||
| bash -x $KAB_SCRIPT </dev/null &>"$XTRACE_LOG" |
There was a problem hiding this comment.
| XTRACE_LOG=$TMT_PLAN_DATA/test.log | ||
| bash -x $KAB_SCRIPT </dev/null &>"$XTRACE_LOG" |
There was a problem hiding this comment.
0576b86 to
851332f
Compare
When pre-commit runs during git commit --amend in a worktree, Git exports repository-local variables such as GIT_DIR and GIT_WORK_TREE into the hook environment. ShellSpec tests that create nested temporary repositories then inherit those variables, so git init/config/commit can operate on the outer repository instead of the test repo. Load a shared ShellSpec helper and unset Git's local environment variables before specs run, keeping nested test repositories isolated from the invoking repository.
- Provision two Fedora VMs per plan via testcloud/libvirt and runs the bisection end-to-end. Uses matrix strategy for parallel execution across all 4 plans (ssh, ssh_src, ssh_auto, criu). 8-hour timeout per plan, fail-fast: false. - Uploads /var/tmp/tmt/run* for debugging.
Fedora 44 Cloud /boot uses Btrfs subvolume for /boot [1]. Running the e2e tests can encounter issues like [2][3]. So use Fedora 43 to bypass these issues. [1] https://fedoraproject.org/wiki/Changes/BtrfsBootForCloud [2] https://bugzilla.redhat.com/show_bug.cgi?id=2483604 [3] rhkdump/kdump-utils#155
6.19.{3..5}-300.fc44 were deleted. This can lead the failure of
kab_ssh_auto test. Use 6.19.2-300.fc44 instead.
10c736d to
f4103c9
Compare
kernel-auto-bisect/main.log is the what we care most to know the progress. For criu e2e test, kab.sh will be checkpointed by CRIU and then the system will get rebooted. To continuously display main.log, we append remote main.log to local file and use "tail -f" to show the content.
kernel-auto-bisect/main.log is the what we care most to know the progress. So use "tmt run execute -vvv" so the main logs can be displayed.
tmt is natively supported on Fedora. By using Fedora container, some benefits includes bypassing issue [1]. [1] teemtee/testcloud#30
bisection end-to-end. Uses matrix strategy for parallel execution
across all 4 plans (ssh, ssh_src, ssh_auto, criu).
8-hour timeout per plan, fail-fast: false.