Skip to content

ci: run tmt e2e tests on GitHub-hosted runners with nested KVM#29

Open
coiby wants to merge 10 commits into
rhkdump:mainfrom
coiby:github_action_tmt
Open

ci: run tmt e2e tests on GitHub-hosted runners with nested KVM#29
coiby wants to merge 10 commits into
rhkdump:mainfrom
coiby:github_action_tmt

Conversation

@coiby

@coiby coiby commented Jun 14, 2026

Copy link
Copy Markdown
Member
  • 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.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread tests/kab_criu/test.sh Outdated
Comment on lines 89 to 94
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

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

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.

Suggested change
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

Comment thread tests/kab_criu/test.sh Outdated
wait_time=$((wait_time + 10))
done

scp "${ssh_opts[@]}" "${TARGET_HOST}:${XTRACE_LOG}" "$XTRACE_LOG"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

high

Update the source path of the scp command to use the remote log path ($REMOTE_LOG) instead of the local $XTRACE_LOG path.

Suggested change
scp "${ssh_opts[@]}" "${TARGET_HOST}:${XTRACE_LOG}" "$XTRACE_LOG"
scp "${ssh_opts[@]}" "${TARGET_HOST}:${REMOTE_LOG}" "$XTRACE_LOG"

Comment thread tests/kab_criu/test.sh
Comment on lines +25 to +27
if [[ -f "$SERVER_SSH_KEY" ]]; then
ssh_opts+=(-o IdentitiesOnly=yes -i $SERVER_SSH_KEY)
fi

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The variable $SERVER_SSH_KEY should be double-quoted to prevent word splitting and globbing if the path contains spaces or special characters.

Suggested change
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

Comment thread tests/kab_ssh/test.sh Outdated
Comment on lines +65 to +66
XTRACE_LOG=$TMT_PLAN_DATA/test.log
bash -x $KAB_SCRIPT </dev/null &>"$XTRACE_LOG"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Quote the $KAB_SCRIPT variable to prevent potential word splitting or globbing issues.

Suggested change
XTRACE_LOG=$TMT_PLAN_DATA/test.log
bash -x $KAB_SCRIPT </dev/null &>"$XTRACE_LOG"
XTRACE_LOG=$TMT_PLAN_DATA/test.log
bash -x "$KAB_SCRIPT" </dev/null &>"$XTRACE_LOG"

Comment thread tests/kab_ssh_auto/test.sh Outdated
Comment on lines +75 to +76
XTRACE_LOG=$TMT_PLAN_DATA/test.log
bash -x $KAB_SCRIPT </dev/null &>"$XTRACE_LOG"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

Quote the $KAB_SCRIPT variable to prevent potential word splitting or globbing issues.

Suggested change
XTRACE_LOG=$TMT_PLAN_DATA/test.log
bash -x $KAB_SCRIPT </dev/null &>"$XTRACE_LOG"
XTRACE_LOG=$TMT_PLAN_DATA/test.log
bash -x "$KAB_SCRIPT" </dev/null &>"$XTRACE_LOG"

@coiby coiby force-pushed the github_action_tmt branch 3 times, most recently from 0576b86 to 851332f Compare June 17, 2026 09:55
coiby added 7 commits June 20, 2026 17:50
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.
@coiby coiby force-pushed the github_action_tmt branch 3 times, most recently from 10c736d to f4103c9 Compare June 21, 2026 03:57
coiby added 3 commits July 3, 2026 18:33
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
@coiby coiby force-pushed the github_action_tmt branch from f4103c9 to 13ec030 Compare July 3, 2026 10:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant