]> git.ipfire.org Git - thirdparty/systemd.git/blame - test/units/testsuite-64.sh
test: udev storage tests
[thirdparty/systemd.git] / test / units / testsuite-64.sh
CommitLineData
f2204ac2
FS
1#!/usr/bin/env bash
2# vi: ts=4 sw=4 tw=0 et:
3
4set -eux
5set -o pipefail
6
7testcase_megasas2_basic() {
8 lsblk -S
9 [[ "$(lsblk --scsi --noheadings | wc -l)" -ge 128 ]]
10}
11
12testcase_nvme_basic() {
13 lsblk --noheadings | grep "^nvme"
14 [[ "$(lsblk --noheadings | grep -c "^nvme")" -ge 28 ]]
15}
16
17testcase_virtio_scsi_identically_named_partitions() {
18 lsblk --noheadings -a -o NAME,PARTLABEL
19 [[ "$(lsblk --noheadings -a -o NAME,PARTLABEL | grep -c "Hello world")" -eq $((16 * 8)) ]]
20}
21
22: >/failed
23
24udevadm settle
25
26lsblk -a
27
28# TEST_FUNCTION_NAME is passed on the kernel command line via systemd.setenv=
29# in the respective test.sh file
30if ! command -v "${TEST_FUNCTION_NAME:?}"; then
31 echo >&2 "Missing verification handler for test case '$TEST_FUNCTION_NAME'"
32 exit 1
33fi
34
35echo "TEST_FUNCTION_NAME=$TEST_FUNCTION_NAME"
36"$TEST_FUNCTION_NAME"
37
38systemctl status systemd-udevd
39
40touch /testok
41rm /failed