diff --git a/.github/runner2.py b/.github/runner2.py new file mode 100644 index 000000000..d68cec96d --- /dev/null +++ b/.github/runner2.py @@ -0,0 +1,48 @@ +import inspect + +from lnst.Controller import Controller +from lnst.Controller.ContainerPoolManager import ContainerPoolManager +from lnst.Controller.MachineMapper import ContainerMapper +from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe + +import lnst.Recipes.ENRT as enrt_recipes + +podman_uri = "unix:///run/podman/podman.sock" +image_name = "lnst" +ctl = Controller( + poolMgr=ContainerPoolManager, + mapper=ContainerMapper, + podman_uri=podman_uri, + image=image_name, + debug=1, +) + +params = dict( + perf_tests=['tcp_stream'], + perf_duration=5, + perf_iterations=2, + perf_warmup_duration=0, + ping_count=1, + perf_test_simulation=True, +) + +for recipe_name in dir(enrt_recipes): + if recipe_name in ["BaseEnrtRecipe", "BaseTunnelRecipe", "BaseLACPRecipe"]: + continue + + recipe = getattr(enrt_recipes, recipe_name) + + if not (inspect.isclass(recipe) and issubclass(recipe, BaseEnrtRecipe)): + continue + + if "Bond" in recipe_name: + params = params.copy() + params["bonding_mode"] = "active-backup" + params["miimon_value"] = 5 + + recipe_instance = recipe(**params) + + ctl.run(recipe_instance) + + overall_result = all([run.overall_result for run in recipe_instance.runs]) + diff --git a/.github/workflows/ci-test.yml b/.github/workflows/ci-test.yml index 3b685f2c3..7477af6c8 100644 --- a/.github/workflows/ci-test.yml +++ b/.github/workflows/ci-test.yml @@ -63,6 +63,62 @@ jobs: venv_path=$(poetry env info -p) sudo "$venv_path"/bin/python3 .github/runner.py + ENRTTest: + runs-on: ubuntu-24.04 + + steps: + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: "3.12" + + - name: Source branch checkout + uses: actions/checkout@v2 + + - name: Set up system requirements + run: | + sudo apt-get update + sudo apt-get install podman -y + sudo systemctl enable --now podman.socket + curl -sSL https://install.python-poetry.org | python3 - --version 1.4.2 + + - name: Set up Podman network requirements + run: | + sudo sysctl -w net.ipv4.ip_forward=1 + sudo sysctl net.ipv4.conf.all.forwarding=1 + sudo iptables -P FORWARD ACCEPT + sudo sysctl -p + + - name: Install LNST + run: | + sudo apt-get install -y iputils-* \ + ethtool \ + gcc \ + python3-dev \ + libxml2-dev \ + libxslt-dev \ + qemu-kvm \ + libvirt-daemon-system \ + libvirt-clients \ + bridge-utils \ + libvirt-dev \ + libnl-3-200 \ + libnl-route-3-dev \ + git \ + libnl-3-dev + export PATH="/root/.local/bin:$PATH" + poetry install -E "containers" + + - name: Build LNST agents image + run: | + sudo -E XDG_RUNTIME_DIR= podman build . -t lnst -f container_files/Dockerfile + + - name: All ENRT recipes test + run: | + export PATH="/root/.local/bin:$PATH" + venv_path=$(poetry env info -p) + sudo "$venv_path"/bin/python3 .github/runner2.py + ImportsCheck: runs-on: ubuntu-20.04 steps: