From 4899f0cac4440d659812c9e389200fba6f4ff4ca Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Apr 2026 19:03:46 +0000 Subject: [PATCH 1/2] Initial plan From ce5f314f76e18fa1b6961df6d8ef4f549371cf87 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Wed, 22 Apr 2026 19:10:46 +0000 Subject: [PATCH 2/2] ci: add libvirt diagnostics and network activation for CoreOS TMT tests Add dump_libvirt_diagnostics() in tmt.rs to capture virsh state when SSH connectivity verification fails (VM list, network list, DHCP leases, dominfo, domiflist, dumpxml). Add a CI step in the test-coreos job to ensure the libvirt default network is active before running CoreOS tests. Assisted-by: GitHub Copilot (claude-sonnet-4.5) Agent-Logs-Url: https://github.com/bootc-dev/bootc/sessions/fc40be37-2aea-41f1-b021-4f5b1d804a4a Co-authored-by: jmarrero <1894385+jmarrero@users.noreply.github.com> --- .github/workflows/ci.yml | 13 +++++++++++++ crates/xtask/src/tmt.rs | 14 ++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0751cf900..8447ccf41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -335,6 +335,19 @@ jobs: name: packages-fedora-43 path: target/packages/ + - name: Ensure libvirt default network is active + run: | + set -euxo pipefail + virsh net-list --all + if virsh net-info default >/dev/null 2>&1; then + if ! virsh net-start default; then + echo "Note: virsh net-start default returned non-zero (network may already be active)" + fi + virsh net-autostart default || echo "Note: virsh net-autostart default returned non-zero" + fi + virsh net-list --all + virsh net-dhcp-leases default || echo "Note: no DHCP leases yet for default network" + - name: Build container and test on CoreOS run: | BOOTC_SKIP_PACKAGE=1 just build diff --git a/crates/xtask/src/tmt.rs b/crates/xtask/src/tmt.rs index 2fc9b9db8..2902114c4 100644 --- a/crates/xtask/src/tmt.rs +++ b/crates/xtask/src/tmt.rs @@ -199,6 +199,19 @@ fn wait_for_vm_ready(sh: &Shell, vm_name: &str) -> Result<(u16, String)> { ) } +/// Dump libvirt diagnostics for a VM to aid debugging when SSH connectivity fails. +/// Prints virsh information to stderr; all commands are best-effort (errors are ignored). +fn dump_libvirt_diagnostics(sh: &Shell, vm_name: &str) { + eprintln!("=== libvirt diagnostics ==="); + let _ = cmd!(sh, "virsh list --all").ignore_status().run(); + let _ = cmd!(sh, "virsh net-list --all").ignore_status().run(); + let _ = cmd!(sh, "virsh net-dhcp-leases default").ignore_status().run(); + let _ = cmd!(sh, "virsh dominfo {vm_name}").ignore_status().run(); + let _ = cmd!(sh, "virsh domiflist {vm_name}").ignore_status().run(); + let _ = cmd!(sh, "virsh dumpxml {vm_name}").ignore_status().run(); + eprintln!("=== end libvirt diagnostics ==="); +} + /// Verify SSH connectivity to the VM /// Uses a more complex command similar to what TMT runs to ensure full readiness #[context("Verifying SSH connectivity")] @@ -597,6 +610,7 @@ pub(crate) fn run_tmt(sh: &Shell, args: &RunTmtArgs) -> Result<()> { println!("Verifying SSH connectivity..."); if let Err(e) = verify_ssh_connectivity(sh, ssh_port, &key_path) { eprintln!("SSH verification failed for plan {}: {:#}", plan, e); + dump_libvirt_diagnostics(sh, &vm_name); cleanup_vm(); all_passed = false; test_results.push((plan.to_string(), false, None));