summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorBrian C. Lane <bcl@redhat.com>2021-06-14 15:04:05 -0700
committerBrian C. Lane <bcl@redhat.com>2021-06-14 15:04:05 -0700
commitea1a97b57d4e84005c66bc9c05f2e7c9244b5118 (patch)
treeb0e089cd004229cbbfb730d2ad28aab00b30840e /tests
parentf801496427db11cc468065dcd77d1c610c0a1047 (diff)
downloadparted-ea1a97b57d4e84005c66bc9c05f2e7c9244b5118.tar.gz
tests: t9050 Use /dev/zero for temporary file and mkswap
and clean up the usage a little bit by giving it a proper name and removing the file when finished.
Diffstat (limited to 'tests')
-rwxr-xr-xtests/t9050-partition-table-types.sh14
1 files changed, 10 insertions, 4 deletions
diff --git a/tests/t9050-partition-table-types.sh b/tests/t9050-partition-table-types.sh
index 57e004a..d63fa80 100755
--- a/tests/t9050-partition-table-types.sh
+++ b/tests/t9050-partition-table-types.sh
@@ -35,16 +35,22 @@ pc98
sun
mkswap
'
+N=1M
+dev=loop-file
-dd if=/dev/null of=f bs=1 seek=30M || framework_failure_
+cleanup_() {
+ rm -f $dev;
+}
+
+dd if=/dev/zero of=$dev bs=$N count=30 || framework_failure_
for i in $types; do
for j in $types; do
echo $i:$j
- case $i in mkswap) mkswap f || fail=1;;
- *) parted -s f mklabel $i || fail=1;; esac
+ case $i in mkswap) mkswap $dev || fail=1;;
+ *) parted -s $dev mklabel $i || fail=1;; esac
case $j in mkswap) continue;; esac
- parted -s f mklabel $j || fail=1
+ parted -s $dev mklabel $j || fail=1
done
done