diff --git a/rust/Cargo.lock b/rust/Cargo.lock index 09e72ad261..57175ecd90 100644 --- a/rust/Cargo.lock +++ b/rust/Cargo.lock @@ -166,6 +166,7 @@ dependencies = [ "utoipa", "uuid", "zbus", + "zypp-agama", ] [[package]] diff --git a/rust/agama-lib/Cargo.toml b/rust/agama-lib/Cargo.toml index 728f7b73b6..e4c9d1fe2f 100644 --- a/rust/agama-lib/Cargo.toml +++ b/rust/agama-lib/Cargo.toml @@ -38,6 +38,7 @@ tokio-tungstenite = { version = "0.26.2", features = ["native-tls"] } tokio-native-tls = "0.3.1" percent-encoding = "2.3.1" uuid = { version = "1.17.0", features = ["serde", "v4"] } +zypp-agama = { path = "../zypp-agama" } [dev-dependencies] httpmock = "0.7.0" diff --git a/rust/agama-lib/src/logs.rs b/rust/agama-lib/src/logs.rs index 84d4ccf652..64dbf243d8 100644 --- a/rust/agama-lib/src/logs.rs +++ b/rust/agama-lib/src/logs.rs @@ -30,6 +30,7 @@ use std::path::{Path, PathBuf}; use std::process::Command; use tempfile::TempDir; use utoipa::ToSchema; +use zypp_agama::SOLVER_TESTCASE_DIR; const DEFAULT_COMMANDS: [(&str, &str); 2] = [ // (, ) @@ -50,7 +51,7 @@ const DEFAULT_PATHS: [&str; 18] = [ "/var/log/boot.msg", "/var/log/udev.log", "/var/log/zypp/history", - "/var/log/zypp/testcase", + SOLVER_TESTCASE_DIR, "/run/agama/dbus.log", "/run/agama/inst-scripts", // config diff --git a/rust/package/agama.changes b/rust/package/agama.changes index 346089d0ef..39fbe7ab83 100644 --- a/rust/package/agama.changes +++ b/rust/package/agama.changes @@ -1,3 +1,12 @@ +------------------------------------------------------------------- +Mon Mar 9 11:37:06 UTC 2026 - Ladislav Slezák + +- Move the location of the dumped solver testcase + to /run/agama/testcase, do not save solver testcase when + "ZYPP_FULLLOG=1" (in that case libzypp creates the solver + testcase automatically in the /var/log/YaST2/autoTestcase/ + directory) (related to gh#agama-project/agama#3242) + ------------------------------------------------------------------- Mon Mar 9 09:39:13 UTC 2026 - Stefan Hundhammer diff --git a/rust/zypp-agama/src/lib.rs b/rust/zypp-agama/src/lib.rs index 1287a86abc..b4416a6aba 100644 --- a/rust/zypp-agama/src/lib.rs +++ b/rust/zypp-agama/src/lib.rs @@ -17,7 +17,7 @@ use helpers::{status_to_result, status_to_result_void, string_from_ptr}; pub mod callbacks; // directory where the solver testcase is saved -const SOLVER_TESTCASE_DIR: &str = "/var/log/zypp/testcase"; +pub const SOLVER_TESTCASE_DIR: &str = "/run/agama/testcase"; #[derive(Debug)] pub struct Repository { @@ -594,8 +594,11 @@ impl Zypp { let status_ptr = &mut status as *mut _; let r_res = zypp_agama_sys::run_solver(self.ptr, only_required, status_ptr); - // save the solver test case if the solver run failed or if saving is forced via boot parameter - if !r_res || save_testcase { + // save the solver testcase if the solver run failed or if saving is forced via boot + // parameter, skip when "ZYPP_FULLLOG=1", in that case libzypp creates the solver + // testcase automatically in the /var/log/YaST2/autoTestcase/ directory + if (!r_res || save_testcase) && std::env::var("ZYPP_FULLLOG").unwrap_or_default() != "1" + { self.create_solver_testcase(); } else { // delete the solver testcase directory, it contains the previous error which is