Compare commits

..

No commits in common. "c8" and "c8s" have entirely different histories.
c8 ... c8s

13 changed files with 285 additions and 2 deletions

57
.gitignore vendored
View File

@ -1 +1,56 @@
SOURCES/libteam-1.31.tar.gz
/libteam-20120113git302672e.tar.gz
/libteam-20120125gita1718f8.tar.gz
/libteam-20120130gitb5cf2a8.tar.gz
/libteam-20120221gitfe97f63.tar.gz
/libteam-20120405gita82f8ac.tar.gz
/libteam-20120504git11e234a.tar.gz
/libteam-20120620gita88fabf.tar.gz
/libteam-20120627gitcd6b557.tar.gz
/libteam-20120627git96569f8.tar.gz
/libteam-20120628gitca7b526.tar.gz
/libteam-20120807gitf042120.tar.gz
/libteam-20120807git9fa4a96.tar.gz
/libteam-20120822gitc0d943d.tar.gz
/libteam-20120904gitbdcf72c.tar.gz
/libteam-20120923git8448186.tar.gz
/libteam-20120925gitcc5cddc.tar.gz
/libteam-20121007git6f48751.tar.gz
/libteam-20121019git1a91059.tar.gz
/libteam-20121025git7fe7c72.tar.gz
/libteam-20121105git3b95b34.tar.gz
/libteam-20121115gitffb5267.tar.gz
/libteam-20121122git18b6701.tar.gz
/libteam-20121206git659a848.tar.gz
/libteam-20121212git01fe4bd.tar.gz
/libteam-20130110gitf16805c.tar.gz
/libteam-1.0.tar.gz
/libteam-1.1.tar.gz
/libteam-1.2.tar.gz
/libteam-1.3.tar.gz
/libteam-1.4.tar.gz
/libteam-1.5.tar.gz
/libteam-1.6.tar.gz
/libteam-1.7.tar.gz
/libteam-1.8.tar.gz
/libteam-1.9.tar.gz
/libteam-1.10.tar.gz
/libteam-1.11.tar.gz
/libteam-1.12.tar.gz
/libteam-1.13.tar.gz
/libteam-1.14.tar.gz
/libteam-1.15.tar.gz
/libteam-1.16.tar.gz
/libteam-1.17.tar.gz
/libteam-1.18.tar.gz
/libteam-1.19.tar.gz
/libteam-1.20.tar.gz
/libteam-1.21.tar.gz
/libteam-1.22.tar.gz
/libteam-1.23.tar.gz
/libteam-1.24.tar.gz
/libteam-1.25.tar.gz
/libteam-1.26.tar.gz
/libteam-1.27.tar.gz
/libteam-1.28.tar.gz
/libteam-1.29.tar.gz
/libteam-1.31.tar.gz

View File

@ -1 +0,0 @@
4e5e0a0d0682f27a0850fac1f9bababdb991f14a SOURCES/libteam-1.31.tar.gz

6
gating.yaml Normal file
View File

@ -0,0 +1,6 @@
--- !Policy
product_versions:
- rhel-8
decision_context: osci_compose_gate
rules:
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}

1
sources Normal file
View File

@ -0,0 +1 @@
SHA512 (libteam-1.31.tar.gz) = 1382cc3b0a2d0211f33e506e8a6fd8a1847398fa5bba56abfc959da70bcc8417cf1dba9e26a777da5729eb237f51a66b3f9cfa33fb830ed684aa076f4c8cec9e

1
tests/.fmf/version Normal file
View File

@ -0,0 +1 @@
1

206
tests/basic/test.sh Normal file
View File

@ -0,0 +1,206 @@
libteam_setup_files()
{
cat <<-EOF > activebackup.json
{
"device":"team0",
"runner":{"name":"activebackup"},
"link_watch": {"name": "ethtool"}
}
EOF
cat <<-EOF >lacp.json
{
"device":"team0",
"runner":{
"name":"lacp",
"active": false,
"fast_rate": true,
"tx_hash": ["eth", "ipv4", "ipv6"]},
"link_watch": {"name": "ethtool"}
}
EOF
cat <<-EOF > roundrobin.json
{
"device":"team0",
"runner":{
"name":"roundrobin",
"fast_rate": true
},
"link_watch": {"name": "ethtool"}
}
EOF
cat <<-EOF > broadcast.json
{
"device":"team0",
"runner":{"name":"broadcast"},
"link_watch": {"name": "ethtool"}
}
EOF
cat <<-EOF > loadbalance.json
{
"device":"team0",
"runner":{
"name":"loadbalance",
"tx_balancer" : { "name" : "basic", "balancing_interval" : 10 },
"tx_hash": ["eth", "ipv4", "ipv6"] },
"link_watch": {"name": "ethtool"}
}
EOF
}
libteam_clean_files()
{
rm -rf *.json
}
libteam_log()
{
echo -e "[libteam gating]: $@"
echo -e "[libteam gating]: $@" >> libteam.log
}
libteam_start_ovs()
{
local url=http://download-node-02.eng.bos.redhat.com/brewroot/packages
rpm -qa | grep openvswitch >> libteam.log || \
yum install -y $url/openvswitch2.11/2.11.0/50.el8fdp/x86_64/openvswitch2.11-2.11.0-50.el8fdp.x86_64.rpm \
$url/openvswitch-selinux-extra-policy/1.0/23.el8fdp/noarch/openvswitch-selinux-extra-policy-1.0-23.el8fdp.noarch.rpm >> libteam.log
systemctl start openvswitch
}
libteam_stop_ovs()
{
systemctl stop openvswitch
}
libteam_setup_switch()
{
[ $runner = "lacp" ] || return
ovs-vsctl del-port br0 br_ceth1
ovs-vsctl del-port br0 br_ceth2
ovs-vsctl add-bond br0 br_lacp1 br_ceth1 br_ceth2 lacp=active
sleep 3
}
libteam_clean_switch()
{
[ $runner = "lacp" ] || return
ovs-vsctl del-port br0 br_lacp1
ovs-vsctl add-port br0 br_ceth1
ovs-vsctl add-port br0 br_ceth2
}
libteam_setup()
{
# ceth1 --- br_ceth1 \
# br0 - br_seth1 --- seth1 (server)
# ceth2 --- br_ceth2 /
# do topo setup
ip netn add serv1
ip link add ceth1 type veth peer name br_ceth1
ip link add ceth2 type veth peer name br_ceth2
ip link add seth1 type veth peer name br_seth1
ip link set seth1 netns serv1
libteam_start_ovs
ovs-vsctl add-br br0
ovs-vsctl add-port br0 br_ceth1
ovs-vsctl add-port br0 br_ceth2
ovs-vsctl add-port br0 br_seth1
ip link set br0 up
ip link set br_ceth1 up
ip link set br_ceth2 up
ip link set br_seth1 up
ip netns exec serv1 ip link set seth1 up
ip netns exec serv1 ip addr add 192.168.11.1/24 dev seth1
libteam_setup_files
rm -rf libteam.log
libteam_log "testing setup\n\n"
}
libteam_test_nm()
{
local runner=$1
nmcli con add con-name team0 type team ifname team0 ipv4.method manual ipv4.addr 192.168.11.2/24 connection.autoconnect no
nmcli con modify team0 team.config $runner.json
nmcli con add type ethernet con-name ceth1 ifname ceth1 master team0
nmcli con add type ethernet con-name ceth2 ifname ceth2 master team0
nmcli con reload
nmcli con up team0
nmcli con up ceth1
nmcli con up ceth2
timeout 60s bash -c "until ping -c 3 192.168.11.1 >> libteam.log; do sleep 5; done" || \
{ let LIBTEAM_FAIL++; libteam_log "FAIL $LIBTEAM_FAIL: nm $runner testing failed"; }
nmcli con delete ceth1
nmcli con delete ceth2
nmcli con delete team0
nmcli con reload
}
libteam_test_teamd()
{
local runner=$1
ip link set ceth1 down
ip link set ceth2 down
teamd -d -f $runner.json
teamdctl team0 port add ceth1
teamdctl team0 port add ceth2
ip link set team0 up
ip addr add 192.168.11.2/24 dev team0
timeout 60s bash -c "until ping -c 3 192.168.11.1 >> libteam.log; do sleep 5; done" || \
{ let LIBTEAM_FAIL++; libteam_log "FAIL $LIBTEAM_FAIL: teamd $runner testing failed"; }
teamd -k -t team0
}
libteam_tests()
{
local type=$1
libteam_log "testing run $type =>"
for runner in broadcast roundrobin activebackup loadbalance lacp; do
libteam_log "runnner $runner testing start"
libteam_setup_switch $runner
eval "libteam_test_$type $runner"
libteam_clean_switch $runner
libteam_log "runnner $runner testing done\n"
done
}
libteam_clean()
{
ip link del ceth1
ip link del ceth2
ip link del br_seth1
ip netn del serv1
ovs-vsctl del-br br0
libteam_stop_ovs
libteam_clean_files
libteam_log "testing clean\n\n"
}
LIBTEAM_FAIL=0
libteam_setup
libteam_tests nm
libteam_tests teamd
libteam_clean
exit $LIBTEAM_FAIL

5
tests/provision.fmf Normal file
View File

@ -0,0 +1,5 @@
---
standard-inventory-qcow2:
qemu:
m: 2G

10
tests/tests.yml Normal file
View File

@ -0,0 +1,10 @@
# Tests for Libteam
- hosts: localhost
roles:
- role: standard-test-basic
tags:
- classic
tests:
- sanity-tests:
dir: basic
run: sh test.sh