2
0
mirror of https://gitlab.com/apparmor/apparmor synced 2025-08-21 17:47:10 +00:00

ci: add emulated USB devices for lsusb profile test

With this lsusb sees a non-empty emulated bus and the test is successful.

```
zyga@x13:~/apparmor$ spread garden:ubuntu-cloud-24.04:tests/profiles/lsusb
2025-06-10 08:01:13 Project content is packed for delivery (6.93MB).
2025-06-10 08:01:13 If killed, discard servers with: spread -reuse-pid=290633 -discard
2025-06-10 08:01:13 Allocating garden:ubuntu-cloud-24.04...
2025-06-10 08:03:25 Waiting for garden:ubuntu-cloud-24.04 to make SSH available at localhost:5000...
2025-06-10 08:03:25 Allocated garden:ubuntu-cloud-24.04.
2025-06-10 08:03:25 Connecting to garden:ubuntu-cloud-24.04...
2025-06-10 08:03:32 Connected to garden:ubuntu-cloud-24.04 at localhost:5000.
2025-06-10 08:03:32 Sending project content to garden:ubuntu-cloud-24.04...
2025-06-10 08:03:34 Preparing garden:ubuntu-cloud-24.04 (garden:ubuntu-cloud-24.04)...
2025-06-10 08:04:26 Preparing garden:ubuntu-cloud-24.04:tests/profiles/lsusb (garden:ubuntu-cloud-24.04)...
2025-06-10 08:04:26 Executing garden:ubuntu-cloud-24.04:tests/profiles/lsusb (garden:ubuntu-cloud-24.04) (1/1)...
2025-06-10 08:04:26 Restoring garden:ubuntu-cloud-24.04:tests/profiles/lsusb (garden:ubuntu-cloud-24.04)...
2025-06-10 08:04:26 Discarding garden:ubuntu-cloud-24.04...
2025-06-10 08:04:27 Successful tasks: 1
2025-06-10 08:04:27 Aborted tasks: 0
```

Signed-off-by: Zygmunt Krynicki <zygmunt.krynicki@canonical.com>
This commit is contained in:
Zygmunt Krynicki 2025-06-10 08:06:19 +02:00
parent 1f25a876ad
commit d68dea45f1

View File

@ -41,12 +41,14 @@ backends:
# to the Ubuntu cloud images that have the rootfs as the first # to the Ubuntu cloud images that have the rootfs as the first
# partition. # partition.
exec image-garden allocate "$SPREAD_SYSTEM"."$ARCH" \ exec image-garden allocate "$SPREAD_SYSTEM"."$ARCH" \
-usb -usbdevice keyboard -usbdevice mouse \
-kernel bzImage \ -kernel bzImage \
-append 'root=/dev/sda1 ro console=tty1 console=ttyS0' -append 'root=/dev/sda1 ro console=tty1 console=ttyS0'
fi fi
# Ask image garden to allocate the system and relay the result back # Ask image garden to allocate the system and relay the result back
# to spread as either success of failure. # to spread as either success of failure.
exec image-garden allocate "$SPREAD_SYSTEM"."$ARCH" exec image-garden allocate "$SPREAD_SYSTEM"."$ARCH" \
-usb -usbdevice keyboard -usbdevice mouse \
discard: | discard: |
# See above for an explanation. # See above for an explanation.
if [ -n "${SPREAD_HOST_PATH-}" ]; then if [ -n "${SPREAD_HOST_PATH-}" ]; then