]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
tests: add sfdisk --no-device-names regression test
authorKarel Zak <kzak@redhat.com>
Tue, 5 May 2026 10:07:56 +0000 (12:07 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 6 May 2026 09:25:04 +0000 (11:25 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
tests/expected/sfdisk/dump-no-device-names [new file with mode: 0644]
tests/expected/sfdisk/dump-no-device-names-json [new file with mode: 0644]
tests/ts/sfdisk/dump

diff --git a/tests/expected/sfdisk/dump-no-device-names b/tests/expected/sfdisk/dump-no-device-names
new file mode 100644 (file)
index 0000000..3923d9c
--- /dev/null
@@ -0,0 +1,12 @@
+label: gpt
+label-id: 613005F9-1C8C-E141-8AEB-F32E8E296C75
+device: <removed>
+unit: sectors
+first-lba: 2048
+last-lba: 204766
+sector-size: 512
+
+1 : start=        2048, size=       20480, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=28A432A3-8D63-3142-B9F5-68A2BF2BC60B
+2 : start=       22528, size=       22528, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=6A7D17FC-7252-564A-9B68-5E2107999BF1
+3 : start=       45056, size=       24576, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=26C303E4-0321-3346-B9EF-BDD39BEA1166
+4 : start=       69632, size=      135135, type=0FC63DAF-8483-4772-8E79-3D69D8477DE4, uuid=AF79D434-C8B3-2445-80FB-317AB157447C
diff --git a/tests/expected/sfdisk/dump-no-device-names-json b/tests/expected/sfdisk/dump-no-device-names-json
new file mode 100644 (file)
index 0000000..f8d93a2
--- /dev/null
@@ -0,0 +1,38 @@
+{
+   "partitiontable": {
+      "label": "gpt",
+      "id": "613005F9-1C8C-E141-8AEB-F32E8E296C75",
+      "device": "<removed>",
+      "unit": "sectors",
+      "firstlba": 2048,
+      "lastlba": 204766,
+      "sectorsize": 512,
+      "partitions": [
+         {
+            "node": "1",
+            "start": 2048,
+            "size": 20480,
+            "type": "0FC63DAF-8483-4772-8E79-3D69D8477DE4",
+            "uuid": "28A432A3-8D63-3142-B9F5-68A2BF2BC60B"
+         },{
+            "node": "2",
+            "start": 22528,
+            "size": 22528,
+            "type": "0FC63DAF-8483-4772-8E79-3D69D8477DE4",
+            "uuid": "6A7D17FC-7252-564A-9B68-5E2107999BF1"
+         },{
+            "node": "3",
+            "start": 45056,
+            "size": 24576,
+            "type": "0FC63DAF-8483-4772-8E79-3D69D8477DE4",
+            "uuid": "26C303E4-0321-3346-B9EF-BDD39BEA1166"
+         },{
+            "node": "4",
+            "start": 69632,
+            "size": 135135,
+            "type": "0FC63DAF-8483-4772-8E79-3D69D8477DE4",
+            "uuid": "AF79D434-C8B3-2445-80FB-317AB157447C"
+         }
+      ]
+   }
+}
index f9442cff840bab5b18d8ba4409499fe35edbc475..8b0e9e516be8da419d966c29c7d7a3a57c736d95 100755 (executable)
@@ -84,4 +84,16 @@ $TS_CMD_SFDISK --list -o START,END,SIZE,UUID,TYPE,NAME ${TS_DEVICE} >> $TS_OUTPU
 ts_fdisk_clean $TS_DEVICE
 ts_finalize_subtest
 
+
+ts_init_subtest "no-device-names"
+$TS_CMD_SFDISK --dump --no-device-names ${TS_DEVICE} >> $TS_OUTPUT 2>> $TS_ERRLOG
+ts_fdisk_clean $TS_DEVICE
+ts_finalize_subtest
+
+
+ts_init_subtest "no-device-names-json"
+$TS_CMD_SFDISK --dump --no-device-names --json ${TS_DEVICE} >> $TS_OUTPUT 2>> $TS_ERRLOG
+ts_fdisk_clean $TS_DEVICE
+ts_finalize_subtest
+
 ts_finalize