git: 9front

Download patch

ref: c2b8859ca615fa3bb16bc7689df698a935528133
parent: 4ea762bc821a4c5aa461a902c61369f486a7e0d4
author: Jacob Moody <moody@posixcafe.org>
date: Tue Dec 9 16:04:37 EST 2025

dist/qcowfs: fix tests

Giving create OEXCL causes an error if the file already exists.
So we need to clean up previous test disks before attempting to make a new one.

--- a/sys/src/cmd/disk/test/basic.rc
+++ b/sys/src/cmd/disk/test/basic.rc
@@ -4,13 +4,15 @@
 rfork en
 
 # read fresh disk
-../$O.qcowfs -n 4294967296 /tmp/qcow
+../$O.qcowfs -n 4294967296 /tmp/qcow.$pid
 dd -ibs 389120 -skip 1 -obs 8192 -count 1 < /mnt/qcow/data >/dev/null
-../$O.qcowfs -n 4294967296 /tmp/qcow
+rm -f /tmp/qcow.$pid
+../$O.qcowfs -n 4294967296 /tmp/qcow.$pid
 dd -ibs 389120 -skip 1 -obs 15473 -count 1 < /mnt/qcow/data >/dev/null
 
 # write
-../$O.qcowfs -n 4294967296 /tmp/qcow
+rm -f /tmp/qcow.$pid
+../$O.qcowfs -n 4294967296 /tmp/qcow.$pid
 dd -ibs 389120 -skip 1 -obs 8192 -count 1 -if /dev/random -of /mnt/qcow/data # start, power of two
 dd -ibs 389120 -skip 1 -obs 15473 -count 1 -if /dev/random -of /mnt/qcow/data # random prime
 dd -ibs 389120 -skip 1 -obs 8192 -seek 524287 -count 1 -if /dev/random -of /mnt/qcow/data  # end
@@ -28,4 +30,5 @@
 	>[1=2] echo mismatched data
 	exit mishash
 }
+rm -f /tmp/qcow.$pid
 exit ''
--