Skip to content

Commit d8ad616

Browse files
committed
tests: skip the test if it cannot create a loopback device
Seems our x86_64 CI host doesn't have enough loopback devices. Signed-off-by: Kazuyoshi Kato <[email protected]>
1 parent 2d8dd18 commit d8ad616

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/integration_tests/functional/test_drives.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import os
66
import platform
7-
from subprocess import run
7+
from subprocess import run, CalledProcessError
88

99
import pytest
1010

@@ -96,7 +96,10 @@ def test_rescan_dev(test_microvm_with_ssh, network_config):
9696
# https://github.com/firecracker-microvm/firecracker-containerd/issues/141
9797
loopback_device = f'/dev/loop{os.getpid()}'
9898
losetup = ['losetup', loopback_device, fs2.path]
99-
run(losetup, check=True)
99+
try:
100+
run(losetup, check=True)
101+
except CalledProcessError:
102+
pytest.skip("the kernel doesn't have enough loopback devices")
100103

101104
try:
102105
response = test_microvm.drive.patch(

0 commit comments

Comments
 (0)