test: add integration test for systemd-storagetm
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
[Unit]
|
||||
Description=TEST-84-STORAGETM
|
||||
After=multi-user.target
|
||||
|
||||
[Service]
|
||||
ExecStartPre=rm -f /failed /testok
|
||||
ExecStart=/usr/lib/systemd/tests/testdata/units/%N.sh
|
||||
Type=oneshot
|
||||
Executable
+25
@@ -0,0 +1,25 @@
|
||||
#!/usr/bin/env bash
|
||||
# SPDX-License-Identifier: LGPL-2.1-or-later
|
||||
set -eux
|
||||
set -o pipefail
|
||||
|
||||
modprobe -v nvmet-tcp
|
||||
modprobe -v nvme-tcp
|
||||
|
||||
systemctl start sys-kernel-config.mount
|
||||
|
||||
dd if=/dev/urandom of=/var/tmp/storagetm.test bs=1024 count=10240
|
||||
|
||||
systemd-run -u teststoragetm.service -p Type=notify /usr/lib/systemd/systemd-storagetm /var/tmp/storagetm.test --nqn=quux
|
||||
|
||||
nvme connect-all -t tcp -a 127.0.0.1 -s 16858 --hostid="$(cat /proc/sys/kernel/random/uuid)"
|
||||
|
||||
dd if=/dev/nvme1n1 bs=1024 | cmp /var/tmp/storagetm.test -
|
||||
|
||||
nvme disconnect --device=nvme1
|
||||
|
||||
systemctl stop teststoragetm.service
|
||||
|
||||
rm /var/tmp/storagetm.test
|
||||
|
||||
touch /testok
|
||||
Reference in New Issue
Block a user