diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 19:10:49 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-14 19:10:49 +0000 |
commit | cfe5e3905201349e9cf3f95d52ff4bd100bde37d (patch) | |
tree | d0baf160cbee3195249d095f85e52d20c21acf02 /tests/ts/blkid | |
parent | Initial commit. (diff) | |
download | util-linux-cfe5e3905201349e9cf3f95d52ff4bd100bde37d.tar.xz util-linux-cfe5e3905201349e9cf3f95d52ff4bd100bde37d.zip |
Adding upstream version 2.39.3.upstream/2.39.3
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ts/blkid')
137 files changed, 623 insertions, 0 deletions
diff --git a/tests/ts/blkid/cache b/tests/ts/blkid/cache new file mode 100755 index 0000000..7c35805 --- /dev/null +++ b/tests/ts/blkid/cache @@ -0,0 +1,48 @@ +#!/bin/bash + +# +# Copyright (C) 2009 Karel Zak <kzak@redhat.com> +# +# This file is part of util-linux. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# + +TS_TOPDIR="${0%/*}/../.." +TS_DESC="caching" + +. "$TS_TOPDIR"/functions.sh + +ts_init "$*" + +ts_skip_nonroot +ts_check_test_command "$TS_CMD_BLKID" +ts_check_test_command "$TS_CMD_MKSWAP" +ts_check_losetup + +ts_device_init + +"$TS_CMD_MKSWAP" -q -p 4096 -e little \ + -U 11111111-1111-1111-1111-111111111111 \ + "$TS_LODEV" \ + >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" + +blkid "$TS_LODEV" \ + | sed -e "s|$TS_LODEV|DEVICE|" \ + >> "$TS_OUTPUT" 2>> "$TS_ERRLOG" + +cat "$BLKID_FILE" \ + | sed -e 's/DEVNO="[^"]*"/DEVNO=""/' \ + -e 's/TIME="[^"]*"/TIME=""/' \ + -e "s|$TS_LODEV|DEVICE|" \ + >> "$TS_OUTPUT" + +ts_finalize diff --git a/tests/ts/blkid/dm-err b/tests/ts/blkid/dm-err new file mode 100755 index 0000000..a23b2e0 --- /dev/null +++ b/tests/ts/blkid/dm-err @@ -0,0 +1,52 @@ +#!/bin/bash + +# +# Copyright (C) 2016 Karel Zak <kzak@redhat.com> +# +# This file is part of util-linux. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# + +TS_TOPDIR="${0%/*}/../.." +TS_DESC="DM error" + +. "$TS_TOPDIR"/functions.sh +ts_init "$*" + +ts_check_test_command "$TS_CMD_BLKID" + +ts_skip_nonroot +ts_check_prog "dmsetup" + +DEVNAME="blkid-dm-err" +DEVICE="/dev/mapper/${DEVNAME}" + +ts_log "Initialize device" +echo "0 262144 error" | dmsetup create $DEVNAME + +# Some tests are run in LXD containers on Travis CI where `mknod` doesn't always work +# https://docs.travis-ci.com/user/multi-cpu-architectures/#security-and-lxd-container +# https://linuxcontainers.org/lxd/docs/master/syscall-interception +if [ "$TRAVIS" == "true" ] && [ ! -b "$DEVICE" ]; then + ts_skip "$DEVICE wasn't created" +fi + +ts_log "Probe device" +$TS_CMD_BLKID -p -o udev $DEVICE >> $TS_OUTPUT 2>> $TS_ERRLOG +echo "Return code: $?" >> $TS_OUTPUT + +udevadm settle +ts_log "Deinitialize device" + +dmsetup remove $DEVNAME + +ts_finalize diff --git a/tests/ts/blkid/images-fs/adaptec-raid.img.xz b/tests/ts/blkid/images-fs/adaptec-raid.img.xz Binary files differnew file mode 100644 index 0000000..20387cd --- /dev/null +++ b/tests/ts/blkid/images-fs/adaptec-raid.img.xz diff --git a/tests/ts/blkid/images-fs/apfs.img.xz b/tests/ts/blkid/images-fs/apfs.img.xz Binary files differnew file mode 100644 index 0000000..4145c01 --- /dev/null +++ b/tests/ts/blkid/images-fs/apfs.img.xz diff --git a/tests/ts/blkid/images-fs/bcache-B.img.xz b/tests/ts/blkid/images-fs/bcache-B.img.xz Binary files differnew file mode 100644 index 0000000..ed187f1 --- /dev/null +++ b/tests/ts/blkid/images-fs/bcache-B.img.xz diff --git a/tests/ts/blkid/images-fs/bcache-C.img.xz b/tests/ts/blkid/images-fs/bcache-C.img.xz Binary files differnew file mode 100644 index 0000000..af90cbf --- /dev/null +++ b/tests/ts/blkid/images-fs/bcache-C.img.xz diff --git a/tests/ts/blkid/images-fs/bcache-journal.img.xz b/tests/ts/blkid/images-fs/bcache-journal.img.xz Binary files differnew file mode 100644 index 0000000..5d2201b --- /dev/null +++ b/tests/ts/blkid/images-fs/bcache-journal.img.xz diff --git a/tests/ts/blkid/images-fs/bcachefs-2.img.xz b/tests/ts/blkid/images-fs/bcachefs-2.img.xz Binary files differnew file mode 100644 index 0000000..267df3f --- /dev/null +++ b/tests/ts/blkid/images-fs/bcachefs-2.img.xz diff --git a/tests/ts/blkid/images-fs/bcachefs.img.xz b/tests/ts/blkid/images-fs/bcachefs.img.xz Binary files differnew file mode 100644 index 0000000..6ef0e50 --- /dev/null +++ b/tests/ts/blkid/images-fs/bcachefs.img.xz diff --git a/tests/ts/blkid/images-fs/befs.img.xz b/tests/ts/blkid/images-fs/befs.img.xz Binary files differnew file mode 100644 index 0000000..188a6e8 --- /dev/null +++ b/tests/ts/blkid/images-fs/befs.img.xz diff --git a/tests/ts/blkid/images-fs/bfs.img.xz b/tests/ts/blkid/images-fs/bfs.img.xz Binary files differnew file mode 100644 index 0000000..98f024a --- /dev/null +++ b/tests/ts/blkid/images-fs/bfs.img.xz diff --git a/tests/ts/blkid/images-fs/bluestore.img.xz b/tests/ts/blkid/images-fs/bluestore.img.xz Binary files differnew file mode 100644 index 0000000..4fd8cbd --- /dev/null +++ b/tests/ts/blkid/images-fs/bluestore.img.xz diff --git a/tests/ts/blkid/images-fs/btrfs.img.xz b/tests/ts/blkid/images-fs/btrfs.img.xz Binary files differnew file mode 100644 index 0000000..418833d --- /dev/null +++ b/tests/ts/blkid/images-fs/btrfs.img.xz diff --git a/tests/ts/blkid/images-fs/cramfs-big.img.xz b/tests/ts/blkid/images-fs/cramfs-big.img.xz Binary files differnew file mode 100644 index 0000000..3d5dbe8 --- /dev/null +++ b/tests/ts/blkid/images-fs/cramfs-big.img.xz diff --git a/tests/ts/blkid/images-fs/cramfs.img.xz b/tests/ts/blkid/images-fs/cramfs.img.xz Binary files differnew file mode 100644 index 0000000..5943867 --- /dev/null +++ b/tests/ts/blkid/images-fs/cramfs.img.xz diff --git a/tests/ts/blkid/images-fs/cs_fvault2.img.xz b/tests/ts/blkid/images-fs/cs_fvault2.img.xz Binary files differnew file mode 100644 index 0000000..a1dec14 --- /dev/null +++ b/tests/ts/blkid/images-fs/cs_fvault2.img.xz diff --git a/tests/ts/blkid/images-fs/ddf-raid.img.xz b/tests/ts/blkid/images-fs/ddf-raid.img.xz Binary files differnew file mode 100644 index 0000000..b5b64fe --- /dev/null +++ b/tests/ts/blkid/images-fs/ddf-raid.img.xz diff --git a/tests/ts/blkid/images-fs/drbd-v08.img.xz b/tests/ts/blkid/images-fs/drbd-v08.img.xz Binary files differnew file mode 100644 index 0000000..2c8db6b --- /dev/null +++ b/tests/ts/blkid/images-fs/drbd-v08.img.xz diff --git a/tests/ts/blkid/images-fs/drbd-v09.img.xz b/tests/ts/blkid/images-fs/drbd-v09.img.xz Binary files differnew file mode 100644 index 0000000..798042d --- /dev/null +++ b/tests/ts/blkid/images-fs/drbd-v09.img.xz diff --git a/tests/ts/blkid/images-fs/drbdmanage-control-volume.img.xz b/tests/ts/blkid/images-fs/drbdmanage-control-volume.img.xz Binary files differnew file mode 100644 index 0000000..d31bfc1 --- /dev/null +++ b/tests/ts/blkid/images-fs/drbdmanage-control-volume.img.xz diff --git a/tests/ts/blkid/images-fs/erofs.img.xz b/tests/ts/blkid/images-fs/erofs.img.xz Binary files differnew file mode 100644 index 0000000..4087344 --- /dev/null +++ b/tests/ts/blkid/images-fs/erofs.img.xz diff --git a/tests/ts/blkid/images-fs/exfat.img.xz b/tests/ts/blkid/images-fs/exfat.img.xz Binary files differnew file mode 100644 index 0000000..43cc09a --- /dev/null +++ b/tests/ts/blkid/images-fs/exfat.img.xz diff --git a/tests/ts/blkid/images-fs/ext2.img.xz b/tests/ts/blkid/images-fs/ext2.img.xz Binary files differnew file mode 100644 index 0000000..3b5489f --- /dev/null +++ b/tests/ts/blkid/images-fs/ext2.img.xz diff --git a/tests/ts/blkid/images-fs/ext3.img.xz b/tests/ts/blkid/images-fs/ext3.img.xz Binary files differnew file mode 100644 index 0000000..7d170e2 --- /dev/null +++ b/tests/ts/blkid/images-fs/ext3.img.xz diff --git a/tests/ts/blkid/images-fs/ext4.img.xz b/tests/ts/blkid/images-fs/ext4.img.xz Binary files differnew file mode 100644 index 0000000..7dbfd70 --- /dev/null +++ b/tests/ts/blkid/images-fs/ext4.img.xz diff --git a/tests/ts/blkid/images-fs/f2fs.img.xz b/tests/ts/blkid/images-fs/f2fs.img.xz Binary files differnew file mode 100644 index 0000000..ed6b95e --- /dev/null +++ b/tests/ts/blkid/images-fs/f2fs.img.xz diff --git a/tests/ts/blkid/images-fs/fat.img.xz b/tests/ts/blkid/images-fs/fat.img.xz Binary files differnew file mode 100644 index 0000000..4e0997a --- /dev/null +++ b/tests/ts/blkid/images-fs/fat.img.xz diff --git a/tests/ts/blkid/images-fs/fat16_noheads.img.xz b/tests/ts/blkid/images-fs/fat16_noheads.img.xz Binary files differnew file mode 100644 index 0000000..a0ee296 --- /dev/null +++ b/tests/ts/blkid/images-fs/fat16_noheads.img.xz diff --git a/tests/ts/blkid/images-fs/fat32_cp850_O_tilde.img.xz b/tests/ts/blkid/images-fs/fat32_cp850_O_tilde.img.xz Binary files differnew file mode 100644 index 0000000..06eb2c9 --- /dev/null +++ b/tests/ts/blkid/images-fs/fat32_cp850_O_tilde.img.xz diff --git a/tests/ts/blkid/images-fs/fat32_label_64MB.img.xz b/tests/ts/blkid/images-fs/fat32_label_64MB.img.xz Binary files differnew file mode 100644 index 0000000..f0976bc --- /dev/null +++ b/tests/ts/blkid/images-fs/fat32_label_64MB.img.xz diff --git a/tests/ts/blkid/images-fs/fat32_mkdosfs_label1.img.xz b/tests/ts/blkid/images-fs/fat32_mkdosfs_label1.img.xz Binary files differnew file mode 100644 index 0000000..4df4b1d --- /dev/null +++ b/tests/ts/blkid/images-fs/fat32_mkdosfs_label1.img.xz diff --git a/tests/ts/blkid/images-fs/fat32_mkdosfs_label1_dosfslabel_NO_NAME.img.xz b/tests/ts/blkid/images-fs/fat32_mkdosfs_label1_dosfslabel_NO_NAME.img.xz Binary files differnew file mode 100644 index 0000000..932ab11 --- /dev/null +++ b/tests/ts/blkid/images-fs/fat32_mkdosfs_label1_dosfslabel_NO_NAME.img.xz diff --git a/tests/ts/blkid/images-fs/fat32_mkdosfs_label1_dosfslabel_empty.img.xz b/tests/ts/blkid/images-fs/fat32_mkdosfs_label1_dosfslabel_empty.img.xz Binary files differnew file mode 100644 index 0000000..3027031 --- /dev/null +++ b/tests/ts/blkid/images-fs/fat32_mkdosfs_label1_dosfslabel_empty.img.xz diff --git a/tests/ts/blkid/images-fs/fat32_mkdosfs_label1_dosfslabel_label2.img.xz b/tests/ts/blkid/images-fs/fat32_mkdosfs_label1_dosfslabel_label2.img.xz Binary files differnew file mode 100644 index 0000000..1551e11 --- /dev/null +++ b/tests/ts/blkid/images-fs/fat32_mkdosfs_label1_dosfslabel_label2.img.xz diff --git a/tests/ts/blkid/images-fs/fat32_mkdosfs_label1_mlabel_NO_NAME.img.xz b/tests/ts/blkid/images-fs/fat32_mkdosfs_label1_mlabel_NO_NAME.img.xz Binary files differnew file mode 100644 index 0000000..264c440 --- /dev/null +++ b/tests/ts/blkid/images-fs/fat32_mkdosfs_label1_mlabel_NO_NAME.img.xz diff --git a/tests/ts/blkid/images-fs/fat32_mkdosfs_label1_mlabel_erase.img.xz b/tests/ts/blkid/images-fs/fat32_mkdosfs_label1_mlabel_erase.img.xz Binary files differnew file mode 100644 index 0000000..f0a9571 --- /dev/null +++ b/tests/ts/blkid/images-fs/fat32_mkdosfs_label1_mlabel_erase.img.xz diff --git a/tests/ts/blkid/images-fs/fat32_mkdosfs_label1_xp_erase.img.xz b/tests/ts/blkid/images-fs/fat32_mkdosfs_label1_xp_erase.img.xz Binary files differnew file mode 100644 index 0000000..cc4280e --- /dev/null +++ b/tests/ts/blkid/images-fs/fat32_mkdosfs_label1_xp_erase.img.xz diff --git a/tests/ts/blkid/images-fs/fat32_mkdosfs_label1_xp_label2.img.xz b/tests/ts/blkid/images-fs/fat32_mkdosfs_label1_xp_label2.img.xz Binary files differnew file mode 100644 index 0000000..66d4838 --- /dev/null +++ b/tests/ts/blkid/images-fs/fat32_mkdosfs_label1_xp_label2.img.xz diff --git a/tests/ts/blkid/images-fs/fat32_mkdosfs_none.img.xz b/tests/ts/blkid/images-fs/fat32_mkdosfs_none.img.xz Binary files differnew file mode 100644 index 0000000..0d084f3 --- /dev/null +++ b/tests/ts/blkid/images-fs/fat32_mkdosfs_none.img.xz diff --git a/tests/ts/blkid/images-fs/fat32_mkdosfs_none_dosfslabel_NO_NAME.img.xz b/tests/ts/blkid/images-fs/fat32_mkdosfs_none_dosfslabel_NO_NAME.img.xz Binary files differnew file mode 100644 index 0000000..a238a01 --- /dev/null +++ b/tests/ts/blkid/images-fs/fat32_mkdosfs_none_dosfslabel_NO_NAME.img.xz diff --git a/tests/ts/blkid/images-fs/fat32_mkdosfs_none_dosfslabel_label1.img.xz b/tests/ts/blkid/images-fs/fat32_mkdosfs_none_dosfslabel_label1.img.xz Binary files differnew file mode 100644 index 0000000..1486031 --- /dev/null +++ b/tests/ts/blkid/images-fs/fat32_mkdosfs_none_dosfslabel_label1.img.xz diff --git a/tests/ts/blkid/images-fs/fat32_mkdosfs_none_dosfslabel_label1_xp_label2.img.xz b/tests/ts/blkid/images-fs/fat32_mkdosfs_none_dosfslabel_label1_xp_label2.img.xz Binary files differnew file mode 100644 index 0000000..5401e1f --- /dev/null +++ b/tests/ts/blkid/images-fs/fat32_mkdosfs_none_dosfslabel_label1_xp_label2.img.xz diff --git a/tests/ts/blkid/images-fs/fat32_mkdosfs_none_xp_label1.img.xz b/tests/ts/blkid/images-fs/fat32_mkdosfs_none_xp_label1.img.xz Binary files differnew file mode 100644 index 0000000..acf01cc --- /dev/null +++ b/tests/ts/blkid/images-fs/fat32_mkdosfs_none_xp_label1.img.xz diff --git a/tests/ts/blkid/images-fs/fat32_mkdosfs_none_xp_label1_dosfslabel_label2.img.xz b/tests/ts/blkid/images-fs/fat32_mkdosfs_none_xp_label1_dosfslabel_label2.img.xz Binary files differnew file mode 100644 index 0000000..bff0971 --- /dev/null +++ b/tests/ts/blkid/images-fs/fat32_mkdosfs_none_xp_label1_dosfslabel_label2.img.xz diff --git a/tests/ts/blkid/images-fs/fat32_xp_label1.img.xz b/tests/ts/blkid/images-fs/fat32_xp_label1.img.xz Binary files differnew file mode 100644 index 0000000..97d71e9 --- /dev/null +++ b/tests/ts/blkid/images-fs/fat32_xp_label1.img.xz diff --git a/tests/ts/blkid/images-fs/fat32_xp_none.img.xz b/tests/ts/blkid/images-fs/fat32_xp_none.img.xz Binary files differnew file mode 100644 index 0000000..a8c819e --- /dev/null +++ b/tests/ts/blkid/images-fs/fat32_xp_none.img.xz diff --git a/tests/ts/blkid/images-fs/fat32_xp_none_dosfslabel_label1.img.xz b/tests/ts/blkid/images-fs/fat32_xp_none_dosfslabel_label1.img.xz Binary files differnew file mode 100644 index 0000000..0ebe6be --- /dev/null +++ b/tests/ts/blkid/images-fs/fat32_xp_none_dosfslabel_label1.img.xz diff --git a/tests/ts/blkid/images-fs/fat32_xp_none_mlabel_label1.img.xz b/tests/ts/blkid/images-fs/fat32_xp_none_mlabel_label1.img.xz Binary files differnew file mode 100644 index 0000000..5a7a774 --- /dev/null +++ b/tests/ts/blkid/images-fs/fat32_xp_none_mlabel_label1.img.xz diff --git a/tests/ts/blkid/images-fs/gfs2.img.xz b/tests/ts/blkid/images-fs/gfs2.img.xz Binary files differnew file mode 100644 index 0000000..22d4d6b --- /dev/null +++ b/tests/ts/blkid/images-fs/gfs2.img.xz diff --git a/tests/ts/blkid/images-fs/hfs.img.xz b/tests/ts/blkid/images-fs/hfs.img.xz Binary files differnew file mode 100644 index 0000000..cfa3252 --- /dev/null +++ b/tests/ts/blkid/images-fs/hfs.img.xz diff --git a/tests/ts/blkid/images-fs/hfsplus.img.xz b/tests/ts/blkid/images-fs/hfsplus.img.xz Binary files differnew file mode 100644 index 0000000..1c37a70 --- /dev/null +++ b/tests/ts/blkid/images-fs/hfsplus.img.xz diff --git a/tests/ts/blkid/images-fs/hpfs.img.xz b/tests/ts/blkid/images-fs/hpfs.img.xz Binary files differnew file mode 100644 index 0000000..4e22a8e --- /dev/null +++ b/tests/ts/blkid/images-fs/hpfs.img.xz diff --git a/tests/ts/blkid/images-fs/hpt37x-raid.img.xz b/tests/ts/blkid/images-fs/hpt37x-raid.img.xz Binary files differnew file mode 100644 index 0000000..1b53059 --- /dev/null +++ b/tests/ts/blkid/images-fs/hpt37x-raid.img.xz diff --git a/tests/ts/blkid/images-fs/hpt45x-raid.img.xz b/tests/ts/blkid/images-fs/hpt45x-raid.img.xz Binary files differnew file mode 100644 index 0000000..7dfe68a --- /dev/null +++ b/tests/ts/blkid/images-fs/hpt45x-raid.img.xz diff --git a/tests/ts/blkid/images-fs/iso-different-iso-joliet-label.img.xz b/tests/ts/blkid/images-fs/iso-different-iso-joliet-label.img.xz Binary files differnew file mode 100644 index 0000000..73c5f2b --- /dev/null +++ b/tests/ts/blkid/images-fs/iso-different-iso-joliet-label.img.xz diff --git a/tests/ts/blkid/images-fs/iso-joliet.img.xz b/tests/ts/blkid/images-fs/iso-joliet.img.xz Binary files differnew file mode 100644 index 0000000..16b8961 --- /dev/null +++ b/tests/ts/blkid/images-fs/iso-joliet.img.xz diff --git a/tests/ts/blkid/images-fs/iso-multi-0-174-348-genisoimage.img.xz b/tests/ts/blkid/images-fs/iso-multi-0-174-348-genisoimage.img.xz Binary files differnew file mode 100644 index 0000000..ec15d8c --- /dev/null +++ b/tests/ts/blkid/images-fs/iso-multi-0-174-348-genisoimage.img.xz diff --git a/tests/ts/blkid/images-fs/iso-rr-joliet.img.xz b/tests/ts/blkid/images-fs/iso-rr-joliet.img.xz Binary files differnew file mode 100644 index 0000000..1d6ad2c --- /dev/null +++ b/tests/ts/blkid/images-fs/iso-rr-joliet.img.xz diff --git a/tests/ts/blkid/images-fs/iso-unicode-long-label.img.xz b/tests/ts/blkid/images-fs/iso-unicode-long-label.img.xz Binary files differnew file mode 100644 index 0000000..488be1a --- /dev/null +++ b/tests/ts/blkid/images-fs/iso-unicode-long-label.img.xz diff --git a/tests/ts/blkid/images-fs/iso.img.xz b/tests/ts/blkid/images-fs/iso.img.xz Binary files differnew file mode 100644 index 0000000..f1146f3 --- /dev/null +++ b/tests/ts/blkid/images-fs/iso.img.xz diff --git a/tests/ts/blkid/images-fs/isw-raid.img.xz b/tests/ts/blkid/images-fs/isw-raid.img.xz Binary files differnew file mode 100644 index 0000000..8e5529a --- /dev/null +++ b/tests/ts/blkid/images-fs/isw-raid.img.xz diff --git a/tests/ts/blkid/images-fs/jbd.img.xz b/tests/ts/blkid/images-fs/jbd.img.xz Binary files differnew file mode 100644 index 0000000..7c5a089 --- /dev/null +++ b/tests/ts/blkid/images-fs/jbd.img.xz diff --git a/tests/ts/blkid/images-fs/jfs.img.xz b/tests/ts/blkid/images-fs/jfs.img.xz Binary files differnew file mode 100644 index 0000000..4780f6d --- /dev/null +++ b/tests/ts/blkid/images-fs/jfs.img.xz diff --git a/tests/ts/blkid/images-fs/jmicron-raid.img.xz b/tests/ts/blkid/images-fs/jmicron-raid.img.xz Binary files differnew file mode 100644 index 0000000..cde0811 --- /dev/null +++ b/tests/ts/blkid/images-fs/jmicron-raid.img.xz diff --git a/tests/ts/blkid/images-fs/lsi-raid.img.xz b/tests/ts/blkid/images-fs/lsi-raid.img.xz Binary files differnew file mode 100644 index 0000000..d6ae15a --- /dev/null +++ b/tests/ts/blkid/images-fs/lsi-raid.img.xz diff --git a/tests/ts/blkid/images-fs/luks1.img.xz b/tests/ts/blkid/images-fs/luks1.img.xz Binary files differnew file mode 100644 index 0000000..c0f5902 --- /dev/null +++ b/tests/ts/blkid/images-fs/luks1.img.xz diff --git a/tests/ts/blkid/images-fs/luks2.img.xz b/tests/ts/blkid/images-fs/luks2.img.xz Binary files differnew file mode 100644 index 0000000..997fb04 --- /dev/null +++ b/tests/ts/blkid/images-fs/luks2.img.xz diff --git a/tests/ts/blkid/images-fs/lvm2.img.xz b/tests/ts/blkid/images-fs/lvm2.img.xz Binary files differnew file mode 100644 index 0000000..4c3c183 --- /dev/null +++ b/tests/ts/blkid/images-fs/lvm2.img.xz diff --git a/tests/ts/blkid/images-fs/mdraid-1.img.xz b/tests/ts/blkid/images-fs/mdraid-1.img.xz Binary files differnew file mode 100644 index 0000000..c17ad3b --- /dev/null +++ b/tests/ts/blkid/images-fs/mdraid-1.img.xz diff --git a/tests/ts/blkid/images-fs/mdraid.img.xz b/tests/ts/blkid/images-fs/mdraid.img.xz Binary files differnew file mode 100644 index 0000000..e8ff4f5 --- /dev/null +++ b/tests/ts/blkid/images-fs/mdraid.img.xz diff --git a/tests/ts/blkid/images-fs/minix-BE.img.xz b/tests/ts/blkid/images-fs/minix-BE.img.xz Binary files differnew file mode 100644 index 0000000..c349a4f --- /dev/null +++ b/tests/ts/blkid/images-fs/minix-BE.img.xz diff --git a/tests/ts/blkid/images-fs/minix-LE.img.xz b/tests/ts/blkid/images-fs/minix-LE.img.xz Binary files differnew file mode 100644 index 0000000..da646a8 --- /dev/null +++ b/tests/ts/blkid/images-fs/minix-LE.img.xz diff --git a/tests/ts/blkid/images-fs/mpool.img.xz b/tests/ts/blkid/images-fs/mpool.img.xz Binary files differnew file mode 100644 index 0000000..4bfefde --- /dev/null +++ b/tests/ts/blkid/images-fs/mpool.img.xz diff --git a/tests/ts/blkid/images-fs/netware.img.xz b/tests/ts/blkid/images-fs/netware.img.xz Binary files differnew file mode 100644 index 0000000..fe5b103 --- /dev/null +++ b/tests/ts/blkid/images-fs/netware.img.xz diff --git a/tests/ts/blkid/images-fs/nilfs2.img.xz b/tests/ts/blkid/images-fs/nilfs2.img.xz Binary files differnew file mode 100644 index 0000000..38de645 --- /dev/null +++ b/tests/ts/blkid/images-fs/nilfs2.img.xz diff --git a/tests/ts/blkid/images-fs/ntfs.img.xz b/tests/ts/blkid/images-fs/ntfs.img.xz Binary files differnew file mode 100644 index 0000000..2b414c4 --- /dev/null +++ b/tests/ts/blkid/images-fs/ntfs.img.xz diff --git a/tests/ts/blkid/images-fs/nvidia-raid.img.xz b/tests/ts/blkid/images-fs/nvidia-raid.img.xz Binary files differnew file mode 100644 index 0000000..775f810 --- /dev/null +++ b/tests/ts/blkid/images-fs/nvidia-raid.img.xz diff --git a/tests/ts/blkid/images-fs/ocfs2.img.xz b/tests/ts/blkid/images-fs/ocfs2.img.xz Binary files differnew file mode 100644 index 0000000..12ed926 --- /dev/null +++ b/tests/ts/blkid/images-fs/ocfs2.img.xz diff --git a/tests/ts/blkid/images-fs/promise-raid.img.xz b/tests/ts/blkid/images-fs/promise-raid.img.xz Binary files differnew file mode 100644 index 0000000..77f135f --- /dev/null +++ b/tests/ts/blkid/images-fs/promise-raid.img.xz diff --git a/tests/ts/blkid/images-fs/reiser3.img.xz b/tests/ts/blkid/images-fs/reiser3.img.xz Binary files differnew file mode 100644 index 0000000..8bc595f --- /dev/null +++ b/tests/ts/blkid/images-fs/reiser3.img.xz diff --git a/tests/ts/blkid/images-fs/reiser4.img.xz b/tests/ts/blkid/images-fs/reiser4.img.xz Binary files differnew file mode 100644 index 0000000..e97f960 --- /dev/null +++ b/tests/ts/blkid/images-fs/reiser4.img.xz diff --git a/tests/ts/blkid/images-fs/romfs.img.xz b/tests/ts/blkid/images-fs/romfs.img.xz Binary files differnew file mode 100644 index 0000000..680eeed --- /dev/null +++ b/tests/ts/blkid/images-fs/romfs.img.xz diff --git a/tests/ts/blkid/images-fs/silicon-raid.img.xz b/tests/ts/blkid/images-fs/silicon-raid.img.xz Binary files differnew file mode 100644 index 0000000..28d6a42 --- /dev/null +++ b/tests/ts/blkid/images-fs/silicon-raid.img.xz diff --git a/tests/ts/blkid/images-fs/small-fat32.img.xz b/tests/ts/blkid/images-fs/small-fat32.img.xz Binary files differnew file mode 100644 index 0000000..7a04f42 --- /dev/null +++ b/tests/ts/blkid/images-fs/small-fat32.img.xz diff --git a/tests/ts/blkid/images-fs/squashfs3.img.xz b/tests/ts/blkid/images-fs/squashfs3.img.xz Binary files differnew file mode 100755 index 0000000..8b2e15d --- /dev/null +++ b/tests/ts/blkid/images-fs/squashfs3.img.xz diff --git a/tests/ts/blkid/images-fs/squashfs4.img.xz b/tests/ts/blkid/images-fs/squashfs4.img.xz Binary files differnew file mode 100644 index 0000000..81f0785 --- /dev/null +++ b/tests/ts/blkid/images-fs/squashfs4.img.xz diff --git a/tests/ts/blkid/images-fs/swap0.img.xz b/tests/ts/blkid/images-fs/swap0.img.xz Binary files differnew file mode 100644 index 0000000..3cfea73 --- /dev/null +++ b/tests/ts/blkid/images-fs/swap0.img.xz diff --git a/tests/ts/blkid/images-fs/swap1-big.img.xz b/tests/ts/blkid/images-fs/swap1-big.img.xz Binary files differnew file mode 100644 index 0000000..7d256fc --- /dev/null +++ b/tests/ts/blkid/images-fs/swap1-big.img.xz diff --git a/tests/ts/blkid/images-fs/swap1.img.xz b/tests/ts/blkid/images-fs/swap1.img.xz Binary files differnew file mode 100644 index 0000000..6e6f539 --- /dev/null +++ b/tests/ts/blkid/images-fs/swap1.img.xz diff --git a/tests/ts/blkid/images-fs/tuxonice.img.xz b/tests/ts/blkid/images-fs/tuxonice.img.xz Binary files differnew file mode 100644 index 0000000..472cf9c --- /dev/null +++ b/tests/ts/blkid/images-fs/tuxonice.img.xz diff --git a/tests/ts/blkid/images-fs/ubi.img.xz b/tests/ts/blkid/images-fs/ubi.img.xz Binary files differnew file mode 100644 index 0000000..1a073f2 --- /dev/null +++ b/tests/ts/blkid/images-fs/ubi.img.xz diff --git a/tests/ts/blkid/images-fs/ubifs.img.xz b/tests/ts/blkid/images-fs/ubifs.img.xz Binary files differnew file mode 100644 index 0000000..2004f5b --- /dev/null +++ b/tests/ts/blkid/images-fs/ubifs.img.xz diff --git a/tests/ts/blkid/images-fs/udf-bdr-2.60-nero.img.xz b/tests/ts/blkid/images-fs/udf-bdr-2.60-nero.img.xz Binary files differnew file mode 100644 index 0000000..9fb9a4f --- /dev/null +++ b/tests/ts/blkid/images-fs/udf-bdr-2.60-nero.img.xz diff --git a/tests/ts/blkid/images-fs/udf-cd-mkudfiso-20100208.img.xz b/tests/ts/blkid/images-fs/udf-cd-mkudfiso-20100208.img.xz Binary files differnew file mode 100644 index 0000000..1da9a28 --- /dev/null +++ b/tests/ts/blkid/images-fs/udf-cd-mkudfiso-20100208.img.xz diff --git a/tests/ts/blkid/images-fs/udf-cd-nero-6.img.xz b/tests/ts/blkid/images-fs/udf-cd-nero-6.img.xz Binary files differnew file mode 100644 index 0000000..673fa62 --- /dev/null +++ b/tests/ts/blkid/images-fs/udf-cd-nero-6.img.xz diff --git a/tests/ts/blkid/images-fs/udf-hdd-macosx-2.60-4096.img.xz b/tests/ts/blkid/images-fs/udf-hdd-macosx-2.60-4096.img.xz Binary files differnew file mode 100644 index 0000000..68412ad --- /dev/null +++ b/tests/ts/blkid/images-fs/udf-hdd-macosx-2.60-4096.img.xz diff --git a/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.0.0-1.img.xz b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.0.0-1.img.xz Binary files differnew file mode 100644 index 0000000..39db4be --- /dev/null +++ b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.0.0-1.img.xz diff --git a/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.0.0-2.img.xz b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.0.0-2.img.xz Binary files differnew file mode 100644 index 0000000..4cba447 --- /dev/null +++ b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.0.0-2.img.xz diff --git a/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-1.img.xz b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-1.img.xz Binary files differnew file mode 100644 index 0000000..7df36db --- /dev/null +++ b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-1.img.xz diff --git a/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-2.img.xz b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-2.img.xz Binary files differnew file mode 100644 index 0000000..bc0facc --- /dev/null +++ b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-2.img.xz diff --git a/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-3.img.xz b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-3.img.xz Binary files differnew file mode 100644 index 0000000..d774e0a --- /dev/null +++ b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-3.img.xz diff --git a/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-4.img.xz b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-4.img.xz Binary files differnew file mode 100644 index 0000000..047e39a --- /dev/null +++ b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-4.img.xz diff --git a/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-5.img.xz b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-5.img.xz Binary files differnew file mode 100644 index 0000000..291d7eb --- /dev/null +++ b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-5.img.xz diff --git a/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-6.img.xz b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-6.img.xz Binary files differnew file mode 100644 index 0000000..393ab9e --- /dev/null +++ b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-6.img.xz diff --git a/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-7.img.xz b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-7.img.xz Binary files differnew file mode 100644 index 0000000..5940009 --- /dev/null +++ b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-7.img.xz diff --git a/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-8.img.xz b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-8.img.xz Binary files differnew file mode 100644 index 0000000..b91180c --- /dev/null +++ b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-1.3-8.img.xz diff --git a/tests/ts/blkid/images-fs/udf-hdd-mkudffs-2.2.img.xz b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-2.2.img.xz Binary files differnew file mode 100644 index 0000000..bc00729 --- /dev/null +++ b/tests/ts/blkid/images-fs/udf-hdd-mkudffs-2.2.img.xz diff --git a/tests/ts/blkid/images-fs/udf-hdd-udfclient-0.7.5.img.xz b/tests/ts/blkid/images-fs/udf-hdd-udfclient-0.7.5.img.xz Binary files differnew file mode 100644 index 0000000..baddc84 --- /dev/null +++ b/tests/ts/blkid/images-fs/udf-hdd-udfclient-0.7.5.img.xz diff --git a/tests/ts/blkid/images-fs/udf-hdd-udfclient-0.7.7.img.xz b/tests/ts/blkid/images-fs/udf-hdd-udfclient-0.7.7.img.xz Binary files differnew file mode 100644 index 0000000..dfb8cdb --- /dev/null +++ b/tests/ts/blkid/images-fs/udf-hdd-udfclient-0.7.7.img.xz diff --git a/tests/ts/blkid/images-fs/udf-hdd-win7.img.xz b/tests/ts/blkid/images-fs/udf-hdd-win7.img.xz Binary files differnew file mode 100644 index 0000000..ee86115 --- /dev/null +++ b/tests/ts/blkid/images-fs/udf-hdd-win7.img.xz diff --git a/tests/ts/blkid/images-fs/udf-multi-0-320-640-mkudffs.img.xz b/tests/ts/blkid/images-fs/udf-multi-0-320-640-mkudffs.img.xz Binary files differnew file mode 100644 index 0000000..cac6318 --- /dev/null +++ b/tests/ts/blkid/images-fs/udf-multi-0-320-640-mkudffs.img.xz diff --git a/tests/ts/blkid/images-fs/udf-multi-0-417-834-genisoimage.img.xz b/tests/ts/blkid/images-fs/udf-multi-0-417-834-genisoimage.img.xz Binary files differnew file mode 100644 index 0000000..c1c6fc7 --- /dev/null +++ b/tests/ts/blkid/images-fs/udf-multi-0-417-834-genisoimage.img.xz diff --git a/tests/ts/blkid/images-fs/udf.img.xz b/tests/ts/blkid/images-fs/udf.img.xz Binary files differnew file mode 100644 index 0000000..fdf0edf --- /dev/null +++ b/tests/ts/blkid/images-fs/udf.img.xz diff --git a/tests/ts/blkid/images-fs/ufs.img.xz b/tests/ts/blkid/images-fs/ufs.img.xz Binary files differnew file mode 100644 index 0000000..58f8b20 --- /dev/null +++ b/tests/ts/blkid/images-fs/ufs.img.xz diff --git a/tests/ts/blkid/images-fs/vdo.img.xz b/tests/ts/blkid/images-fs/vdo.img.xz Binary files differnew file mode 100644 index 0000000..08c7ecb --- /dev/null +++ b/tests/ts/blkid/images-fs/vdo.img.xz diff --git a/tests/ts/blkid/images-fs/via-raid.img.xz b/tests/ts/blkid/images-fs/via-raid.img.xz Binary files differnew file mode 100644 index 0000000..c5f6fb7 --- /dev/null +++ b/tests/ts/blkid/images-fs/via-raid.img.xz diff --git a/tests/ts/blkid/images-fs/vmfs.img.xz b/tests/ts/blkid/images-fs/vmfs.img.xz Binary files differnew file mode 100644 index 0000000..ce4544e --- /dev/null +++ b/tests/ts/blkid/images-fs/vmfs.img.xz diff --git a/tests/ts/blkid/images-fs/vmfs_volume.img.xz b/tests/ts/blkid/images-fs/vmfs_volume.img.xz Binary files differnew file mode 100644 index 0000000..93f11b4 --- /dev/null +++ b/tests/ts/blkid/images-fs/vmfs_volume.img.xz diff --git a/tests/ts/blkid/images-fs/xfs-log.img.xz b/tests/ts/blkid/images-fs/xfs-log.img.xz Binary files differnew file mode 100644 index 0000000..35ff33b --- /dev/null +++ b/tests/ts/blkid/images-fs/xfs-log.img.xz diff --git a/tests/ts/blkid/images-fs/xfs-v5.img.xz b/tests/ts/blkid/images-fs/xfs-v5.img.xz Binary files differnew file mode 100644 index 0000000..e2399e3 --- /dev/null +++ b/tests/ts/blkid/images-fs/xfs-v5.img.xz diff --git a/tests/ts/blkid/images-fs/xfs.img.xz b/tests/ts/blkid/images-fs/xfs.img.xz Binary files differnew file mode 100644 index 0000000..5576c66 --- /dev/null +++ b/tests/ts/blkid/images-fs/xfs.img.xz diff --git a/tests/ts/blkid/images-fs/zfs.img.xz b/tests/ts/blkid/images-fs/zfs.img.xz Binary files differnew file mode 100644 index 0000000..f85e536 --- /dev/null +++ b/tests/ts/blkid/images-fs/zfs.img.xz diff --git a/tests/ts/blkid/images-fs/zonefs.img.xz b/tests/ts/blkid/images-fs/zonefs.img.xz Binary files differnew file mode 100644 index 0000000..c936a80 --- /dev/null +++ b/tests/ts/blkid/images-fs/zonefs.img.xz diff --git a/tests/ts/blkid/images-pt/atari-primary.img.xz b/tests/ts/blkid/images-pt/atari-primary.img.xz Binary files differnew file mode 100644 index 0000000..6f915fa --- /dev/null +++ b/tests/ts/blkid/images-pt/atari-primary.img.xz diff --git a/tests/ts/blkid/images-pt/atari-xgm.img.xz b/tests/ts/blkid/images-pt/atari-xgm.img.xz Binary files differnew file mode 100644 index 0000000..a98c02d --- /dev/null +++ b/tests/ts/blkid/images-pt/atari-xgm.img.xz diff --git a/tests/ts/blkid/images-pt/bsd.img.xz b/tests/ts/blkid/images-pt/bsd.img.xz Binary files differnew file mode 100644 index 0000000..bfdb50b --- /dev/null +++ b/tests/ts/blkid/images-pt/bsd.img.xz diff --git a/tests/ts/blkid/images-pt/dos+bsd.img.xz b/tests/ts/blkid/images-pt/dos+bsd.img.xz Binary files differnew file mode 100644 index 0000000..f87dd74 --- /dev/null +++ b/tests/ts/blkid/images-pt/dos+bsd.img.xz diff --git a/tests/ts/blkid/images-pt/gpt.img.xz b/tests/ts/blkid/images-pt/gpt.img.xz Binary files differnew file mode 100644 index 0000000..9a085b4 --- /dev/null +++ b/tests/ts/blkid/images-pt/gpt.img.xz diff --git a/tests/ts/blkid/images-pt/sgi.img.xz b/tests/ts/blkid/images-pt/sgi.img.xz Binary files differnew file mode 100644 index 0000000..d5fed80 --- /dev/null +++ b/tests/ts/blkid/images-pt/sgi.img.xz diff --git a/tests/ts/blkid/images-pt/sun.img.xz b/tests/ts/blkid/images-pt/sun.img.xz Binary files differnew file mode 100644 index 0000000..a00594a --- /dev/null +++ b/tests/ts/blkid/images-pt/sun.img.xz diff --git a/tests/ts/blkid/low-probe b/tests/ts/blkid/low-probe new file mode 100755 index 0000000..27a074b --- /dev/null +++ b/tests/ts/blkid/low-probe @@ -0,0 +1,66 @@ +#!/bin/bash + +# +# Copyright (C) 2009 Karel Zak <kzak@redhat.com> +# +# This file is part of util-linux. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# + +TS_TOPDIR="${0%/*}/../.." +TS_DESC="superblocks probing" + +. "$TS_TOPDIR"/functions.sh + +ts_init "$*" + +ts_check_test_command "$TS_CMD_BLKID" +ts_check_prog "xz" + +mkdir -p $TS_OUTDIR/images-fs + +for img in $(ls $TS_SELF/images-fs/*.img.xz | sort); do + name=$(basename $img .img.xz) + outimg=$TS_OUTDIR/images-fs/${name}.img + + xz -dc $img > $outimg + + # + # multi session images, the image name contains "-multi-" and all + # -<numbers>- are interpreted as offset to the sessions. The offset is + # calculated in 2048 sectors. For example: iso-multi-0-174-348-genisoimage.img + # + if [[ $name =~ (.*multi.*) ]]; then + sessions=$(echo "$name" \ + | awk 'BEGIN { RS="-" } /^[[:digit:]]+$/ { print $0 }') + name=$(echo "$name" \ + | awk 'BEGIN { RS="-"; ORS="-" } !/^[[:digit:]]+$/ { print $1 }' \ + | sed 's/-$//g') + for off in $sessions; do + ts_init_subtest $name-$off + $TS_CMD_BLKID -p -o udev $outimg \ + --hint session_offset=$(( $off * 2048 )) \ + 2> $TS_ERRLOG | sort > $TS_OUTPUT + ts_finalize_subtest + done + # + # Standard filesystem images + # + else + ts_init_subtest $name + $TS_CMD_BLKID -p -o udev $outimg 2> $TS_ERRLOG | sort > $TS_OUTPUT + ts_finalize_subtest + fi +done + +ts_finalize + diff --git a/tests/ts/blkid/lowprobe-pt b/tests/ts/blkid/lowprobe-pt new file mode 100755 index 0000000..8e55ccc --- /dev/null +++ b/tests/ts/blkid/lowprobe-pt @@ -0,0 +1,44 @@ +#!/bin/bash + +# +# Copyright (C) 2009 Karel Zak <kzak@redhat.com> +# +# This file is part of util-linux. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# + +TS_TOPDIR="${0%/*}/../.." +TS_DESC="partitions probing" + +. "$TS_TOPDIR"/functions.sh + +ts_init "$*" + +ts_check_test_command "$TS_HELPER_PARTITIONS" +ts_check_prog "xz" + +mkdir -p $TS_OUTDIR/images-pt + +for img in $(ls $TS_SELF/images-pt/*.img.xz | sort); do + name=$(basename $img .img.xz) + outimg=$TS_OUTDIR/images-pt/${name}.img + + ts_init_subtest $name + + xz -dc $img > $outimg + + $TS_HELPER_PARTITIONS $outimg &> $TS_OUTPUT + ts_finalize_subtest +done + +ts_finalize + diff --git a/tests/ts/blkid/md-raid0-whole b/tests/ts/blkid/md-raid0-whole new file mode 100755 index 0000000..0c957ab --- /dev/null +++ b/tests/ts/blkid/md-raid0-whole @@ -0,0 +1,99 @@ +#!/bin/bash + +# +# Copyright (C) 2010 Karel Zak <kzak@redhat.com> +# +# This file is part of util-linux. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# + +TS_TOPDIR="${0%/*}/../.." +TS_DESC="MD raid0 (whole-disks)" + +. "$TS_TOPDIR"/functions.sh +ts_init "$*" + +ts_check_test_command "$TS_CMD_FDISK" +ts_check_test_command "$TS_CMD_BLKID" + +ts_skip_nonroot +ts_check_losetup +ts_check_prog "mdadm" + +# rhbz#182625: It can't create new raid0 with metadata 0.90 from mdadm-4.1 +TS_KNOWN_FAIL="yes" + +ts_log "Initialize devices" +IMGNAME="${TS_OUTDIR}/${TS_TESTNAME}" + +ts_device_init 50 ${IMGNAME}1.img +DEVICE1=$TS_LODEV + +ts_device_init 50 ${IMGNAME}2.img +DEVICE2=$TS_LODEV + +MD_DEVNAME=md8 +MD_DEVICE=/dev/${MD_DEVNAME} + +ts_lock "md" +mdadm -q -S ${MD_DEVICE} &> /dev/null + +ts_log "Create RAID device" +mdadm -q --create ${MD_DEVICE} --metadata=0.90 --chunk=64 --level=0 \ + --raid-devices=2 ${DEVICE1} ${DEVICE2} >> $TS_OUTPUT 2>> $TS_ERRLOG + +# create dos partition table +$TS_CMD_FDISK --noauto-pt ${MD_DEVICE} &>/dev/null <<EOF +o +w +q +EOF + +ts_log "Create partitions on RAID device" +$TS_CMD_FDISK ${MD_DEVICE} >> $TS_OUTPUT 2>> $TS_ERRLOG <<EOF +n +p +1 + ++10M +n +p +2 + + +p +w +q +EOF + +udevadm settle + +ts_log "Probe first RAID member" +$TS_CMD_BLKID -p -o udev $DEVICE1 2>> $TS_ERRLOG | sort >> $TS_OUTPUT + +ts_log "Probe second RAID member" +$TS_CMD_BLKID -p -o udev $DEVICE1 2>> $TS_ERRLOG | sort >> $TS_OUTPUT + +ts_log "Stop RAID device" +mdadm -q -S ${MD_DEVICE} >> $TS_OUTPUT 2>> $TS_ERRLOG + +udevadm settle +ts_unlock "md" + +ts_log "Deinitialize devices" + +ts_fdisk_clean $MD_DEVICE + +# remove generated UUIDs +sed -i -e 's/ID_FS_UUID.*//g' $TS_OUTPUT + +ts_finalize diff --git a/tests/ts/blkid/md-raid1-part b/tests/ts/blkid/md-raid1-part new file mode 100755 index 0000000..b0ef822 --- /dev/null +++ b/tests/ts/blkid/md-raid1-part @@ -0,0 +1,99 @@ +#!/bin/bash + +# +# Copyright (C) 2010 Karel Zak <kzak@redhat.com> +# +# This file is part of util-linux. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# + +TS_TOPDIR="${0%/*}/../.." +TS_DESC="MD raid1 (last partition)" + +. "$TS_TOPDIR"/functions.sh +ts_init "$*" + +ts_check_test_command "$TS_CMD_FDISK" +ts_check_test_command "$TS_CMD_BLKID" + +ts_skip_nonroot +ts_check_prog "mdadm" + +# rhbz#182625: It can't create new raid0 with metadata 0.90 from mdadm-4.1 +TS_KNOWN_FAIL="yes" + +# set global variable TS_DEVICE +ts_scsi_debug_init dev_size_mb=51 sector_size=512 + +ts_log "Create partitions" +$TS_CMD_FDISK --noauto-pt ${TS_DEVICE} >> $TS_OUTPUT 2>> $TS_ERRLOG <<EOF +o +n +p +1 + ++25M +n +p +2 + + +p +w +q +EOF + +# replace generated ID with something stable +$TS_CMD_FDISK ${TS_DEVICE} &> /dev/null <<EOF +x +i +0x1 +r +w +q +EOF + +udevadm settle +MD_DEVNAME=md8 +MD_DEVICE=/dev/${MD_DEVNAME} + +ts_lock "md" + +ts_log "Create RAID1 device" +mdadm -q -S ${MD_DEVICE} &> /dev/null +mdadm -q --create ${MD_DEVICE} --metadata=0.90 --chunk=64 --level=1 \ + --raid-devices=2 ${TS_DEVICE}1 ${TS_DEVICE}2 >> $TS_OUTPUT 2>> $TS_ERRLOG +udevadm settle + +ts_log "Probe whole-disk" +$TS_CMD_BLKID -p -o udev ${TS_DEVICE} 2>> $TS_ERRLOG | sort >> $TS_OUTPUT + +ts_log "Probe first RAID member" +$TS_CMD_BLKID -p -o udev ${TS_DEVICE}1 2>> $TS_ERRLOG | sort >> $TS_OUTPUT + +ts_log "Probe second RAID member" +$TS_CMD_BLKID -p -o udev ${TS_DEVICE}2 2>> $TS_ERRLOG | sort >> $TS_OUTPUT + +mdadm -q -S ${MD_DEVICE} >> $TS_OUTPUT 2>> $TS_ERRLOG + +udevadm settle +ts_unlock "md" + +ts_fdisk_clean $TS_DEVICE +# substitute UUIDs and major/minor number before comparison +sed -i \ + -e 's/^\(ID_FS_UUID\)=.*/\1=__ts_uuid__/' \ + -e 's/^\(ID_FS_UUID_ENC\)=.*/\1=__ts_uuid_enc__/' \ + -e 's/^\(ID_PART_ENTRY_DISK\)=.*/\1=__ts_majorminor__/' \ + $TS_OUTPUT + +ts_finalize diff --git a/tests/ts/blkid/md-raid1-whole b/tests/ts/blkid/md-raid1-whole new file mode 100755 index 0000000..1199fab --- /dev/null +++ b/tests/ts/blkid/md-raid1-whole @@ -0,0 +1,103 @@ +#!/bin/bash + +# +# Copyright (C) 2010 Karel Zak <kzak@redhat.com> +# +# This file is part of util-linux. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# + +TS_TOPDIR="${0%/*}/../.." +TS_DESC="MD raid1 (whole-disks)" + +. "$TS_TOPDIR"/functions.sh +ts_init "$*" + +ts_check_test_command "$TS_CMD_FDISK" +ts_check_test_command "$TS_CMD_BLKID" + +ts_skip_nonroot +ts_check_losetup +ts_check_prog "mdadm" + +# rhbz#182625: It can't create new raid0 with metadata 0.90 from mdadm-4.1 +TS_KNOWN_FAIL="yes" + +ts_log "Initialize devices" +IMGNAME="${TS_OUTDIR}/${TS_TESTNAME}" + +ts_device_init 50 ${IMGNAME}1.img +DEVICE1=$TS_LODEV + +ts_device_init 50 ${IMGNAME}2.img +DEVICE2=$TS_LODEV + +MD_DEVNAME=md8 +MD_DEVICE=/dev/${MD_DEVNAME} + +ts_lock "md" + +mdadm -q -S ${MD_DEVICE} &> /dev/null +udevadm settle + +ts_log "Create RAID device" +mdadm -q --create ${MD_DEVICE} --metadata=0.90 --chunk=64 --level=1 \ + --raid-devices=2 ${DEVICE1} ${DEVICE2} >> $TS_OUTPUT 2>> $TS_ERRLOG +udevadm settle + +# create dos partition table +$TS_CMD_FDISK --noauto-pt ${MD_DEVICE} &>/dev/null <<EOF +o +w +q +EOF + +ts_log "Create partitions on RAID device" +$TS_CMD_FDISK ${MD_DEVICE} >> $TS_OUTPUT 2>> $TS_ERRLOG <<EOF +n +p +1 + ++10M +n +p +2 + ++10M +p +w +q +EOF + +udevadm settle + +ts_log "Probe first RAID member" +$TS_CMD_BLKID -p -o udev $DEVICE1 2>> $TS_ERRLOG | sort >> $TS_OUTPUT + +ts_log "Probe second RAID member" +$TS_CMD_BLKID -p -o udev $DEVICE1 2>> $TS_ERRLOG | sort >> $TS_OUTPUT + +ts_log "Stop RAID device" +mdadm -q -S ${MD_DEVICE} >> $TS_OUTPUT 2>> $TS_ERRLOG + +udevadm settle +ts_unlock "md" + +ts_log "Deinitialize devices" + +ts_fdisk_clean +# seems that raid1 minimum I/O size has been changed in kernels >4.4.x and >4.8 +sed -i 's@^\(I/O size (minimum/optimal): \)[1-9][0-9]*@\1<removed>@' $TS_OUTPUT +# remove generated UUIDs +sed -i -e 's/ID_FS_UUID.*//g' $TS_OUTPUT + +ts_finalize diff --git a/tests/ts/blkid/offset b/tests/ts/blkid/offset new file mode 100755 index 0000000..1b81ecf --- /dev/null +++ b/tests/ts/blkid/offset @@ -0,0 +1,58 @@ +#!/bin/bash + +# This file is part of util-linux. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +TS_TOPDIR="${0%/*}/../.." +TS_DESC="offset" + +. "$TS_TOPDIR"/functions.sh +ts_init "$*" + +ts_check_test_command "$TS_CMD_SFDISK" +ts_check_test_command "$TS_CMD_BLKID" +ts_check_test_command "$TS_CMD_PARTX" + +ts_check_prog "mkfs.ext2" +ts_skip_nonroot + +# set global variable TS_DEVICE +ts_scsi_debug_init dev_size_mb=50 sector_size=512 + +$TS_CMD_SFDISK ${TS_DEVICE} >> $TS_OUTPUT 2>> $TS_ERRLOG <<EOF +label: gpt +label-id: b181c399-4711-4c52-8b65-9e764541218d + +,5M,L +,5M,L +,5M,L +, , +EOF +ts_fdisk_clean $TS_DEVICE +udevadm settle + + +mkfs.ext2 -b 4096 -L FOO -U ccf3dc28-f697-4577-971b-0bc79300a700 ${TS_DEVICE}2 &> /dev/null +udevadm settle +ts_device_has "TYPE" "ext2" ${TS_DEVICE}2 || + ts_die "Cannot find ext2 on ${TS_DEVICE}2" + +DEVNAME=$(basename $TS_DEVICE) +offset=$(( $(cat /sys/block/${DEVNAME}/${DEVNAME}2/start) * 512)) +size=$(( $(cat /sys/block/${DEVNAME}/${DEVNAME}2/size) * 512)) + +$TS_CMD_PARTX --delete ${TS_DEVICE} &> /dev/null + +$TS_CMD_BLKID -p -o udev --offset=${offset} --size=${size} $TS_DEVICE \ + >> $TS_OUTPUT 2>> $TS_ERRLOG + +ts_finalize diff --git a/tests/ts/blkid/topology b/tests/ts/blkid/topology new file mode 100755 index 0000000..fcf0724 --- /dev/null +++ b/tests/ts/blkid/topology @@ -0,0 +1,54 @@ +#!/bin/bash + +# +# Copyright (C) 2022 Thomas Weißschuh <thomas@t-8ch.de> +# +# This file is part of util-linux. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This file is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# + +TS_TOPDIR="${0%/*}/../.." +TS_DESC="topology probing" + +. "$TS_TOPDIR"/functions.sh + +ts_init "$*" + +ts_skip_nonroot +ts_check_losetup +ts_check_test_command "$TS_CMD_BLKID" +ts_check_test_command "$TS_CMD_SFDISK" + +ts_device_init + + +ts_init_subtest disk +echo -e 'label: dos\n- - - -' | "$TS_CMD_SFDISK" -q "$TS_LODEV" + +"$TS_CMD_BLKID" -i -o udev "$TS_LODEV" \ + 2> "$TS_ERRLOG" \ + | sed -E -e 's/^ID_FS_DISKSEQ=[[:digit:]]+$/ID_FS_DISKSEQ=S/' \ + | sort > "$TS_OUTPUT" + +ts_finalize_subtest + + +ts_init_subtest partition + +"$TS_CMD_BLKID" -i -o udev "$TS_LODEV"p1 \ + 2> "$TS_ERRLOG" \ + | sed -E -e 's/^ID_FS_DISKSEQ=[[:digit:]]+$/ID_FS_DISKSEQ=S/' \ + | sort > "$TS_OUTPUT" + +ts_finalize_subtest + +ts_finalize |