Skip to content

Commit 9050788

Browse files
committed
ci: split root and non-root storage tests
Fixes: oVirt#128 Signed-off-by: Albert Esteve <[email protected]>
1 parent 9b09f1d commit 9050788

File tree

2 files changed

+27
-10
lines changed

2 files changed

+27
-10
lines changed

.github/workflows/ci.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ jobs:
2020
options: --privileged
2121
steps:
2222
- uses: actions/checkout@v2
23-
- name: Run storage tests
23+
- name: Run storage tests marked as root
24+
run: ./automation/tests-storage.sh --root
25+
- name: Run storage tests not marked as root
2426
run: ./automation/tests-storage.sh
2527
tests:
2628
env:

automation/tests-storage.sh

+24-9
Original file line numberDiff line numberDiff line change
@@ -12,21 +12,31 @@ create_loop_devices() {
1212
}
1313

1414
setup_storage() {
15-
python3 tests/storage/userstorage.py setup
15+
make storage
1616
}
1717

1818
teardown_storage() {
19-
python3 tests/storage/userstorage.py teardown \
19+
make clean-storage \
2020
|| echo "WARNING: Ingoring error while tearing down user storage"
2121
}
2222

23-
# Configure lvm to ignore udev events, otherwise some lvm tests hang.
24-
mkdir -p /etc/lvm
25-
cp docker/lvmlocal.conf /etc/lvm/
23+
run_as_root=false
24+
if [ ! -z "$1" ]; then
25+
flag=$1
26+
if [ "$flag" = "--root" ]; then
27+
run_as_root=true
28+
fi
29+
fi
2630

27-
# Make sure we have enough loop device nodes. Using 16 devices since with 8
28-
# devices we have random mount failures.
29-
create_loop_devices 16
31+
if [ "$run_as_root" = true ]; then
32+
# Configure lvm to ignore udev events, otherwise some lvm tests hang.
33+
mkdir -p /etc/lvm
34+
cp docker/lvmlocal.conf /etc/lvm/
35+
36+
# Make sure we have enough loop device nodes. Using 16 devices since with 8
37+
# devices we have random mount failures.
38+
create_loop_devices 16
39+
fi
3040

3141
# Build vdsm.
3242
./autogen.sh --system
@@ -36,4 +46,9 @@ make
3646
trap teardown_storage EXIT
3747
setup_storage
3848

39-
make tests-storage
49+
if [ "$run_as_root" = true ]; then
50+
# Run only tests marked as root
51+
tox -e storage -- -m root --cov-fail-under=30 tests/storage
52+
else
53+
tox -e storage -- -m 'not root' tests/storage
54+
fi

0 commit comments

Comments
 (0)