summaryrefslogtreecommitdiffstats
path: root/test/units/testsuite-64.sh (follow)
Commit message (Collapse)AuthorAgeFilesLines
* test: use idiomatic bash loop iterationZbigniew Jędrzejewski-Szmek2023-04-241-2/+2
| | | | | In a few cases, also avoid a sleep in the last (failed) iteration of the loop. It doesn't matter too much, but it's still ugly.
* test-64: add tests for compat devlinks for NVMe driveYu Watanabe2023-04-071-1/+47
|
* udev-rules: fix nvme symlink creation on namespace changesThomas Blume2023-03-211-0/+2
| | | | | | | | | | The nvme by-id symlink changes to the latest namespace when a new namespace gets added, for example by connecting multiple NVMe/TCP host controllers via nvme connect-all. That is incorrect for persistent device links. The persistent symbolic device link should continue to point to the same NVMe namespace throughout the lifetime of the current boot. Therefore the namespace id needs to be added to the link name.
* test: force mkfs.btrfs to overwrite any existing file systemsFrantisek Sumsal2023-03-091-4/+4
| | | | | | | | | | | | | mkfs.btrfs (unlike mkfs.ext4) checks if the target already contains a file system and refuses to continue if so. This causes spurious fails in case the random garbage on the temporary device matches a valid FS header: [ 19.723806] testsuite-64.sh[355]: + udevadm lock --device=/dev/mapper/encbtrfs0 --device=/dev/mapper/encbtrfs1 --device=/dev/mapper/encbtrfs2 --device=/dev/mapper/encbtrfs3 mkfs.btrfs -M -d raid1 -m raid1 -L btrfs_mencdisk -U deadbeef-dead-dead-beef-000000000003 /dev/mapper/encbtrfs0 /dev/mapper/encbtrfs1 /dev/mapper/encbtrfs2 /dev/mapper/encbtrfs3 [ 19.918934] testsuite-64.sh[2494]: ERROR: /dev/mapper/encbtrfs0 appears to contain an existing filesystem (hfsplus) [ 19.920490] testsuite-64.sh[2494]: ERROR: use the -f option to force overwrite of /dev/mapper/encbtrfs0 Let's force mkfs.btrfs to overwrite the file system in such case.
* test: add coverage for #24177Frantisek Sumsal2023-02-221-1/+37
| | | | Original issue: https://bugzilla.redhat.com/show_bug.cgi?id=1985288
* test: add another stress test for devlink creationYu Watanabe2023-02-221-1/+68
|
* test: add a testcase for lvextendYu Watanabe2023-02-011-0/+20
| | | | For RHBZ#2158628 (https://bugzilla.redhat.com/show_bug.cgi?id=2158628)
* test: make helper_check_device_units() log unit nameYu Watanabe2023-02-011-3/+4
|
* TEST-65: use [[ -v ]] moreZbigniew Jędrzejewski-Szmek2022-12-071-5/+5
| | | | | It's a bashism, but we use other bash features anyway, and it's cleaner and much less verbose.
* test: make sure mount point exists in testsuite-64.shNick Rosbrook2022-11-281-0/+1
|
* test: add coverage for the nvme-subsystemFrantisek Sumsal2022-10-111-0/+12
| | | | | | | Specifically for: - https://github.com/systemd/systemd/pull/24748 - https://github.com/systemd/systemd/pull/24766 - https://github.com/systemd/systemd/pull/24946
* test-64-udev-storage: use wait command instead of hackish "udevadm lock true"Yu Watanabe2022-09-291-4/+6
| | | | | Otherwise, "udevadm lock true" may lock a block device earlier than "udevadm lock sfdisk &".
* test: fix a copy-paste errorFrantisek Sumsal2022-09-281-1/+1
|
* test: use fewer partitions/LVs when running with plain QEMUFrantisek Sumsal2022-09-271-6/+11
|
* test: make the symlink helpers a bit more quietFrantisek Sumsal2022-09-271-3/+0
| | | | and show only errors/warnings.
* test: ignore tty* devices when checking device unitsFrantisek Sumsal2022-09-271-1/+1
| | | | | This lower the runtime of `check_device_units()` in a plain QEMU VM from ~45 seconds to ~25 seconds.
* test: lower the # of iterations when running with plain QEMUFrantisek Sumsal2022-09-271-3/+17
|
* test-64-storage: add test for renaming lvm volumeYu Watanabe2022-09-201-0/+16
|
* test-64-udev-storage: check device unitsYu Watanabe2022-09-201-0/+116
|
* test: add testcase for link priorityYu Watanabe2022-09-181-19/+61
|
* test: add testcase for udev-watchYu Watanabe2022-09-111-0/+43
|
* test-64: run one more subtest on non-KVM environment with relaxed conditionYu Watanabe2022-08-281-1/+9
|
* test-64: relax number of partitions used in testcase_simultaneous_events() ↵Yu Watanabe2022-08-281-9/+12
| | | | to speed up non-KVM environment
* test-64: extend timeout for slower env e.g. non-kvmYu Watanabe2022-08-281-1/+1
|
* test: lower the # of iterations with plain QEMUFrantisek Sumsal2022-08-261-1/+1
|
* test: lower the # of mpath devices to 16Frantisek Sumsal2022-08-261-1/+1
| | | | to make the test suitable for slower machines.
* test: optionally wait a bit when checking the mount unitFrantisek Sumsal2022-08-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On fast systems we might race against systemd and check the mount unit after mounting it way too early before systemd had a chance to react to the change. ``` [ 4.677701] H systemd[1]: Event source 0x210b3b0 (mount-monitor-dispatch) entered rate limit state. ... [ 4.863731] H testsuite-64.sh[812]: + mount /logsysfsRxx [ 4.865918] H kernel: EXT4-fs (vda2): mounted filesystem with ordered data mode. Opts: (null) [ 4.866213] H testsuite-64.sh[812]: + systemctl status /logsysfsRxx [ 4.877502] H testsuite-64.sh[919]: ○ logsysfsRxx.mount - /logsysfsRxx [ 4.877502] H testsuite-64.sh[919]: Loaded: loaded (/etc/fstab; generated) [ 4.877502] H testsuite-64.sh[919]: Active: inactive (dead) [ 4.877502] H testsuite-64.sh[919]: Where: /logsysfsRxx [ 4.877502] H testsuite-64.sh[919]: What: /dev/disk/by-uuid/deadbeef-dead-dead-beef-222222222222 [ 4.877502] H testsuite-64.sh[919]: Docs: man:fstab(5) [ 4.877502] H testsuite-64.sh[919]: man:systemd-fstab-generator(8) [ 4.877502] H testsuite-64.sh[919]: Aug 03 10:10:10 H systemd[1]: logsysfsRxx.mount: Processing implicit device dependencies [ 4.877502] H testsuite-64.sh[919]: Aug 03 10:10:10 H systemd[1]: logsysfsRxx.mount: Added Requires dependency on /dev/disk/by-uuid/deadbeef-dead-dead-beef-222222222222 [ 4.877502] H testsuite-64.sh[919]: Aug 03 10:10:10 H systemd[1]: logsysfsRxx.mount: Added StopPropagatedFrom dependency on /dev/disk/by-uuid/deadbeef-dead-dead-beef-222222222222 [ 4.895683] H sh[920]: + systemctl poweroff --no-block [ 4.906533] H systemd[1]: Found unit logsysfsRxx.mount at /run/systemd/generator/logsysfsRxx.mount (regular file) [ 4.906594] H systemd[1]: Preset files don't specify rule for logsysfsRxx.mount. Enabling. [ 4.906990] H systemd[1]: testsuite-64.service: Main process exited, code=exited, status=3/NOTIMPLEMENTED [ 4.907057] H systemd[1]: testsuite-64.service: Failed with result 'exit-code'. [ 4.907287] H systemd[1]: Failed to start testsuite-64.service. [ 4.955293] H systemd[1]: Starting end.service... [ 4.955736] H systemd-logind[809]: The system will power off now! [ 4.955868] H systemd-logind[809]: System is powering down. [ 4.975781] H systemd[1]: Event source 0x210b3b0 (mount-monitor-dispatch) left rate limit state. [ 4.975821] H systemd[1]: logsysfsRxx.mount: Processing implicit device dependencies [ 4.975857] H systemd[1]: logsysfsRxx.mount: Added Requires dependency on /dev/vda2 [ 4.975893] H systemd[1]: logsysfsRxx.mount: Added StopPropagatedFrom dependency on /dev/vda2 [ 4.975928] H systemd[1]: Unit blockdev@dev-vda2.target has alias blockdev@.target. [ 4.975967] H systemd[1]: logsysfsRxx.mount: Added After dependency on /dev/vda2 [ 4.976081] H systemd[1]: logsysfsRxx.mount: Changed dead -> mounted ```
* test: make TEST-64 a bit more ASan friendlyFrantisek Sumsal2022-07-071-15/+25
| | | | | | | | Reduce the number of iterations in some of the test cases, since they generate a huge amount of uevents and basically DoS udev (which can't keep up while being slowed down by ASan). To avoid this, let's reduce the number of iterations and bump the timeout when running under ASan, since we're not interested in performance in such cases.
* test: extend the "hashed" unit names coverage a bitFrantisek Sumsal2022-04-231-3/+16
| | | | Follow-up to #22759.
* test: partition the MD deviceFrantisek Sumsal2022-04-171-26/+50
| | | | | | | Also, loop the assemble/disassemble part couple of times to test udev even harder. Resolves: #23092
* test: cleanup after the MD + LVM test case as wellFrantisek Sumsal2022-04-171-1/+6
|
* test: add a test case for MD + LVM + ext4Frantisek Sumsal2022-04-141-1/+49
|
* test: extend testcase_mdadm_basic() with RAID 5 and 10Frantisek Sumsal2022-04-141-10/+68
|
* Merge pull request #23011 from mrc0mmand/TEST-64-mdLennart Poettering2022-04-131-0/+33
|\ | | | | test: add MD-related tests to TEST-64
| * test: add MD-related tests to TEST-64Frantisek Sumsal2022-04-131-0/+33
| |
* | tests: reflect that we can now handle devices with very long sysfs pathsMichal Sekletar2022-04-131-2/+3
|/
* test: use udevadm lock when partitioning block devicesYu Watanabe2022-04-061-4/+4
| | | | | We can use `sfdisk --lock` for these cases, but some CI environments have old sfdisk which does not support `--lock` option.
* test: use udevadm wait and lockYu Watanabe2022-04-041-199/+39
| | | | Hopefully fixes #22911.
* test: replace helper_wait_for_dev() with 'udevadm wait'Yu Watanabe2022-04-011-45/+4
|
* test: use flock when calling mkfs.btrfsFrantisek Sumsal2022-03-251-4/+46
| | | | | | | | | As stated in https://github.com/systemd/systemd/issues/21819#issuecomment-1064377645 `mkfs.btrfs` doesn't hold the lock for the whole duration of `mkfs.btrfs`, thus causing unexpected races & test fails. Let's wrap the `mkfs.btrfs` calls in an flock wrapper to mitigate this. Hopefully fixes: #21819
* test: accept GC'ed units in newer LVMFrantisek Sumsal2022-02-101-0/+8
| | | | | | | | | | Since lvm 2.03.15 the transient units are started without `-r`, thus disappearing once they finish and breaking the test (which expects them to remain loaded after finishing). Let's accept `LoadState=not-found` as a valid result as well to fix this. Follow-up to: d10d562bd4b9f93130fb2b23f2b0d0d4126ea7d4 See: https://sourceware.org/git/?p=lvm2.git;a=commit;h=fbd8b0cf43dc67f51f86f060dce748f446985855
* Revert "test: wait for newly created btrfs triggered"Yu Watanabe2022-01-281-12/+0
| | | | | | This reverts commit 39f83dd7606730f65eb9831703a8ea3667682a85. As this does not solve the issue.
* test: wait for newly created btrfs triggeredYu Watanabe2022-01-191-0/+12
| | | | Fixes the second issue in #21819.
* test: settle before checking logsFrantisek Sumsal2021-12-161-0/+2
| | | | | | | | | | | | | | | | | Otherwise we might miss the "Device path too long" message: ``` [ 21.083274] testsuite-64.sh[374]: swapoff /dev/vda1 [ 21.089841] testsuite-64.sh[376]: ++ mktemp [ 21.095115] testsuite-64.sh[271]: + logfile=/tmp/tmp.a1MULA35wL [ 21.095115] testsuite-64.sh[271]: + journalctl -b -q --no-pager -o short-monotonic -p info --grep 'Device path.*vda.?'\'' too long to fit into unit name' ... [ 21.277360] systemd[1]: testsuite-64.service: Main process exited, code=exited, status=1/FAILURE [ 21.277508] systemd[1]: testsuite-64.service: Failed with result 'exit-code'. ... [ 21.323500] systemd[1]: Device path '/sys/devices/pci0000:00/0000:00:03.0/0000:01:00.0/0000:02:00.0/0000:03:00.0/0000:04:00.0/0000:05:00.0/0000:06:00.0/0000:07:00.0/0000:08:00.0/0000:09:00.0/0000:0a:00.0/0000:0b:00.0/0000:0c:00.0/0000:0d:00.0/0000:0e:00.0/0000:0f:00.0/0000:10:00.0/0000:11:00.0/0000:12:00.0/0000:13:00.0/0000:14:00.0/0000:15:00.0/0000:16:00.0/0000:17:00.0/0000:18:00.0/0000:19:00.0/0000:1a:00.0/virtio0/block/vda/vda1' too long to fit into unit name, ignoring device. ```
* test: wait until `lvm-activate-$vgroup.service` finishesFrantisek Sumsal2021-11-051-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new lvm autoactivation method runs `vgchange` via `systemd-run --no-block`[0], which means that checking if the unit is in the `active` state is not enough, since the main binary might still be running. Let's fix this by waiting until the unit reaches the `exited` sub state. Follow-up to: * 29f8bef05eb9a4bb7f578b31409ca38ec1b1a069 * e50d743f99fa66c9f55e534c4e109a2cf6323f04 [0] https://sourceware.org/git/?p=lvm2.git;a=blob;f=udev/69-dm-lvm.rules.in;h=39e5b98074010745f78a7a86a05929700c9cd690;hb=67722b312390cdab29c076c912e14bd739c5c0f6#l83 Example: ``` [ 17.102002] systemd-udevd[282]: sdf: '/usr/bin/systemd-run -r --no-block --property DefaultDependencies=no --unit lvm-activate-iscsi_lvm2212 /usr/bin/lvm vgchange -aay --nohints iscsi_lvm2212'(err) 'Running as unit: lvm-activate-iscsi_> [ 17.102522] systemd-udevd[282]: sdf: Process '/usr/bin/systemd-run -r --no-block --property DefaultDependencies=no --unit lvm-activate-iscsi_lvm2212 /usr/bin/lvm vgchange -aay --nohints iscsi_lvm2212' succeeded. [ 17.102697] systemd-udevd[282]: sdf: Adding watch on '/dev/sdf' [ 17.104944] systemd[1]: lvm-activate-iscsi_lvm2212.service: Changed dead -> running ... [ 17.105434] systemd[1]: Started /usr/bin/lvm vgchange -aay --nohints iscsi_lvm2212. [ 17.105601] systemd[931]: lvm-activate-iscsi_lvm2212.service: Executing: /usr/bin/lvm vgchange -aay --nohints iscsi_lvm2212 ... [ 17.420228] testsuite-64.sh[268]: + systemctl -q is-active lvm-activate-iscsi_lvm2212.service [ 17.420228] testsuite-64.sh[268]: + return 0 [ 17.420228] testsuite-64.sh[268]: + test -e /dev/disk/by-path/ip-127.0.0.1:3260-iscsi-iqn.2021-09.com.example:iscsi.lvm.test-lun-4 [ 17.420228] testsuite-64.sh[268]: + udevadm settle [ 17.420228] testsuite-64.sh[268]: + test -e /dev/iscsi_lvm2212/mypart1 ... [ 17.451313] systemd[1]: testsuite-64.service: Main process exited, code=exited, status=1/FAILURE [ 17.451475] systemd[1]: testsuite-64.service: Failed with result 'exit-code'. ... [ 17.555759] systemd[1]: Starting End the test... [ 17.556972] sh[941]: + systemctl poweroff --no-block ... [ 17.688923] lvm[931]: 2 logical volume(s) in volume group "iscsi_lvm2212" now active ... [ 17.838484] systemd[1]: lvm-activate-iscsi_lvm2212.service: Child 931 belongs to lvm-activate-iscsi_lvm2212.service. [ 17.838718] systemd[1]: lvm-activate-iscsi_lvm2212.service: Main process exited, code=exited, status=0/SUCCESS (success) ```
* test: support both lvm vgroup activation methodsFrantisek Sumsal2021-11-021-2/+39
|
* test: add a missing `udevadm settle` to the multipath test caseFrantisek Sumsal2021-10-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 8a088877ab92d3777d7f487393e3daef6edf43ff uncovered a missing `udevadm settle` in the multipath test case, causing the test to occasionally fail with: ``` [ 41.718617] testsuite-64.sh[806]: + for i in {0..63} [ 41.727917] systemd-udevd[1120]: sdhf: /usr/lib/udev/rules.d/60-persistent-storage.rules:66 Importing properties from results of 'scsi_id --export --whitelisted -d /dev/sdhf' [ 41.728668] testsuite-64.sh[2341]: ++ printf %.4d 1 [ 41.733851] systemd-udevd[1415]: sdhc: Adding watch on '/dev/sdhc' [ 41.734477] testsuite-64.sh[806]: + wwid=deaddeadbeef0001 [ 41.734477] testsuite-64.sh[806]: + path=/dev/disk/by-id/wwn-0xdeaddeadbeef0001 [ 41.746174] systemd-udevd[1409]: sdhb: 'scsi_id --export --whitelisted -d /dev/sdhb'(out) 'ID_MODEL_ENC=QEMU\x20HARDDISK\x20\x20\x20' [ 41.747058] testsuite-64.sh[2342]: ++ readlink -f /dev/disk/by-id/wwn-0xdeaddeadbeef0001 [ 41.755512] testsuite-64.sh[806]: + dmpath=/dev/sdi [ 41.755512] testsuite-64.sh[806]: + lsblk /dev/disk/by-id/wwn-0xdeaddeadbeef0001 [ 41.766884] systemd-udevd[1402]: sdhd: 'scsi_id --export --whitelisted -d /dev/sdhd'(out) 'ID_VENDOR=QEMU' [ 41.767532] testsuite-64.sh[2343]: NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS [ 41.767532] testsuite-64.sh[2343]: sdi 8:128 0 512B 0 disk [ 41.779219] systemd-udevd[1400]: dm-33: 'kpartx_id 254 33 mpath-3deaddeadbeef0051'(out) 'DM_WWN=0xdeaddeadbeef0051' [ 41.779902] testsuite-64.sh[806]: + multipath -C /dev/sdi [ 41.785296] systemd-udevd[1414]: dm-31: Device processed (SEQNUM=4839, ACTION=change) [ 41.785925] testsuite-64.sh[2344]: 37.658168 | /dev/sdi is not a dm device ```
* test: enable debug logging of systemd-udevdYu Watanabe2021-10-261-0/+3
| | | | Otherwise, it is hard to debug when the test fails.
* Typos found by codespellDimitri Papadopoulos2021-10-201-1/+1
|
* tests: add spdx headers to scripts and MakefilesZbigniew Jędrzejewski-Szmek2021-10-181-0/+1
|