Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: david-marchand/lnst
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: LNST-project/lnst
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.
Loading
Showing 836 changed files with 37,151 additions and 37,212 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.venv
38 changes: 38 additions & 0 deletions .github/lnst_setup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash

echo Set up system requirements

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

echo Set up Podman network requirements

sudo sysctl -w net.ipv4.ip_forward=1
sudo sysctl net.ipv4.conf.all.forwarding=1
sudo iptables -P FORWARD ACCEPT
sudo sysctl -p

echo Install LNST

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"

echo Build LNST agents image
sudo -E XDG_RUNTIME_DIR= podman build . -t lnst -f container_files/agent/Dockerfile
15 changes: 15 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
### Description
(Please provide an overall description of what your Merge request is trying to
do.)

### Tests
(Please provide a list of tests that prove that the pull
request doesn't break the stable state of the master branch. This should
include test runs with valid results for all of critical workflows.)

### Reviews
(Please add a list of reviewers that should check the validity and sanity of
this merge request before it's accepted. Use the `@username` syntax. If you
don't know who to mention just link `@all`.)

Closes: #
39 changes: 39 additions & 0 deletions .github/runner.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
from lnst.Controller import Controller, HostReq, DeviceReq, BaseRecipe
from lnst.Controller.ContainerPoolManager import ContainerPoolManager
from lnst.Controller.MachineMapper import ContainerMapper


class HelloWorldRecipe(BaseRecipe):
machine1 = HostReq()
machine1.nic1 = DeviceReq(label="net1")

machine2 = HostReq()
machine2.nic1 = DeviceReq(label="net1")

def test(self):
self.matched.machine1.nic1.ip_add("192.168.1.1/24")
self.matched.machine1.nic1.up()
self.matched.machine2.nic1.ip_add("192.168.1.2/24")
self.matched.machine2.nic1.up()

self.matched.machine1.run("ping 192.168.1.2 -c 5")
self.matched.machine2.run("ping 192.168.1.1 -c 5")


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,
network_plugin="custom_lnst",
)

recipe_instance = HelloWorldRecipe()
ctl.run(recipe_instance)

overall_result = all([run.overall_result for run in recipe_instance.runs])

exit(not overall_result)
115 changes: 115 additions & 0 deletions .github/runner_all_enrt.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
import inspect
import logging

from lnst.Controller import Controller
from lnst.Controller.ContainerPoolManager import ContainerPoolManager
from lnst.Controller.MachineMapper import ContainerMapper
from lnst.Recipes.ENRT.BaseEnrtRecipe import BaseEnrtRecipe
from lnst.Recipes.ENRT.BondingMixin import BondingMixin
from lnst.Recipes.ENRT.BaseSRIOVNetnsTcRecipe import BaseSRIOVNetnsTcRecipe
from lnst.Recipes.ENRT.ConfigMixins.OffloadSubConfigMixin import OffloadSubConfigMixin

import lnst.Recipes.ENRT as enrt_recipes

podman_uri = "unix:///run/podman/podman.sock"
image_name = "lnst"

params_base = dict(
perf_tests=['tcp_stream'],
perf_duration=5,
perf_iterations=2,
perf_warmup_duration=0,
ping_count=1,
perf_test_simulation=True,
)

i = 0
recipe_results = {}
for recipe_name in dir(enrt_recipes):
if recipe_name in ["BaseEnrtRecipe", "BaseTunnelRecipe", "BaseLACPRecipe", "DellLACPRecipe", "BaseSRIOVNetnsTcRecipe"]:
continue
elif "Ovs" in recipe_name or "OvS" in recipe_name:
# ovs can't run without systemd service so containers don't work correctly
continue
elif recipe_name == "SimpleNetworkTunableRecipe":
# veth doesn't support hash functions
continue
elif "Team" in recipe_name:
# teaming has some unexplained issues right now
# TODO check?
continue
elif recipe_name in ["L2TPTunnelRecipe"]:
continue

recipe = getattr(enrt_recipes, recipe_name)

if not (inspect.isclass(recipe) and issubclass(recipe, BaseEnrtRecipe)):
continue
elif issubclass(recipe, BaseSRIOVNetnsTcRecipe):
# veth doesn't support sriov
continue

i += 1

params = params_base.copy()

if issubclass(recipe, BondingMixin) or recipe_name in[ "GreTunnelOverBondRecipe", "LinuxBridgeOverBondRecipe", "TeamVsBondRecipe", "VirtualBridgeVlansOverBondRecipe", "VlansOverBondRecipe"]:
params["bonding_mode"] = "active-backup"
params["miimon_value"] = 5
elif issubclass(recipe, enrt_recipes.TeamRecipe) or issubclass(recipe, enrt_recipes.DoubleTeamRecipe):
params["runner_name"] = "activebackup"
elif recipe_name.startswith("CT"):
del params["perf_tests"]
if "CTFulltableInsertionRateRecipe" in recipe_name:
params["long_lived_conns"] = 10000
elif recipe_name == "SoftwareRDMARecipe":
del params["perf_tests"]
elif recipe_name == "ShortLivedConnectionsRecipe":
del params["perf_tests"]

if recipe_name in ["GeneveLwtTunnelRecipe", "GreLwtTunnelRecipe", "L2TPTunnelRecipe", "VxlanLwtTunnelRecipe", "GeneveTunnelRecipe", "VxlanGpeTunnelRecipe"]:
params["carrier_ipversion"] = "ipv4"

if recipe_name in ["SitTunnelRecipe", "IpIpTunnelRecipe"]:
params["tunnel_mode"] = "any"
if recipe_name in ["Ip6TnlTunnelRecipe"]:
params["tunnel_mode"] = "ip6ip6"

if recipe_name == "SoftwareRDMARecipe":
params["software_rdma_type"] = "rxe"

if recipe_name in ["XDPDropRecipe", "XDPTxRecipe"]:
params["multi_dev_interrupt_config"] = {
"host1": {"eth0": {"cpus": [0], "cpu_policy": "round-robin"}},
"host2": {"eth0": {"cpus": [0], "cpu_policy": "round-robin"}},
}
params["perf_tool_cpu"] = [0]

if issubclass(recipe, OffloadSubConfigMixin):
params['offload_combinations'] = []

try:
recipe_instance = recipe(**params)

print(f"-----------------------------{recipe_name} {i}START---------------------------")
ctl = Controller(
poolMgr=ContainerPoolManager,
mapper=ContainerMapper,
podman_uri=podman_uri,
image=image_name,
debug=1,
network_plugin="custom_lnst"
)
ctl.run(recipe_instance)

overall_result = all([run.overall_result for run in recipe_instance.runs])
recipe_results[recipe_name] = "PASS" if overall_result else "FAIL"
except Exception as e:
logging.exception(f"Recipe {recipe_name} crashed with exception.")
recipe_results[recipe_name] = f"EXCEPTION: {e}"

print("Recipe run results:")
for recipe_name, result in recipe_results.items():
print(recipe_name, result)

exit(any(result.startswith("EXCEPTION") for result in recipe_results.values()))
69 changes: 69 additions & 0 deletions .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: CI test

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
FunctionalTest:
runs-on: ubuntu-latest

steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.9"

- name: Source branch checkout
uses: actions/checkout@v2

- name: LNST Setup
run: bash .github/lnst_setup.sh

- name: SimpleNetworkRecipe ping test
run: |
export PATH="/root/.local/bin:$PATH"
venv_path=$(poetry env info -p)
sudo "$venv_path"/bin/python3 .github/runner.py
ENRT_All_Test:
runs-on: ubuntu-latest

steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.9"

- name: Source branch checkout
uses: actions/checkout@v2

- name: LNST Setup
run: bash .github/lnst_setup.sh

- name: Run all ENRT recipes
run: |
export PATH="/root/.local/bin:$PATH"
venv_path=$(poetry env info -p)
sudo "$venv_path"/bin/python3 .github/runner_all_enrt.py
ImportsCheck:
runs-on: ubuntu-latest
steps:
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: "3.9"

- name: Source branch checkout
uses: actions/checkout@v2

- name: Install dependencies
run: |
sudo apt-get install pylint
- name: Imports check
run: |
pylint --disable=all --enable=W0611 lnst
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -5,6 +5,10 @@
.#*

Logs/
build/

#Intelij (Pycharm) project directory
.idea/

# vim swap files
*.swp
13 changes: 13 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: 2

build:
os: "ubuntu-22.04"
tools:
python: "3.10"

python:
install:
- requirements: docs/requirements.txt

sphinx:
configuration: docs/source/conf.py
64 changes: 46 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,42 +1,70 @@
# Current state

[IMPORTANT UPDATE ABOUT RECENT REPOSITORY CHANGES](https://lists.fedorahosted.org/archives/list/lnst-developers@lists.fedorahosted.org/thread/WK2PWZSUVDDJBQCJSZDR6WCJKZ44ZKVU/)

We recently went through some breaking changes to the repository code base as
outlined in the linked email. These have been coming for a long time as most of
our development was focused on the 'next' branch (now renamed to master).

A lot of the 'next' functionality is ready to be used for testing purposes but
we've yet to mark individual library APIs as 'stable' so no guarantees for
backwards compatibility are yet in place.

# LNST - Linux Network Stack Test #

Linux Network Stack Test is a tool that supports development and execution
of automated and portable network tests. For detailed description of the
architecture of LNST please refer to project website (link listed on
Internet Resources bellow).


## Install

LNST can be installed using python's distutils.
Installation and a simple Hello world example is available at
[Installation](docs/source/installation.rst)

## Documentation

```bash
su
./setup.py install
```
Documentation is available in the `docs/` directory, you can build it with
`make html` using *Sphinx*.

The built documentation is also available online on https://lnst.readthedocs.io/en/latest/

## Authors
The documentation is not fully complete so you may not find all of what you're
looking for so feel free to reach out to us if you have any questions.

## Contributing

If you're interested in helping out we accept code contributions via Patches
submitted to our mailing list <lnst-developers@lists.fedorahosted.org>.

Feel free to also report issues or submit pull requests.

## Authors/Contributors

* Jiri Pirko <jiri@resnulli.us>
* Jan Tluka <jtluka@redhat.com>
* Ondrej Lichtner <olichtne@redhat.com>
* Jiri Prochazka <jprochaz@redhat.com>
* Jiri Zupka <jzupka@redhat.com>
* Radek Pazdera <radek@pazdera.co.uk>

* Ondrej Lichtner <olichtne@redhat.com> (current maintainer)
* Jozef Urbanovsky <jurbanov@redhat.com>
* Samuel Dobron <sdobron@redhat.com>
* Jakub Rozek (not active anymore)
* Perry Gagne (not active anymore)
* Christos Sfakianakis (not active anymore)
* Jiri Prochazka (not active anymore)
* Kamil Jerabek (not active anymore)
* Jiri Zupka (not active anymore)
* Radek Pazdera (not active anymore)

## Internet Resources
## How to contact us

* Project Wiki: https://github.com/jpirko/lnst/wiki
* Documentation: https://github.com/jpirko/lnst/wiki#learn
* Git Source Tree: https://github.com/jpirko/lnst
* Mailing List: <lnst-developers@lists.fedorahosted.org>
* Git Source Tree: https://github.com/LNST-project/lnst
* Mailing List: <lnst-developers@lists.fedorahosted.org>

We currently don't have an irc channel due to the freenode situation and since
it wasn't exactly actively used we haven't created a new one yet.

## License

**Copyright (C) 2011-2015 Red Hat, Inc.**
**Copyright (C) 2011-2023 Red Hat, Inc.**

LNST is distributed under GNU General Public License version 2. See the file
"COPYING" in the source distribution for information on terms & conditions
Loading