]> git.ipfire.org Git - thirdparty/util-linux.git/commit
tests: consolidate ts_device_has UUID or LABEL
authorRuediger Meier <ruediger.meier@ga-group.nl>
Sat, 10 Mar 2018 18:44:32 +0000 (19:44 +0100)
committerKarel Zak <kzak@redhat.com>
Mon, 19 Mar 2018 10:46:11 +0000 (11:46 +0100)
commit9ca02cf52d70d56fc3f7e152c55154a15c62af6d
treeef005d92180afe8fbea8db7aa18079939de9f922
parentec182d8b9da7596809aab9aab4fc931e9ccb7494
tests: consolidate ts_device_has UUID or LABEL

Regarding parallel root checks ...

 - fix: add a few missing "udevadm settle" where we are using LABELs or UUIDs

 - introduce ts_udevadm_settle():
    * Still trivial implementation. The idea is to use it in future for all
      tests instead of directly calling "udevadm settle". So we could add debug
      messages, wait for specific events, add code for non-udev systems or even
      use "udevadm --{start,stop}-exec-queue" to be really sure what we are
      doing and why using udevadm at all.
    * The currently unused args may be used in future and show the code reader
      already now why we are calling "udevadm settle" at all.
    * So far this patch only affects swapon/, mount/, libmount/ tests, and is
      only about UUIDs and LABELs, but may be continued later for "partitions",
      "md devices", whatever.
    * We are calling ts_udevadm_settle() right *before* we need a LABEL or
      UUID, not just *after* we created one. This may be a bit better for
      speed and shows the code reader which command would fail without settle.

 - function ts_device_has_uuid() is unused now, we trust blkid(1). Renamed to
   ts_is_uuid() in case we would need it again.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
15 files changed:
tests/functions.sh
tests/ts/libmount/tabfiles-tags
tests/ts/libmount/tabfiles-tags-py
tests/ts/mount/fstab-devname2label
tests/ts/mount/fstab-devname2uuid
tests/ts/mount/fstab-label
tests/ts/mount/fstab-label2devname
tests/ts/mount/fstab-label2uuid
tests/ts/mount/fstab-uuid
tests/ts/mount/fstab-uuid2devname
tests/ts/mount/fstab-uuid2label
tests/ts/mount/label
tests/ts/mount/uuid
tests/ts/swapon/label
tests/ts/swapon/uuid