-------------------
+Corrupt primary table
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 512 bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Size Type
+<removed>1 2048 4095 1M EFI System
+<removed>2 4096 6143 1M Linux filesystem
+<removed>3 6144 8191 1M Linux filesystem
+<removed>4 8192 10239 1M Linux filesystem
+<removed>5 10240 12287 1M Linux swap
+<removed>6 12288 14335 1M Linux filesystem
+<removed>7 14336 16383 1M Linux filesystem
+<removed>8 16384 18431 1M Linux filesystem
+
+-------------------
+
+Corrupt backup table
+
+---layout----------
+Disk <removed>: 10 MiB, 10485760 bytes, 20480 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 512 bytes
+I/O size (minimum/optimal): 512 bytes / 512 bytes
+Disklabel type: gpt
+Disk identifier: <removed>
+
+Device Start End Size Type
+<removed>1 2048 4095 1M EFI System
+<removed>2 4096 6143 1M Linux filesystem
+<removed>3 6144 8191 1M Linux filesystem
+<removed>4 8192 10239 1M Linux filesystem
+<removed>5 10240 12287 1M Linux swap
+<removed>6 12288 14335 1M Linux filesystem
+<removed>7 14336 16383 1M Linux filesystem
+<removed>8 16384 18431 1M Linux filesystem
+
+-------------------
function print_layout {
echo -ne "\n---layout----------" >> $TS_OUTPUT
- $TS_CMD_FDISK -l ${TEST_IMAGE_NAME} >> $TS_OUTPUT
+ $TS_CMD_FDISK -l ${TEST_IMAGE_NAME} &>> $TS_OUTPUT
echo -ne "-------------------\n\n" >> $TS_OUTPUT
}
print_layout
+ts_log "Corrupt primary table"
+dd if=/dev/zero of=${TEST_IMAGE_NAME} bs=512 count=1 seek=1 conv=notrunc &> /dev/null
+echo -e "w\n" | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null
+
+print_layout
+
+ts_log "Corrupt backup table"
+dd if=/dev/zero of=${TEST_IMAGE_NAME} bs=512 count=1 \
+ seek=$(( 1024 * 1024 * 10 / 512 - 1)) conv=notrunc &> /dev/null
+echo -e "w\n" | $TS_CMD_FDISK ${TEST_IMAGE_NAME} &> /dev/null
+
+print_layout
+
ts_fdisk_clean ${TEST_IMAGE_NAME}
ts_finalize