]> git.sven.stormbind.net Git - sven/exfatprogs.git/commitdiff
Add autopkgtest from upstream CI
authorAlessandro Astone <alessandro.astone@canonical.com>
Fri, 19 Jul 2024 15:54:27 +0000 (17:54 +0200)
committerSven Hoexter <sven@stormbind.net>
Fri, 26 Jul 2024 12:36:07 +0000 (14:36 +0200)
Original source:
https://github.com/exfatprogs/exfatprogs/blob/1.2.4/.github/workflows/c-cpp.yml#L37

debian/tests/control
debian/tests/create-files [new file with mode: 0644]

index b1bbe7e10837e19d41e5aad56920d36c964de2f5..c951620d59eba3283c65c73b15ac7ad7e626733d 100644 (file)
@@ -1,3 +1,7 @@
 Tests: fsck
 Depends: @
 Restrictions: allow-stderr
+
+Tests: create-files
+Depends: @
+Restrictions: isolation-machine, needs-root
diff --git a/debian/tests/create-files b/debian/tests/create-files
new file mode 100644 (file)
index 0000000..d7e89d6
--- /dev/null
@@ -0,0 +1,35 @@
+#!/bin/bash
+
+# Original source:
+# https://github.com/exfatprogs/exfatprogs/blob/1.2.4/.github/workflows/c-cpp.yml#L37
+
+set -e
+
+mkdir "${AUTOPKGTEST_TMP}/mnt"
+truncate -s 10G "${AUTOPKGTEST_TMP}/test.img"
+
+dev=$(losetup --show -f "${AUTOPKGTEST_TMP}/test.img")
+mkfs.exfat ${dev}
+
+mount -t exfat ${dev} "${AUTOPKGTEST_TMP}/mnt"
+cd "${AUTOPKGTEST_TMP}/mnt"
+
+i=1;while [ $i -le 10000 ];do touch file$i;if [ $? != 0 ]; then exit 1; fi; i=$(($i + 1));done
+sync
+rm -rf *
+
+i=1;while [ $i -le 10000 ];do mkdir dir$i;if [ $? != 0 ]; then exit 1; fi; i=$(($i + 1));done
+sync
+rm -rf *
+
+i=1;while [ $i -le 10000 ];do touch file$i;if [ $? != 0 ]; then exit 1; fi; i=$(($i + 1));done
+i=1;while [ $i -le 10000 ];do mkdir dir$i;if [ $? != 0 ]; then exit 1; fi; i=$(($i + 1));done
+sync
+
+fsck.exfat ${dev}
+find . -delete
+fsck.exfat ${dev}
+
+cd -
+umount ${dev}
+losetup -d ${dev}