summaryrefslogtreecommitdiff
path: root/tests/t3310-flags.sh
diff options
context:
space:
mode:
authorPhillip Susi <psusi@ubuntu.com>2018-05-10 12:31:36 -0400
committerPhillip Susi <psusi@ubuntu.com>2018-06-05 10:34:37 -0400
commit9e196cc2902255c328a90584e44666b79e4344c3 (patch)
tree10cfbb03560196d5187edc720c3b5200823f8cb7 /tests/t3310-flags.sh
parentddb9cce8a2ec87cdd9853bdca25c852c7aee8bdf (diff)
downloadparted-9e196cc2902255c328a90584e44666b79e4344c3.tar.gz
Fix set and disk_set to not crash when no flags are supported
Loop labels and file images support no flags. set and disk_set would prompt for a flag and accept any string since the list of flags was empty, then fail to look up an actual flag value, then throw an exception with a null string for the name of the flag, which would bug.
Diffstat (limited to 'tests/t3310-flags.sh')
-rw-r--r--tests/t3310-flags.sh13
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/t3310-flags.sh b/tests/t3310-flags.sh
index 2da72d0..0997748 100644
--- a/tests/t3310-flags.sh
+++ b/tests/t3310-flags.sh
@@ -114,4 +114,17 @@ for table_type in aix amiga atari bsd dvh gpt mac msdos pc98 sun loop; do
done
done
+# loop filesystems support no flags. Make sure this doesn't crash
+
+if [ $ss == 512 ]; then
+ # only test on 512 byte ss since mke2fs assumes this on a file
+ truncate -s 5m img || framework_failure
+ mke2fs img || framework_failure
+ echo Error: No flags supported > out.exp
+ parted -s img set 1 foo on > out 2>&1
+ compare out.exp out || fail=1
+ parted -s img disk_set foo on > out 2>&1
+ compare out.exp out || fail=1
+fi
+
Exit $fail