test: delete /swapfile after swapoff

[   23.608342] TEST-55-OOMD.sh[689]: + btrfs filesystem mkswapfile -s 64M /swapfile
[   23.651930] TEST-55-OOMD.sh[704]: ERROR: cannot create new swapfile: File exists
This commit is contained in:
Luca Boccassi
2024-11-06 05:02:57 +09:00
committed by Yu Watanabe
parent 57feaaece3
commit 78b032d727
+1
View File
@@ -24,6 +24,7 @@ fi
# Activate swap file if we are in a VM
if systemd-detect-virt --vm --quiet; then
swapoff --all
rm -f /swapfile
if [[ "$(findmnt -n -o FSTYPE /)" == btrfs ]]; then
btrfs filesystem mkswapfile -s 64M /swapfile
else