diff --git a/gating.yaml b/gating.yaml new file mode 100644 index 0000000..4ca9235 --- /dev/null +++ b/gating.yaml @@ -0,0 +1,6 @@ +--- !Policy +product_versions: + - rhel-10 +decision_context: osci_compose_gate +rules: + - !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional} diff --git a/tests/sanity/mptcpd.sh b/tests/sanity/mptcpd.sh new file mode 100755 index 0000000..efea3a3 --- /dev/null +++ b/tests/sanity/mptcpd.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +set -e + +exec 3>&1 +export LANG=C +pretty() { echo -e "\x1b[32m\x1b[1m[+] ${1:+NS$1: }${2}\x1b[0m" >&3; } +pp() { pretty "" "$*"; "$@"; } +slp() { read -t "$1" -N 1 || true; } + +do_cleanup() { + set +e + exec 2>/dev/null + pp systemctl stop mptcp + pp ip link del dev mptcp-dummy0 || true +# note: endpoints are still present after interface removal + pp ip mptcp endpoint flush || true +} + +trap do_cleanup EXIT + +do_setup() { + ip mptcp endpoint flush || true + ip link del dev mptcp-dummy0 2>/dev/null || true + pp modprobe dummy + pp systemctl restart mptcp + # settle to allow addition of all endpoints + sleep 5 + pp systemctl is-active --quiet mptcp + pp ip mptcp limits set add_addr_accepted 8 subflows 8 + pp ip link add name mptcp-dummy0 type dummy + pp ip link set dev mptcp-dummy0 up + pp ip address add dev mptcp-dummy0 192.0.2.10/24 +} + +do_check0() { + # settle to allow addition of all endpoints + sleep 5 + pp ip mptcp endpoint show | grep "192\.0\.2\.10.*dev mptcp-dummy0" + pp echo done +} + +do_setup +do_check0 diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..9eac4ff --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,12 @@ +# Tests for mptcpd +- hosts: localhost + roles: + - role: standard-test-basic + required_packages: + - iproute + tags: + - classic + tests: + - sanity-tests: + dir: ./sanity + run: mptcpd.sh