summaryrefslogtreecommitdiff
path: root/tests/t0800-json-gpt.sh
diff options
context:
space:
mode:
authorArvin Schnell <aschnell@suse.com>2022-07-28 09:20:09 +0000
committerBrian C. Lane <bcl@redhat.com>2022-09-30 15:22:07 -0700
commitdaceb2d6a76a66254168effcc2cd0d5f4fadf946 (patch)
tree71cad18480aa44462782ec02302b007059a40368 /tests/t0800-json-gpt.sh
parent8f37b28825933af9bbbac7f00cc7e23f916c7018 (diff)
downloadparted-daceb2d6a76a66254168effcc2cd0d5f4fadf946.tar.gz
parted: Add display of GPT UUIDs in JSON output
This adds 2 new disk type features, one for the whole disk UUID and another for the per-partition UUID. It adds ped_disk_get_uuid and ped_partition_get_uuid functions to retrieve them. It adds them to the JSON output on GPT disklabeled disks as "uuid" in the disk and partitions sections of the JSON output. Signed-off-by: Brian C. Lane <bcl@redhat.com>
Diffstat (limited to 'tests/t0800-json-gpt.sh')
-rwxr-xr-xtests/t0800-json-gpt.sh7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests/t0800-json-gpt.sh b/tests/t0800-json-gpt.sh
index 354c0bd..f6a3fb9 100755
--- a/tests/t0800-json-gpt.sh
+++ b/tests/t0800-json-gpt.sh
@@ -32,8 +32,8 @@ parted --script "$dev" mkpart "test1" ext4 10% 20% > out 2>&1 || fail=1
parted --script "$dev" mkpart "test2" xfs 20% 60% > out 2>&1 || fail=1
parted --script "$dev" set 2 raid on > out 2>&1 || fail=1
-# print with json format
-parted --script --json "$dev" unit s print free > out 2>&1 || fail=1
+# print with json format, replace non-deterministic uuids
+parted --script --json "$dev" unit s print free | sed -E 's/"uuid": "[0-9a-f-]{36}"/"uuid": "<uuid>"/' > out 2>&1 || fail=1
cat <<EOF > exp || fail=1
{
@@ -45,6 +45,7 @@ cat <<EOF > exp || fail=1
"logical-sector-size": 512,
"physical-sector-size": 512,
"label": "gpt",
+ "uuid": "<uuid>",
"max-partitions": 128,
"flags": [
"pmbr_boot"
@@ -63,6 +64,7 @@ cat <<EOF > exp || fail=1
"size": "10240s",
"type": "primary",
"type-uuid": "0fc63daf-8483-4772-8e79-3d69d8477de4",
+ "uuid": "<uuid>",
"name": "test1"
},{
"number": 2,
@@ -71,6 +73,7 @@ cat <<EOF > exp || fail=1
"size": "40960s",
"type": "primary",
"type-uuid": "a19d880f-05fc-4d3b-a006-743f0f84911e",
+ "uuid": "<uuid>",
"name": "test2",
"flags": [
"raid"