It seems ip(8) link-show command does not provide link-netnsid in all
cases (versions ?). Let's try to use "ip netns list-id" as fallback.
This commit also add possibility to debug the script by $LOG variable.
Signed-off-by: Karel Zak <kzak@redhat.com>
This adds DRBD meta data images for DRBD versions 8 and 9, as well as
the according expected output.
Signed-off-by: Roland Kammerer <roland.kammerer@linbit.com>
oids test did not check if uuidgen was available.
oids test was also calling uuidgen from PATH which could result
in wrong results if uuidgen from a previous util-linux installation
was used.
With this commit we will check if uuidgen was built and make sure
that we only call the uuidgen binary we just built. If uuidgen is
not available we will skip this test.
According to the UDF 2.60 specification, the Minimum UDF Read Revision
value shall be at most #0250 for all media with a UDF 2.60 file system.
So in this case use Minimum UDF Write Revision as ID_FS_VERSION to
distinguish between UDF 2.50 and UDF 2.60 discs.
This commit also adds a testing Blu-Ray Recordable image with UDF revision
2.60 created by Nero which really sets Minimum UDF Read Revision to 2.50.
Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
When script is used on a host with a relatively small free disk space, it
is sometimes desirable to limit the size of the captured output. This
can now be enforced with the --output-limit option.
The --output-limit option lets the user specify a maximum size. The program
uses the size parsing from strutils and thus supports the usual
multiplicative suffixes (kiB, KB, MiB, MB, etc.). After the specified
number of bytes have been written to the output file, the script program
will terminate the child process.
Due to buffering, the size of the output file might exceed the specified
limit. This limit also does not include the start and done messages.
The race test was throwing an error dur to a variable being "" in some cases.
Quoting the variable in the equal test took care of that test.
[kzak@redhat.com: - use done() to stop script
- count also timing file
- remove unnamed member initialization in ctl struct
- add to bash-completion]
Signed-off-by: Fred Mora <fmora@datto.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
The strerror() output is is nothing stable and may be different on
another systems. It would be possible to use sed(1) to unify the
output, but it seems overkill in this case.
Signed-off-by: Karel Zak <kzak@redhat.com>
* 'master' of https://github.com/pali/util-linux:
tests: Add tests for FAT32 labels
blkid: Encode any field which starts with LABEL in same way as LABEL field
libblkid: vfat: Change parsing label in special cases
The bug has been introduced during column(1) rewrite. The function
read_input() need to skip leading space only temporary to detect empty
lines, but the rest of the code has to use the original buffer (line).
I've tried to fix one of the symptoms by 5c7b67fbbf
(alter), but this solution is unnecessary and too complex.
Changes:
* don't ignore leading space
* remove unnecessary stuff introduced by 5c7b67fbbf
* fix regression test with incorrect separator
Addresses: https://github.com/karelzak/util-linux/issues/575
Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=1560283
Signed-off-by: Karel Zak <kzak@redhat.com>
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>
ts_is_mounted "/dev/loop1" returned true if /dev/loop17 was
mounted. A very annoying source of sporadic failures since
many years. This issue became more visible since running the
checks in parallel, which increases the probability to get
bigger loop device numbers.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
I still don't understand why this helps to fix these tests on my system.
udevadm settle had no positive effect. Adding the sleeps before
"is_mounted" also didn't fixed that, that's amazing!?
Below the test log, very often seen on my system since a long time:
-------------------- util-linux regression tests --------------------
For development purpose only.
Don't execute on production system!
kernel: 4.4.104-39-default
libmount: context: [01] mount-by-devname ... OK
libmount: context: [02] umount-by-devname ... OK
libmount: context: [03] mount-by-label ... OK
libmount: context: [04] umount-by-mountpoint ... OK
libmount: context: [05] mount-by-uuid ... FAILED (libmount/context-mount-by-uuid)
libmount: context: [06] mount-flags ... FAILED (libmount/context-mount-flags)
libmount: context: [07] mount-loopdev ... OK
libmount: context: [08] x-mount.mkdir ... OK
libmount: context: [09] X-mount.mkdir ... OK
libmount: context ... FAILED (2 from 9 sub-tests)
---------------------------------------------------------------------
1 tests of 17 FAILED
---------------------------------------------------------------------
rudi@zappa:~/devel/util-linux/build> cat tests/diff/libmount/context-mount-by-uuid
--- /home/rudi/devel/util-linux/tests/expected/libmount/context-mount-by-uuid 2017-07-03 12:20:24.144845538 +0200
+++ /home/rudi/devel/util-linux/build/tests/output/libmount/context-mount-by-uuid 2018-01-24 00:42:18.549444408 +0100
@@ -1,2 +1,3 @@
successfully mounted
-successfully umounted
+failed to umount
+FAILED [rc=16]/dev/sdb1 still mounted
rudi@zappa:~/devel/util-linux/build> cat tests/diff/libmount/context-mount-flags
--- /home/rudi/devel/util-linux/tests/expected/libmount/context-mount-flags 2017-07-03 12:20:24.148845497 +0200
+++ /home/rudi/devel/util-linux/build/tests/output/libmount/context-mount-flags 2018-01-24 00:42:18.725442931 +0100
@@ -1,5 +1,5 @@
+test_mount_context: failed to mount: Device or resource busy
+FAILED [rc=16]rw,relatime
successfully mounted
-ro,nosuid,noexec
-successfully mounted
-rw,nosuid,noexec
+rw,relatime
successfully umounted
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
This was the error
uuidd: couldn't bind unix socket /var/tmp/portage/sys-apps/util-linux-2.31.1/work/util-linux-2.31.1-abi_x86_64.amd64/tests/output/uuid/uuiddkOcTUuoZ7kaP3: Address already in use
because the socket path was truncated to 108 chars which was luckily
an existing directory.
Now we abort early with "uuidd: socket name too long: ... "
Reported-by: Thomas Deutschmann <whissi@gentoo.org>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
The usage looks a bit cleaner, and I guess that pgrep(1) is available
on the same machines where "ps --ppid" would work (procps-ng).
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
* 'libblkid-atari' of https://github.com/yontalcar/util-linux:
libblkid: atari - reject devices with blocksize != 512
libblkid: atari - don't add duplicate entries
libblkid: atari - test if any partition fits disk size
tests: added missing expected outputs for partx (atari)
libblkid: atari - fix bad variable name
tests: added test for libblkid atari pt
libblkid: Support for Atari partitioning scheme
Fix test for systems with pagesize != 4096
Loop over many combinations of sizes, endianness and blocksizes.
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
This hopefully fixes the original problem addressed by the reverted
patch 7cb962c7.
The bug was introduced by myself in
f991dbd3 "fsck.cramfs: allow smaller superblock sizes"
CC: Tobias Stoeckmann <tobias@stoeckmann.org>
Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>