]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: add old dump for sfdisk
authorKarel Zak <kzak@redhat.com>
Thu, 16 Apr 2015 16:01:32 +0000 (18:01 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 16 Apr 2015 16:01:32 +0000 (18:01 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/expected/sfdisk/dos-dump-gaps [new file with mode: 0644]
tests/expected/sfdisk/dos-dump-old [new file with mode: 0644]
tests/ts/sfdisk/dos
tests/ts/sfdisk/files/dump-gaps [new file with mode: 0644]
tests/ts/sfdisk/files/dump-old [new file with mode: 0644]
tests/ts/sfdisk/gpt

diff --git a/tests/expected/sfdisk/dos-dump-gaps b/tests/expected/sfdisk/dos-dump-gaps
new file mode 100644 (file)
index 0000000..8587030
--- /dev/null
@@ -0,0 +1,24 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / 32768 bytes
+
+>>> Script header accepted.
+>>> Created a new <removed>.
+Created a new <removed>.
+<removed>2: Ignoring partition.
+<removed>3: Created a new <removed>.
+<removed>4: Ignoring partition.
+All partitions used.
+
+New situation:
+
+Device     Boot Start    End Sectors  Size Id Type
+<removed>1  *     2048  52046   49999 24.4M 83 Linux
+<removed>3       52048 102046   49999 24.4M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
diff --git a/tests/expected/sfdisk/dos-dump-old b/tests/expected/sfdisk/dos-dump-old
new file mode 100644 (file)
index 0000000..e6835f9
--- /dev/null
@@ -0,0 +1,23 @@
+Checking that no-one is using this disk right now ... OK
+
+Disk <removed>: 50 MiB, 52428800 bytes, 102400 sectors
+Units: sectors of 1 * 512 = 512 bytes
+Sector size (logical/physical): 512 bytes / 4096 bytes
+I/O size (minimum/optimal): 4096 bytes / 32768 bytes
+
+>>> Script header accepted.
+>>> Created a new <removed>.
+Created a new <removed>.
+<removed>2: Ignoring partition.
+<removed>3: Ignoring partition.
+<removed>4: Ignoring partition.
+All partitions used.
+
+New situation:
+
+Device     Boot Start   End Sectors  Size Id Type
+<removed>1  *     2048 52046   49999 24.4M 83 Linux
+
+The partition table has been altered.
+Calling ioctl() to re-read partition table.
+Syncing disks.
index 8277ddcfacfad8a19d6620478db377ea84ece845..467e540f489908dec585ab93bad8e3fa3d1fe238 100755 (executable)
@@ -21,7 +21,7 @@ TS_DESC="MBR"
 . $TS_TOPDIR/functions.sh
 ts_init "$*"
 
-ts_check_test_command "$TS_CMD_FDISK"
+ts_check_test_command "$TS_CMD_SFDISK"
 ts_check_test_command "$TS_CMD_WIPEFS"
 
 ts_skip_nonroot
@@ -125,5 +125,25 @@ udevadm settle
 ts_finalize_subtest
 
 
+ts_init_subtest "dump-old"
+$TS_CMD_WIPEFS -a ${TS_DEVICE} &> /dev/null
+udevadm settle
+$TS_CMD_SFDISK ${TS_DEVICE} < $TS_SELF/files/dump-old >> $TS_OUTPUT 2>&1
+udevadm settle
+ts_fdisk_clean $TS_DEVICE
+udevadm settle
+ts_finalize_subtest
+
+
+ts_init_subtest "dump-gaps"
+$TS_CMD_WIPEFS -a ${TS_DEVICE} &> /dev/null
+udevadm settle
+$TS_CMD_SFDISK ${TS_DEVICE} < $TS_SELF/files/dump-gaps >> $TS_OUTPUT 2>&1
+udevadm settle
+ts_fdisk_clean $TS_DEVICE
+udevadm settle
+ts_finalize_subtest
+
+
 rmmod scsi_debug
 ts_finalize
diff --git a/tests/ts/sfdisk/files/dump-gaps b/tests/ts/sfdisk/files/dump-gaps
new file mode 100644 (file)
index 0000000..3aff9ca
--- /dev/null
@@ -0,0 +1,7 @@
+# partition table of /dev/sdc
+unit: sectors
+
+/dev/sdc1 : start=     2048, size=    49999, Id=83, bootable
+/dev/sdc2 : start=        0, size=        0, Id= 0
+/dev/sdc3 : start=    52048, size=    49999, Id=83
+/dev/sdc4 : start=        0, size=        0, Id= 0
diff --git a/tests/ts/sfdisk/files/dump-old b/tests/ts/sfdisk/files/dump-old
new file mode 100644 (file)
index 0000000..7708e5e
--- /dev/null
@@ -0,0 +1,7 @@
+# partition table of /dev/sdc
+unit: sectors
+
+/dev/sdc1 : start=     2048, size=    49999, Id=83, bootable
+/dev/sdc2 : start=        0, size=        0, Id= 0
+/dev/sdc3 : start=        0, size=        0, Id= 0
+/dev/sdc4 : start=        0, size=        0, Id= 0
index 252691f46a94dcce065dcf190ec90387023c6ea8..de1184c94442614fe31cf4edc1a559068dcf062c 100755 (executable)
@@ -21,7 +21,7 @@ TS_DESC="GPT"
 . $TS_TOPDIR/functions.sh
 ts_init "$*"
 
-ts_check_test_command "$TS_CMD_FDISK"
+ts_check_test_command "$TS_CMD_SFDISK"
 ts_check_test_command "$TS_CMD_WIPEFS"
 
 ts_skip_nonroot