summaryrefslogtreecommitdiffstats
path: root/tests/ts/fdisk
diff options
context:
space:
mode:
authorJames Clarke2016-07-14 10:02:24 +0200
committerKarel Zak2016-07-14 12:20:55 +0200
commit0d474d29c58f36085d3dfdfc22524e0870527e00 (patch)
treea5354e1dec0faf8adf46b1eb56fc3017a59e8a22 /tests/ts/fdisk
parentblkdiscard: Improve man page (diff)
downloadkernel-qcow2-util-linux-0d474d29c58f36085d3dfdfc22524e0870527e00.tar.gz
kernel-qcow2-util-linux-0d474d29c58f36085d3dfdfc22524e0870527e00.tar.xz
kernel-qcow2-util-linux-0d474d29c58f36085d3dfdfc22524e0870527e00.zip
tests: Fix fdisk/id and fdisk/mbr-nondos-mode on Sparc
On Sparc, fdisk defaults to using SUN disk labels, which causes the output from these tests to differ from non-Sparc. Signed-off-by: James Clarke <jrtc27@jrtc27.com>
Diffstat (limited to 'tests/ts/fdisk')
-rwxr-xr-xtests/ts/fdisk/id13
-rwxr-xr-xtests/ts/fdisk/mbr-nondos-mode13
2 files changed, 26 insertions, 0 deletions
diff --git a/tests/ts/fdisk/id b/tests/ts/fdisk/id
index a24d793e8..85b87d682 100755
--- a/tests/ts/fdisk/id
+++ b/tests/ts/fdisk/id
@@ -25,6 +25,19 @@ ts_check_test_command "$TS_CMD_FDISK"
FDISK_CMD_ID1="x\ni\n0x1\nr\nw\n"
FDISK_CMD_ID2="x\ni\n0x2\nr\nw\n"
+# Sparc uses SUN disk labels by default and thus has a different output
+ARCH=$(uname -m)
+case $ARCH in
+ *sparc* )
+ ARCH_EXT=".sparc"
+ ;;
+ *)
+ ARCH_EXT=""
+ ;;
+esac
+
+TS_EXPECTED+="${ARCH_EXT}"
+
ts_log "Initialize empty image"
TEST_IMAGE_NAME=$(ts_image_init 10)
diff --git a/tests/ts/fdisk/mbr-nondos-mode b/tests/ts/fdisk/mbr-nondos-mode
index e01b060f3..7ac5dae1b 100755
--- a/tests/ts/fdisk/mbr-nondos-mode
+++ b/tests/ts/fdisk/mbr-nondos-mode
@@ -37,6 +37,19 @@ FDISK_CMD_DELETE_1PRIMARY="d\n1\n" # delete first primary
FDISK_CMD_DELETE_2PRIMARY="d\n2\n" # delete first primary
FDISK_CMD_DELETE_EXTENDED="d\n3\n" # delete second primary
+# Sparc uses SUN disk labels by default and thus has a different output
+ARCH=$(uname -m)
+case $ARCH in
+ *sparc* )
+ ARCH_EXT=".sparc"
+ ;;
+ *)
+ ARCH_EXT=""
+ ;;
+esac
+
+TS_EXPECTED+="${ARCH_EXT}"
+
function print_layout {
echo -ne "\n---layout----------\n" >> $TS_OUTPUT
$TS_CMD_FDISK -l ${TEST_IMAGE_NAME} >> $TS_OUTPUT