Skip to content

Commit 7f10c45

Browse files
tmt: Remove 'target' directory on plan completion
Tmt seems to be copying the 'target' directory to /var/tmp/tmt/** when running a test which might be eating up disk space. Remove all 'target' directories from `/var/tmp/tmt/**` after plan completion Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
1 parent c846066 commit 7f10c45

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

Justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ test-composefs bootloader filesystem boot_type seal_state *ARGS:
205205
filesystem={{filesystem}} \
206206
boot_type={{boot_type}} \
207207
seal_state={{seal_state}} \
208-
test-tmt --composefs-backend \
208+
test-tmt-nobuild --composefs-backend \
209209
--bootloader={{bootloader}} \
210210
--filesystem={{filesystem}} \
211211
--seal-state={{seal_state}} \

crates/xtask/src/tmt.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -564,6 +564,9 @@ fn run_plan(
564564
// Log disk usage after each test run to help diagnose "no space left on device" failures
565565
println!("Disk usage after plan {}:", plan);
566566
let _ = cmd!(sh, "df -h").run();
567+
let script = r#"find /var/tmp/tmt -type d -name target -exec rm -rf {} \;"#;
568+
let _ = cmd!(sh, "sh -c {script}").run();
569+
println!("==========================================");
567570

568571
// Clean up VM regardless of test result (unless --preserve-vm is set)
569572
cleanup_vm();

0 commit comments

Comments
 (0)