]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: apfs: add test
authorThomas Weißschuh <thomas@t-8ch.de>
Mon, 10 Oct 2022 21:07:25 +0000 (23:07 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Wed, 12 Oct 2022 22:29:36 +0000 (00:29 +0200)
Fixes #1807

Information known to macOS:
```
$ hdiutil attach apfs.img
/dev/disk1
/dev/disk2              EF57347C-0000-11AA-AA11-0030654
/dev/disk2s1            41504653-0000-11AA-AA11-0030654 /Volumes/testapfs

$ diskutil info disk2
   Device Identifier:        disk2
   Device Node:              /dev/disk2
   Whole:                    Yes
   Part of Whole:            disk2
   Device / Media Name:      Disk Image

   Volume Name:              Not applicable (no file system)
   Mounted:                  Not applicable (no file system)
   File System:              None

   Content (IOContent):      EF57347C-0000-11AA-AA11-00306543ECAC
   OS Can Be Installed:      No
   Media Type:               Generic
   Protocol:                 Disk Image
   SMART Status:             Not Supported
   Disk / Partition UUID:    25E5F1D3-11C0-4D36-98A5-3F66953519B9

   Disk Size:                10.5 MB (10485760 Bytes) (exactly 20480 512-Byte-Units)
   Device Block Size:        4096 Bytes

   Read-Only Media:          No
   Read-Only Volume:         Not applicable (no file system)

   Device Location:          External
   Removable Media:          Removable
   Media Removal:            Software-Activated

   Virtual:                  Yes

$ diskutil info disk2s1
   Device Identifier:        disk2s1
   Device Node:              /dev/disk2s1
   Whole:                    No
   Part of Whole:            disk2

   Volume Name:              testapfs
   Mounted:                  Yes
   Mount Point:              /Volumes/testapfs

   Partition Type:           41504653-0000-11AA-AA11-00306543ECAC
   File System Personality:  APFS
   Type (Bundle):            apfs
   Name (User Visible):      APFS
   Owners:                   Disabled

   OS Can Be Installed:      Yes
   Media Type:               Generic
   Protocol:                 Disk Image
   SMART Status:             Not Supported
   Volume UUID:              3EA5C1EF-64CB-447C-AE37-8046CDC35010
   Disk / Partition UUID:    3EA5C1EF-64CB-447C-AE37-8046CDC35010

   Disk Size:                10.5 MB (10485760 Bytes) (exactly 20480 512-Byte-Units)
   Device Block Size:        4096 Bytes

   Volume Total Space:       10.5 MB (10485760 Bytes) (exactly 20480 512-Byte-Units)
   Volume Used Space:        376.8 KB (376832 Bytes) (exactly 736 512-Byte-Units) (3.6%)
   Volume Free Space:        10.1 MB (10108928 Bytes) (exactly 19744 512-Byte-Units) (96.4%)
   Allocation Block Size:    4096 Bytes

   Read-Only Media:          No
   Read-Only Volume:         No

   Device Location:          External
   Removable Media:          Removable
   Media Removal:            Software-Activated
```

tests/expected/blkid/low-probe-apfs [new file with mode: 0644]
tests/ts/blkid/images-fs/apfs.img.xz [new file with mode: 0644]

diff --git a/tests/expected/blkid/low-probe-apfs b/tests/expected/blkid/low-probe-apfs
new file mode 100644 (file)
index 0000000..492edfd
--- /dev/null
@@ -0,0 +1,6 @@
+ID_FS_BLOCK_SIZE=4096
+ID_FS_FSBLOCKSIZE=4096
+ID_FS_TYPE=apfs
+ID_FS_USAGE=filesystem
+ID_FS_UUID=25e5f1d3-11c0-4d36-98a5-3f66953519b9
+ID_FS_UUID_ENC=25e5f1d3-11c0-4d36-98a5-3f66953519b9
diff --git a/tests/ts/blkid/images-fs/apfs.img.xz b/tests/ts/blkid/images-fs/apfs.img.xz
new file mode 100644 (file)
index 0000000..4145c01
Binary files /dev/null and b/tests/ts/blkid/images-fs/apfs.img.xz differ