-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add simple smoke test building drbd & dpdk
- Loading branch information
Showing
6 changed files
with
80 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import pytest | ||
from pytest_container import container_from_pytest_param | ||
from pytest_container import DerivedContainer | ||
from pytest_container.container import ContainerData | ||
|
||
from bci_tester.data import KERNEL_MODULE_CONTAINER | ||
|
||
|
||
_DRBD_VERSION = "9.2.5" | ||
|
||
|
||
DRBD_CONTAINER = DerivedContainer( | ||
base=container_from_pytest_param(KERNEL_MODULE_CONTAINER), | ||
containerfile=rf"""WORKDIR /src/ | ||
RUN zypper -n in coccinelle tar | ||
RUN set -euxo pipefail; \ | ||
curl -L -o drbd.tar.gz https://pkg.linbit.com//downloads/drbd/9/drbd-{_DRBD_VERSION}.tar.gz; \ | ||
tar xvzf drbd.tar.gz; rm drbd.tar.gz; cd drbd-{_DRBD_VERSION}; \ | ||
make -C /usr/src/linux-obj/x86_64/default modules M="$(pwd)/drbd" SPAAS=false | ||
""", | ||
) | ||
|
||
|
||
_DPDK_VERSION = "23.07" | ||
|
||
DPDK_CONTAINER = DerivedContainer( | ||
base=container_from_pytest_param(KERNEL_MODULE_CONTAINER), | ||
containerfile=rf"""WORKDIR /src/ | ||
RUN zypper -n in meson python3-pip libnuma-devel && pip install pyelftools | ||
RUN set -euxo pipefail; \ | ||
curl -o dpdk.tar.gz https://fast.dpdk.org/rel/dpdk-{_DPDK_VERSION}.tar.gz; tar xvzf dpdk.tar.gz; rm dpdk.tar.gz; cd dpdk-{_DPDK_VERSION}; \ | ||
meson --prefix=/usr --includedir=/usr/include/ -Ddefault_library=shared -Denable_docs=false -Db_lto=false -Dplatform="$(uname -m)" -Dcpu_instruction_set=generic -Denable_kmods=true -Dkernel_dir="/usr/src/linux-obj/$(uname -m)/default" build; \ | ||
meson compile -C build | ||
""", | ||
) | ||
|
||
|
||
@pytest.mark.parametrize("container", [DRBD_CONTAINER], indirect=True) | ||
def test_drbd_builds(container: ContainerData) -> None: | ||
assert container.connection.file( | ||
f"/src/drbd-{_DRBD_VERSION}/drbd/drbd.ko" | ||
).exists | ||
|
||
|
||
@pytest.mark.parametrize("container", [DPDK_CONTAINER], indirect=True) | ||
def test_dpdk_builds(container: ContainerData) -> None: | ||
assert container.connection.file( | ||
f"/src/dpdk-{_DPDK_VERSION}/build/kernel/linux/kni/rte_kni.ko" | ||
).exists |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters