Skip to contentSkip to conversation

tests: Fix fdisk/id and fdisk/mbr-nondos-mode on Sparc

PATCH Applied James Clarke 2 participants 2 messages Jul 14, 2016 Util-Linux package

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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.

---
 tests/expected/fdisk/id.sparc              |   3 +
 tests/expected/fdisk/mbr-nondos-mode.sparc | 189 +++++++++++++++++++++++++++++
 tests/ts/fdisk/id                          |  13 ++
 tests/ts/fdisk/mbr-nondos-mode             |  13 ++
 4 files changed, 218 insertions(+)
tests/expected/fdisk/id.sparc new file +3 -0
new file mode 100644
index 0000000..aa3f407
@@ -0,0 +1,3 @@
+Initialize empty image
+Create MBR with ID=0x1
+Create MBR with ID=0x2
tests/expected/fdisk/mbr-nondos-mode.sparc new file +189 -0

189 lines not on this page · raw message

tests/ts/fdisk/id +13 -0
index a24d793..85b87d6 100755
@@ -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)
 
tests/ts/fdisk/mbr-nondos-mode +13 -0
index e01b060..7ac5dae 100755
@@ -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
Signature · 1 line
2.9.1
maintainer Applied
#1 lore raw
Quoted 10 lines · James Clarke

On Sparc, fdisk defaults to using SUN disk labels, which causes the output from these tests to differ from non-Sparc.

---
 tests/expected/fdisk/id.sparc              |   3 +
 tests/expected/fdisk/mbr-nondos-mode.sparc | 189 +++++++++++++++++++++++++++++
 tests/ts/fdisk/id                          |  13 ++
 tests/ts/fdisk/mbr-nondos-mode             |  13 ++
 4 files changed, 218 insertions(+)

Applied, thanks!

Karel

Signature · 2 lines
 Karel Zak  <[email protected]>
 http://karelzak.blogspot.com