]>
Commit | Line | Data |
---|---|---|
f2204ac2 FS |
1 | #!/usr/bin/env bash |
2 | # vi: ts=4 sw=4 tw=0 et: | |
3 | ||
4 | set -eux | |
5 | set -o pipefail | |
6 | ||
7 | testcase_megasas2_basic() { | |
8 | lsblk -S | |
9 | [[ "$(lsblk --scsi --noheadings | wc -l)" -ge 128 ]] | |
10 | } | |
11 | ||
12 | testcase_nvme_basic() { | |
13 | lsblk --noheadings | grep "^nvme" | |
14 | [[ "$(lsblk --noheadings | grep -c "^nvme")" -ge 28 ]] | |
15 | } | |
16 | ||
17 | testcase_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 | ||
24 | udevadm settle | |
25 | ||
26 | lsblk -a | |
27 | ||
28 | # TEST_FUNCTION_NAME is passed on the kernel command line via systemd.setenv= | |
29 | # in the respective test.sh file | |
30 | if ! command -v "${TEST_FUNCTION_NAME:?}"; then | |
31 | echo >&2 "Missing verification handler for test case '$TEST_FUNCTION_NAME'" | |
32 | exit 1 | |
33 | fi | |
34 | ||
35 | echo "TEST_FUNCTION_NAME=$TEST_FUNCTION_NAME" | |
36 | "$TEST_FUNCTION_NAME" | |
37 | ||
38 | systemctl status systemd-udevd | |
39 | ||
40 | touch /testok | |
41 | rm /failed |