[lnst] NmConfigDevice: fix team device configuration for NM 1.0.0
by Jiří Pírko
commit 72a6ec33067ddc456df8cd248cf0ebd9712972d8
Author: Jan Tluka <jtluka(a)redhat.com>
Date: Wed Jan 21 11:41:56 2015 +0100
NmConfigDevice: fix team device configuration for NM 1.0.0
With NetworkManager version 1.0.0 the team device configuration API has
changed a bit and "slave_type" key has been renamed to "slave-type".
The patch adds a check for NM version and uses the appropriate key
variant.
This fixes #97.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Slave/NmConfigDevice.py | 13 ++++++++++---
1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/lnst/Slave/NmConfigDevice.py b/lnst/Slave/NmConfigDevice.py
index 0d4af2d..60d5d0a 100644
--- a/lnst/Slave/NmConfigDevice.py
+++ b/lnst/Slave/NmConfigDevice.py
@@ -291,15 +291,22 @@ class NmConfigDeviceGeneric(object):
self._acon_obj_path = None
def nm_enslave(self, slave_type, master_uuid, slave_conf):
- self._connection["connection"]["slave_type"] = slave_type
+ if get_nm_version() < "1.0.0":
+ self._connection["connection"]["slave_type"] = slave_type
+ else:
+ self._connection["connection"]["slave-type"] = slave_type
self._connection["connection"]["master"] = master_uuid
self._connection.update(slave_conf)
self._nm_update_connection()
def nm_free(self):
- if "slave_type" in self._connection["connection"]:
- del self._connection["connection"]["slave_type"]
+ if get_nm_version() < "1.0.0":
+ if "slave_type" in self._connection["connection"]:
+ del self._connection["connection"]["slave_type"]
+ else:
+ if "slave-type" in self._connection["connection"]:
+ del self._connection["connection"]["slave-type"]
if "master" in self._connection["connection"]:
del self._connection["connection"]["master"]
9 years, 3 months
[PATCH] NmConfigDevice: fix team device configuration for NM 1.0.0
by Jan Tluka
With NetworkManager version 1.0.0 the team device configuration API has
changed a bit and "slave_type" key has been renamed to "slave-type".
The patch adds a check for NM version and uses the appropriate key
variant.
This fixes #97.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/Slave/NmConfigDevice.py | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/lnst/Slave/NmConfigDevice.py b/lnst/Slave/NmConfigDevice.py
index 0d4af2d..60d5d0a 100644
--- a/lnst/Slave/NmConfigDevice.py
+++ b/lnst/Slave/NmConfigDevice.py
@@ -291,15 +291,22 @@ class NmConfigDeviceGeneric(object):
self._acon_obj_path = None
def nm_enslave(self, slave_type, master_uuid, slave_conf):
- self._connection["connection"]["slave_type"] = slave_type
+ if get_nm_version() < "1.0.0":
+ self._connection["connection"]["slave_type"] = slave_type
+ else:
+ self._connection["connection"]["slave-type"] = slave_type
self._connection["connection"]["master"] = master_uuid
self._connection.update(slave_conf)
self._nm_update_connection()
def nm_free(self):
- if "slave_type" in self._connection["connection"]:
- del self._connection["connection"]["slave_type"]
+ if get_nm_version() < "1.0.0":
+ if "slave_type" in self._connection["connection"]:
+ del self._connection["connection"]["slave_type"]
+ else:
+ if "slave-type" in self._connection["connection"]:
+ del self._connection["connection"]["slave-type"]
if "master" in self._connection["connection"]:
del self._connection["connection"]["master"]
--
1.9.3
9 years, 3 months
[PATCH 1/6] rename run-git-test, add rsync option, change -g option
by Ondrej Lichtner
From: Ondrej Lichtner <olichtne(a)redhat.com>
This commit renames the bash script that runs lnst regression tests to
run-test.sh. The reason behind this is that the tests don't really have
anything in common with git.
This commit also adds the argument -s which makes the script use rsync
to download lnst from a specified URL instead of using git clone on that
url.
When using the script to run all tests, before execution they will be
numerically sorted so that we keep the ordering in which they were
added.
Finally I changed the -g option (for git url) to -u (for url) since it
makes more sense like this.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
regression-tests/run-git-test.sh | 222 ------------------------------------
regression-tests/run-test.sh | 236 +++++++++++++++++++++++++++++++++++++++
2 files changed, 236 insertions(+), 222 deletions(-)
delete mode 100755 regression-tests/run-git-test.sh
create mode 100755 regression-tests/run-test.sh
diff --git a/regression-tests/run-git-test.sh b/regression-tests/run-git-test.sh
deleted file mode 100755
index ef84a2e..0000000
--- a/regression-tests/run-git-test.sh
+++ /dev/null
@@ -1,222 +0,0 @@
-#!/usr/bin/bash
-
-function get_hostname
-{
- sed -n "s/.*param name=['\"]hostname['\"] value=['\"]\([^'\"]\+\)['\"].*/\1/p" $1
-}
-
-function log
-{
- if [ -n "$log_dir" ]; then
- echo "$1" | tee -a "$log_dir/log"
- else
- echo "$1"
- fi
-}
-
-function logn
-{
- if [ -n "$log_dir" ]; then
- echo -n "$1" | tee -a "$log_dir/log"
- else
- echo -n "$1"
- fi
-}
-
-function logtest
-{
- if [ -n "$log_dir" ]; then
- log_path="$log_dir/$test_dir"
- mkdir -p "$log_path"
- (tee $log_path/stdout.log) 3>&1 1>&2 2>&3 | tee $log_path/stderr.log
- else
- cat
- fi
-}
-
-function print_separator
-{
- log "--------------------------------------------------------------------------------"
-}
-
-function usage
-{
- echo "Usage: $0 [-r revision] [-l logdir] [-t list_of_tests] [-g url] [-n]"
- echo " -r revision Test a specific git branch/rev/tag"
- echo " -l logdir Save test results to a directory"
- echo " -t list_of_tests Run only these tests"
- echo " Example: -t 0,1,2 will run tests 0, 1, and 2"
- echo " -n Disable use of NetworkManager on slavemachines"
- echo " Note: enabled by default"
- echo " -g url URL pointing to LNST git repository that should be cloned"
- exit 0
-}
-
-# ---
-
-#default repository url
-git_url="../"
-
-while getopts "hlr:t:g:n" OPTION
-do
- case $OPTION in
- h) usage ;;
- l) log_dir_name="results-`date "+%Y-%m-%d-%I-%M-%S"`"
- mkdir -p $log_dir_name
- log_dir=`realpath $log_dir_name`;;
- r) rev="$OPTARG";;
- t) tests="`tr "," " " <<<"$OPTARG"`" ;;
- n) nm_off="yes";;
- g) git_url="$OPTARG";;
- \?) exit 1;;
- esac
-done
-
-# Check for test suite lock
-if [ -e .lock ]; then
- pid=`cat .lock`
- echo "The test suite is locked by process $pid." \
- "Someone might be using it right now."
- echo "Type 'unlock' if you wish to proceed anyway:"
- read -e input
- if [ "$input" != "unlock" ]; then
- exit 1
- fi
-fi
-
-# Lock the test suite
-echo "$$" >.lock
-
-# Clone the repo
-repo=`mktemp -d`
-git clone $git_url $repo
-
-# Checkout the appropriate revision/tag
-if [ ! -z "$rev" ]; then
- pushd . >/dev/null
- cd $repo
- git checkout "$rev"
- popd >/dev/null
-else
- log "Revision not specified, using HEAD."
- rev="HEAD"
-fi
-
-# Load the proper config
-#rm -rf ~/.lnst
-#cp -r env ~/.lnst
-cp -r env/* $repo/
-
-# Scan the pool and prepare the machines in it
-for machine in `ls -1 env/pool/`; do
- hostname=`get_hostname env/pool/$machine`
-
- # In case this script was killed and there are any slave processes
- # left hanging on the machine.
- ssh "root@$hostname" 'for p in `pgrep lnst-slave`; do kill -9 $p; done'
-
- # Create a temporary dir for the git tree to be tested
- remote_repo=`ssh "root@$hostname" "mktemp -d"`
-
- # Transfer the repo to the machine
- rsync -r --exclude "Logs" --exclude ".git" "$repo/" \
- "root@$hostname:$remote_repo"
-
- if [ ! -z $nm_off ]; then
- ssh "root@$hostname" "cd $remote_repo && echo \"use_nm = false\" >> lnst-slave.conf"
- fi
-
- # Start the slave process
- ssh -n -t -t "root@$hostname" "cd $remote_repo && ./lnst-slave" >/dev/null \
- 2>/dev/null &
- pid=$!
-
- # Save the status (hostname, pid of the ssh session, repo path)
- # so we can cleanup things properly after the tests.
- if [ -z "$slave_status" ]; then
- slave_status="$hostname $pid $remote_repo"
- else
- slave_status="$hostname $pid $remote_repo
- $slave_status"
- fi
-done
-
-sleep 1
-
-summary="Summary:"
-
-# Run the tests in the tests/ directory
-print_separator
-
-# In case the list of test names to run was omitted, run all of them
-if [ -z "$tests" ]; then
- tests="`ls -1 tests/ | grep -v '\.sh$'`"
-fi
-
-for test_name in $tests; do
- test_dir=`realpath tests/$test_name`
- if [ -e "$test_dir/run.sh" ]; then
- logn "Running test #$test_name: "
- if [ -e $test_dir/desc ]; then
- while read line; do log " $line"; done < $test_dir/desc
- else
- logn "\n"
- fi
- print_separator
-
- pushd . >/dev/null
- cd $test_dir
-
- chmod +x run.sh
- if [ -n "$log_dir" ]; then
- log_path="$log_dir/$test_name"
- mkdir -p "$log_path"
-
- # A bit of black magic in bash.
- # Explanation: http://bit.ly/1dxuMJI
- log "`PATH="$repo:$PATH" ./run.sh \
- > >(tee $log_path/stdout.log) \
- 2> >(tee $log_path/stderr.log >&2)`"
- else
- PATH="$repo:$PATH" ./run.sh
- fi
-
- rv=$?
-
- popd >/dev/null
-
- print_separator
- if [ "$rv" -eq "0" ]; then
- log "Result #$test_name: PASS"
- summary=`echo -e "$summary\n test #$test_name: PASS"`
- else
- log "Result #$test_name: FAIL"
- summary=`echo -e "$summary\n test #$test_name: FAIL"`
- #break
- fi
- print_separator
- else
- log "Skipping test #$test_name, run.sh file not found."
- print_separator
- summary=`echo -e "$summary\n test #$test_name: SKIPPED"`
- fi
-done
-
-log "$summary"
-print_separator
-
-sleep 1
-
-# Cleanup
-while read line; do
- hostname=`awk '{print $1}' <<<"$line"`
- pid=`awk '{print $2}' <<<"$line"`
- remote_repo=`awk '{print $3}' <<<"$line"`
-
- kill $pid
- ssh -n "root@$hostname" "rm -r $remote_repo"
-done <<< "$slave_status"
-
-rm -rf $repo
-
-rm -rf .lock
diff --git a/regression-tests/run-test.sh b/regression-tests/run-test.sh
new file mode 100755
index 0000000..1c9c657
--- /dev/null
+++ b/regression-tests/run-test.sh
@@ -0,0 +1,236 @@
+#!/usr/bin/bash
+
+function get_hostname
+{
+ sed -n "s/.*param name=['\"]hostname['\"] value=['\"]\([^'\"]\+\)['\"].*/\1/p" $1
+}
+
+function log
+{
+ if [ -n "$log_dir" ]; then
+ echo "$1" | tee -a "$log_dir/log"
+ else
+ echo "$1"
+ fi
+}
+
+function logn
+{
+ if [ -n "$log_dir" ]; then
+ echo -n "$1" | tee -a "$log_dir/log"
+ else
+ echo -n "$1"
+ fi
+}
+
+function logtest
+{
+ if [ -n "$log_dir" ]; then
+ log_path="$log_dir/$test_dir"
+ mkdir -p "$log_path"
+ (tee $log_path/stdout.log) 3>&1 1>&2 2>&3 | tee $log_path/stderr.log
+ else
+ cat
+ fi
+}
+
+function print_separator
+{
+ log "--------------------------------------------------------------------------------"
+}
+
+function usage
+{
+ echo "Usage: $0 [-r revision] [-l logdir] [-t list_of_tests] [-u url] [-n]"
+ echo " -r revision Test a specific git branch/rev/tag"
+ echo " Note: ignored when -s is used"
+ echo " -l logdir Save test results to a directory"
+ echo " -t list_of_tests Run only these tests"
+ echo " Example: -t 0,1,2 will run tests 0, 1, and 2"
+ echo " -n Disable use of NetworkManager on slavemachines"
+ echo " Note: enabled by default"
+ echo " -u url URL pointing to LNST repository that should be used"
+ echo " Note: git clone and checkout by default"
+ echo " -s use rsync instead of git"
+ exit 0
+}
+
+# ---
+
+#default repository url
+url="../"
+use_git=true
+
+while getopts "hlr:t:g:ns" OPTION
+do
+ case $OPTION in
+ h) usage ;;
+ l) log_dir_name="results-`date "+%Y-%m-%d-%I-%M-%S"`"
+ mkdir -p $log_dir_name
+ log_dir=`realpath $log_dir_name`;;
+ r) rev="$OPTARG";;
+ t) tests="`tr "," " " <<<"$OPTARG"`" ;;
+ n) nm_off="yes";;
+ g) url="$OPTARG";;
+ s) use_git=false;;
+ \?) exit 1;;
+ esac
+done
+
+# Check for test suite lock
+if [ -e .lock ]; then
+ pid=`cat .lock`
+ echo "The test suite is locked by process $pid." \
+ "Someone might be using it right now."
+ echo "Type 'unlock' if you wish to proceed anyway:"
+ read -e input
+ if [ "$input" != "unlock" ]; then
+ exit 1
+ fi
+fi
+
+# Lock the test suite
+echo "$$" >.lock
+
+# Clone the repo
+repo=`mktemp -d`
+if $use_git ; then
+ git clone $url $repo
+else
+ rsync -r $url $repo
+fi
+
+if $use_git ; then
+ # Checkout the appropriate revision/tag
+ if [ ! -z "$rev" ]; then
+ pushd . >/dev/null
+ cd $repo
+ git checkout "$rev"
+ popd >/dev/null
+ else
+ log "Revision not specified, using HEAD."
+ rev="HEAD"
+ fi
+fi
+
+# Load the proper config
+#rm -rf ~/.lnst
+#cp -r env ~/.lnst
+cp -r env/* $repo/
+
+# Scan the pool and prepare the machines in it
+for machine in `ls -1 env/pool/`; do
+ hostname=`get_hostname env/pool/$machine`
+
+ # In case this script was killed and there are any slave processes
+ # left hanging on the machine.
+ ssh "root@$hostname" 'for p in `pgrep lnst-slave`; do kill -9 $p; done'
+
+ # Create a temporary dir for the git tree to be tested
+ remote_repo=`ssh "root@$hostname" "mktemp -d"`
+
+ # Transfer the repo to the machine
+ rsync -r --exclude "Logs" --exclude ".git" "$repo/" \
+ "root@$hostname:$remote_repo"
+
+ if [ ! -z $nm_off ]; then
+ ssh "root@$hostname" "cd $remote_repo && echo \"use_nm = false\" >> lnst-slave.conf"
+ fi
+
+ # Start the slave process
+ ssh -n -t -t "root@$hostname" "cd $remote_repo && ./lnst-slave" >/dev/null \
+ 2>/dev/null &
+ pid=$!
+
+ # Save the status (hostname, pid of the ssh session, repo path)
+ # so we can cleanup things properly after the tests.
+ if [ -z "$slave_status" ]; then
+ slave_status="$hostname $pid $remote_repo"
+ else
+ slave_status="$hostname $pid $remote_repo
+ $slave_status"
+ fi
+done
+
+sleep 1
+
+summary="Summary:"
+
+# Run the tests in the tests/ directory
+print_separator
+
+# In case the list of test names to run was omitted, run all of them
+if [ -z "$tests" ]; then
+ tests="`command ls -1 tests/ | grep -v '\.sh$' | sort -n`"
+fi
+
+for test_name in $tests; do
+ test_dir=`realpath tests/$test_name`
+ if [ -e "$test_dir/run.sh" ]; then
+ logn "Running test #$test_name: "
+ if [ -e $test_dir/desc ]; then
+ while read line; do log " $line"; done < $test_dir/desc
+ else
+ logn "\n"
+ fi
+ print_separator
+
+ pushd . >/dev/null
+ cd $test_dir
+
+ chmod +x run.sh
+ if [ -n "$log_dir" ]; then
+ log_path="$log_dir/$test_name"
+ mkdir -p "$log_path"
+
+ # A bit of black magic in bash.
+ # Explanation: http://bit.ly/1dxuMJI
+ log "`PATH="$repo:$PATH" ./run.sh \
+ > >(tee $log_path/stdout.log) \
+ 2> >(tee $log_path/stderr.log >&2)`"
+ else
+ PATH="$repo:$PATH" ./run.sh
+ fi
+
+ rv=$?
+
+ popd >/dev/null
+
+ print_separator
+ if [ "$rv" -eq "0" ]; then
+ log "Result #$test_name: PASS"
+ summary=`echo -e "$summary\n test #$test_name: PASS"`
+ else
+ log "Result #$test_name: FAIL"
+ summary=`echo -e "$summary\n test #$test_name: FAIL"`
+ #break
+ fi
+ print_separator
+ else
+ log "Skipping test #$test_name, run.sh file not found."
+ print_separator
+ summary=`echo -e "$summary\n test #$test_name: SKIPPED"`
+ fi
+done
+
+log "$summary"
+print_separator
+
+sleep 1
+
+# Cleanup
+if [ $slave_status ]; then
+ while read line; do
+ hostname=`awk '{print $1}' <<<"$line"`
+ pid=`awk '{print $2}' <<<"$line"`
+ remote_repo=`awk '{print $3}' <<<"$line"`
+
+ echo "kill $pid"
+ kill $pid
+ ssh -n "root@$hostname" "rm -r $remote_repo"
+ done <<< "$slave_status"
+fi
+
+rm -rf $repo
+
+rm -rf .lock
--
2.1.0
9 years, 3 months
[lnst] Added IPv6 tests for all the tests in phase 1 and phase 2
by Jiří Pírko
commit d4176e168ef74d4b436ae7b628b33f58081ff7a5
Author: Jiri Prochazka <jprochaz(a)redhat.com>
Date: Tue Jan 20 10:58:55 2015 +0100
Added IPv6 tests for all the tests in phase 1 and phase 2
Prefix 2002::/112 is used for testing, link-local did not work with netperf.
Known issues on VMs:
- Ping across different VLANs in different subnets work, even if they should not
- ping6 does sometime use source address from different subinterface
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
recipes/regression_tests/phase1/3_vlans.py | 109 +++++++++++--
recipes/regression_tests/phase1/3_vlans.xml | 9 +
.../phase1/3_vlans_over_active_backup_bond.xml | 16 ++-
.../regression_tests/phase1/3_vlans_over_bond.py | 113 +++++++++++--
.../phase1/3_vlans_over_round_robin_bond.xml | 9 +
.../regression_tests/phase1/active_backup_bond.xml | 5 +
.../phase1/active_backup_double_bond.xml | 5 +
recipes/regression_tests/phase1/bonding_test.py | 116 +++++++------
recipes/regression_tests/phase1/ping_flood.xml | 9 +-
.../regression_tests/phase1/round_robin_bond.xml | 5 +
.../phase1/round_robin_double_bond.xml | 5 +
recipes/regression_tests/phase1/simple_ping.py | 36 +++--
...tual_bridge_2_vlans_over_active_backup_bond.xml | 7 +
.../phase1/virtual_bridge_2_vlans_over_bond.py | 132 +++++++++++++--
.../phase1/virtual_bridge_vlan_in_guest.py | 83 +++++++++-
.../phase1/virtual_bridge_vlan_in_guest.xml | 5 +
.../phase1/virtual_bridge_vlan_in_host.py | 79 ++++++++-
.../phase1/virtual_bridge_vlan_in_host.xml | 5 +
.../phase2/3_vlans_over_active_backup_team.xml | 9 +
.../phase2/3_vlans_over_round_robin_team.xml | 9 +
.../regression_tests/phase2/3_vlans_over_team.py | 113 +++++++++++--
.../phase2/active_backup_double_team.xml | 2 +
.../regression_tests/phase2/active_backup_team.xml | 2 +
.../active_backup_team_vs_active_backup_bond.xml | 2 +
.../active_backup_team_vs_round_robin_bond.xml | 2 +
.../phase2/round_robin_double_team.xml | 2 +
.../regression_tests/phase2/round_robin_team.xml | 2 +
.../round_robin_team_vs_active_backup_bond.xml | 2 +
.../round_robin_team_vs_round_robin_bond.xml | 2 +
recipes/regression_tests/phase2/team_test.py | 173 ++++++++++++++++----
...l_ovs_bridge_2_vlans_over_active_backup_bond.py | 135 ++++++++++++++--
..._ovs_bridge_2_vlans_over_active_backup_bond.xml | 7 +
.../phase2/virtual_ovs_bridge_vlan_in_guest.py | 81 ++++++++-
.../phase2/virtual_ovs_bridge_vlan_in_guest.xml | 5 +
.../phase2/virtual_ovs_bridge_vlan_in_host.py | 79 ++++++++-
.../phase2/virtual_ovs_bridge_vlan_in_host.xml | 7 +-
36 files changed, 1171 insertions(+), 211 deletions(-)
---
diff --git a/recipes/regression_tests/phase1/3_vlans.py b/recipes/regression_tests/phase1/3_vlans.py
index 4681d8a..c7f8824 100644
--- a/recipes/regression_tests/phase1/3_vlans.py
+++ b/recipes/regression_tests/phase1/3_vlans.py
@@ -7,8 +7,8 @@ from lnst.Controller.Task import ctl
m1 = ctl.get_host("testmachine1")
m2 = ctl.get_host("testmachine2")
-m1.sync_resources(modules=["IcmpPing", "Netperf"])
-m2.sync_resources(modules=["IcmpPing", "Netperf"])
+m1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
+m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# ------
# TESTS
@@ -17,40 +17,83 @@ m2.sync_resources(modules=["IcmpPing", "Netperf"])
vlans = ["vlan10", "vlan20", "vlan30"]
offloads = ["gso", "gro", "tso"]
+ipv = ctl.get_alias('ipv')
+
for vlan1 in vlans:
for vlan2 in vlans:
ping_mod = ctl.get_module("IcmpPing",
options={
- "addr" : m2.get_ip(vlan2),
+ "addr" : m2.get_ip(vlan2, 0),
"count" : 100,
"iface" : m1.get_devname(vlan1),
"interval" : 0.1
})
+
+ ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : m2.get_ip(vlan2, 1),
+ "count" : 100,
+ "iface" : m1.get_devname(vlan1),
+ "interval" : 0.1
+ })
+
netperf_srv = ctl.get_module("Netperf",
options={
"role" : "server",
- "bind" : m1.get_ip(vlan1),
+ "bind" : m1.get_ip(vlan1, 0),
})
+
+ netperf_srv6 = ctl.get_module("Netperf",
+ options={
+ "role" : "server",
+ "bind" : m1.get_ip(vlan1, 1),
+ "netperf_opts" : " -6",
+ })
+
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" :
- m1.get_ip(vlan1),
+ m1.get_ip(vlan1, 0),
"duration" : 60,
"testname" : "TCP_STREAM",
"netperf_opts" :
"-L %s" % m2.get_ip(vlan1)
})
+
netperf_cli_udp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" :
- m1.get_ip(vlan1),
+ m1.get_ip(vlan1, 0),
"duration" : 60,
"testname" : "UDP_STREAM",
"netperf_opts" :
"-L %s" % m2.get_ip(vlan1)
})
+
+ netperf_cli_tcp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ m1.get_ip(vlan1, 1),
+ "duration" : 60,
+ "testname" : "TCP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % m2.get_ip(vlan1, 1)
+ })
+
+ netperf_cli_udp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ m1.get_ip(vlan1, 1),
+ "duration" : 60,
+ "testname" : "UDP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % m2.get_ip(vlan1, 1)
+ })
+
for offload in offloads:
# These tests should pass
# Ping between same VLANs
@@ -61,16 +104,44 @@ for vlan1 in vlans:
offload, state))
m2.run("ethtool -K %s %s %s" % (m2.get_devname("eth1"),
offload, state))
+ if ipv == 'ipv4':
+ # Ping test
+ m1.run(ping_mod)
+
+ # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp, timeout=65)
+ m2.run(netperf_cli_udp, timeout=65)
+ srv_proc.intr()
+ elif ipv == 'ipv6':
+ # Ping test
+ m1.run(ping_mod6)
+
+ # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp6, timeout=65)
+ m2.run(netperf_cli_udp6, timeout=65)
+ srv_proc.intr()
+ else:
+ # Ping tests
+ m1.run(ping_mod)
+ m1.run(ping_mod6)
- # Ping test
- m1.run(ping_mod)
+ # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp, timeout=65)
+ m2.run(netperf_cli_udp, timeout=65)
+ srv_proc.intr()
- # Netperf test (both TCP and UDP)
- srv_proc = m1.run(netperf_srv, bg=True)
- ctl.wait(2)
- m2.run(netperf_cli_tcp, timeout=65)
- m2.run(netperf_cli_udp, timeout=65)
- srv_proc.intr()
+ # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp6, timeout=65)
+ m2.run(netperf_cli_udp6, timeout=65)
+ srv_proc.intr()
# These tests should fail
# Ping across different VLAN
@@ -82,5 +153,11 @@ for vlan1 in vlans:
m2.run("ethtool -K %s %s %s" % (m2.get_devname("eth1"),
offload, state))
- # Ping test
- m1.run(ping_mod, expect="fail")
+ if ipv == 'ipv4':
+ # Ping test
+ m1.run(ping_mod, expect="fail")
+ elif ipv == 'ipv6':
+ m1.run(ping_mod6, expect="fail")
+ else:
+ m1.run(ping_mod, expect="fail")
+ m1.run(ping_mod6, expect="fail")
diff --git a/recipes/regression_tests/phase1/3_vlans.xml b/recipes/regression_tests/phase1/3_vlans.xml
index faa5045..a5c47fb 100644
--- a/recipes/regression_tests/phase1/3_vlans.xml
+++ b/recipes/regression_tests/phase1/3_vlans.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="testmachine1">
<interfaces>
@@ -12,6 +15,7 @@
</slaves>
<addresses>
<address value="192.168.10.1/24" />
+ <address value="2002::10:1/112" />
</addresses>
</vlan>
<vlan id="vlan20">
@@ -23,6 +27,7 @@
</slaves>
<addresses>
<address value="192.168.20.1/24" />
+ <address value="2002::20:1/112" />
</addresses>
</vlan>
<vlan id="vlan30">
@@ -34,6 +39,7 @@
</slaves>
<addresses>
<address value="192.168.30.1/24" />
+ <address value="2002::30:1/112" />
</addresses>
</vlan>
</interfaces>
@@ -50,6 +56,7 @@
</slaves>
<addresses>
<address value="192.168.10.2/24" />
+ <address value="2002::10:2/112" />
</addresses>
</vlan>
<vlan id="vlan20">
@@ -61,6 +68,7 @@
</slaves>
<addresses>
<address value="192.168.20.2/24" />
+ <address value="2002::20:2/112" />
</addresses>
</vlan>
<vlan id="vlan30">
@@ -72,6 +80,7 @@
</slaves>
<addresses>
<address value="192.168.30.2/24" />
+ <address value="2002::30:2/112" />
</addresses>
</vlan>
</interfaces>
diff --git a/recipes/regression_tests/phase1/3_vlans_over_active_backup_bond.xml b/recipes/regression_tests/phase1/3_vlans_over_active_backup_bond.xml
index d125971..ce12030 100644
--- a/recipes/regression_tests/phase1/3_vlans_over_active_backup_bond.xml
+++ b/recipes/regression_tests/phase1/3_vlans_over_active_backup_bond.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="testmachine1">
<interfaces>
@@ -14,7 +17,7 @@
<slave id="eth2" />
</slaves>
<addresses>
- <address value="1.2.3.4/24" />
+ <address value="2002::1/112" />
</addresses>
</bond>
<vlan id="vlan10">
@@ -26,6 +29,7 @@
</slaves>
<addresses>
<address value="192.168.10.1/24" />
+ <address value="2002::10:1/112" />
</addresses>
</vlan>
<vlan id="vlan20">
@@ -37,6 +41,7 @@
</slaves>
<addresses>
<address value="192.168.20.1/24" />
+ <address value="2002::20:1/112" />
</addresses>
</vlan>
<vlan id="vlan30">
@@ -48,6 +53,7 @@
</slaves>
<addresses>
<address value="192.168.30.1/24" />
+ <address value="2002::30:1/112" />
</addresses>
</vlan>
</interfaces>
@@ -55,6 +61,11 @@
<host id="testmachine2">
<interfaces>
<eth id="eth1" label="tnet" />
+ <eth id="eth2" label="tnet">
+ <addresses>
+ <address value="2002::2/112" />
+ </addresses>
+ </eth>
<vlan id="vlan10">
<options>
<option name="vlan_tci" value="10" />
@@ -64,6 +75,7 @@
</slaves>
<addresses>
<address value="192.168.10.2/24" />
+ <address value="2002::10:2/112" />
</addresses>
</vlan>
<vlan id="vlan20">
@@ -75,6 +87,7 @@
</slaves>
<addresses>
<address value="192.168.20.2/24" />
+ <address value="2002::20:2/112" />
</addresses>
</vlan>
<vlan id="vlan30">
@@ -86,6 +99,7 @@
</slaves>
<addresses>
<address value="192.168.30.2/24" />
+ <address value="2002::30:2/112" />
</addresses>
</vlan>
</interfaces>
diff --git a/recipes/regression_tests/phase1/3_vlans_over_bond.py b/recipes/regression_tests/phase1/3_vlans_over_bond.py
index 1c95ed2..a9a0eb8 100644
--- a/recipes/regression_tests/phase1/3_vlans_over_bond.py
+++ b/recipes/regression_tests/phase1/3_vlans_over_bond.py
@@ -7,8 +7,8 @@ from lnst.Controller.Task import ctl
m1 = ctl.get_host("testmachine1")
m2 = ctl.get_host("testmachine2")
-m1.sync_resources(modules=["IcmpPing", "Netperf"])
-m2.sync_resources(modules=["IcmpPing", "Netperf"])
+m1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
+m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# ------
# TESTS
@@ -17,40 +17,83 @@ m2.sync_resources(modules=["IcmpPing", "Netperf"])
vlans = ["vlan10", "vlan20", "vlan30"]
offloads = ["gso", "gro", "tso"]
+ipv = ctl.get_alias('ipv')
+
for vlan1 in vlans:
for vlan2 in vlans:
ping_mod = ctl.get_module("IcmpPing",
options={
- "addr" : m2.get_ip(vlan2),
+ "addr" : m2.get_ip(vlan2, 0),
"count" : 100,
"iface" : m1.get_devname(vlan1),
"interval" : 0.1
})
+
+ ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : m2.get_ip(vlan2, 1),
+ "count" : 100,
+ "iface" : m1.get_devname(vlan1),
+ "interval" : 0.1
+ })
+
netperf_srv = ctl.get_module("Netperf",
options={
"role" : "server",
- "bind" : m1.get_ip(vlan1),
+ "bind" : m1.get_ip(vlan1, 0),
})
+
+ netperf_srv6 = ctl.get_module("Netperf",
+ options={
+ "role" : "server",
+ "bind" : m1.get_ip(vlan1, 1),
+ "netperf_opts" : " -6",
+ })
+
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" :
- m1.get_ip(vlan1),
+ m1.get_ip(vlan1, 0),
"duration" : 60,
"testname" : "TCP_STREAM",
"netperf_opts" :
- "-L %s" % m2.get_ip(vlan1)
+ "-L %s" % m2.get_ip(vlan1, 0)
})
+
netperf_cli_udp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" :
- m1.get_ip(vlan1),
+ m1.get_ip(vlan1, 0),
"duration" : 60,
"testname" : "UDP_STREAM",
"netperf_opts" :
- "-L %s" % m2.get_ip(vlan1)
+ "-L %s" % m2.get_ip(vlan1, 0)
})
+
+ netperf_cli_tcp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ m1.get_ip(vlan1, 1),
+ "duration" : 60,
+ "testname" : "TCP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % m2.get_ip(vlan1, 1)
+ })
+
+ netperf_cli_udp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ m1.get_ip(vlan1, 1),
+ "duration" : 60,
+ "testname" : "UDP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % m2.get_ip(vlan1, 1)
+ })
+
for offload in offloads:
# These tests should pass
# Ping between same VLANs
@@ -63,16 +106,44 @@ for vlan1 in vlans:
offload, state))
m2.run("ethtool -K %s %s %s" % (m2.get_devname("eth1"),
offload, state))
+ if ipv == 'ipv4':
+ # Ping test
+ m1.run(ping_mod)
+
+ # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp, timeout=65)
+ m2.run(netperf_cli_udp, timeout=65)
+ srv_proc.intr()
+ elif ipv == 'ipv6':
+ # Ping test
+ m1.run(ping_mod6)
+
+ # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp6, timeout=65)
+ m2.run(netperf_cli_udp6, timeout=65)
+ srv_proc.intr()
+ else:
+ # Ping tests
+ m1.run(ping_mod)
+ m1.run(ping_mod6)
- # Ping test
- m1.run(ping_mod)
+ # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp, timeout=65)
+ m2.run(netperf_cli_udp, timeout=65)
+ srv_proc.intr()
- # Netperf test (both TCP and UDP)
- srv_proc = m1.run(netperf_srv, bg=True)
- ctl.wait(2)
- m2.run(netperf_cli_tcp, timeout=65)
- m2.run(netperf_cli_udp, timeout=65)
- srv_proc.intr()
+ # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp6, timeout=65)
+ m2.run(netperf_cli_udp6, timeout=65)
+ srv_proc.intr()
# These tests should fail
# Ping across different VLAN
@@ -86,5 +157,11 @@ for vlan1 in vlans:
m2.run("ethtool -K %s %s %s" % (m2.get_devname("eth1"),
offload, state))
- # Ping test
- m1.run(ping_mod, expect="fail")
+ if ipv == 'ipv4':
+ # Ping test
+ m1.run(ping_mod, expect="fail")
+ elif ipv == 'ipv6':
+ m1.run(ping_mod6, expect="fail")
+ else:
+ m1.run(ping_mod, expect="fail")
+ m1.run(ping_mod6, expect="fail")
diff --git a/recipes/regression_tests/phase1/3_vlans_over_round_robin_bond.xml b/recipes/regression_tests/phase1/3_vlans_over_round_robin_bond.xml
index 2d4aac3..a0a290b 100644
--- a/recipes/regression_tests/phase1/3_vlans_over_round_robin_bond.xml
+++ b/recipes/regression_tests/phase1/3_vlans_over_round_robin_bond.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="testmachine1">
<interfaces>
@@ -26,6 +29,7 @@
</slaves>
<addresses>
<address value="192.168.10.1/24" />
+ <address value="2002::10:1/112" />
</addresses>
</vlan>
<vlan id="vlan20">
@@ -37,6 +41,7 @@
</slaves>
<addresses>
<address value="192.168.20.1/24" />
+ <address value="2002::20:1/112" />
</addresses>
</vlan>
<vlan id="vlan30">
@@ -48,6 +53,7 @@
</slaves>
<addresses>
<address value="192.168.30.1/24" />
+ <address value="2002::30:1/112" />
</addresses>
</vlan>
</interfaces>
@@ -64,6 +70,7 @@
</slaves>
<addresses>
<address value="192.168.10.2/24" />
+ <address value="2002::10:2/112" />
</addresses>
</vlan>
<vlan id="vlan20">
@@ -75,6 +82,7 @@
</slaves>
<addresses>
<address value="192.168.20.2/24" />
+ <address value="2002::20:2/112" />
</addresses>
</vlan>
<vlan id="vlan30">
@@ -86,6 +94,7 @@
</slaves>
<addresses>
<address value="192.168.30.2/24" />
+ <address value="2002::30:2/112" />
</addresses>
</vlan>
</interfaces>
diff --git a/recipes/regression_tests/phase1/active_backup_bond.xml b/recipes/regression_tests/phase1/active_backup_bond.xml
index 760ff8d..bfe05c5 100644
--- a/recipes/regression_tests/phase1/active_backup_bond.xml
+++ b/recipes/regression_tests/phase1/active_backup_bond.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="testmachine1">
<interfaces>
@@ -15,6 +18,7 @@
</slaves>
<addresses>
<address value="192.168.0.1/24" />
+ <address value="2002::1/112"/>
</addresses>
</bond>
</interfaces>
@@ -24,6 +28,7 @@
<eth id="test_if" label="tnet">
<addresses>
<address value="192.168.0.2/24" />
+ <address value="2002::2/112"/>
</addresses>
</eth>
</interfaces>
diff --git a/recipes/regression_tests/phase1/active_backup_double_bond.xml b/recipes/regression_tests/phase1/active_backup_double_bond.xml
index 9fa6286..a09163e 100644
--- a/recipes/regression_tests/phase1/active_backup_double_bond.xml
+++ b/recipes/regression_tests/phase1/active_backup_double_bond.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="testmachine1">
<interfaces>
@@ -15,6 +18,7 @@
</slaves>
<addresses>
<address value="192.168.0.1/24" />
+ <address value="2002::1/112"/>
</addresses>
</bond>
</interfaces>
@@ -34,6 +38,7 @@
</slaves>
<addresses>
<address value="192.168.0.2/24" />
+ <address value="2002::2/112"/>
</addresses>
</bond>
</interfaces>
diff --git a/recipes/regression_tests/phase1/bonding_test.py b/recipes/regression_tests/phase1/bonding_test.py
index 38e058b..f7d45d6 100644
--- a/recipes/regression_tests/phase1/bonding_test.py
+++ b/recipes/regression_tests/phase1/bonding_test.py
@@ -7,11 +7,9 @@ from lnst.Controller.Task import ctl
m1 = ctl.get_host("testmachine1")
m2 = ctl.get_host("testmachine2")
-m1.sync_resources(modules=["IcmpPing", "Netperf"])
-m2.sync_resources(modules=["IcmpPing", "Netperf"])
+m1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
+m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
-m1_ip = m1.get_ip("test_if")
-m2_ip = m2.get_ip("test_if")
# ------
# TESTS
@@ -19,9 +17,19 @@ m2_ip = m2.get_ip("test_if")
offloads = ["tso", "gro", "gso"]
+ipv = ctl.get_alias('ipv')
+
ping_mod = ctl.get_module("IcmpPing",
options={
- "addr" : m2_ip,
+ "addr" : m2.get_ip("test_if", 0),
+ "count" : 100,
+ "iface" : m1.get_devname("test_if"),
+ "interval" : 0.1
+ })
+
+ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : m2.get_ip("test_if", 1),
"count" : 100,
"iface" : m1.get_devname("test_if"),
"interval" : 0.1
@@ -30,70 +38,53 @@ ping_mod = ctl.get_module("IcmpPing",
netperf_srv = ctl.get_module("Netperf",
options = {
"role" : "server",
- "bind" : m1_ip
+ "bind" : m1.get_ip("test_if", 0)
+ })
+
+netperf_srv6 = ctl.get_module("Netperf",
+ options={
+ "role" : "server",
+ "bind" : m1.get_ip("test_if", 1),
+ "netperf_opts" : " -6",
})
netperf_cli_tcp = ctl.get_module("Netperf",
options = {
"role" : "client",
- "netperf_server" : m1_ip,
+ "netperf_server" : m1.get_ip("test_if", 0),
"duration" : 60,
"testname" : "TCP_STREAM",
- "netperf_opts" : "-L %s" % m2_ip
+ "netperf_opts" : "-L %s" % m2.get_ip("test_if", 0)
})
netperf_cli_udp = ctl.get_module("Netperf",
options = {
"role" : "client",
- "netperf_server" : m1_ip,
+ "netperf_server" : m1.get_ip("test_if", 0),
"duration" : 60,
"testname" : "UDP_STREAM",
- "netperf_opts" : "-L %s" % m2_ip
+ "netperf_opts" : "-L %s" % m2.get_ip("test_if", 0)
})
-for offload in offloads:
- for state in ["on", "off"]:
- m1.run("ethtool -K %s %s %s" % (m1.get_devname("test_if"), offload,
- state))
- m2.run("ethtool -K %s %s %s" % (m2.get_devname("test_if"), offload,
- state))
- m1.run(ping_mod)
- server_proc = m1.run(netperf_srv, bg=True)
- ctl.wait(2)
- m2.run(netperf_cli_tcp, timeout=65)
- m2.run(netperf_cli_udp, timeout=65)
- server_proc.intr()
-ping_mod = ctl.get_module("IcmpPing",
- options={
- "addr" : m1_ip,
- "count" : 100,
- "iface" : m2.get_devname("test_if"),
- "interval" : 0.1
- })
-
-
-netperf_srv = ctl.get_module("Netperf",
- options = {
- "role" : "server",
- "bind" : m2_ip
- })
-
-netperf_cli_tcp = ctl.get_module("Netperf",
- options = {
+netperf_cli_tcp6 = ctl.get_module("Netperf",
+ options={
"role" : "client",
- "netperf_server" : m2_ip,
+ "netperf_server" :
+ m1.get_ip("test_if", 1),
"duration" : 60,
"testname" : "TCP_STREAM",
- "netperf_opts" : "-L %s" % m1_ip
+ "netperf_opts" :
+ "-L %s -6" % m2.get_ip("test_if", 1)
})
-
-netperf_cli_udp = ctl.get_module("Netperf",
- options = {
+netperf_cli_udp6 = ctl.get_module("Netperf",
+ options={
"role" : "client",
- "netperf_server" : m2_ip,
+ "netperf_server" :
+ m1.get_ip("test_if", 1),
"duration" : 60,
"testname" : "UDP_STREAM",
- "netperf_opts" : "-L %s" % m1_ip
+ "netperf_opts" :
+ "-L %s -6" % m2.get_ip("test_if", 1)
})
for offload in offloads:
@@ -102,9 +93,30 @@ for offload in offloads:
state))
m2.run("ethtool -K %s %s %s" % (m2.get_devname("test_if"), offload,
state))
- m2.run(ping_mod)
- server_proc = m2.run(netperf_srv, bg=True)
- ctl.wait(2)
- m1.run(netperf_cli_tcp, timeout=65)
- m1.run(netperf_cli_udp, timeout=65)
- server_proc.intr()
+ if ipv == 'ipv4':
+ m1.run(ping_mod)
+ server_proc = m1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp, timeout=65)
+ m2.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+ elif ipv == 'ipv6':
+ m1.run(ping_mod6)
+ server_proc = m1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp6, timeout=65)
+ m2.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
+ else:
+ m1.run(ping_mod)
+ m1.run(ping_mod6)
+ server_proc = m1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp, timeout=65)
+ m2.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+ server_proc = m1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp6, timeout=65)
+ m2.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
\ No newline at end of file
diff --git a/recipes/regression_tests/phase1/ping_flood.xml b/recipes/regression_tests/phase1/ping_flood.xml
index 3f466d9..881f5a5 100644
--- a/recipes/regression_tests/phase1/ping_flood.xml
+++ b/recipes/regression_tests/phase1/ping_flood.xml
@@ -1,10 +1,14 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="machine1">
<interfaces>
<eth id="testiface" label="testnet">
<addresses>
- <address>192.168.100.10/24</address>
+ <address>192.168.101.10/24</address>
+ <address>2002::1/112</address>
</addresses>
</eth>
</interfaces>
@@ -13,7 +17,8 @@
<interfaces>
<eth id="testiface" label="testnet">
<addresses>
- <address>192.168.100.11/24</address>
+ <address>192.168.101.11/24</address>
+ <address>2002::2/112</address>
</addresses>
</eth>
</interfaces>
diff --git a/recipes/regression_tests/phase1/round_robin_bond.xml b/recipes/regression_tests/phase1/round_robin_bond.xml
index 237cced..63b0f26 100644
--- a/recipes/regression_tests/phase1/round_robin_bond.xml
+++ b/recipes/regression_tests/phase1/round_robin_bond.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="testmachine1">
<interfaces>
@@ -15,6 +18,7 @@
</slaves>
<addresses>
<address value="192.168.0.1/24" />
+ <address value="2002::1/112"/>
</addresses>
</bond>
</interfaces>
@@ -24,6 +28,7 @@
<eth id="test_if" label="tnet">
<addresses>
<address value="192.168.0.2/24" />
+ <address value="2002::2/112"/>
</addresses>
</eth>
</interfaces>
diff --git a/recipes/regression_tests/phase1/round_robin_double_bond.xml b/recipes/regression_tests/phase1/round_robin_double_bond.xml
index 556fbd2..0e27fcf 100644
--- a/recipes/regression_tests/phase1/round_robin_double_bond.xml
+++ b/recipes/regression_tests/phase1/round_robin_double_bond.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="testmachine1">
<interfaces>
@@ -15,6 +18,7 @@
</slaves>
<addresses>
<address value="192.168.0.1/24" />
+ <address value="2002::1/112"/>
</addresses>
</bond>
</interfaces>
@@ -34,6 +38,7 @@
</slaves>
<addresses>
<address value="192.168.0.2/24" />
+ <address value="2002::2/112"/>
</addresses>
</bond>
</interfaces>
diff --git a/recipes/regression_tests/phase1/simple_ping.py b/recipes/regression_tests/phase1/simple_ping.py
index 400104a..b19b2d7 100644
--- a/recipes/regression_tests/phase1/simple_ping.py
+++ b/recipes/regression_tests/phase1/simple_ping.py
@@ -3,17 +3,31 @@ from lnst.Controller.Task import ctl
hostA = ctl.get_host("machine1")
hostB = ctl.get_host("machine2")
-hostA.sync_resources(modules=["IcmpPing"])
-hostB.sync_resources(modules=["IcmpPing"])
-
-hostA_devices = hostA.get_interface("testiface")
-hostB_devices = hostB.get_interface("testiface")
+hostA.sync_resources(modules=["Icmp6Ping", "IcmpPing"])
+hostB.sync_resources(modules=["Icmp6Ping", "IcmpPing"])
ping_mod = ctl.get_module("IcmpPing",
- options={
- "addr": hostB.get_ip("testiface", 0),
- "count": 100,
- "interval": 0.2,
- "limit_rate": 95})
+ options={
+ "addr": hostB.get_ip("testiface", 0),
+ "count": 100,
+ "interval": 0.2,
+ "iface" : hostA.get_devname("testiface"),
+ "limit_rate": 90})
+
+ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr": hostB.get_ip("testiface", 1),
+ "count": 100,
+ "interval": 0.2,
+ "iface" : hostA.get_devname("testiface"),
+ "limit_rate": 90})
+
+if ctl.get_alias('ipv') == 'ipv6':
+ hostA.run(ping_mod6)
+
+elif ctl.get_alias('ipv') == 'ipv4':
+ hostA.run(ping_mod)
-hostA.run(ping_mod)
+else:
+ hostA.run(ping_mod)
+ hostA.run(ping_mod6)
diff --git a/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_active_backup_bond.xml b/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_active_backup_bond.xml
index 950bf0d..695a544 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_active_backup_bond.xml
+++ b/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_active_backup_bond.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="host1">
<interfaces>
@@ -60,6 +63,7 @@
<eth id="guestnic" label="to_guest1">
<addresses>
<address>192.168.10.100/24</address>
+ <address value="2002::10:100/112"/>
</addresses>
</eth>
</interfaces>
@@ -69,6 +73,7 @@
<eth id="guestnic" label="to_guest2">
<addresses>
<address>192.168.20.100/24</address>
+ <address value="2002::20:100/112"/>
</addresses>
</eth>
</interfaces>
@@ -134,6 +139,7 @@
<eth id="guestnic" label="to_guest3">
<addresses>
<address>192.168.10.101/24</address>
+ <address value="2002::10:101/112"/>
</addresses>
</eth>
</interfaces>
@@ -143,6 +149,7 @@
<eth id="guestnic" label="to_guest4">
<addresses>
<address>192.168.20.101/24</address>
+ <address value="2002::20:101/112"/>
</addresses>
</eth>
</interfaces>
diff --git a/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py b/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py
index 36eabd3..6f024ed 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py
+++ b/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py
@@ -7,16 +7,16 @@ from lnst.Controller.Task import ctl
# Host 1 + guests 1 and 2
#h1 = ctl.get_host("host1")
g1 = ctl.get_host("guest1")
-g1.sync_resources(modules=["IcmpPing", "Netperf"])
+g1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
g2 = ctl.get_host("guest2")
-g2.sync_resources(modules=["IcmpPing", "Netperf"])
+g2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# Host 2 + guests 3 and 4
#h2 = ctl.get_host("host2")
g3 = ctl.get_host("guest3")
-g3.sync_resources(modules=["IcmpPing", "Netperf"])
+g3.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
g4 = ctl.get_host("guest4")
-g4.sync_resources(modules=["IcmpPing", "Netperf"])
+g4.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# ------
# TESTS
@@ -24,26 +24,52 @@ g4.sync_resources(modules=["IcmpPing", "Netperf"])
offloads = ["gso", "gro", "tso"]
+ipv = ctl.get_alias("ipv")
+
ping_mod = ctl.get_module("IcmpPing",
options={
- "addr" : g3.get_ip("guestnic"),
+ "addr" : g3.get_ip("guestnic", 0),
"count" : 100,
"iface" : g1.get_devname("guestnic"),
"interval" : 0.1
})
ping_mod2 = ctl.get_module("IcmpPing",
options={
- "addr" : g2.get_ip("guestnic"),
+ "addr" : g2.get_ip("guestnic", 0),
"count" : 100,
"iface" : g4.get_devname("guestnic"),
"interval" : 0.1
})
+
+ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : g3.get_ip("guestnic", 1),
+ "count" : 100,
+ "iface" : g1.get_devname("guestnic"),
+ "interval" : 0.1
+ })
+
+ping_mod62 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : g2.get_ip("guestnic", 1),
+ "count" : 100,
+ "iface" : g4.get_devname("guestnic"),
+ "interval" : 0.1
+ })
+
netperf_srv = ctl.get_module("Netperf",
options={
"role": "server",
"bind" : g1.get_ip("guestnic")
})
+netperf_srv6 = ctl.get_module("Netperf",
+ options={
+ "role" : "server",
+ "bind" : g1.get_ip("guestnic", 1),
+ "netperf_opts" : " -6",
+ })
+
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
@@ -63,6 +89,29 @@ netperf_cli_udp = ctl.get_module("Netperf",
"netperf_opts" : "-L %s" %
g3.get_ip("guestnic")
})
+
+netperf_cli_tcp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ g1.get_ip("guestnic", 1),
+ "duration" : 60,
+ "testname" : "TCP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % g3.get_ip("guestnic", 1)
+ })
+
+netperf_cli_udp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ g1.get_ip("guestnic", 1),
+ "duration" : 60,
+ "testname" : "UDP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % g3.get_ip("guestnic", 1)
+ })
+
ping_mod_bad = ctl.get_module("IcmpPing",
options={
"addr" : g4.get_ip("guestnic"),
@@ -70,6 +119,7 @@ ping_mod_bad = ctl.get_module("IcmpPing",
"iface" : g1.get_devname("guestnic"),
"interval" : 0.1
})
+
ping_mod_bad2 = ctl.get_module("IcmpPing",
options={
"addr" : g2.get_ip("guestnic"),
@@ -78,6 +128,22 @@ ping_mod_bad2 = ctl.get_module("IcmpPing",
"interval" : 0.1
})
+ping_mod6_bad = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : g4.get_ip("guestnic", 1),
+ "count" : 100,
+ "iface" : g1.get_devname("guestnic"),
+ "interval" : 0.1
+ })
+
+ping_mod6_bad2 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : g2.get_ip("guestnic", 1),
+ "count" : 100,
+ "iface" : g3.get_devname("guestnic"),
+ "interval" : 0.1
+ })
+
for offload in offloads:
for state in ["on", "off"]:
g1.run("ethtool -K %s %s %s" % (g1.get_devname("guestnic"),
@@ -88,12 +154,48 @@ for offload in offloads:
offload, state))
g4.run("ethtool -K %s %s %s" % (g4.get_devname("guestnic"),
offload, state))
- g1.run(ping_mod)
- g4.run(ping_mod2)
- g1.run(ping_mod_bad, expect="fail")
- g3.run(ping_mod_bad2, expect="fail")
-
- g1.run(netperf_srv, bg=True, timeout=125)
- ctl.wait(2)
- g3.run(netperf_cli_tcp, timeout=65)
- g3.run(netperf_cli_udp, timeout=65)
+ if ipv == 'ipv4':
+ g1.run(ping_mod)
+ g4.run(ping_mod2)
+ g1.run(ping_mod_bad, expect="fail")
+ g3.run(ping_mod_bad2, expect="fail")
+
+ server_proc = g1.run(netperf_srv, bg=True, timeout=125)
+ ctl.wait(2)
+ g3.run(netperf_cli_tcp, timeout=65)
+ g3.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+ elif ipv == 'ipv6':
+ g1.run(ping_mod6)
+ g4.run(ping_mod62)
+ g1.run(ping_mod6_bad, expect="fail")
+ g3.run(ping_mod6_bad2, expect="fail")
+
+ server_proc = g1.run(netperf_srv6, bg=True, timeout=125)
+ ctl.wait(2)
+ g3.run(netperf_cli_tcp6, timeout=65)
+ g3.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
+ else:
+ # IPv4
+ g1.run(ping_mod)
+ g4.run(ping_mod2)
+ g1.run(ping_mod_bad, expect="fail")
+ g3.run(ping_mod_bad2, expect="fail")
+
+ server_proc = g1.run(netperf_srv, bg=True, timeout=125)
+ ctl.wait(2)
+ g3.run(netperf_cli_tcp, timeout=65)
+ g3.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+ # IPv6
+ g1.run(ping_mod6)
+ g4.run(ping_mod62)
+ g1.run(ping_mod6_bad, expect="fail")
+ g3.run(ping_mod6_bad2, expect="fail")
+
+ server_proc = g1.run(netperf_srv6, bg=True, timeout=125)
+ ctl.wait(2)
+ g3.run(netperf_cli_tcp6, timeout=65)
+ g3.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
diff --git a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py
index 71c7f4d..41dd0b5 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py
@@ -9,8 +9,8 @@ g1 = ctl.get_host("guest1")
h2 = ctl.get_host("host2")
-g1.sync_resources(modules=["IcmpPing", "Netperf"])
-h2.sync_resources(modules=["IcmpPing", "Netperf"])
+g1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
+h2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# ------
# TESTS
@@ -18,19 +18,37 @@ h2.sync_resources(modules=["IcmpPing", "Netperf"])
offloads = ["gso", "gro", "tso"]
+ipv = ctl.get_alias("ipv")
+
ping_mod = ctl.get_module("IcmpPing",
options={
- "addr" : h2.get_ip("vlan10"),
+ "addr" : h2.get_ip("vlan10", 0),
+ "count" : 100,
+ "iface" : g1.get_devname("vlan10"),
+ "interval" : 0.1
+ })
+
+ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : h2.get_ip("vlan10", 1),
"count" : 100,
"iface" : g1.get_devname("vlan10"),
"interval" : 0.1
})
+
netperf_srv = ctl.get_module("Netperf",
options={
"role" : "server",
"bind" : g1.get_ip("vlan10")
})
+netperf_srv6 = ctl.get_module("Netperf",
+ options={
+ "role" : "server",
+ "bind" : g1.get_ip("vlan10", 1),
+ "netperf_opts" : " -6",
+ })
+
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
@@ -50,16 +68,63 @@ netperf_cli_udp = ctl.get_module("Netperf",
"netperf_opts" : "-L %s" %
h2.get_ip("vlan10")
})
+
+netperf_cli_tcp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ g1.get_ip("vlan10", 1),
+ "duration" : 60,
+ "testname" : "TCP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % h2.get_ip("vlan10", 1)
+ })
+
+netperf_cli_udp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ g1.get_ip("vlan10", 1),
+ "duration" : 60,
+ "testname" : "UDP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % h2.get_ip("vlan10", 1)
+ })
+
for offload in offloads:
for state in ["on", "off"]:
g1.run("ethtool -K %s %s %s" % (g1.get_devname("guestnic"),
offload, state))
h2.run("ethtool -K %s %s %s" % (h2.get_devname("nic"),
offload, state))
- g1.run(ping_mod)
- server_proc = g1.run(netperf_srv, bg=True)
- ctl.wait(2)
- h2.run(netperf_cli_tcp, timeout=65)
- h2.run(netperf_cli_udp, timeout=65)
- server_proc.intr()
+ if ipv == 'ipv4':
+ g1.run(ping_mod)
+ server_proc = g1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp, timeout=65)
+ h2.run(netperf_cli_udp, timeout=65)
+
+ server_proc.intr()
+ elif ipv == 'ipv6':
+ g1.run(ping_mod6)
+ server_proc = g1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp6, timeout=65)
+ h2.run(netperf_cli_udp6, timeout=65)
+
+ server_proc.intr()
+ else:
+ g1.run(ping_mod)
+ server_proc = g1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp, timeout=65)
+ h2.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+
+ g1.run(ping_mod6)
+ server_proc = g1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp6, timeout=65)
+ h2.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
\ No newline at end of file
diff --git a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.xml b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.xml
index 95ec86f..26347b8 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.xml
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="host1">
<interfaces>
@@ -27,6 +30,7 @@
</slaves>
<addresses>
<address>192.168.10.10/24</address>
+ <address>2002::10:10/112</address>
</addresses>
</vlan>
</interfaces>
@@ -43,6 +47,7 @@
</slaves>
<addresses>
<address>192.168.10.11/24</address>
+ <address>2002::10:11/112</address>
</addresses>
</vlan>
</interfaces>
diff --git a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py
index 4543387..3344d81 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py
@@ -9,8 +9,8 @@ g1 = ctl.get_host("guest1")
h2 = ctl.get_host("host2")
-g1.sync_resources(modules=["IcmpPing", "Netperf"])
-h2.sync_resources(modules=["IcmpPing", "Netperf"])
+g1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
+h2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# ------
# TESTS
@@ -18,6 +18,8 @@ h2.sync_resources(modules=["IcmpPing", "Netperf"])
offloads = ["gso", "gro", "tso"]
+ipv = ctl.get_alias("ipv")
+
ping_mod = ctl.get_module("IcmpPing",
options={
"addr" : h2.get_ip("vlan10"),
@@ -25,12 +27,28 @@ ping_mod = ctl.get_module("IcmpPing",
"iface" : g1.get_devname("guestnic"),
"interval" : 0.1
})
+
+ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : h2.get_ip("vlan10", 1),
+ "count" : 100,
+ "iface" : g1.get_devname("guestnic"),
+ "interval" : 0.1
+ })
+
netperf_srv = ctl.get_module("Netperf",
options={
"role" : "server",
"bind" : g1.get_ip("guestnic")
})
+netperf_srv6 = ctl.get_module("Netperf",
+ options={
+ "role" : "server",
+ "bind" : g1.get_ip("guestnic", 1),
+ "netperf_opts" : " -6",
+ })
+
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
@@ -51,16 +69,61 @@ netperf_cli_udp = ctl.get_module("Netperf",
h2.get_ip("vlan10")
})
+netperf_cli_tcp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ g1.get_ip("guestnic", 1),
+ "duration" : 60,
+ "testname" : "TCP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % h2.get_ip("vlan10", 1)
+ })
+
+netperf_cli_udp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ g1.get_ip("guestnic", 1),
+ "duration" : 60,
+ "testname" : "UDP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % h2.get_ip("vlan10", 1)
+ })
+
for offload in offloads:
for state in ["on", "off"]:
g1.run("ethtool -K %s %s %s" % (g1.get_devname("guestnic"),
offload, state))
h2.run("ethtool -K %s %s %s" % (h2.get_devname("nic"),
offload, state))
- g1.run(ping_mod)
- server_proc = g1.run(netperf_srv, bg=True)
- ctl.wait(2)
- h2.run(netperf_cli_tcp, timeout=65)
- h2.run(netperf_cli_udp, timeout=65)
+ if ipv == 'ipv4':
+ g1.run(ping_mod)
+ server_proc = g1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp, timeout=65)
+ h2.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+
+ elif ipv == 'ipv6':
+ g1.run(ping_mod6)
+ server_proc = g1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp6, timeout=65)
+ h2.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
+
+ else:
+ g1.run(ping_mod)
+ server_proc = g1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp, timeout=65)
+ h2.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
- server_proc.intr()
+ g1.run(ping_mod6)
+ server_proc = g1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp6, timeout=65)
+ h2.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
diff --git a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.xml b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.xml
index 5508c33..e2b23d1 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.xml
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="host1">
<interfaces>
@@ -28,6 +31,7 @@
<eth id="guestnic" label="to_guest">
<addresses>
<address>192.168.10.10/24</address>
+ <address>2002::10:10/112</address>
</addresses>
</eth>
</interfaces>
@@ -44,6 +48,7 @@
</slaves>
<addresses>
<address>192.168.10.11/24</address>
+ <address>2002::10:11/112</address>
</addresses>
</vlan>
</interfaces>
diff --git a/recipes/regression_tests/phase2/3_vlans_over_active_backup_team.xml b/recipes/regression_tests/phase2/3_vlans_over_active_backup_team.xml
index 59ff534..225f76d 100644
--- a/recipes/regression_tests/phase2/3_vlans_over_active_backup_team.xml
+++ b/recipes/regression_tests/phase2/3_vlans_over_active_backup_team.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="testmachine1">
<interfaces>
@@ -32,6 +35,7 @@
</slaves>
<addresses>
<address value="192.168.10.1/24" />
+ <address value="2002::10:1/112" />
</addresses>
</vlan>
<vlan id="vlan20">
@@ -43,6 +47,7 @@
</slaves>
<addresses>
<address value="192.168.20.1/24" />
+ <address value="2002::20:1/112" />
</addresses>
</vlan>
<vlan id="vlan30">
@@ -54,6 +59,7 @@
</slaves>
<addresses>
<address value="192.168.30.1/24" />
+ <address value="2002::30:1/112" />
</addresses>
</vlan>
</interfaces>
@@ -70,6 +76,7 @@
</slaves>
<addresses>
<address value="192.168.10.2/24" />
+ <address value="2002::10:2/112" />
</addresses>
</vlan>
<vlan id="vlan20">
@@ -81,6 +88,7 @@
</slaves>
<addresses>
<address value="192.168.20.2/24" />
+ <address value="2002::20:2/112" />
</addresses>
</vlan>
<vlan id="vlan30">
@@ -92,6 +100,7 @@
</slaves>
<addresses>
<address value="192.168.30.2/24" />
+ <address value="2002::30:2/112" />
</addresses>
</vlan>
</interfaces>
diff --git a/recipes/regression_tests/phase2/3_vlans_over_round_robin_team.xml b/recipes/regression_tests/phase2/3_vlans_over_round_robin_team.xml
index 0e9f009..cdcec31 100644
--- a/recipes/regression_tests/phase2/3_vlans_over_round_robin_team.xml
+++ b/recipes/regression_tests/phase2/3_vlans_over_round_robin_team.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="testmachine1">
<interfaces>
@@ -32,6 +35,7 @@
</slaves>
<addresses>
<address value="192.168.10.1/24" />
+ <address value="2002::10:1/112" />
</addresses>
</vlan>
<vlan id="vlan20">
@@ -43,6 +47,7 @@
</slaves>
<addresses>
<address value="192.168.20.1/24" />
+ <address value="2002::20:1/112" />
</addresses>
</vlan>
<vlan id="vlan30">
@@ -54,6 +59,7 @@
</slaves>
<addresses>
<address value="192.168.30.1/24" />
+ <address value="2002::30:1/112" />
</addresses>
</vlan>
</interfaces>
@@ -70,6 +76,7 @@
</slaves>
<addresses>
<address value="192.168.10.2/24" />
+ <address value="2002::10:2/112" />
</addresses>
</vlan>
<vlan id="vlan20">
@@ -81,6 +88,7 @@
</slaves>
<addresses>
<address value="192.168.20.2/24" />
+ <address value="2002::20:2/112" />
</addresses>
</vlan>
<vlan id="vlan30">
@@ -92,6 +100,7 @@
</slaves>
<addresses>
<address value="192.168.30.2/24" />
+ <address value="2002::30:2/112" />
</addresses>
</vlan>
</interfaces>
diff --git a/recipes/regression_tests/phase2/3_vlans_over_team.py b/recipes/regression_tests/phase2/3_vlans_over_team.py
index 645e2cf..2ede5d4 100644
--- a/recipes/regression_tests/phase2/3_vlans_over_team.py
+++ b/recipes/regression_tests/phase2/3_vlans_over_team.py
@@ -7,8 +7,8 @@ from lnst.Controller.Task import ctl
m1 = ctl.get_host("testmachine1")
m2 = ctl.get_host("testmachine2")
-m1.sync_resources(modules=["IcmpPing", "Netperf"])
-m2.sync_resources(modules=["IcmpPing", "Netperf"])
+m1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
+m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# ------
# TESTS
@@ -17,40 +17,82 @@ m2.sync_resources(modules=["IcmpPing", "Netperf"])
vlans = ["vlan10", "vlan20", "vlan30"]
offloads = ["gso", "gro", "tso"]
+ipv = ctl.get_alias('ipv')
+
for vlan1 in vlans:
for vlan2 in vlans:
ping_mod = ctl.get_module("IcmpPing",
options={
- "addr" : m2.get_ip(vlan2),
+ "addr" : m2.get_ip(vlan2, 0),
+ "count" : 100,
+ "iface" : m1.get_devname(vlan1),
+ "interval" : 0.1
+ })
+
+ ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : m2.get_ip(vlan2, 1),
"count" : 100,
"iface" : m1.get_devname(vlan1),
"interval" : 0.1
})
+
netperf_srv = ctl.get_module("Netperf",
options={
"role" : "server",
- "bind" : m1.get_ip(vlan1),
+ "bind" : m1.get_ip(vlan1, 0),
+ })
+
+ netperf_srv6 = ctl.get_module("Netperf",
+ options={
+ "role" : "server",
+ "bind" : m1.get_ip(vlan1, 1),
+ "netperf_opts" : " -6",
})
+
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" :
- m1.get_ip(vlan1),
+ m1.get_ip(vlan1, 0),
"duration" : 60,
"testname" : "TCP_STREAM",
"netperf_opts" :
- "-L %s" % m2.get_ip(vlan1)
+ "-L %s" % m2.get_ip(vlan1, 0)
})
+
netperf_cli_udp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" :
- m1.get_ip(vlan1),
+ m1.get_ip(vlan1, 0),
"duration" : 60,
"testname" : "UDP_STREAM",
"netperf_opts" :
- "-L %s" % m2.get_ip(vlan1)
+ "-L %s" % m2.get_ip(vlan1, 0)
})
+
+ netperf_cli_tcp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ m1.get_ip(vlan1, 1),
+ "duration" : 60,
+ "testname" : "TCP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % m2.get_ip(vlan1, 1)
+ })
+ netperf_cli_udp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ m1.get_ip(vlan1, 1),
+ "duration" : 60,
+ "testname" : "UDP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % m2.get_ip(vlan1, 1)
+ })
+
for offload in offloads:
# These tests should pass
# Ping between same VLANs
@@ -65,15 +107,44 @@ for vlan1 in vlans:
offload, state))
m2.run("ethtool -K %s %s %s" % (m2.get_devname("eth1"),
offload, state))
- # Ping test
- m1.run(ping_mod)
- # Netperf test (both TCP and UDP)
- srv_proc = m1.run(netperf_srv, bg=True)
- ctl.wait(2)
- m2.run(netperf_cli_tcp, timeout=65)
- m2.run(netperf_cli_udp, timeout=65)
- srv_proc.intr()
+ if ipv == 'ipv4':
+ # Ping test
+ m1.run(ping_mod)
+
+ # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp, timeout=65)
+ m2.run(netperf_cli_udp, timeout=65)
+ srv_proc.intr()
+ elif ipv == 'ipv6':
+ m1.run(ping_mod6)
+
+ # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp6, timeout=65)
+ m2.run(netperf_cli_udp6, timeout=65)
+ srv_proc.intr()
+ else:
+ m1.run(ping_mod)
+
+ # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp, timeout=65)
+ m2.run(netperf_cli_udp, timeout=65)
+ srv_proc.intr()
+
+ m1.run(ping_mod6)
+
+ # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp6, timeout=65)
+ m2.run(netperf_cli_udp6, timeout=65)
+ srv_proc.intr()
# These tests should fail
# Ping across different VLAN
@@ -88,6 +159,12 @@ for vlan1 in vlans:
offload, state))
m2.run("ethtool -K %s %s %s" % (m2.get_devname("eth1"),
offload, state))
-
# Ping test
- m1.run(ping_mod, expect="fail")
+ if ipv == 'ipv4':
+ m1.run(ping_mod, expect="fail")
+ elif ipv == 'ipv6':
+ m1.run(ping_mod6, expect="fail")
+ else:
+ m1.run(ping_mod, expect="fail")
+ m1.run(ping_mod6, expect="fail")
+
diff --git a/recipes/regression_tests/phase2/active_backup_double_team.xml b/recipes/regression_tests/phase2/active_backup_double_team.xml
index 0f98b40..9ecefe2 100644
--- a/recipes/regression_tests/phase2/active_backup_double_team.xml
+++ b/recipes/regression_tests/phase2/active_backup_double_team.xml
@@ -21,6 +21,7 @@
</slaves>
<addresses>
<address value="192.168.0.1/24" />
+ <address value="2002::1/112" />
</addresses>
</team>
</interfaces>
@@ -46,6 +47,7 @@
</slaves>
<addresses>
<address value="192.168.0.2/24" />
+ <address value="2002::2/112" />
</addresses>
</team>
</interfaces>
diff --git a/recipes/regression_tests/phase2/active_backup_team.xml b/recipes/regression_tests/phase2/active_backup_team.xml
index 44a6430..15ad59a 100644
--- a/recipes/regression_tests/phase2/active_backup_team.xml
+++ b/recipes/regression_tests/phase2/active_backup_team.xml
@@ -21,6 +21,7 @@
</slaves>
<addresses>
<address value="192.168.0.1/24" />
+ <address value="2002::1/112" />
</addresses>
</team>
</interfaces>
@@ -30,6 +31,7 @@
<eth id="test_if" label="tnet">
<addresses>
<address value="192.168.0.2/24" />
+ <address value="2002::2/112" />
</addresses>
</eth>
</interfaces>
diff --git a/recipes/regression_tests/phase2/active_backup_team_vs_active_backup_bond.xml b/recipes/regression_tests/phase2/active_backup_team_vs_active_backup_bond.xml
index 621a4e8..445123c 100644
--- a/recipes/regression_tests/phase2/active_backup_team_vs_active_backup_bond.xml
+++ b/recipes/regression_tests/phase2/active_backup_team_vs_active_backup_bond.xml
@@ -21,6 +21,7 @@
</slaves>
<addresses>
<address value="192.168.0.1/24" />
+ <address value="2002::1/112" />
</addresses>
</team>
</interfaces>
@@ -42,6 +43,7 @@
</slaves>
<addresses>
<address value="192.168.0.2/24" />
+ <address value="2002::2/112" />
</addresses>
</bond>
</interfaces>
diff --git a/recipes/regression_tests/phase2/active_backup_team_vs_round_robin_bond.xml b/recipes/regression_tests/phase2/active_backup_team_vs_round_robin_bond.xml
index e7119a7..fc8a6a5 100644
--- a/recipes/regression_tests/phase2/active_backup_team_vs_round_robin_bond.xml
+++ b/recipes/regression_tests/phase2/active_backup_team_vs_round_robin_bond.xml
@@ -21,6 +21,7 @@
</slaves>
<addresses>
<address value="192.168.0.1/24" />
+ <address value="2002::1/112" />
</addresses>
</team>
</interfaces>
@@ -42,6 +43,7 @@
</slaves>
<addresses>
<address value="192.168.0.2/24" />
+ <address value="2002::2/112" />
</addresses>
</bond>
</interfaces>
diff --git a/recipes/regression_tests/phase2/round_robin_double_team.xml b/recipes/regression_tests/phase2/round_robin_double_team.xml
index fe6bdfe..624d6c9 100644
--- a/recipes/regression_tests/phase2/round_robin_double_team.xml
+++ b/recipes/regression_tests/phase2/round_robin_double_team.xml
@@ -21,6 +21,7 @@
</slaves>
<addresses>
<address value="192.168.0.1/24" />
+ <address value="2002::2/112" />
</addresses>
</team>
</interfaces>
@@ -46,6 +47,7 @@
</slaves>
<addresses>
<address value="192.168.0.2/24" />
+ <address value="2002::2/112" />
</addresses>
</team>
</interfaces>
diff --git a/recipes/regression_tests/phase2/round_robin_team.xml b/recipes/regression_tests/phase2/round_robin_team.xml
index 4a69db9..030aaf4 100644
--- a/recipes/regression_tests/phase2/round_robin_team.xml
+++ b/recipes/regression_tests/phase2/round_robin_team.xml
@@ -21,6 +21,7 @@
</slaves>
<addresses>
<address value="192.168.0.1/24" />
+ <address value="2002::1/112" />
</addresses>
</team>
</interfaces>
@@ -30,6 +31,7 @@
<eth id="test_if" label="tnet">
<addresses>
<address value="192.168.0.2/24" />
+ <address value="2002::2/112" />
</addresses>
</eth>
</interfaces>
diff --git a/recipes/regression_tests/phase2/round_robin_team_vs_active_backup_bond.xml b/recipes/regression_tests/phase2/round_robin_team_vs_active_backup_bond.xml
index d645f1f..c33414a 100644
--- a/recipes/regression_tests/phase2/round_robin_team_vs_active_backup_bond.xml
+++ b/recipes/regression_tests/phase2/round_robin_team_vs_active_backup_bond.xml
@@ -21,6 +21,7 @@
</slaves>
<addresses>
<address value="192.168.0.1/24" />
+ <address value="2002::1/112" />
</addresses>
</team>
</interfaces>
@@ -42,6 +43,7 @@
</slaves>
<addresses>
<address value="192.168.0.2/24" />
+ <address value="2002::2/112" />
</addresses>
</bond>
</interfaces>
diff --git a/recipes/regression_tests/phase2/round_robin_team_vs_round_robin_bond.xml b/recipes/regression_tests/phase2/round_robin_team_vs_round_robin_bond.xml
index d134119..2641b0d 100644
--- a/recipes/regression_tests/phase2/round_robin_team_vs_round_robin_bond.xml
+++ b/recipes/regression_tests/phase2/round_robin_team_vs_round_robin_bond.xml
@@ -21,6 +21,7 @@
</slaves>
<addresses>
<address value="192.168.0.1/24" />
+ <address value="2002::1/112" />
</addresses>
</team>
</interfaces>
@@ -42,6 +43,7 @@
</slaves>
<addresses>
<address value="192.168.0.2/24" />
+ <address value="2002::2/112" />
</addresses>
</bond>
</interfaces>
diff --git a/recipes/regression_tests/phase2/team_test.py b/recipes/regression_tests/phase2/team_test.py
index 38e058b..78e9efe 100644
--- a/recipes/regression_tests/phase2/team_test.py
+++ b/recipes/regression_tests/phase2/team_test.py
@@ -7,11 +7,8 @@ from lnst.Controller.Task import ctl
m1 = ctl.get_host("testmachine1")
m2 = ctl.get_host("testmachine2")
-m1.sync_resources(modules=["IcmpPing", "Netperf"])
-m2.sync_resources(modules=["IcmpPing", "Netperf"])
-
-m1_ip = m1.get_ip("test_if")
-m2_ip = m2.get_ip("test_if")
+m1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
+m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# ------
# TESTS
@@ -19,9 +16,19 @@ m2_ip = m2.get_ip("test_if")
offloads = ["tso", "gro", "gso"]
+ipv = ctl.get_alias('ipv')
+
ping_mod = ctl.get_module("IcmpPing",
options={
- "addr" : m2_ip,
+ "addr" : m2.get_ip("test_if", 0),
+ "count" : 100,
+ "iface" : m1.get_devname("test_if"),
+ "interval" : 0.1
+ })
+
+ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : m2.get_ip("test_if", 1),
"count" : 100,
"iface" : m1.get_devname("test_if"),
"interval" : 0.1
@@ -30,70 +37,156 @@ ping_mod = ctl.get_module("IcmpPing",
netperf_srv = ctl.get_module("Netperf",
options = {
"role" : "server",
- "bind" : m1_ip
+ "bind" : m1.get_ip("test_if", 0)
+ })
+
+netperf_srv6 = ctl.get_module("Netperf",
+ options = {
+ "role" : "server",
+ "bind" : m1.get_ip("test_if", 1),
+ "netperf_opts" : " -6"
})
netperf_cli_tcp = ctl.get_module("Netperf",
options = {
"role" : "client",
- "netperf_server" : m1_ip,
+ "netperf_server" : m1.get_ip("test_if", 0),
"duration" : 60,
"testname" : "TCP_STREAM",
- "netperf_opts" : "-L %s" % m2_ip
+ "netperf_opts" : "-L %s" % m2.get_ip("test_if", 0)
})
netperf_cli_udp = ctl.get_module("Netperf",
options = {
"role" : "client",
- "netperf_server" : m1_ip,
+ "netperf_server" : m1.get_ip("test_if", 0),
+ "duration" : 60,
+ "testname" : "UDP_STREAM",
+ "netperf_opts" : "-L %s" % m2.get_ip("test_if", 0)
+ })
+
+netperf_cli_tcp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ m1.get_ip("test_if", 1),
+ "duration" : 60,
+ "testname" : "TCP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % m2.get_ip("test_if", 1)
+ })
+netperf_cli_udp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ m1.get_ip("test_if", 1),
"duration" : 60,
"testname" : "UDP_STREAM",
- "netperf_opts" : "-L %s" % m2_ip
+ "netperf_opts" :
+ "-L %s -6" % m2.get_ip("test_if", 1)
})
+
for offload in offloads:
for state in ["on", "off"]:
m1.run("ethtool -K %s %s %s" % (m1.get_devname("test_if"), offload,
state))
m2.run("ethtool -K %s %s %s" % (m2.get_devname("test_if"), offload,
state))
- m1.run(ping_mod)
- server_proc = m1.run(netperf_srv, bg=True)
- ctl.wait(2)
- m2.run(netperf_cli_tcp, timeout=65)
- m2.run(netperf_cli_udp, timeout=65)
- server_proc.intr()
+ if ipv == "ipv4":
+ m1.run(ping_mod)
+ server_proc = m1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp, timeout=65)
+ m2.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+ elif ipv == "ipv6":
+ m1.run(ping_mod6)
+ server_proc = m1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp6, timeout=65)
+ m2.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
+ else:
+ m1.run(ping_mod)
+ server_proc = m1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp, timeout=65)
+ m2.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+
+ m1.run(ping_mod6)
+ server_proc = m1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp6, timeout=65)
+ m2.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
ping_mod = ctl.get_module("IcmpPing",
options={
- "addr" : m1_ip,
+ "addr" : m1.get_ip("test_if", 0),
"count" : 100,
"iface" : m2.get_devname("test_if"),
"interval" : 0.1
})
+ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : m1.get_ip("test_if", 1),
+ "count" : 100,
+ "iface" : m2.get_devname("test_if"),
+ "interval" : 0.1
+ })
netperf_srv = ctl.get_module("Netperf",
options = {
"role" : "server",
- "bind" : m2_ip
+ "bind" : m2.get_ip("test_if", 0)
+ })
+
+netperf_srv6 = ctl.get_module("Netperf",
+ options = {
+ "role" : "server",
+ "bind" : m2.get_ip("test_if", 1),
+ "netperf_opts" : " -6"
})
netperf_cli_tcp = ctl.get_module("Netperf",
options = {
"role" : "client",
- "netperf_server" : m2_ip,
+ "netperf_server" : m2.get_ip("test_if", 0),
"duration" : 60,
"testname" : "TCP_STREAM",
- "netperf_opts" : "-L %s" % m1_ip
+ "netperf_opts" : "-L %s" % m1.get_ip("test_if", 0)
})
netperf_cli_udp = ctl.get_module("Netperf",
options = {
"role" : "client",
- "netperf_server" : m2_ip,
+ "netperf_server" : m2.get_ip("test_if", 0),
+ "duration" : 60,
+ "testname" : "UDP_STREAM",
+ "netperf_opts" : "-L %s" % m1.get_ip("test_if", 0)
+ })
+
+netperf_cli_tcp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ m2.get_ip("test_if", 1),
+ "duration" : 60,
+ "testname" : "TCP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % m1.get_ip("test_if", 1)
+ })
+netperf_cli_udp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ m2.get_ip("test_if", 1),
"duration" : 60,
"testname" : "UDP_STREAM",
- "netperf_opts" : "-L %s" % m1_ip
+ "netperf_opts" :
+ "-L %s -6" % m1.get_ip("test_if", 1)
})
for offload in offloads:
@@ -102,9 +195,31 @@ for offload in offloads:
state))
m2.run("ethtool -K %s %s %s" % (m2.get_devname("test_if"), offload,
state))
- m2.run(ping_mod)
- server_proc = m2.run(netperf_srv, bg=True)
- ctl.wait(2)
- m1.run(netperf_cli_tcp, timeout=65)
- m1.run(netperf_cli_udp, timeout=65)
- server_proc.intr()
+ if ipv == 'ipv4':
+ m2.run(ping_mod)
+ server_proc = m2.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ m1.run(netperf_cli_tcp, timeout=65)
+ m1.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+ elif ipv == 'ipv6':
+ m2.run(ping_mod6)
+ server_proc = m2.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m1.run(netperf_cli_tcp6, timeout=65)
+ m1.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
+ else:
+ m2.run(ping_mod)
+ server_proc = m2.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ m1.run(netperf_cli_tcp, timeout=65)
+ m1.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+
+ m2.run(ping_mod6)
+ server_proc = m2.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m1.run(netperf_cli_tcp6, timeout=65)
+ m1.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
\ No newline at end of file
diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py b/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py
index 36eabd3..a4cfdd8 100644
--- a/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py
+++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py
@@ -7,16 +7,16 @@ from lnst.Controller.Task import ctl
# Host 1 + guests 1 and 2
#h1 = ctl.get_host("host1")
g1 = ctl.get_host("guest1")
-g1.sync_resources(modules=["IcmpPing", "Netperf"])
+g1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
g2 = ctl.get_host("guest2")
-g2.sync_resources(modules=["IcmpPing", "Netperf"])
+g2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# Host 2 + guests 3 and 4
#h2 = ctl.get_host("host2")
g3 = ctl.get_host("guest3")
-g3.sync_resources(modules=["IcmpPing", "Netperf"])
+g3.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
g4 = ctl.get_host("guest4")
-g4.sync_resources(modules=["IcmpPing", "Netperf"])
+g4.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# ------
# TESTS
@@ -24,26 +24,53 @@ g4.sync_resources(modules=["IcmpPing", "Netperf"])
offloads = ["gso", "gro", "tso"]
+ipv = ctl.get_alias("ipv")
+
ping_mod = ctl.get_module("IcmpPing",
options={
- "addr" : g3.get_ip("guestnic"),
+ "addr" : g3.get_ip("guestnic", 0),
"count" : 100,
"iface" : g1.get_devname("guestnic"),
"interval" : 0.1
})
+
ping_mod2 = ctl.get_module("IcmpPing",
options={
- "addr" : g2.get_ip("guestnic"),
+ "addr" : g2.get_ip("guestnic", 0),
"count" : 100,
"iface" : g4.get_devname("guestnic"),
"interval" : 0.1
})
+
+ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : g3.get_ip("guestnic", 1),
+ "count" : 100,
+ "iface" : g1.get_devname("guestnic"),
+ "interval" : 0.1
+ })
+
+ping_mod62 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : g2.get_ip("guestnic", 1),
+ "count" : 100,
+ "iface" : g4.get_devname("guestnic"),
+ "interval" : 0.1
+ })
+
netperf_srv = ctl.get_module("Netperf",
options={
"role": "server",
"bind" : g1.get_ip("guestnic")
})
+netperf_srv6 = ctl.get_module("Netperf",
+ options={
+ "role" : "server",
+ "bind" : g1.get_ip("guestnic", 1),
+ "netperf_opts" : " -6",
+ })
+
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
@@ -63,6 +90,29 @@ netperf_cli_udp = ctl.get_module("Netperf",
"netperf_opts" : "-L %s" %
g3.get_ip("guestnic")
})
+
+netperf_cli_tcp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ g1.get_ip("guestnic", 1),
+ "duration" : 60,
+ "testname" : "TCP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % g3.get_ip("guestnic", 1)
+ })
+
+netperf_cli_udp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ g1.get_ip("guestnic", 1),
+ "duration" : 60,
+ "testname" : "UDP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % g3.get_ip("guestnic", 1)
+ })
+
ping_mod_bad = ctl.get_module("IcmpPing",
options={
"addr" : g4.get_ip("guestnic"),
@@ -70,6 +120,8 @@ ping_mod_bad = ctl.get_module("IcmpPing",
"iface" : g1.get_devname("guestnic"),
"interval" : 0.1
})
+
+
ping_mod_bad2 = ctl.get_module("IcmpPing",
options={
"addr" : g2.get_ip("guestnic"),
@@ -78,6 +130,23 @@ ping_mod_bad2 = ctl.get_module("IcmpPing",
"interval" : 0.1
})
+ping_mod6_bad = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : g4.get_ip("guestnic", 1),
+ "count" : 100,
+ "iface" : g1.get_devname("guestnic"),
+ "interval" : 0.1
+ })
+
+ping_mod6_bad2 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : g2.get_ip("guestnic", 1),
+ "count" : 100,
+ "iface" : g3.get_devname("guestnic"),
+ "interval" : 0.1
+ })
+
+
for offload in offloads:
for state in ["on", "off"]:
g1.run("ethtool -K %s %s %s" % (g1.get_devname("guestnic"),
@@ -88,12 +157,48 @@ for offload in offloads:
offload, state))
g4.run("ethtool -K %s %s %s" % (g4.get_devname("guestnic"),
offload, state))
- g1.run(ping_mod)
- g4.run(ping_mod2)
- g1.run(ping_mod_bad, expect="fail")
- g3.run(ping_mod_bad2, expect="fail")
-
- g1.run(netperf_srv, bg=True, timeout=125)
- ctl.wait(2)
- g3.run(netperf_cli_tcp, timeout=65)
- g3.run(netperf_cli_udp, timeout=65)
+ if ipv == 'ipv4':
+ g1.run(ping_mod)
+ g4.run(ping_mod2)
+ g1.run(ping_mod_bad, expect="fail")
+ g3.run(ping_mod_bad2, expect="fail")
+
+ server_proc = g1.run(netperf_srv, bg=True, timeout=125)
+ ctl.wait(2)
+ g3.run(netperf_cli_tcp, timeout=65)
+ g3.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+ elif ipv == 'ipv6':
+ g1.run(ping_mod6)
+ g4.run(ping_mod62)
+ g1.run(ping_mod6_bad, expect="fail")
+ g3.run(ping_mod6_bad2, expect="fail")
+
+ server_proc = g1.run(netperf_srv6, bg=True, timeout=125)
+ ctl.wait(2)
+ g3.run(netperf_cli_tcp6, timeout=65)
+ g3.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
+ else:
+ # IPv4
+ g1.run(ping_mod)
+ g4.run(ping_mod2)
+ g1.run(ping_mod_bad, expect="fail")
+ g3.run(ping_mod_bad2, expect="fail")
+
+ server_proc = g1.run(netperf_srv, bg=True, timeout=125)
+ ctl.wait(2)
+ g3.run(netperf_cli_tcp, timeout=65)
+ g3.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+ # IPv6
+ g1.run(ping_mod6)
+ g4.run(ping_mod62)
+ g1.run(ping_mod6_bad, expect="fail")
+ g3.run(ping_mod6_bad2, expect="fail")
+
+ server_proc = g1.run(netperf_srv6, bg=True, timeout=125)
+ ctl.wait(2)
+ g3.run(netperf_cli_tcp6, timeout=65)
+ g3.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.xml b/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.xml
index c901b16..1347e38 100644
--- a/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.xml
+++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="host1">
<interfaces>
@@ -41,6 +44,7 @@
<eth id="guestnic" label="to_guest1">
<addresses>
<address>192.168.10.100/24</address>
+ <address>2002::10:100/112</address>
</addresses>
</eth>
</interfaces>
@@ -50,6 +54,7 @@
<eth id="guestnic" label="to_guest2">
<addresses>
<address>192.168.20.100/24</address>
+ <address>2002::20:100/112</address>
</addresses>
</eth>
</interfaces>
@@ -96,6 +101,7 @@
<eth id="guestnic" label="to_guest3">
<addresses>
<address>192.168.10.101/24</address>
+ <address>2002::10:101/112</address>
</addresses>
</eth>
</interfaces>
@@ -105,6 +111,7 @@
<eth id="guestnic" label="to_guest4">
<addresses>
<address>192.168.20.101/24</address>
+ <address>2002::20:100/112</address>
</addresses>
</eth>
</interfaces>
diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.py b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.py
index 71c7f4d..0d6aba8 100644
--- a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.py
+++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.py
@@ -9,8 +9,8 @@ g1 = ctl.get_host("guest1")
h2 = ctl.get_host("host2")
-g1.sync_resources(modules=["IcmpPing", "Netperf"])
-h2.sync_resources(modules=["IcmpPing", "Netperf"])
+g1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
+h2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# ------
# TESTS
@@ -18,6 +18,8 @@ h2.sync_resources(modules=["IcmpPing", "Netperf"])
offloads = ["gso", "gro", "tso"]
+ipv = ctl.get_alias("ipv")
+
ping_mod = ctl.get_module("IcmpPing",
options={
"addr" : h2.get_ip("vlan10"),
@@ -25,12 +27,28 @@ ping_mod = ctl.get_module("IcmpPing",
"iface" : g1.get_devname("vlan10"),
"interval" : 0.1
})
+
+ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : h2.get_ip("vlan10", 1),
+ "count" : 100,
+ "iface" : g1.get_devname("vlan10"),
+ "interval" : 0.1
+ })
+
netperf_srv = ctl.get_module("Netperf",
options={
"role" : "server",
"bind" : g1.get_ip("vlan10")
})
+netperf_srv6 = ctl.get_module("Netperf",
+ options={
+ "role" : "server",
+ "bind" : g1.get_ip("vlan10", 1),
+ "netperf_opts" : " -6",
+ })
+
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
@@ -50,16 +68,63 @@ netperf_cli_udp = ctl.get_module("Netperf",
"netperf_opts" : "-L %s" %
h2.get_ip("vlan10")
})
+
+netperf_cli_tcp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ g1.get_ip("vlan10", 1),
+ "duration" : 60,
+ "testname" : "TCP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % h2.get_ip("vlan10", 1)
+ })
+
+netperf_cli_udp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ g1.get_ip("vlan10", 1),
+ "duration" : 60,
+ "testname" : "UDP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % h2.get_ip("vlan10", 1)
+ })
+
+
for offload in offloads:
for state in ["on", "off"]:
g1.run("ethtool -K %s %s %s" % (g1.get_devname("guestnic"),
offload, state))
h2.run("ethtool -K %s %s %s" % (h2.get_devname("nic"),
offload, state))
- g1.run(ping_mod)
- server_proc = g1.run(netperf_srv, bg=True)
- ctl.wait(2)
- h2.run(netperf_cli_tcp, timeout=65)
- h2.run(netperf_cli_udp, timeout=65)
+ if ipv == 'ipv4':
+ g1.run(ping_mod)
+ server_proc = g1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp, timeout=65)
+ h2.run(netperf_cli_udp, timeout=65)
+
+ server_proc.intr()
+ elif ipv == 'ipv6':
+ g1.run(ping_mod6)
+ server_proc = g1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp6, timeout=65)
+ h2.run(netperf_cli_udp6, timeout=65)
+
+ server_proc.intr()
+ else:
+ g1.run(ping_mod)
+ server_proc = g1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp, timeout=65)
+ h2.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
- server_proc.intr()
+ g1.run(ping_mod6)
+ server_proc = g1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp6, timeout=65)
+ h2.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.xml b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.xml
index 4442e4a..dfab509 100644
--- a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.xml
+++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="host1">
<interfaces>
@@ -24,6 +27,7 @@
</slaves>
<addresses>
<address>192.168.10.10/24</address>
+ <address>2002::10:10/112</address>
</addresses>
</vlan>
</interfaces>
@@ -40,6 +44,7 @@
</slaves>
<addresses>
<address>192.168.10.11/24</address>
+ <address>2002::10:11/112</address>
</addresses>
</vlan>
</interfaces>
diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.py b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.py
index 4543387..3344d81 100644
--- a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.py
+++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.py
@@ -9,8 +9,8 @@ g1 = ctl.get_host("guest1")
h2 = ctl.get_host("host2")
-g1.sync_resources(modules=["IcmpPing", "Netperf"])
-h2.sync_resources(modules=["IcmpPing", "Netperf"])
+g1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
+h2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# ------
# TESTS
@@ -18,6 +18,8 @@ h2.sync_resources(modules=["IcmpPing", "Netperf"])
offloads = ["gso", "gro", "tso"]
+ipv = ctl.get_alias("ipv")
+
ping_mod = ctl.get_module("IcmpPing",
options={
"addr" : h2.get_ip("vlan10"),
@@ -25,12 +27,28 @@ ping_mod = ctl.get_module("IcmpPing",
"iface" : g1.get_devname("guestnic"),
"interval" : 0.1
})
+
+ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : h2.get_ip("vlan10", 1),
+ "count" : 100,
+ "iface" : g1.get_devname("guestnic"),
+ "interval" : 0.1
+ })
+
netperf_srv = ctl.get_module("Netperf",
options={
"role" : "server",
"bind" : g1.get_ip("guestnic")
})
+netperf_srv6 = ctl.get_module("Netperf",
+ options={
+ "role" : "server",
+ "bind" : g1.get_ip("guestnic", 1),
+ "netperf_opts" : " -6",
+ })
+
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
@@ -51,16 +69,61 @@ netperf_cli_udp = ctl.get_module("Netperf",
h2.get_ip("vlan10")
})
+netperf_cli_tcp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ g1.get_ip("guestnic", 1),
+ "duration" : 60,
+ "testname" : "TCP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % h2.get_ip("vlan10", 1)
+ })
+
+netperf_cli_udp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ g1.get_ip("guestnic", 1),
+ "duration" : 60,
+ "testname" : "UDP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % h2.get_ip("vlan10", 1)
+ })
+
for offload in offloads:
for state in ["on", "off"]:
g1.run("ethtool -K %s %s %s" % (g1.get_devname("guestnic"),
offload, state))
h2.run("ethtool -K %s %s %s" % (h2.get_devname("nic"),
offload, state))
- g1.run(ping_mod)
- server_proc = g1.run(netperf_srv, bg=True)
- ctl.wait(2)
- h2.run(netperf_cli_tcp, timeout=65)
- h2.run(netperf_cli_udp, timeout=65)
+ if ipv == 'ipv4':
+ g1.run(ping_mod)
+ server_proc = g1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp, timeout=65)
+ h2.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+
+ elif ipv == 'ipv6':
+ g1.run(ping_mod6)
+ server_proc = g1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp6, timeout=65)
+ h2.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
+
+ else:
+ g1.run(ping_mod)
+ server_proc = g1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp, timeout=65)
+ h2.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
- server_proc.intr()
+ g1.run(ping_mod6)
+ server_proc = g1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp6, timeout=65)
+ h2.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.xml b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.xml
index 50eb792..13a71cd 100644
--- a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.xml
+++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="host1">
<interfaces>
@@ -22,6 +25,7 @@
<eth id="guestnic" label="to_guest">
<addresses>
<address>192.168.10.10/24</address>
+ <address>2002::10:10/112</address>
</addresses>
</eth>
</interfaces>
@@ -42,11 +46,12 @@
</slaves>
<addresses>
<address>192.168.10.11/24</address>
+ <address>2002::10:11/112</address>
</addresses>
</vlan>
</interfaces>
</host>
</network>
- <task python="./virtual_ovs_bridge_vlan_in_host.py" />
+ <task python="virtual_ovs_bridge_vlan_in_host.py" />
</lnstrecipe>
9 years, 3 months
[lnst] NetTestSlave: signal handling for lnst-slave in netns
by Jiří Pírko
commit 110ab74f9c4f9a60fd42d029a5ea67e04af3f3b9
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Mon Jan 19 17:07:57 2015 +0100
NetTestSlave: signal handling for lnst-slave in netns
This commit modifies signal handling for lnst-slave processes running in
non-root network namespaces to:
* when a SIGHUP, SIGTERM or SIGINT is recieved resend this signal to the
parent process that is running in the root netns and it will
coordinate deconfiguration
* when SIGUSR1 is recieved the main server loop will be interrupted like
it would with the previous signal handling
This solves the issue of deconfiguration races and crashes happening
when doing Ctrl-C from the terminal after lnst-ctl config-only was
called.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Slave/NetTestSlave.py | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/lnst/Slave/NetTestSlave.py b/lnst/Slave/NetTestSlave.py
index c63c719..8eb1f99 100644
--- a/lnst/Slave/NetTestSlave.py
+++ b/lnst/Slave/NetTestSlave.py
@@ -516,6 +516,7 @@ class SlaveMethods:
self._server_handler.add_netns(netns, read_pipe)
return None
elif pid == 0:
+ self._slave_server.set_netns_sighandlers()
#create new network namespace
libc_name = ctypes.util.find_library("c")
#from sched.h
@@ -564,7 +565,7 @@ class SlaveMethods:
return False
else:
netns_pid = self._net_namespaces[netns]["pid"]
- os.kill(netns_pid, signal.SIGTERM)
+ os.kill(netns_pid, signal.SIGUSR1)
os.waitpid(netns_pid, 0)
logging.debug("Network namespace %s removed." % netns)
@@ -859,3 +860,13 @@ class NetTestSlave:
def _signal_die_handler(self, signum, frame):
logging.info("Caught signal %d -> dying" % signum)
self._finished = True
+
+ def _parent_resend_signal_handler(self, signum, frame):
+ logging.info("Caught signal %d -> resending to parent" % signum)
+ os.kill(os.getppid(), signum)
+
+ def set_netns_sighandlers(self):
+ signal.signal(signal.SIGHUP, self._parent_resend_signal_handler)
+ signal.signal(signal.SIGINT, self._parent_resend_signal_handler)
+ signal.signal(signal.SIGTERM, self._parent_resend_signal_handler)
+ signal.signal(signal.SIGUSR1, self._signal_die_handler)
9 years, 3 months
[PATCH] Added IPv6 tests for all the tests in phase 1 and phase 2
by Jiri Prochazka
From: Jiri Prochazka <jprochaz(a)redhat.com>
Prefix 2002::/112 is used for testing, link-local did not work with netperf.
Known issues on VMs:
- Ping across different VLANs in different subnets work, even if they should not
- ping6 does sometime use source address from different subinterface
---
recipes/regression_tests/phase1/3_vlans.py | 109 +++++++++++--
recipes/regression_tests/phase1/3_vlans.xml | 9 ++
.../phase1/3_vlans_over_active_backup_bond.xml | 16 +-
.../regression_tests/phase1/3_vlans_over_bond.py | 113 +++++++++++---
.../phase1/3_vlans_over_round_robin_bond.xml | 9 ++
.../regression_tests/phase1/active_backup_bond.xml | 5 +
.../phase1/active_backup_double_bond.xml | 5 +
recipes/regression_tests/phase1/bonding_test.py | 116 +++++++-------
recipes/regression_tests/phase1/ping_flood.xml | 9 +-
.../regression_tests/phase1/round_robin_bond.xml | 5 +
.../phase1/round_robin_double_bond.xml | 5 +
recipes/regression_tests/phase1/simple_ping.py | 36 +++--
...tual_bridge_2_vlans_over_active_backup_bond.xml | 7 +
.../phase1/virtual_bridge_2_vlans_over_bond.py | 132 ++++++++++++++--
.../phase1/virtual_bridge_vlan_in_guest.py | 83 ++++++++--
.../phase1/virtual_bridge_vlan_in_guest.xml | 5 +
.../phase1/virtual_bridge_vlan_in_host.py | 79 +++++++++-
.../phase1/virtual_bridge_vlan_in_host.xml | 5 +
.../phase2/3_vlans_over_active_backup_team.xml | 9 ++
.../phase2/3_vlans_over_round_robin_team.xml | 9 ++
.../regression_tests/phase2/3_vlans_over_team.py | 113 +++++++++++---
.../phase2/active_backup_double_team.xml | 2 +
.../regression_tests/phase2/active_backup_team.xml | 2 +
.../active_backup_team_vs_active_backup_bond.xml | 2 +
.../active_backup_team_vs_round_robin_bond.xml | 2 +
.../phase2/round_robin_double_team.xml | 2 +
.../regression_tests/phase2/round_robin_team.xml | 2 +
.../round_robin_team_vs_active_backup_bond.xml | 2 +
.../round_robin_team_vs_round_robin_bond.xml | 2 +
recipes/regression_tests/phase2/team_test.py | 173 +++++++++++++++++----
...l_ovs_bridge_2_vlans_over_active_backup_bond.py | 135 ++++++++++++++--
..._ovs_bridge_2_vlans_over_active_backup_bond.xml | 7 +
.../phase2/virtual_ovs_bridge_vlan_in_guest.py | 81 +++++++++-
.../phase2/virtual_ovs_bridge_vlan_in_guest.xml | 5 +
.../phase2/virtual_ovs_bridge_vlan_in_host.py | 79 +++++++++-
.../phase2/virtual_ovs_bridge_vlan_in_host.xml | 7 +-
36 files changed, 1171 insertions(+), 211 deletions(-)
diff --git a/recipes/regression_tests/phase1/3_vlans.py b/recipes/regression_tests/phase1/3_vlans.py
index 4681d8a..c7f8824 100644
--- a/recipes/regression_tests/phase1/3_vlans.py
+++ b/recipes/regression_tests/phase1/3_vlans.py
@@ -7,8 +7,8 @@ from lnst.Controller.Task import ctl
m1 = ctl.get_host("testmachine1")
m2 = ctl.get_host("testmachine2")
-m1.sync_resources(modules=["IcmpPing", "Netperf"])
-m2.sync_resources(modules=["IcmpPing", "Netperf"])
+m1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
+m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# ------
# TESTS
@@ -17,40 +17,83 @@ m2.sync_resources(modules=["IcmpPing", "Netperf"])
vlans = ["vlan10", "vlan20", "vlan30"]
offloads = ["gso", "gro", "tso"]
+ipv = ctl.get_alias('ipv')
+
for vlan1 in vlans:
for vlan2 in vlans:
ping_mod = ctl.get_module("IcmpPing",
options={
- "addr" : m2.get_ip(vlan2),
+ "addr" : m2.get_ip(vlan2, 0),
"count" : 100,
"iface" : m1.get_devname(vlan1),
"interval" : 0.1
})
+
+ ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : m2.get_ip(vlan2, 1),
+ "count" : 100,
+ "iface" : m1.get_devname(vlan1),
+ "interval" : 0.1
+ })
+
netperf_srv = ctl.get_module("Netperf",
options={
"role" : "server",
- "bind" : m1.get_ip(vlan1),
+ "bind" : m1.get_ip(vlan1, 0),
})
+
+ netperf_srv6 = ctl.get_module("Netperf",
+ options={
+ "role" : "server",
+ "bind" : m1.get_ip(vlan1, 1),
+ "netperf_opts" : " -6",
+ })
+
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" :
- m1.get_ip(vlan1),
+ m1.get_ip(vlan1, 0),
"duration" : 60,
"testname" : "TCP_STREAM",
"netperf_opts" :
"-L %s" % m2.get_ip(vlan1)
})
+
netperf_cli_udp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" :
- m1.get_ip(vlan1),
+ m1.get_ip(vlan1, 0),
"duration" : 60,
"testname" : "UDP_STREAM",
"netperf_opts" :
"-L %s" % m2.get_ip(vlan1)
})
+
+ netperf_cli_tcp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ m1.get_ip(vlan1, 1),
+ "duration" : 60,
+ "testname" : "TCP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % m2.get_ip(vlan1, 1)
+ })
+
+ netperf_cli_udp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ m1.get_ip(vlan1, 1),
+ "duration" : 60,
+ "testname" : "UDP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % m2.get_ip(vlan1, 1)
+ })
+
for offload in offloads:
# These tests should pass
# Ping between same VLANs
@@ -61,16 +104,44 @@ for vlan1 in vlans:
offload, state))
m2.run("ethtool -K %s %s %s" % (m2.get_devname("eth1"),
offload, state))
+ if ipv == 'ipv4':
+ # Ping test
+ m1.run(ping_mod)
+
+ # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp, timeout=65)
+ m2.run(netperf_cli_udp, timeout=65)
+ srv_proc.intr()
+ elif ipv == 'ipv6':
+ # Ping test
+ m1.run(ping_mod6)
+
+ # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp6, timeout=65)
+ m2.run(netperf_cli_udp6, timeout=65)
+ srv_proc.intr()
+ else:
+ # Ping tests
+ m1.run(ping_mod)
+ m1.run(ping_mod6)
- # Ping test
- m1.run(ping_mod)
+ # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp, timeout=65)
+ m2.run(netperf_cli_udp, timeout=65)
+ srv_proc.intr()
- # Netperf test (both TCP and UDP)
- srv_proc = m1.run(netperf_srv, bg=True)
- ctl.wait(2)
- m2.run(netperf_cli_tcp, timeout=65)
- m2.run(netperf_cli_udp, timeout=65)
- srv_proc.intr()
+ # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp6, timeout=65)
+ m2.run(netperf_cli_udp6, timeout=65)
+ srv_proc.intr()
# These tests should fail
# Ping across different VLAN
@@ -82,5 +153,11 @@ for vlan1 in vlans:
m2.run("ethtool -K %s %s %s" % (m2.get_devname("eth1"),
offload, state))
- # Ping test
- m1.run(ping_mod, expect="fail")
+ if ipv == 'ipv4':
+ # Ping test
+ m1.run(ping_mod, expect="fail")
+ elif ipv == 'ipv6':
+ m1.run(ping_mod6, expect="fail")
+ else:
+ m1.run(ping_mod, expect="fail")
+ m1.run(ping_mod6, expect="fail")
diff --git a/recipes/regression_tests/phase1/3_vlans.xml b/recipes/regression_tests/phase1/3_vlans.xml
index faa5045..a5c47fb 100644
--- a/recipes/regression_tests/phase1/3_vlans.xml
+++ b/recipes/regression_tests/phase1/3_vlans.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="testmachine1">
<interfaces>
@@ -12,6 +15,7 @@
</slaves>
<addresses>
<address value="192.168.10.1/24" />
+ <address value="2002::10:1/112" />
</addresses>
</vlan>
<vlan id="vlan20">
@@ -23,6 +27,7 @@
</slaves>
<addresses>
<address value="192.168.20.1/24" />
+ <address value="2002::20:1/112" />
</addresses>
</vlan>
<vlan id="vlan30">
@@ -34,6 +39,7 @@
</slaves>
<addresses>
<address value="192.168.30.1/24" />
+ <address value="2002::30:1/112" />
</addresses>
</vlan>
</interfaces>
@@ -50,6 +56,7 @@
</slaves>
<addresses>
<address value="192.168.10.2/24" />
+ <address value="2002::10:2/112" />
</addresses>
</vlan>
<vlan id="vlan20">
@@ -61,6 +68,7 @@
</slaves>
<addresses>
<address value="192.168.20.2/24" />
+ <address value="2002::20:2/112" />
</addresses>
</vlan>
<vlan id="vlan30">
@@ -72,6 +80,7 @@
</slaves>
<addresses>
<address value="192.168.30.2/24" />
+ <address value="2002::30:2/112" />
</addresses>
</vlan>
</interfaces>
diff --git a/recipes/regression_tests/phase1/3_vlans_over_active_backup_bond.xml b/recipes/regression_tests/phase1/3_vlans_over_active_backup_bond.xml
index d125971..ce12030 100644
--- a/recipes/regression_tests/phase1/3_vlans_over_active_backup_bond.xml
+++ b/recipes/regression_tests/phase1/3_vlans_over_active_backup_bond.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="testmachine1">
<interfaces>
@@ -14,7 +17,7 @@
<slave id="eth2" />
</slaves>
<addresses>
- <address value="1.2.3.4/24" />
+ <address value="2002::1/112" />
</addresses>
</bond>
<vlan id="vlan10">
@@ -26,6 +29,7 @@
</slaves>
<addresses>
<address value="192.168.10.1/24" />
+ <address value="2002::10:1/112" />
</addresses>
</vlan>
<vlan id="vlan20">
@@ -37,6 +41,7 @@
</slaves>
<addresses>
<address value="192.168.20.1/24" />
+ <address value="2002::20:1/112" />
</addresses>
</vlan>
<vlan id="vlan30">
@@ -48,6 +53,7 @@
</slaves>
<addresses>
<address value="192.168.30.1/24" />
+ <address value="2002::30:1/112" />
</addresses>
</vlan>
</interfaces>
@@ -55,6 +61,11 @@
<host id="testmachine2">
<interfaces>
<eth id="eth1" label="tnet" />
+ <eth id="eth2" label="tnet">
+ <addresses>
+ <address value="2002::2/112" />
+ </addresses>
+ </eth>
<vlan id="vlan10">
<options>
<option name="vlan_tci" value="10" />
@@ -64,6 +75,7 @@
</slaves>
<addresses>
<address value="192.168.10.2/24" />
+ <address value="2002::10:2/112" />
</addresses>
</vlan>
<vlan id="vlan20">
@@ -75,6 +87,7 @@
</slaves>
<addresses>
<address value="192.168.20.2/24" />
+ <address value="2002::20:2/112" />
</addresses>
</vlan>
<vlan id="vlan30">
@@ -86,6 +99,7 @@
</slaves>
<addresses>
<address value="192.168.30.2/24" />
+ <address value="2002::30:2/112" />
</addresses>
</vlan>
</interfaces>
diff --git a/recipes/regression_tests/phase1/3_vlans_over_bond.py b/recipes/regression_tests/phase1/3_vlans_over_bond.py
index 1c95ed2..a9a0eb8 100644
--- a/recipes/regression_tests/phase1/3_vlans_over_bond.py
+++ b/recipes/regression_tests/phase1/3_vlans_over_bond.py
@@ -7,8 +7,8 @@ from lnst.Controller.Task import ctl
m1 = ctl.get_host("testmachine1")
m2 = ctl.get_host("testmachine2")
-m1.sync_resources(modules=["IcmpPing", "Netperf"])
-m2.sync_resources(modules=["IcmpPing", "Netperf"])
+m1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
+m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# ------
# TESTS
@@ -17,40 +17,83 @@ m2.sync_resources(modules=["IcmpPing", "Netperf"])
vlans = ["vlan10", "vlan20", "vlan30"]
offloads = ["gso", "gro", "tso"]
+ipv = ctl.get_alias('ipv')
+
for vlan1 in vlans:
for vlan2 in vlans:
ping_mod = ctl.get_module("IcmpPing",
options={
- "addr" : m2.get_ip(vlan2),
+ "addr" : m2.get_ip(vlan2, 0),
"count" : 100,
"iface" : m1.get_devname(vlan1),
"interval" : 0.1
})
+
+ ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : m2.get_ip(vlan2, 1),
+ "count" : 100,
+ "iface" : m1.get_devname(vlan1),
+ "interval" : 0.1
+ })
+
netperf_srv = ctl.get_module("Netperf",
options={
"role" : "server",
- "bind" : m1.get_ip(vlan1),
+ "bind" : m1.get_ip(vlan1, 0),
})
+
+ netperf_srv6 = ctl.get_module("Netperf",
+ options={
+ "role" : "server",
+ "bind" : m1.get_ip(vlan1, 1),
+ "netperf_opts" : " -6",
+ })
+
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" :
- m1.get_ip(vlan1),
+ m1.get_ip(vlan1, 0),
"duration" : 60,
"testname" : "TCP_STREAM",
"netperf_opts" :
- "-L %s" % m2.get_ip(vlan1)
+ "-L %s" % m2.get_ip(vlan1, 0)
})
+
netperf_cli_udp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" :
- m1.get_ip(vlan1),
+ m1.get_ip(vlan1, 0),
"duration" : 60,
"testname" : "UDP_STREAM",
"netperf_opts" :
- "-L %s" % m2.get_ip(vlan1)
+ "-L %s" % m2.get_ip(vlan1, 0)
})
+
+ netperf_cli_tcp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ m1.get_ip(vlan1, 1),
+ "duration" : 60,
+ "testname" : "TCP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % m2.get_ip(vlan1, 1)
+ })
+
+ netperf_cli_udp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ m1.get_ip(vlan1, 1),
+ "duration" : 60,
+ "testname" : "UDP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % m2.get_ip(vlan1, 1)
+ })
+
for offload in offloads:
# These tests should pass
# Ping between same VLANs
@@ -63,16 +106,44 @@ for vlan1 in vlans:
offload, state))
m2.run("ethtool -K %s %s %s" % (m2.get_devname("eth1"),
offload, state))
+ if ipv == 'ipv4':
+ # Ping test
+ m1.run(ping_mod)
+
+ # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp, timeout=65)
+ m2.run(netperf_cli_udp, timeout=65)
+ srv_proc.intr()
+ elif ipv == 'ipv6':
+ # Ping test
+ m1.run(ping_mod6)
+
+ # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp6, timeout=65)
+ m2.run(netperf_cli_udp6, timeout=65)
+ srv_proc.intr()
+ else:
+ # Ping tests
+ m1.run(ping_mod)
+ m1.run(ping_mod6)
- # Ping test
- m1.run(ping_mod)
+ # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp, timeout=65)
+ m2.run(netperf_cli_udp, timeout=65)
+ srv_proc.intr()
- # Netperf test (both TCP and UDP)
- srv_proc = m1.run(netperf_srv, bg=True)
- ctl.wait(2)
- m2.run(netperf_cli_tcp, timeout=65)
- m2.run(netperf_cli_udp, timeout=65)
- srv_proc.intr()
+ # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp6, timeout=65)
+ m2.run(netperf_cli_udp6, timeout=65)
+ srv_proc.intr()
# These tests should fail
# Ping across different VLAN
@@ -86,5 +157,11 @@ for vlan1 in vlans:
m2.run("ethtool -K %s %s %s" % (m2.get_devname("eth1"),
offload, state))
- # Ping test
- m1.run(ping_mod, expect="fail")
+ if ipv == 'ipv4':
+ # Ping test
+ m1.run(ping_mod, expect="fail")
+ elif ipv == 'ipv6':
+ m1.run(ping_mod6, expect="fail")
+ else:
+ m1.run(ping_mod, expect="fail")
+ m1.run(ping_mod6, expect="fail")
diff --git a/recipes/regression_tests/phase1/3_vlans_over_round_robin_bond.xml b/recipes/regression_tests/phase1/3_vlans_over_round_robin_bond.xml
index 2d4aac3..a0a290b 100644
--- a/recipes/regression_tests/phase1/3_vlans_over_round_robin_bond.xml
+++ b/recipes/regression_tests/phase1/3_vlans_over_round_robin_bond.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="testmachine1">
<interfaces>
@@ -26,6 +29,7 @@
</slaves>
<addresses>
<address value="192.168.10.1/24" />
+ <address value="2002::10:1/112" />
</addresses>
</vlan>
<vlan id="vlan20">
@@ -37,6 +41,7 @@
</slaves>
<addresses>
<address value="192.168.20.1/24" />
+ <address value="2002::20:1/112" />
</addresses>
</vlan>
<vlan id="vlan30">
@@ -48,6 +53,7 @@
</slaves>
<addresses>
<address value="192.168.30.1/24" />
+ <address value="2002::30:1/112" />
</addresses>
</vlan>
</interfaces>
@@ -64,6 +70,7 @@
</slaves>
<addresses>
<address value="192.168.10.2/24" />
+ <address value="2002::10:2/112" />
</addresses>
</vlan>
<vlan id="vlan20">
@@ -75,6 +82,7 @@
</slaves>
<addresses>
<address value="192.168.20.2/24" />
+ <address value="2002::20:2/112" />
</addresses>
</vlan>
<vlan id="vlan30">
@@ -86,6 +94,7 @@
</slaves>
<addresses>
<address value="192.168.30.2/24" />
+ <address value="2002::30:2/112" />
</addresses>
</vlan>
</interfaces>
diff --git a/recipes/regression_tests/phase1/active_backup_bond.xml b/recipes/regression_tests/phase1/active_backup_bond.xml
index 760ff8d..bfe05c5 100644
--- a/recipes/regression_tests/phase1/active_backup_bond.xml
+++ b/recipes/regression_tests/phase1/active_backup_bond.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="testmachine1">
<interfaces>
@@ -15,6 +18,7 @@
</slaves>
<addresses>
<address value="192.168.0.1/24" />
+ <address value="2002::1/112"/>
</addresses>
</bond>
</interfaces>
@@ -24,6 +28,7 @@
<eth id="test_if" label="tnet">
<addresses>
<address value="192.168.0.2/24" />
+ <address value="2002::2/112"/>
</addresses>
</eth>
</interfaces>
diff --git a/recipes/regression_tests/phase1/active_backup_double_bond.xml b/recipes/regression_tests/phase1/active_backup_double_bond.xml
index 9fa6286..a09163e 100644
--- a/recipes/regression_tests/phase1/active_backup_double_bond.xml
+++ b/recipes/regression_tests/phase1/active_backup_double_bond.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="testmachine1">
<interfaces>
@@ -15,6 +18,7 @@
</slaves>
<addresses>
<address value="192.168.0.1/24" />
+ <address value="2002::1/112"/>
</addresses>
</bond>
</interfaces>
@@ -34,6 +38,7 @@
</slaves>
<addresses>
<address value="192.168.0.2/24" />
+ <address value="2002::2/112"/>
</addresses>
</bond>
</interfaces>
diff --git a/recipes/regression_tests/phase1/bonding_test.py b/recipes/regression_tests/phase1/bonding_test.py
index 38e058b..f7d45d6 100644
--- a/recipes/regression_tests/phase1/bonding_test.py
+++ b/recipes/regression_tests/phase1/bonding_test.py
@@ -7,11 +7,9 @@ from lnst.Controller.Task import ctl
m1 = ctl.get_host("testmachine1")
m2 = ctl.get_host("testmachine2")
-m1.sync_resources(modules=["IcmpPing", "Netperf"])
-m2.sync_resources(modules=["IcmpPing", "Netperf"])
+m1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
+m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
-m1_ip = m1.get_ip("test_if")
-m2_ip = m2.get_ip("test_if")
# ------
# TESTS
@@ -19,9 +17,19 @@ m2_ip = m2.get_ip("test_if")
offloads = ["tso", "gro", "gso"]
+ipv = ctl.get_alias('ipv')
+
ping_mod = ctl.get_module("IcmpPing",
options={
- "addr" : m2_ip,
+ "addr" : m2.get_ip("test_if", 0),
+ "count" : 100,
+ "iface" : m1.get_devname("test_if"),
+ "interval" : 0.1
+ })
+
+ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : m2.get_ip("test_if", 1),
"count" : 100,
"iface" : m1.get_devname("test_if"),
"interval" : 0.1
@@ -30,70 +38,53 @@ ping_mod = ctl.get_module("IcmpPing",
netperf_srv = ctl.get_module("Netperf",
options = {
"role" : "server",
- "bind" : m1_ip
+ "bind" : m1.get_ip("test_if", 0)
+ })
+
+netperf_srv6 = ctl.get_module("Netperf",
+ options={
+ "role" : "server",
+ "bind" : m1.get_ip("test_if", 1),
+ "netperf_opts" : " -6",
})
netperf_cli_tcp = ctl.get_module("Netperf",
options = {
"role" : "client",
- "netperf_server" : m1_ip,
+ "netperf_server" : m1.get_ip("test_if", 0),
"duration" : 60,
"testname" : "TCP_STREAM",
- "netperf_opts" : "-L %s" % m2_ip
+ "netperf_opts" : "-L %s" % m2.get_ip("test_if", 0)
})
netperf_cli_udp = ctl.get_module("Netperf",
options = {
"role" : "client",
- "netperf_server" : m1_ip,
+ "netperf_server" : m1.get_ip("test_if", 0),
"duration" : 60,
"testname" : "UDP_STREAM",
- "netperf_opts" : "-L %s" % m2_ip
+ "netperf_opts" : "-L %s" % m2.get_ip("test_if", 0)
})
-for offload in offloads:
- for state in ["on", "off"]:
- m1.run("ethtool -K %s %s %s" % (m1.get_devname("test_if"), offload,
- state))
- m2.run("ethtool -K %s %s %s" % (m2.get_devname("test_if"), offload,
- state))
- m1.run(ping_mod)
- server_proc = m1.run(netperf_srv, bg=True)
- ctl.wait(2)
- m2.run(netperf_cli_tcp, timeout=65)
- m2.run(netperf_cli_udp, timeout=65)
- server_proc.intr()
-ping_mod = ctl.get_module("IcmpPing",
- options={
- "addr" : m1_ip,
- "count" : 100,
- "iface" : m2.get_devname("test_if"),
- "interval" : 0.1
- })
-
-
-netperf_srv = ctl.get_module("Netperf",
- options = {
- "role" : "server",
- "bind" : m2_ip
- })
-
-netperf_cli_tcp = ctl.get_module("Netperf",
- options = {
+netperf_cli_tcp6 = ctl.get_module("Netperf",
+ options={
"role" : "client",
- "netperf_server" : m2_ip,
+ "netperf_server" :
+ m1.get_ip("test_if", 1),
"duration" : 60,
"testname" : "TCP_STREAM",
- "netperf_opts" : "-L %s" % m1_ip
+ "netperf_opts" :
+ "-L %s -6" % m2.get_ip("test_if", 1)
})
-
-netperf_cli_udp = ctl.get_module("Netperf",
- options = {
+netperf_cli_udp6 = ctl.get_module("Netperf",
+ options={
"role" : "client",
- "netperf_server" : m2_ip,
+ "netperf_server" :
+ m1.get_ip("test_if", 1),
"duration" : 60,
"testname" : "UDP_STREAM",
- "netperf_opts" : "-L %s" % m1_ip
+ "netperf_opts" :
+ "-L %s -6" % m2.get_ip("test_if", 1)
})
for offload in offloads:
@@ -102,9 +93,30 @@ for offload in offloads:
state))
m2.run("ethtool -K %s %s %s" % (m2.get_devname("test_if"), offload,
state))
- m2.run(ping_mod)
- server_proc = m2.run(netperf_srv, bg=True)
- ctl.wait(2)
- m1.run(netperf_cli_tcp, timeout=65)
- m1.run(netperf_cli_udp, timeout=65)
- server_proc.intr()
+ if ipv == 'ipv4':
+ m1.run(ping_mod)
+ server_proc = m1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp, timeout=65)
+ m2.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+ elif ipv == 'ipv6':
+ m1.run(ping_mod6)
+ server_proc = m1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp6, timeout=65)
+ m2.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
+ else:
+ m1.run(ping_mod)
+ m1.run(ping_mod6)
+ server_proc = m1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp, timeout=65)
+ m2.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+ server_proc = m1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp6, timeout=65)
+ m2.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
\ No newline at end of file
diff --git a/recipes/regression_tests/phase1/ping_flood.xml b/recipes/regression_tests/phase1/ping_flood.xml
index 3f466d9..881f5a5 100644
--- a/recipes/regression_tests/phase1/ping_flood.xml
+++ b/recipes/regression_tests/phase1/ping_flood.xml
@@ -1,10 +1,14 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="machine1">
<interfaces>
<eth id="testiface" label="testnet">
<addresses>
- <address>192.168.100.10/24</address>
+ <address>192.168.101.10/24</address>
+ <address>2002::1/112</address>
</addresses>
</eth>
</interfaces>
@@ -13,7 +17,8 @@
<interfaces>
<eth id="testiface" label="testnet">
<addresses>
- <address>192.168.100.11/24</address>
+ <address>192.168.101.11/24</address>
+ <address>2002::2/112</address>
</addresses>
</eth>
</interfaces>
diff --git a/recipes/regression_tests/phase1/round_robin_bond.xml b/recipes/regression_tests/phase1/round_robin_bond.xml
index 237cced..63b0f26 100644
--- a/recipes/regression_tests/phase1/round_robin_bond.xml
+++ b/recipes/regression_tests/phase1/round_robin_bond.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="testmachine1">
<interfaces>
@@ -15,6 +18,7 @@
</slaves>
<addresses>
<address value="192.168.0.1/24" />
+ <address value="2002::1/112"/>
</addresses>
</bond>
</interfaces>
@@ -24,6 +28,7 @@
<eth id="test_if" label="tnet">
<addresses>
<address value="192.168.0.2/24" />
+ <address value="2002::2/112"/>
</addresses>
</eth>
</interfaces>
diff --git a/recipes/regression_tests/phase1/round_robin_double_bond.xml b/recipes/regression_tests/phase1/round_robin_double_bond.xml
index 556fbd2..0e27fcf 100644
--- a/recipes/regression_tests/phase1/round_robin_double_bond.xml
+++ b/recipes/regression_tests/phase1/round_robin_double_bond.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="testmachine1">
<interfaces>
@@ -15,6 +18,7 @@
</slaves>
<addresses>
<address value="192.168.0.1/24" />
+ <address value="2002::1/112"/>
</addresses>
</bond>
</interfaces>
@@ -34,6 +38,7 @@
</slaves>
<addresses>
<address value="192.168.0.2/24" />
+ <address value="2002::2/112"/>
</addresses>
</bond>
</interfaces>
diff --git a/recipes/regression_tests/phase1/simple_ping.py b/recipes/regression_tests/phase1/simple_ping.py
index 400104a..b19b2d7 100644
--- a/recipes/regression_tests/phase1/simple_ping.py
+++ b/recipes/regression_tests/phase1/simple_ping.py
@@ -3,17 +3,31 @@ from lnst.Controller.Task import ctl
hostA = ctl.get_host("machine1")
hostB = ctl.get_host("machine2")
-hostA.sync_resources(modules=["IcmpPing"])
-hostB.sync_resources(modules=["IcmpPing"])
-
-hostA_devices = hostA.get_interface("testiface")
-hostB_devices = hostB.get_interface("testiface")
+hostA.sync_resources(modules=["Icmp6Ping", "IcmpPing"])
+hostB.sync_resources(modules=["Icmp6Ping", "IcmpPing"])
ping_mod = ctl.get_module("IcmpPing",
- options={
- "addr": hostB.get_ip("testiface", 0),
- "count": 100,
- "interval": 0.2,
- "limit_rate": 95})
+ options={
+ "addr": hostB.get_ip("testiface", 0),
+ "count": 100,
+ "interval": 0.2,
+ "iface" : hostA.get_devname("testiface"),
+ "limit_rate": 90})
+
+ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr": hostB.get_ip("testiface", 1),
+ "count": 100,
+ "interval": 0.2,
+ "iface" : hostA.get_devname("testiface"),
+ "limit_rate": 90})
+
+if ctl.get_alias('ipv') == 'ipv6':
+ hostA.run(ping_mod6)
+
+elif ctl.get_alias('ipv') == 'ipv4':
+ hostA.run(ping_mod)
-hostA.run(ping_mod)
+else:
+ hostA.run(ping_mod)
+ hostA.run(ping_mod6)
diff --git a/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_active_backup_bond.xml b/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_active_backup_bond.xml
index 950bf0d..695a544 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_active_backup_bond.xml
+++ b/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_active_backup_bond.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="host1">
<interfaces>
@@ -60,6 +63,7 @@
<eth id="guestnic" label="to_guest1">
<addresses>
<address>192.168.10.100/24</address>
+ <address value="2002::10:100/112"/>
</addresses>
</eth>
</interfaces>
@@ -69,6 +73,7 @@
<eth id="guestnic" label="to_guest2">
<addresses>
<address>192.168.20.100/24</address>
+ <address value="2002::20:100/112"/>
</addresses>
</eth>
</interfaces>
@@ -134,6 +139,7 @@
<eth id="guestnic" label="to_guest3">
<addresses>
<address>192.168.10.101/24</address>
+ <address value="2002::10:101/112"/>
</addresses>
</eth>
</interfaces>
@@ -143,6 +149,7 @@
<eth id="guestnic" label="to_guest4">
<addresses>
<address>192.168.20.101/24</address>
+ <address value="2002::20:101/112"/>
</addresses>
</eth>
</interfaces>
diff --git a/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py b/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py
index 36eabd3..6f024ed 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py
+++ b/recipes/regression_tests/phase1/virtual_bridge_2_vlans_over_bond.py
@@ -7,16 +7,16 @@ from lnst.Controller.Task import ctl
# Host 1 + guests 1 and 2
#h1 = ctl.get_host("host1")
g1 = ctl.get_host("guest1")
-g1.sync_resources(modules=["IcmpPing", "Netperf"])
+g1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
g2 = ctl.get_host("guest2")
-g2.sync_resources(modules=["IcmpPing", "Netperf"])
+g2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# Host 2 + guests 3 and 4
#h2 = ctl.get_host("host2")
g3 = ctl.get_host("guest3")
-g3.sync_resources(modules=["IcmpPing", "Netperf"])
+g3.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
g4 = ctl.get_host("guest4")
-g4.sync_resources(modules=["IcmpPing", "Netperf"])
+g4.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# ------
# TESTS
@@ -24,26 +24,52 @@ g4.sync_resources(modules=["IcmpPing", "Netperf"])
offloads = ["gso", "gro", "tso"]
+ipv = ctl.get_alias("ipv")
+
ping_mod = ctl.get_module("IcmpPing",
options={
- "addr" : g3.get_ip("guestnic"),
+ "addr" : g3.get_ip("guestnic", 0),
"count" : 100,
"iface" : g1.get_devname("guestnic"),
"interval" : 0.1
})
ping_mod2 = ctl.get_module("IcmpPing",
options={
- "addr" : g2.get_ip("guestnic"),
+ "addr" : g2.get_ip("guestnic", 0),
"count" : 100,
"iface" : g4.get_devname("guestnic"),
"interval" : 0.1
})
+
+ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : g3.get_ip("guestnic", 1),
+ "count" : 100,
+ "iface" : g1.get_devname("guestnic"),
+ "interval" : 0.1
+ })
+
+ping_mod62 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : g2.get_ip("guestnic", 1),
+ "count" : 100,
+ "iface" : g4.get_devname("guestnic"),
+ "interval" : 0.1
+ })
+
netperf_srv = ctl.get_module("Netperf",
options={
"role": "server",
"bind" : g1.get_ip("guestnic")
})
+netperf_srv6 = ctl.get_module("Netperf",
+ options={
+ "role" : "server",
+ "bind" : g1.get_ip("guestnic", 1),
+ "netperf_opts" : " -6",
+ })
+
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
@@ -63,6 +89,29 @@ netperf_cli_udp = ctl.get_module("Netperf",
"netperf_opts" : "-L %s" %
g3.get_ip("guestnic")
})
+
+netperf_cli_tcp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ g1.get_ip("guestnic", 1),
+ "duration" : 60,
+ "testname" : "TCP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % g3.get_ip("guestnic", 1)
+ })
+
+netperf_cli_udp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ g1.get_ip("guestnic", 1),
+ "duration" : 60,
+ "testname" : "UDP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % g3.get_ip("guestnic", 1)
+ })
+
ping_mod_bad = ctl.get_module("IcmpPing",
options={
"addr" : g4.get_ip("guestnic"),
@@ -70,6 +119,7 @@ ping_mod_bad = ctl.get_module("IcmpPing",
"iface" : g1.get_devname("guestnic"),
"interval" : 0.1
})
+
ping_mod_bad2 = ctl.get_module("IcmpPing",
options={
"addr" : g2.get_ip("guestnic"),
@@ -78,6 +128,22 @@ ping_mod_bad2 = ctl.get_module("IcmpPing",
"interval" : 0.1
})
+ping_mod6_bad = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : g4.get_ip("guestnic", 1),
+ "count" : 100,
+ "iface" : g1.get_devname("guestnic"),
+ "interval" : 0.1
+ })
+
+ping_mod6_bad2 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : g2.get_ip("guestnic", 1),
+ "count" : 100,
+ "iface" : g3.get_devname("guestnic"),
+ "interval" : 0.1
+ })
+
for offload in offloads:
for state in ["on", "off"]:
g1.run("ethtool -K %s %s %s" % (g1.get_devname("guestnic"),
@@ -88,12 +154,48 @@ for offload in offloads:
offload, state))
g4.run("ethtool -K %s %s %s" % (g4.get_devname("guestnic"),
offload, state))
- g1.run(ping_mod)
- g4.run(ping_mod2)
- g1.run(ping_mod_bad, expect="fail")
- g3.run(ping_mod_bad2, expect="fail")
-
- g1.run(netperf_srv, bg=True, timeout=125)
- ctl.wait(2)
- g3.run(netperf_cli_tcp, timeout=65)
- g3.run(netperf_cli_udp, timeout=65)
+ if ipv == 'ipv4':
+ g1.run(ping_mod)
+ g4.run(ping_mod2)
+ g1.run(ping_mod_bad, expect="fail")
+ g3.run(ping_mod_bad2, expect="fail")
+
+ server_proc = g1.run(netperf_srv, bg=True, timeout=125)
+ ctl.wait(2)
+ g3.run(netperf_cli_tcp, timeout=65)
+ g3.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+ elif ipv == 'ipv6':
+ g1.run(ping_mod6)
+ g4.run(ping_mod62)
+ g1.run(ping_mod6_bad, expect="fail")
+ g3.run(ping_mod6_bad2, expect="fail")
+
+ server_proc = g1.run(netperf_srv6, bg=True, timeout=125)
+ ctl.wait(2)
+ g3.run(netperf_cli_tcp6, timeout=65)
+ g3.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
+ else:
+ # IPv4
+ g1.run(ping_mod)
+ g4.run(ping_mod2)
+ g1.run(ping_mod_bad, expect="fail")
+ g3.run(ping_mod_bad2, expect="fail")
+
+ server_proc = g1.run(netperf_srv, bg=True, timeout=125)
+ ctl.wait(2)
+ g3.run(netperf_cli_tcp, timeout=65)
+ g3.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+ # IPv6
+ g1.run(ping_mod6)
+ g4.run(ping_mod62)
+ g1.run(ping_mod6_bad, expect="fail")
+ g3.run(ping_mod6_bad2, expect="fail")
+
+ server_proc = g1.run(netperf_srv6, bg=True, timeout=125)
+ ctl.wait(2)
+ g3.run(netperf_cli_tcp6, timeout=65)
+ g3.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
diff --git a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py
index 71c7f4d..41dd0b5 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.py
@@ -9,8 +9,8 @@ g1 = ctl.get_host("guest1")
h2 = ctl.get_host("host2")
-g1.sync_resources(modules=["IcmpPing", "Netperf"])
-h2.sync_resources(modules=["IcmpPing", "Netperf"])
+g1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
+h2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# ------
# TESTS
@@ -18,19 +18,37 @@ h2.sync_resources(modules=["IcmpPing", "Netperf"])
offloads = ["gso", "gro", "tso"]
+ipv = ctl.get_alias("ipv")
+
ping_mod = ctl.get_module("IcmpPing",
options={
- "addr" : h2.get_ip("vlan10"),
+ "addr" : h2.get_ip("vlan10", 0),
+ "count" : 100,
+ "iface" : g1.get_devname("vlan10"),
+ "interval" : 0.1
+ })
+
+ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : h2.get_ip("vlan10", 1),
"count" : 100,
"iface" : g1.get_devname("vlan10"),
"interval" : 0.1
})
+
netperf_srv = ctl.get_module("Netperf",
options={
"role" : "server",
"bind" : g1.get_ip("vlan10")
})
+netperf_srv6 = ctl.get_module("Netperf",
+ options={
+ "role" : "server",
+ "bind" : g1.get_ip("vlan10", 1),
+ "netperf_opts" : " -6",
+ })
+
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
@@ -50,16 +68,63 @@ netperf_cli_udp = ctl.get_module("Netperf",
"netperf_opts" : "-L %s" %
h2.get_ip("vlan10")
})
+
+netperf_cli_tcp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ g1.get_ip("vlan10", 1),
+ "duration" : 60,
+ "testname" : "TCP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % h2.get_ip("vlan10", 1)
+ })
+
+netperf_cli_udp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ g1.get_ip("vlan10", 1),
+ "duration" : 60,
+ "testname" : "UDP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % h2.get_ip("vlan10", 1)
+ })
+
for offload in offloads:
for state in ["on", "off"]:
g1.run("ethtool -K %s %s %s" % (g1.get_devname("guestnic"),
offload, state))
h2.run("ethtool -K %s %s %s" % (h2.get_devname("nic"),
offload, state))
- g1.run(ping_mod)
- server_proc = g1.run(netperf_srv, bg=True)
- ctl.wait(2)
- h2.run(netperf_cli_tcp, timeout=65)
- h2.run(netperf_cli_udp, timeout=65)
- server_proc.intr()
+ if ipv == 'ipv4':
+ g1.run(ping_mod)
+ server_proc = g1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp, timeout=65)
+ h2.run(netperf_cli_udp, timeout=65)
+
+ server_proc.intr()
+ elif ipv == 'ipv6':
+ g1.run(ping_mod6)
+ server_proc = g1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp6, timeout=65)
+ h2.run(netperf_cli_udp6, timeout=65)
+
+ server_proc.intr()
+ else:
+ g1.run(ping_mod)
+ server_proc = g1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp, timeout=65)
+ h2.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+
+ g1.run(ping_mod6)
+ server_proc = g1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp6, timeout=65)
+ h2.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
\ No newline at end of file
diff --git a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.xml b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.xml
index 95ec86f..26347b8 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.xml
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_guest.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="host1">
<interfaces>
@@ -27,6 +30,7 @@
</slaves>
<addresses>
<address>192.168.10.10/24</address>
+ <address>2002::10:10/112</address>
</addresses>
</vlan>
</interfaces>
@@ -43,6 +47,7 @@
</slaves>
<addresses>
<address>192.168.10.11/24</address>
+ <address>2002::10:11/112</address>
</addresses>
</vlan>
</interfaces>
diff --git a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py
index 4543387..3344d81 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.py
@@ -9,8 +9,8 @@ g1 = ctl.get_host("guest1")
h2 = ctl.get_host("host2")
-g1.sync_resources(modules=["IcmpPing", "Netperf"])
-h2.sync_resources(modules=["IcmpPing", "Netperf"])
+g1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
+h2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# ------
# TESTS
@@ -18,6 +18,8 @@ h2.sync_resources(modules=["IcmpPing", "Netperf"])
offloads = ["gso", "gro", "tso"]
+ipv = ctl.get_alias("ipv")
+
ping_mod = ctl.get_module("IcmpPing",
options={
"addr" : h2.get_ip("vlan10"),
@@ -25,12 +27,28 @@ ping_mod = ctl.get_module("IcmpPing",
"iface" : g1.get_devname("guestnic"),
"interval" : 0.1
})
+
+ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : h2.get_ip("vlan10", 1),
+ "count" : 100,
+ "iface" : g1.get_devname("guestnic"),
+ "interval" : 0.1
+ })
+
netperf_srv = ctl.get_module("Netperf",
options={
"role" : "server",
"bind" : g1.get_ip("guestnic")
})
+netperf_srv6 = ctl.get_module("Netperf",
+ options={
+ "role" : "server",
+ "bind" : g1.get_ip("guestnic", 1),
+ "netperf_opts" : " -6",
+ })
+
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
@@ -51,16 +69,61 @@ netperf_cli_udp = ctl.get_module("Netperf",
h2.get_ip("vlan10")
})
+netperf_cli_tcp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ g1.get_ip("guestnic", 1),
+ "duration" : 60,
+ "testname" : "TCP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % h2.get_ip("vlan10", 1)
+ })
+
+netperf_cli_udp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ g1.get_ip("guestnic", 1),
+ "duration" : 60,
+ "testname" : "UDP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % h2.get_ip("vlan10", 1)
+ })
+
for offload in offloads:
for state in ["on", "off"]:
g1.run("ethtool -K %s %s %s" % (g1.get_devname("guestnic"),
offload, state))
h2.run("ethtool -K %s %s %s" % (h2.get_devname("nic"),
offload, state))
- g1.run(ping_mod)
- server_proc = g1.run(netperf_srv, bg=True)
- ctl.wait(2)
- h2.run(netperf_cli_tcp, timeout=65)
- h2.run(netperf_cli_udp, timeout=65)
+ if ipv == 'ipv4':
+ g1.run(ping_mod)
+ server_proc = g1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp, timeout=65)
+ h2.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+
+ elif ipv == 'ipv6':
+ g1.run(ping_mod6)
+ server_proc = g1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp6, timeout=65)
+ h2.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
+
+ else:
+ g1.run(ping_mod)
+ server_proc = g1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp, timeout=65)
+ h2.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
- server_proc.intr()
+ g1.run(ping_mod6)
+ server_proc = g1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp6, timeout=65)
+ h2.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
diff --git a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.xml b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.xml
index 5508c33..e2b23d1 100644
--- a/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.xml
+++ b/recipes/regression_tests/phase1/virtual_bridge_vlan_in_host.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="host1">
<interfaces>
@@ -28,6 +31,7 @@
<eth id="guestnic" label="to_guest">
<addresses>
<address>192.168.10.10/24</address>
+ <address>2002::10:10/112</address>
</addresses>
</eth>
</interfaces>
@@ -44,6 +48,7 @@
</slaves>
<addresses>
<address>192.168.10.11/24</address>
+ <address>2002::10:11/112</address>
</addresses>
</vlan>
</interfaces>
diff --git a/recipes/regression_tests/phase2/3_vlans_over_active_backup_team.xml b/recipes/regression_tests/phase2/3_vlans_over_active_backup_team.xml
index 59ff534..225f76d 100644
--- a/recipes/regression_tests/phase2/3_vlans_over_active_backup_team.xml
+++ b/recipes/regression_tests/phase2/3_vlans_over_active_backup_team.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="testmachine1">
<interfaces>
@@ -32,6 +35,7 @@
</slaves>
<addresses>
<address value="192.168.10.1/24" />
+ <address value="2002::10:1/112" />
</addresses>
</vlan>
<vlan id="vlan20">
@@ -43,6 +47,7 @@
</slaves>
<addresses>
<address value="192.168.20.1/24" />
+ <address value="2002::20:1/112" />
</addresses>
</vlan>
<vlan id="vlan30">
@@ -54,6 +59,7 @@
</slaves>
<addresses>
<address value="192.168.30.1/24" />
+ <address value="2002::30:1/112" />
</addresses>
</vlan>
</interfaces>
@@ -70,6 +76,7 @@
</slaves>
<addresses>
<address value="192.168.10.2/24" />
+ <address value="2002::10:2/112" />
</addresses>
</vlan>
<vlan id="vlan20">
@@ -81,6 +88,7 @@
</slaves>
<addresses>
<address value="192.168.20.2/24" />
+ <address value="2002::20:2/112" />
</addresses>
</vlan>
<vlan id="vlan30">
@@ -92,6 +100,7 @@
</slaves>
<addresses>
<address value="192.168.30.2/24" />
+ <address value="2002::30:2/112" />
</addresses>
</vlan>
</interfaces>
diff --git a/recipes/regression_tests/phase2/3_vlans_over_round_robin_team.xml b/recipes/regression_tests/phase2/3_vlans_over_round_robin_team.xml
index 0e9f009..cdcec31 100644
--- a/recipes/regression_tests/phase2/3_vlans_over_round_robin_team.xml
+++ b/recipes/regression_tests/phase2/3_vlans_over_round_robin_team.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="testmachine1">
<interfaces>
@@ -32,6 +35,7 @@
</slaves>
<addresses>
<address value="192.168.10.1/24" />
+ <address value="2002::10:1/112" />
</addresses>
</vlan>
<vlan id="vlan20">
@@ -43,6 +47,7 @@
</slaves>
<addresses>
<address value="192.168.20.1/24" />
+ <address value="2002::20:1/112" />
</addresses>
</vlan>
<vlan id="vlan30">
@@ -54,6 +59,7 @@
</slaves>
<addresses>
<address value="192.168.30.1/24" />
+ <address value="2002::30:1/112" />
</addresses>
</vlan>
</interfaces>
@@ -70,6 +76,7 @@
</slaves>
<addresses>
<address value="192.168.10.2/24" />
+ <address value="2002::10:2/112" />
</addresses>
</vlan>
<vlan id="vlan20">
@@ -81,6 +88,7 @@
</slaves>
<addresses>
<address value="192.168.20.2/24" />
+ <address value="2002::20:2/112" />
</addresses>
</vlan>
<vlan id="vlan30">
@@ -92,6 +100,7 @@
</slaves>
<addresses>
<address value="192.168.30.2/24" />
+ <address value="2002::30:2/112" />
</addresses>
</vlan>
</interfaces>
diff --git a/recipes/regression_tests/phase2/3_vlans_over_team.py b/recipes/regression_tests/phase2/3_vlans_over_team.py
index 645e2cf..2ede5d4 100644
--- a/recipes/regression_tests/phase2/3_vlans_over_team.py
+++ b/recipes/regression_tests/phase2/3_vlans_over_team.py
@@ -7,8 +7,8 @@ from lnst.Controller.Task import ctl
m1 = ctl.get_host("testmachine1")
m2 = ctl.get_host("testmachine2")
-m1.sync_resources(modules=["IcmpPing", "Netperf"])
-m2.sync_resources(modules=["IcmpPing", "Netperf"])
+m1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
+m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# ------
# TESTS
@@ -17,40 +17,82 @@ m2.sync_resources(modules=["IcmpPing", "Netperf"])
vlans = ["vlan10", "vlan20", "vlan30"]
offloads = ["gso", "gro", "tso"]
+ipv = ctl.get_alias('ipv')
+
for vlan1 in vlans:
for vlan2 in vlans:
ping_mod = ctl.get_module("IcmpPing",
options={
- "addr" : m2.get_ip(vlan2),
+ "addr" : m2.get_ip(vlan2, 0),
+ "count" : 100,
+ "iface" : m1.get_devname(vlan1),
+ "interval" : 0.1
+ })
+
+ ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : m2.get_ip(vlan2, 1),
"count" : 100,
"iface" : m1.get_devname(vlan1),
"interval" : 0.1
})
+
netperf_srv = ctl.get_module("Netperf",
options={
"role" : "server",
- "bind" : m1.get_ip(vlan1),
+ "bind" : m1.get_ip(vlan1, 0),
+ })
+
+ netperf_srv6 = ctl.get_module("Netperf",
+ options={
+ "role" : "server",
+ "bind" : m1.get_ip(vlan1, 1),
+ "netperf_opts" : " -6",
})
+
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" :
- m1.get_ip(vlan1),
+ m1.get_ip(vlan1, 0),
"duration" : 60,
"testname" : "TCP_STREAM",
"netperf_opts" :
- "-L %s" % m2.get_ip(vlan1)
+ "-L %s" % m2.get_ip(vlan1, 0)
})
+
netperf_cli_udp = ctl.get_module("Netperf",
options={
"role" : "client",
"netperf_server" :
- m1.get_ip(vlan1),
+ m1.get_ip(vlan1, 0),
"duration" : 60,
"testname" : "UDP_STREAM",
"netperf_opts" :
- "-L %s" % m2.get_ip(vlan1)
+ "-L %s" % m2.get_ip(vlan1, 0)
})
+
+ netperf_cli_tcp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ m1.get_ip(vlan1, 1),
+ "duration" : 60,
+ "testname" : "TCP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % m2.get_ip(vlan1, 1)
+ })
+ netperf_cli_udp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ m1.get_ip(vlan1, 1),
+ "duration" : 60,
+ "testname" : "UDP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % m2.get_ip(vlan1, 1)
+ })
+
for offload in offloads:
# These tests should pass
# Ping between same VLANs
@@ -65,15 +107,44 @@ for vlan1 in vlans:
offload, state))
m2.run("ethtool -K %s %s %s" % (m2.get_devname("eth1"),
offload, state))
- # Ping test
- m1.run(ping_mod)
- # Netperf test (both TCP and UDP)
- srv_proc = m1.run(netperf_srv, bg=True)
- ctl.wait(2)
- m2.run(netperf_cli_tcp, timeout=65)
- m2.run(netperf_cli_udp, timeout=65)
- srv_proc.intr()
+ if ipv == 'ipv4':
+ # Ping test
+ m1.run(ping_mod)
+
+ # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp, timeout=65)
+ m2.run(netperf_cli_udp, timeout=65)
+ srv_proc.intr()
+ elif ipv == 'ipv6':
+ m1.run(ping_mod6)
+
+ # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp6, timeout=65)
+ m2.run(netperf_cli_udp6, timeout=65)
+ srv_proc.intr()
+ else:
+ m1.run(ping_mod)
+
+ # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp, timeout=65)
+ m2.run(netperf_cli_udp, timeout=65)
+ srv_proc.intr()
+
+ m1.run(ping_mod6)
+
+ # Netperf test (both TCP and UDP)
+ srv_proc = m1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp6, timeout=65)
+ m2.run(netperf_cli_udp6, timeout=65)
+ srv_proc.intr()
# These tests should fail
# Ping across different VLAN
@@ -88,6 +159,12 @@ for vlan1 in vlans:
offload, state))
m2.run("ethtool -K %s %s %s" % (m2.get_devname("eth1"),
offload, state))
-
# Ping test
- m1.run(ping_mod, expect="fail")
+ if ipv == 'ipv4':
+ m1.run(ping_mod, expect="fail")
+ elif ipv == 'ipv6':
+ m1.run(ping_mod6, expect="fail")
+ else:
+ m1.run(ping_mod, expect="fail")
+ m1.run(ping_mod6, expect="fail")
+
diff --git a/recipes/regression_tests/phase2/active_backup_double_team.xml b/recipes/regression_tests/phase2/active_backup_double_team.xml
index 0f98b40..9ecefe2 100644
--- a/recipes/regression_tests/phase2/active_backup_double_team.xml
+++ b/recipes/regression_tests/phase2/active_backup_double_team.xml
@@ -21,6 +21,7 @@
</slaves>
<addresses>
<address value="192.168.0.1/24" />
+ <address value="2002::1/112" />
</addresses>
</team>
</interfaces>
@@ -46,6 +47,7 @@
</slaves>
<addresses>
<address value="192.168.0.2/24" />
+ <address value="2002::2/112" />
</addresses>
</team>
</interfaces>
diff --git a/recipes/regression_tests/phase2/active_backup_team.xml b/recipes/regression_tests/phase2/active_backup_team.xml
index 44a6430..15ad59a 100644
--- a/recipes/regression_tests/phase2/active_backup_team.xml
+++ b/recipes/regression_tests/phase2/active_backup_team.xml
@@ -21,6 +21,7 @@
</slaves>
<addresses>
<address value="192.168.0.1/24" />
+ <address value="2002::1/112" />
</addresses>
</team>
</interfaces>
@@ -30,6 +31,7 @@
<eth id="test_if" label="tnet">
<addresses>
<address value="192.168.0.2/24" />
+ <address value="2002::2/112" />
</addresses>
</eth>
</interfaces>
diff --git a/recipes/regression_tests/phase2/active_backup_team_vs_active_backup_bond.xml b/recipes/regression_tests/phase2/active_backup_team_vs_active_backup_bond.xml
index 621a4e8..445123c 100644
--- a/recipes/regression_tests/phase2/active_backup_team_vs_active_backup_bond.xml
+++ b/recipes/regression_tests/phase2/active_backup_team_vs_active_backup_bond.xml
@@ -21,6 +21,7 @@
</slaves>
<addresses>
<address value="192.168.0.1/24" />
+ <address value="2002::1/112" />
</addresses>
</team>
</interfaces>
@@ -42,6 +43,7 @@
</slaves>
<addresses>
<address value="192.168.0.2/24" />
+ <address value="2002::2/112" />
</addresses>
</bond>
</interfaces>
diff --git a/recipes/regression_tests/phase2/active_backup_team_vs_round_robin_bond.xml b/recipes/regression_tests/phase2/active_backup_team_vs_round_robin_bond.xml
index e7119a7..fc8a6a5 100644
--- a/recipes/regression_tests/phase2/active_backup_team_vs_round_robin_bond.xml
+++ b/recipes/regression_tests/phase2/active_backup_team_vs_round_robin_bond.xml
@@ -21,6 +21,7 @@
</slaves>
<addresses>
<address value="192.168.0.1/24" />
+ <address value="2002::1/112" />
</addresses>
</team>
</interfaces>
@@ -42,6 +43,7 @@
</slaves>
<addresses>
<address value="192.168.0.2/24" />
+ <address value="2002::2/112" />
</addresses>
</bond>
</interfaces>
diff --git a/recipes/regression_tests/phase2/round_robin_double_team.xml b/recipes/regression_tests/phase2/round_robin_double_team.xml
index fe6bdfe..624d6c9 100644
--- a/recipes/regression_tests/phase2/round_robin_double_team.xml
+++ b/recipes/regression_tests/phase2/round_robin_double_team.xml
@@ -21,6 +21,7 @@
</slaves>
<addresses>
<address value="192.168.0.1/24" />
+ <address value="2002::2/112" />
</addresses>
</team>
</interfaces>
@@ -46,6 +47,7 @@
</slaves>
<addresses>
<address value="192.168.0.2/24" />
+ <address value="2002::2/112" />
</addresses>
</team>
</interfaces>
diff --git a/recipes/regression_tests/phase2/round_robin_team.xml b/recipes/regression_tests/phase2/round_robin_team.xml
index 4a69db9..030aaf4 100644
--- a/recipes/regression_tests/phase2/round_robin_team.xml
+++ b/recipes/regression_tests/phase2/round_robin_team.xml
@@ -21,6 +21,7 @@
</slaves>
<addresses>
<address value="192.168.0.1/24" />
+ <address value="2002::1/112" />
</addresses>
</team>
</interfaces>
@@ -30,6 +31,7 @@
<eth id="test_if" label="tnet">
<addresses>
<address value="192.168.0.2/24" />
+ <address value="2002::2/112" />
</addresses>
</eth>
</interfaces>
diff --git a/recipes/regression_tests/phase2/round_robin_team_vs_active_backup_bond.xml b/recipes/regression_tests/phase2/round_robin_team_vs_active_backup_bond.xml
index d645f1f..c33414a 100644
--- a/recipes/regression_tests/phase2/round_robin_team_vs_active_backup_bond.xml
+++ b/recipes/regression_tests/phase2/round_robin_team_vs_active_backup_bond.xml
@@ -21,6 +21,7 @@
</slaves>
<addresses>
<address value="192.168.0.1/24" />
+ <address value="2002::1/112" />
</addresses>
</team>
</interfaces>
@@ -42,6 +43,7 @@
</slaves>
<addresses>
<address value="192.168.0.2/24" />
+ <address value="2002::2/112" />
</addresses>
</bond>
</interfaces>
diff --git a/recipes/regression_tests/phase2/round_robin_team_vs_round_robin_bond.xml b/recipes/regression_tests/phase2/round_robin_team_vs_round_robin_bond.xml
index d134119..2641b0d 100644
--- a/recipes/regression_tests/phase2/round_robin_team_vs_round_robin_bond.xml
+++ b/recipes/regression_tests/phase2/round_robin_team_vs_round_robin_bond.xml
@@ -21,6 +21,7 @@
</slaves>
<addresses>
<address value="192.168.0.1/24" />
+ <address value="2002::1/112" />
</addresses>
</team>
</interfaces>
@@ -42,6 +43,7 @@
</slaves>
<addresses>
<address value="192.168.0.2/24" />
+ <address value="2002::2/112" />
</addresses>
</bond>
</interfaces>
diff --git a/recipes/regression_tests/phase2/team_test.py b/recipes/regression_tests/phase2/team_test.py
index 38e058b..78e9efe 100644
--- a/recipes/regression_tests/phase2/team_test.py
+++ b/recipes/regression_tests/phase2/team_test.py
@@ -7,11 +7,8 @@ from lnst.Controller.Task import ctl
m1 = ctl.get_host("testmachine1")
m2 = ctl.get_host("testmachine2")
-m1.sync_resources(modules=["IcmpPing", "Netperf"])
-m2.sync_resources(modules=["IcmpPing", "Netperf"])
-
-m1_ip = m1.get_ip("test_if")
-m2_ip = m2.get_ip("test_if")
+m1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
+m2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# ------
# TESTS
@@ -19,9 +16,19 @@ m2_ip = m2.get_ip("test_if")
offloads = ["tso", "gro", "gso"]
+ipv = ctl.get_alias('ipv')
+
ping_mod = ctl.get_module("IcmpPing",
options={
- "addr" : m2_ip,
+ "addr" : m2.get_ip("test_if", 0),
+ "count" : 100,
+ "iface" : m1.get_devname("test_if"),
+ "interval" : 0.1
+ })
+
+ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : m2.get_ip("test_if", 1),
"count" : 100,
"iface" : m1.get_devname("test_if"),
"interval" : 0.1
@@ -30,70 +37,156 @@ ping_mod = ctl.get_module("IcmpPing",
netperf_srv = ctl.get_module("Netperf",
options = {
"role" : "server",
- "bind" : m1_ip
+ "bind" : m1.get_ip("test_if", 0)
+ })
+
+netperf_srv6 = ctl.get_module("Netperf",
+ options = {
+ "role" : "server",
+ "bind" : m1.get_ip("test_if", 1),
+ "netperf_opts" : " -6"
})
netperf_cli_tcp = ctl.get_module("Netperf",
options = {
"role" : "client",
- "netperf_server" : m1_ip,
+ "netperf_server" : m1.get_ip("test_if", 0),
"duration" : 60,
"testname" : "TCP_STREAM",
- "netperf_opts" : "-L %s" % m2_ip
+ "netperf_opts" : "-L %s" % m2.get_ip("test_if", 0)
})
netperf_cli_udp = ctl.get_module("Netperf",
options = {
"role" : "client",
- "netperf_server" : m1_ip,
+ "netperf_server" : m1.get_ip("test_if", 0),
+ "duration" : 60,
+ "testname" : "UDP_STREAM",
+ "netperf_opts" : "-L %s" % m2.get_ip("test_if", 0)
+ })
+
+netperf_cli_tcp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ m1.get_ip("test_if", 1),
+ "duration" : 60,
+ "testname" : "TCP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % m2.get_ip("test_if", 1)
+ })
+netperf_cli_udp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ m1.get_ip("test_if", 1),
"duration" : 60,
"testname" : "UDP_STREAM",
- "netperf_opts" : "-L %s" % m2_ip
+ "netperf_opts" :
+ "-L %s -6" % m2.get_ip("test_if", 1)
})
+
for offload in offloads:
for state in ["on", "off"]:
m1.run("ethtool -K %s %s %s" % (m1.get_devname("test_if"), offload,
state))
m2.run("ethtool -K %s %s %s" % (m2.get_devname("test_if"), offload,
state))
- m1.run(ping_mod)
- server_proc = m1.run(netperf_srv, bg=True)
- ctl.wait(2)
- m2.run(netperf_cli_tcp, timeout=65)
- m2.run(netperf_cli_udp, timeout=65)
- server_proc.intr()
+ if ipv == "ipv4":
+ m1.run(ping_mod)
+ server_proc = m1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp, timeout=65)
+ m2.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+ elif ipv == "ipv6":
+ m1.run(ping_mod6)
+ server_proc = m1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp6, timeout=65)
+ m2.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
+ else:
+ m1.run(ping_mod)
+ server_proc = m1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp, timeout=65)
+ m2.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+
+ m1.run(ping_mod6)
+ server_proc = m1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m2.run(netperf_cli_tcp6, timeout=65)
+ m2.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
ping_mod = ctl.get_module("IcmpPing",
options={
- "addr" : m1_ip,
+ "addr" : m1.get_ip("test_if", 0),
"count" : 100,
"iface" : m2.get_devname("test_if"),
"interval" : 0.1
})
+ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : m1.get_ip("test_if", 1),
+ "count" : 100,
+ "iface" : m2.get_devname("test_if"),
+ "interval" : 0.1
+ })
netperf_srv = ctl.get_module("Netperf",
options = {
"role" : "server",
- "bind" : m2_ip
+ "bind" : m2.get_ip("test_if", 0)
+ })
+
+netperf_srv6 = ctl.get_module("Netperf",
+ options = {
+ "role" : "server",
+ "bind" : m2.get_ip("test_if", 1),
+ "netperf_opts" : " -6"
})
netperf_cli_tcp = ctl.get_module("Netperf",
options = {
"role" : "client",
- "netperf_server" : m2_ip,
+ "netperf_server" : m2.get_ip("test_if", 0),
"duration" : 60,
"testname" : "TCP_STREAM",
- "netperf_opts" : "-L %s" % m1_ip
+ "netperf_opts" : "-L %s" % m1.get_ip("test_if", 0)
})
netperf_cli_udp = ctl.get_module("Netperf",
options = {
"role" : "client",
- "netperf_server" : m2_ip,
+ "netperf_server" : m2.get_ip("test_if", 0),
+ "duration" : 60,
+ "testname" : "UDP_STREAM",
+ "netperf_opts" : "-L %s" % m1.get_ip("test_if", 0)
+ })
+
+netperf_cli_tcp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ m2.get_ip("test_if", 1),
+ "duration" : 60,
+ "testname" : "TCP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % m1.get_ip("test_if", 1)
+ })
+netperf_cli_udp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ m2.get_ip("test_if", 1),
"duration" : 60,
"testname" : "UDP_STREAM",
- "netperf_opts" : "-L %s" % m1_ip
+ "netperf_opts" :
+ "-L %s -6" % m1.get_ip("test_if", 1)
})
for offload in offloads:
@@ -102,9 +195,31 @@ for offload in offloads:
state))
m2.run("ethtool -K %s %s %s" % (m2.get_devname("test_if"), offload,
state))
- m2.run(ping_mod)
- server_proc = m2.run(netperf_srv, bg=True)
- ctl.wait(2)
- m1.run(netperf_cli_tcp, timeout=65)
- m1.run(netperf_cli_udp, timeout=65)
- server_proc.intr()
+ if ipv == 'ipv4':
+ m2.run(ping_mod)
+ server_proc = m2.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ m1.run(netperf_cli_tcp, timeout=65)
+ m1.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+ elif ipv == 'ipv6':
+ m2.run(ping_mod6)
+ server_proc = m2.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m1.run(netperf_cli_tcp6, timeout=65)
+ m1.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
+ else:
+ m2.run(ping_mod)
+ server_proc = m2.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ m1.run(netperf_cli_tcp, timeout=65)
+ m1.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+
+ m2.run(ping_mod6)
+ server_proc = m2.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ m1.run(netperf_cli_tcp6, timeout=65)
+ m1.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
\ No newline at end of file
diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py b/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py
index 36eabd3..a4cfdd8 100644
--- a/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py
+++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.py
@@ -7,16 +7,16 @@ from lnst.Controller.Task import ctl
# Host 1 + guests 1 and 2
#h1 = ctl.get_host("host1")
g1 = ctl.get_host("guest1")
-g1.sync_resources(modules=["IcmpPing", "Netperf"])
+g1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
g2 = ctl.get_host("guest2")
-g2.sync_resources(modules=["IcmpPing", "Netperf"])
+g2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# Host 2 + guests 3 and 4
#h2 = ctl.get_host("host2")
g3 = ctl.get_host("guest3")
-g3.sync_resources(modules=["IcmpPing", "Netperf"])
+g3.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
g4 = ctl.get_host("guest4")
-g4.sync_resources(modules=["IcmpPing", "Netperf"])
+g4.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# ------
# TESTS
@@ -24,26 +24,53 @@ g4.sync_resources(modules=["IcmpPing", "Netperf"])
offloads = ["gso", "gro", "tso"]
+ipv = ctl.get_alias("ipv")
+
ping_mod = ctl.get_module("IcmpPing",
options={
- "addr" : g3.get_ip("guestnic"),
+ "addr" : g3.get_ip("guestnic", 0),
"count" : 100,
"iface" : g1.get_devname("guestnic"),
"interval" : 0.1
})
+
ping_mod2 = ctl.get_module("IcmpPing",
options={
- "addr" : g2.get_ip("guestnic"),
+ "addr" : g2.get_ip("guestnic", 0),
"count" : 100,
"iface" : g4.get_devname("guestnic"),
"interval" : 0.1
})
+
+ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : g3.get_ip("guestnic", 1),
+ "count" : 100,
+ "iface" : g1.get_devname("guestnic"),
+ "interval" : 0.1
+ })
+
+ping_mod62 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : g2.get_ip("guestnic", 1),
+ "count" : 100,
+ "iface" : g4.get_devname("guestnic"),
+ "interval" : 0.1
+ })
+
netperf_srv = ctl.get_module("Netperf",
options={
"role": "server",
"bind" : g1.get_ip("guestnic")
})
+netperf_srv6 = ctl.get_module("Netperf",
+ options={
+ "role" : "server",
+ "bind" : g1.get_ip("guestnic", 1),
+ "netperf_opts" : " -6",
+ })
+
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
@@ -63,6 +90,29 @@ netperf_cli_udp = ctl.get_module("Netperf",
"netperf_opts" : "-L %s" %
g3.get_ip("guestnic")
})
+
+netperf_cli_tcp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ g1.get_ip("guestnic", 1),
+ "duration" : 60,
+ "testname" : "TCP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % g3.get_ip("guestnic", 1)
+ })
+
+netperf_cli_udp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ g1.get_ip("guestnic", 1),
+ "duration" : 60,
+ "testname" : "UDP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % g3.get_ip("guestnic", 1)
+ })
+
ping_mod_bad = ctl.get_module("IcmpPing",
options={
"addr" : g4.get_ip("guestnic"),
@@ -70,6 +120,8 @@ ping_mod_bad = ctl.get_module("IcmpPing",
"iface" : g1.get_devname("guestnic"),
"interval" : 0.1
})
+
+
ping_mod_bad2 = ctl.get_module("IcmpPing",
options={
"addr" : g2.get_ip("guestnic"),
@@ -78,6 +130,23 @@ ping_mod_bad2 = ctl.get_module("IcmpPing",
"interval" : 0.1
})
+ping_mod6_bad = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : g4.get_ip("guestnic", 1),
+ "count" : 100,
+ "iface" : g1.get_devname("guestnic"),
+ "interval" : 0.1
+ })
+
+ping_mod6_bad2 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : g2.get_ip("guestnic", 1),
+ "count" : 100,
+ "iface" : g3.get_devname("guestnic"),
+ "interval" : 0.1
+ })
+
+
for offload in offloads:
for state in ["on", "off"]:
g1.run("ethtool -K %s %s %s" % (g1.get_devname("guestnic"),
@@ -88,12 +157,48 @@ for offload in offloads:
offload, state))
g4.run("ethtool -K %s %s %s" % (g4.get_devname("guestnic"),
offload, state))
- g1.run(ping_mod)
- g4.run(ping_mod2)
- g1.run(ping_mod_bad, expect="fail")
- g3.run(ping_mod_bad2, expect="fail")
-
- g1.run(netperf_srv, bg=True, timeout=125)
- ctl.wait(2)
- g3.run(netperf_cli_tcp, timeout=65)
- g3.run(netperf_cli_udp, timeout=65)
+ if ipv == 'ipv4':
+ g1.run(ping_mod)
+ g4.run(ping_mod2)
+ g1.run(ping_mod_bad, expect="fail")
+ g3.run(ping_mod_bad2, expect="fail")
+
+ server_proc = g1.run(netperf_srv, bg=True, timeout=125)
+ ctl.wait(2)
+ g3.run(netperf_cli_tcp, timeout=65)
+ g3.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+ elif ipv == 'ipv6':
+ g1.run(ping_mod6)
+ g4.run(ping_mod62)
+ g1.run(ping_mod6_bad, expect="fail")
+ g3.run(ping_mod6_bad2, expect="fail")
+
+ server_proc = g1.run(netperf_srv6, bg=True, timeout=125)
+ ctl.wait(2)
+ g3.run(netperf_cli_tcp6, timeout=65)
+ g3.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
+ else:
+ # IPv4
+ g1.run(ping_mod)
+ g4.run(ping_mod2)
+ g1.run(ping_mod_bad, expect="fail")
+ g3.run(ping_mod_bad2, expect="fail")
+
+ server_proc = g1.run(netperf_srv, bg=True, timeout=125)
+ ctl.wait(2)
+ g3.run(netperf_cli_tcp, timeout=65)
+ g3.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+ # IPv6
+ g1.run(ping_mod6)
+ g4.run(ping_mod62)
+ g1.run(ping_mod6_bad, expect="fail")
+ g3.run(ping_mod6_bad2, expect="fail")
+
+ server_proc = g1.run(netperf_srv6, bg=True, timeout=125)
+ ctl.wait(2)
+ g3.run(netperf_cli_tcp6, timeout=65)
+ g3.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.xml b/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.xml
index c901b16..1347e38 100644
--- a/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.xml
+++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_2_vlans_over_active_backup_bond.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="host1">
<interfaces>
@@ -41,6 +44,7 @@
<eth id="guestnic" label="to_guest1">
<addresses>
<address>192.168.10.100/24</address>
+ <address>2002::10:100/112</address>
</addresses>
</eth>
</interfaces>
@@ -50,6 +54,7 @@
<eth id="guestnic" label="to_guest2">
<addresses>
<address>192.168.20.100/24</address>
+ <address>2002::20:100/112</address>
</addresses>
</eth>
</interfaces>
@@ -96,6 +101,7 @@
<eth id="guestnic" label="to_guest3">
<addresses>
<address>192.168.10.101/24</address>
+ <address>2002::10:101/112</address>
</addresses>
</eth>
</interfaces>
@@ -105,6 +111,7 @@
<eth id="guestnic" label="to_guest4">
<addresses>
<address>192.168.20.101/24</address>
+ <address>2002::20:100/112</address>
</addresses>
</eth>
</interfaces>
diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.py b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.py
index 71c7f4d..0d6aba8 100644
--- a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.py
+++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.py
@@ -9,8 +9,8 @@ g1 = ctl.get_host("guest1")
h2 = ctl.get_host("host2")
-g1.sync_resources(modules=["IcmpPing", "Netperf"])
-h2.sync_resources(modules=["IcmpPing", "Netperf"])
+g1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
+h2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# ------
# TESTS
@@ -18,6 +18,8 @@ h2.sync_resources(modules=["IcmpPing", "Netperf"])
offloads = ["gso", "gro", "tso"]
+ipv = ctl.get_alias("ipv")
+
ping_mod = ctl.get_module("IcmpPing",
options={
"addr" : h2.get_ip("vlan10"),
@@ -25,12 +27,28 @@ ping_mod = ctl.get_module("IcmpPing",
"iface" : g1.get_devname("vlan10"),
"interval" : 0.1
})
+
+ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : h2.get_ip("vlan10", 1),
+ "count" : 100,
+ "iface" : g1.get_devname("vlan10"),
+ "interval" : 0.1
+ })
+
netperf_srv = ctl.get_module("Netperf",
options={
"role" : "server",
"bind" : g1.get_ip("vlan10")
})
+netperf_srv6 = ctl.get_module("Netperf",
+ options={
+ "role" : "server",
+ "bind" : g1.get_ip("vlan10", 1),
+ "netperf_opts" : " -6",
+ })
+
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
@@ -50,16 +68,63 @@ netperf_cli_udp = ctl.get_module("Netperf",
"netperf_opts" : "-L %s" %
h2.get_ip("vlan10")
})
+
+netperf_cli_tcp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ g1.get_ip("vlan10", 1),
+ "duration" : 60,
+ "testname" : "TCP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % h2.get_ip("vlan10", 1)
+ })
+
+netperf_cli_udp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ g1.get_ip("vlan10", 1),
+ "duration" : 60,
+ "testname" : "UDP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % h2.get_ip("vlan10", 1)
+ })
+
+
for offload in offloads:
for state in ["on", "off"]:
g1.run("ethtool -K %s %s %s" % (g1.get_devname("guestnic"),
offload, state))
h2.run("ethtool -K %s %s %s" % (h2.get_devname("nic"),
offload, state))
- g1.run(ping_mod)
- server_proc = g1.run(netperf_srv, bg=True)
- ctl.wait(2)
- h2.run(netperf_cli_tcp, timeout=65)
- h2.run(netperf_cli_udp, timeout=65)
+ if ipv == 'ipv4':
+ g1.run(ping_mod)
+ server_proc = g1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp, timeout=65)
+ h2.run(netperf_cli_udp, timeout=65)
+
+ server_proc.intr()
+ elif ipv == 'ipv6':
+ g1.run(ping_mod6)
+ server_proc = g1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp6, timeout=65)
+ h2.run(netperf_cli_udp6, timeout=65)
+
+ server_proc.intr()
+ else:
+ g1.run(ping_mod)
+ server_proc = g1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp, timeout=65)
+ h2.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
- server_proc.intr()
+ g1.run(ping_mod6)
+ server_proc = g1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp6, timeout=65)
+ h2.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.xml b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.xml
index 4442e4a..dfab509 100644
--- a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.xml
+++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_guest.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="host1">
<interfaces>
@@ -24,6 +27,7 @@
</slaves>
<addresses>
<address>192.168.10.10/24</address>
+ <address>2002::10:10/112</address>
</addresses>
</vlan>
</interfaces>
@@ -40,6 +44,7 @@
</slaves>
<addresses>
<address>192.168.10.11/24</address>
+ <address>2002::10:11/112</address>
</addresses>
</vlan>
</interfaces>
diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.py b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.py
index 4543387..3344d81 100644
--- a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.py
+++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.py
@@ -9,8 +9,8 @@ g1 = ctl.get_host("guest1")
h2 = ctl.get_host("host2")
-g1.sync_resources(modules=["IcmpPing", "Netperf"])
-h2.sync_resources(modules=["IcmpPing", "Netperf"])
+g1.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
+h2.sync_resources(modules=["IcmpPing", "Icmp6Ping", "Netperf"])
# ------
# TESTS
@@ -18,6 +18,8 @@ h2.sync_resources(modules=["IcmpPing", "Netperf"])
offloads = ["gso", "gro", "tso"]
+ipv = ctl.get_alias("ipv")
+
ping_mod = ctl.get_module("IcmpPing",
options={
"addr" : h2.get_ip("vlan10"),
@@ -25,12 +27,28 @@ ping_mod = ctl.get_module("IcmpPing",
"iface" : g1.get_devname("guestnic"),
"interval" : 0.1
})
+
+ping_mod6 = ctl.get_module("Icmp6Ping",
+ options={
+ "addr" : h2.get_ip("vlan10", 1),
+ "count" : 100,
+ "iface" : g1.get_devname("guestnic"),
+ "interval" : 0.1
+ })
+
netperf_srv = ctl.get_module("Netperf",
options={
"role" : "server",
"bind" : g1.get_ip("guestnic")
})
+netperf_srv6 = ctl.get_module("Netperf",
+ options={
+ "role" : "server",
+ "bind" : g1.get_ip("guestnic", 1),
+ "netperf_opts" : " -6",
+ })
+
netperf_cli_tcp = ctl.get_module("Netperf",
options={
"role" : "client",
@@ -51,16 +69,61 @@ netperf_cli_udp = ctl.get_module("Netperf",
h2.get_ip("vlan10")
})
+netperf_cli_tcp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ g1.get_ip("guestnic", 1),
+ "duration" : 60,
+ "testname" : "TCP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % h2.get_ip("vlan10", 1)
+ })
+
+netperf_cli_udp6 = ctl.get_module("Netperf",
+ options={
+ "role" : "client",
+ "netperf_server" :
+ g1.get_ip("guestnic", 1),
+ "duration" : 60,
+ "testname" : "UDP_STREAM",
+ "netperf_opts" :
+ "-L %s -6" % h2.get_ip("vlan10", 1)
+ })
+
for offload in offloads:
for state in ["on", "off"]:
g1.run("ethtool -K %s %s %s" % (g1.get_devname("guestnic"),
offload, state))
h2.run("ethtool -K %s %s %s" % (h2.get_devname("nic"),
offload, state))
- g1.run(ping_mod)
- server_proc = g1.run(netperf_srv, bg=True)
- ctl.wait(2)
- h2.run(netperf_cli_tcp, timeout=65)
- h2.run(netperf_cli_udp, timeout=65)
+ if ipv == 'ipv4':
+ g1.run(ping_mod)
+ server_proc = g1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp, timeout=65)
+ h2.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
+
+ elif ipv == 'ipv6':
+ g1.run(ping_mod6)
+ server_proc = g1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp6, timeout=65)
+ h2.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
+
+ else:
+ g1.run(ping_mod)
+ server_proc = g1.run(netperf_srv, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp, timeout=65)
+ h2.run(netperf_cli_udp, timeout=65)
+ server_proc.intr()
- server_proc.intr()
+ g1.run(ping_mod6)
+ server_proc = g1.run(netperf_srv6, bg=True)
+ ctl.wait(2)
+ h2.run(netperf_cli_tcp6, timeout=65)
+ h2.run(netperf_cli_udp6, timeout=65)
+ server_proc.intr()
diff --git a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.xml b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.xml
index 50eb792..13a71cd 100644
--- a/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.xml
+++ b/recipes/regression_tests/phase2/virtual_ovs_bridge_vlan_in_host.xml
@@ -1,4 +1,7 @@
<lnstrecipe>
+ <define>
+ <alias name="ipv" value="both" />
+ </define>
<network>
<host id="host1">
<interfaces>
@@ -22,6 +25,7 @@
<eth id="guestnic" label="to_guest">
<addresses>
<address>192.168.10.10/24</address>
+ <address>2002::10:10/112</address>
</addresses>
</eth>
</interfaces>
@@ -42,11 +46,12 @@
</slaves>
<addresses>
<address>192.168.10.11/24</address>
+ <address>2002::10:11/112</address>
</addresses>
</vlan>
</interfaces>
</host>
</network>
- <task python="./virtual_ovs_bridge_vlan_in_host.py" />
+ <task python="virtual_ovs_bridge_vlan_in_host.py" />
</lnstrecipe>
--
2.1.0
9 years, 3 months
[lnst] regression tests: add new tests for old closed bugs
by Jiří Pírko
commit de960c50d4017d06752a5b50292ef642ab3b4c54
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Fri Jan 16 14:06:04 2015 +0100
regression tests: add new tests for old closed bugs
This commit catches up to the current state of solved bugs on github.
Some closed bugs were skipped since no easy regression test can be
written.
The desc files always contain the link to the corresponding github
issue.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
regression-tests/tests/16/desc | 3 +
regression-tests/tests/16/recipe.xml | 37 +++
regression-tests/tests/16/run.sh | 14 +
regression-tests/tests/17/desc | 3 +
regression-tests/tests/17/recipe.xml | 38 +++
regression-tests/tests/17/run.sh | 14 +
regression-tests/tests/18/desc | 6 +
regression-tests/tests/18/recipe.xml | 26 ++
regression-tests/tests/18/run.sh | 19 ++
regression-tests/tests/19/desc | 3 +
regression-tests/tests/19/recipe.xml | 17 +
regression-tests/tests/19/run.sh | 19 ++
regression-tests/tests/20/desc | 3 +
regression-tests/tests/20/recipe1.xml | 47 +++
regression-tests/tests/20/recipe2.xml | 31 ++
regression-tests/tests/20/run.sh | 20 ++
regression-tests/tests/21/desc | 3 +
regression-tests/tests/21/lnst-ctl.conf | 3 +
regression-tests/tests/21/recipe.xml | 55 ++++
regression-tests/tests/21/run.sh | 18 +
.../tests/21/test_modules/TCPConnection.py | 60 ++++
.../tests/21/test_tools/tcp_conn/Makefile | 12 +
.../tests/21/test_tools/tcp_conn/lnst-setup.sh | 3 +
.../tests/21/test_tools/tcp_conn/tcp_connect.c | 281 +++++++++++++++++
.../tests/21/test_tools/tcp_conn/tcp_listen.c | 330 ++++++++++++++++++++
regression-tests/tests/22/desc | 3 +
regression-tests/tests/22/lnst-ctl.conf | 2 +
regression-tests/tests/22/pool/slave1.xml | 6 +
regression-tests/tests/22/pool/slave2.xml | 6 +
regression-tests/tests/22/recipe.xml | 26 ++
regression-tests/tests/22/run.sh | 18 +
regression-tests/tests/23/desc | 3 +
regression-tests/tests/23/lnst-ctl.conf | 2 +
regression-tests/tests/23/recipe.xml | 42 +++
regression-tests/tests/23/run.sh | 19 ++
regression-tests/tests/23/test_modules/IcmpPing.py | 71 +++++
regression-tests/tests/24/desc | 6 +
regression-tests/tests/24/recipe_fail.xml | 33 ++
regression-tests/tests/24/recipe_pass.xml | 33 ++
regression-tests/tests/24/run.sh | 22 ++
40 files changed, 1357 insertions(+), 0 deletions(-)
---
diff --git a/regression-tests/tests/16/desc b/regression-tests/tests/16/desc
new file mode 100644
index 0000000..a063e3a
--- /dev/null
+++ b/regression-tests/tests/16/desc
@@ -0,0 +1,3 @@
+address tag should accept value in the tag contents or the 'value' attribute
+
+https://github.com/jpirko/lnst/issues/31
diff --git a/regression-tests/tests/16/recipe.xml b/regression-tests/tests/16/recipe.xml
new file mode 100644
index 0000000..3d8887e
--- /dev/null
+++ b/regression-tests/tests/16/recipe.xml
@@ -0,0 +1,37 @@
+<lnstrecipe>
+ <network>
+ <host id="slave1">
+ <interfaces>
+ <eth id="testifc1" label="A">
+ <addresses>
+ <address>fd00::1/64</address>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+
+ <host id="slave2">
+ <interfaces>
+ <eth id="testifc3" label="A">
+ <addresses>
+ <address value="fd00::2/64"/>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+
+ </network>
+
+ <task>
+ <ctl_wait seconds="5"/>
+ <config host="slave1" option="/proc/sys/net/ipv4/igmp_max_memberships" value="5"/>
+ <run host="slave1" module="Icmp6Ping">
+ <options>
+ <option name="addr" value="{ip(slave2,testifc3)}"/>
+ <option name="count" value="20"/>
+ <option name="interval" value="0"/>
+ </options>
+ </run>
+ </task>
+
+</lnstrecipe>
diff --git a/regression-tests/tests/16/run.sh b/regression-tests/tests/16/run.sh
new file mode 100755
index 0000000..6b80eb5
--- /dev/null
+++ b/regression-tests/tests/16/run.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+. ../lib.sh
+
+init_test
+
+lnst-ctl -d run recipe.xml
+rv=$?
+
+print_separator
+
+assert_status "pass" "$rv"
+
+end_test
diff --git a/regression-tests/tests/17/desc b/regression-tests/tests/17/desc
new file mode 100644
index 0000000..af02d5b
--- /dev/null
+++ b/regression-tests/tests/17/desc
@@ -0,0 +1,3 @@
+Unknown options to a test module result in a stack trace
+
+https://github.com/jpirko/lnst/issues/38
diff --git a/regression-tests/tests/17/recipe.xml b/regression-tests/tests/17/recipe.xml
new file mode 100644
index 0000000..56f9216
--- /dev/null
+++ b/regression-tests/tests/17/recipe.xml
@@ -0,0 +1,38 @@
+<lnstrecipe>
+ <network>
+ <host id="slave1">
+ <interfaces>
+ <eth id="testiface" label="A">
+ <addresses>
+ <address value="fd00::1/64"/>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+
+ <host id="slave2">
+ <interfaces>
+ <eth id="testiface" label="A">
+ <addresses>
+ <address value="fd00::2/64"/>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+
+ </network>
+
+ <task>
+ <ctl_wait seconds="5"/>
+ <run module="Icmp6Ping" host="slave1" timeout="30">
+ <options>
+ <option name="addre" value="{ip(slave2,testiface)}"/> <!-- this is wrong -->
+ <option name="addr" value="{ip(slave2,testiface)}"/> <!-- this is correct -->
+ <option name="count" value="10"/>
+ <option name="interval" value="0.0"/>
+ <option name="limit_rate" value="95"/>
+ </options>
+ </run>
+ </task>
+
+</lnstrecipe>
diff --git a/regression-tests/tests/17/run.sh b/regression-tests/tests/17/run.sh
new file mode 100755
index 0000000..6b80eb5
--- /dev/null
+++ b/regression-tests/tests/17/run.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+
+. ../lib.sh
+
+init_test
+
+lnst-ctl -d run recipe.xml
+rv=$?
+
+print_separator
+
+assert_status "pass" "$rv"
+
+end_test
diff --git a/regression-tests/tests/18/desc b/regression-tests/tests/18/desc
new file mode 100644
index 0000000..bca06cc
--- /dev/null
+++ b/regression-tests/tests/18/desc
@@ -0,0 +1,6 @@
+Empty task results in uhandled exception
+
+Instead we should require at least one command or end with an error, but not a
+stack trace.
+
+https://github.com/jpirko/lnst/issues/53
diff --git a/regression-tests/tests/18/recipe.xml b/regression-tests/tests/18/recipe.xml
new file mode 100644
index 0000000..75db68c
--- /dev/null
+++ b/regression-tests/tests/18/recipe.xml
@@ -0,0 +1,26 @@
+<lnstrecipe>
+ <network>
+ <host id="slave1">
+ <interfaces>
+ <eth id="testiface" label="A">
+ <addresses>
+ <address value="fd00::1/64"/>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+
+ <host id="slave2">
+ <interfaces>
+ <eth id="testiface" label="A">
+ <addresses>
+ <address value="fd00::2/64"/>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+
+ </network>
+
+ <task/>
+</lnstrecipe>
diff --git a/regression-tests/tests/18/run.sh b/regression-tests/tests/18/run.sh
new file mode 100755
index 0000000..ba19649
--- /dev/null
+++ b/regression-tests/tests/18/run.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+. ../lib.sh
+
+init_test
+
+lnst-ctl -d run recipe.xml | tee test.log
+rv=${PIPESTATUS[0]}
+
+log=`cat test.log`
+
+rm -f test.log
+
+print_separator
+
+assert_status "error" "$rv"
+assert_log "ERROR" "Parser error:" "$log"
+
+end_test
diff --git a/regression-tests/tests/19/desc b/regression-tests/tests/19/desc
new file mode 100644
index 0000000..a704a88
--- /dev/null
+++ b/regression-tests/tests/19/desc
@@ -0,0 +1,3 @@
+undefined interface id in template function
+
+https://github.com/jpirko/lnst/issues/55
diff --git a/regression-tests/tests/19/recipe.xml b/regression-tests/tests/19/recipe.xml
new file mode 100644
index 0000000..4fa9892
--- /dev/null
+++ b/regression-tests/tests/19/recipe.xml
@@ -0,0 +1,17 @@
+<lnstrecipe>
+ <network>
+ <host id="tm1">
+ <interfaces>
+ <eth id="nic1" label="testnet">
+ <addresses>
+ <address value="192.168.131.201/24"/>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ </network>
+
+ <task>
+ <run host="tm1" command="ethtool -i {ip(tm1,nic2)}"/>
+ </task>
+</lnstrecipe>
diff --git a/regression-tests/tests/19/run.sh b/regression-tests/tests/19/run.sh
new file mode 100755
index 0000000..001c35b
--- /dev/null
+++ b/regression-tests/tests/19/run.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+. ../lib.sh
+
+init_test
+
+lnst-ctl -d run recipe.xml | tee test.log
+rv=${PIPESTATUS[0]}
+
+log=`cat test.log`
+
+rm -f test.log
+
+print_separator
+
+assert_status "error" "$rv"
+assert_log "ERROR" "Second parameter of function ip() is invalid" "$log"
+
+end_test
diff --git a/regression-tests/tests/20/desc b/regression-tests/tests/20/desc
new file mode 100644
index 0000000..c695ab0
--- /dev/null
+++ b/regression-tests/tests/20/desc
@@ -0,0 +1,3 @@
+recipe cannot be run after config_only run of recipe with team/bonding
+
+https://github.com/jpirko/lnst/issues/59
diff --git a/regression-tests/tests/20/recipe1.xml b/regression-tests/tests/20/recipe1.xml
new file mode 100644
index 0000000..54346e9
--- /dev/null
+++ b/regression-tests/tests/20/recipe1.xml
@@ -0,0 +1,47 @@
+<lnstrecipe>
+ <network>
+ <host id="tm1">
+ <interfaces>
+ <eth id="nic1" label="testnet"/>
+ <bond id="bond">
+ <slaves>
+ <slave id="nic1"/>
+ </slaves>
+ <addresses>
+ <address value="192.168.131.201/24"/>
+ </addresses>
+ </bond>
+ </interfaces>
+ </host>
+ <host id="tm2">
+ <interfaces>
+ <eth id="nic1" label="testnet"/>
+ <team id="team">
+ <options>
+ <option name="teamd_config">
+ {
+ "runner": {"name": "activebackup"},
+ "link_watch": {"name": "ethtool"}
+ }
+ </option>
+ </options>
+ <slaves>
+ <slave id="nic1"/>
+ </slaves>
+ <addresses>
+ <address value="192.168.131.202/24"/>
+ </addresses>
+ </team>
+ </interfaces>
+ </host>
+ </network>
+
+ <task>
+ <run host="tm1" module="IcmpPing">
+ <options>
+ <option name="addr" value="{ip(tm2,team)}"/>
+ <option name="count" value="3"/>
+ </options>
+ </run>
+ </task>
+</lnstrecipe>
diff --git a/regression-tests/tests/20/recipe2.xml b/regression-tests/tests/20/recipe2.xml
new file mode 100644
index 0000000..327c0f3
--- /dev/null
+++ b/regression-tests/tests/20/recipe2.xml
@@ -0,0 +1,31 @@
+<lnstrecipe>
+ <network>
+ <host id="tm1">
+ <interfaces>
+ <eth id="nic1" label="testnet">
+ <addresses>
+ <address value="192.168.131.201/24"/>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ <host id="tm2">
+ <interfaces>
+ <eth id="nic1" label="testnet">
+ <addresses>
+ <address value="192.168.131.202/24"/>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ </network>
+
+ <task>
+ <run host="tm1" module="IcmpPing">
+ <options>
+ <option name="addr" value="{ip(tm2,nic1)}"/>
+ <option name="count" value="3"/>
+ </options>
+ </run>
+ </task>
+</lnstrecipe>
diff --git a/regression-tests/tests/20/run.sh b/regression-tests/tests/20/run.sh
new file mode 100755
index 0000000..ca50115
--- /dev/null
+++ b/regression-tests/tests/20/run.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+. ../lib.sh
+
+init_test
+
+lnst-ctl -d run recipe1.xml | tee test.log
+rv1=${PIPESTATUS[0]}
+
+lnst-ctl -d run recipe2.xml | tee test.log
+rv2=${PIPESTATUS[0]}
+
+
+print_separator
+assert_status "pass" "$rv1"
+assert_status "pass" "$rv2"
+
+rm -f test.log
+
+end_test
diff --git a/regression-tests/tests/21/desc b/regression-tests/tests/21/desc
new file mode 100644
index 0000000..e4f5cbc
--- /dev/null
+++ b/regression-tests/tests/21/desc
@@ -0,0 +1,3 @@
+broken tool-module dependency during synchronization
+
+https://github.com/jpirko/lnst/issues/71
diff --git a/regression-tests/tests/21/lnst-ctl.conf b/regression-tests/tests/21/lnst-ctl.conf
new file mode 100644
index 0000000..9f43732
--- /dev/null
+++ b/regression-tests/tests/21/lnst-ctl.conf
@@ -0,0 +1,3 @@
+[environment]
+test_tool_dirs = ./test_tools
+test_module_dirs = ./test_modules
diff --git a/regression-tests/tests/21/recipe.xml b/regression-tests/tests/21/recipe.xml
new file mode 100644
index 0000000..ee61de1
--- /dev/null
+++ b/regression-tests/tests/21/recipe.xml
@@ -0,0 +1,55 @@
+<lnstrecipe>
+ <network>
+ <host id="tm1">
+ <interfaces>
+ <eth id="nic1" label="testnet">
+ <addresses>
+ <address value="192.168.131.201/24"/>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ <host id="tm2">
+ <interfaces>
+ <eth id="nic1" label="testnet">
+ <addresses>
+ <address value="192.168.131.202/24"/>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ </network>
+
+ <task>
+ <define>
+ <alias name="my_range" value="10000-10050" />
+ </define>
+
+ <define>
+ <alias name="debug" value="no"/>
+ </define>
+
+ <run module="TCPConnection" host="tm2" bg_id="server">
+ <options>
+ <option name="mode" value="server"/>
+ <option name="address" value="{ip(tm2,nic1)}"/>
+ <option name="portrange" value="{$my_range}"/>
+ <option name="continuous" value="yes"/>
+ <option name="debug" value="{$debug}"/>
+ </options>
+ </run>
+ <ctl_wait seconds="3"/>
+ <run module="TCPConnection" host="tm1" bg_id="client">
+ <options>
+ <option name="mode" value="client"/>
+ <option name="address" value="{ip(tm2,nic1)}"/>
+ <option name="portrange" value="{$my_range}"/>
+ <option name="continuous" value="yes"/>
+ <option name="debug" value="{$debug}"/>
+ </options>
+ </run>
+ <ctl_wait seconds="15"/>
+ <intr host="tm1" bg_id="client"/>
+ <intr host="tm2" bg_id="server"/>
+ </task>
+</lnstrecipe>
diff --git a/regression-tests/tests/21/run.sh b/regression-tests/tests/21/run.sh
new file mode 100755
index 0000000..07bd6c0
--- /dev/null
+++ b/regression-tests/tests/21/run.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+. ../lib.sh
+
+init_test
+
+touch test_tools/*
+touch test_modules/*
+
+lnst-ctl -c lnst-ctl.conf -d -r run recipe.xml | tee test.log
+rv=${PIPESTATUS[0]}
+
+print_separator
+assert_status "pass" "$rv"
+
+rm -f test.log
+
+end_test
diff --git a/regression-tests/tests/21/test_modules/TCPConnection.py b/regression-tests/tests/21/test_modules/TCPConnection.py
new file mode 100644
index 0000000..43b88a9
--- /dev/null
+++ b/regression-tests/tests/21/test_modules/TCPConnection.py
@@ -0,0 +1,60 @@
+"""
+This module defines TCPConnection test,
+a python wrapper for LNST's tcp_conn test tool
+"""
+
+__author__ = """
+jtluka(a)redhat.com (Jan Tluka)
+"""
+
+import re
+import errno
+import logging
+from lnst.Common.TestsCommon import TestGeneric
+from lnst.Common.Utils import bool_it
+
+class TCPConnection(TestGeneric):
+ def run(self):
+ mode = self.get_mopt("mode")
+ address = self.get_mopt("address")
+ portrange = self.get_mopt("portrange")
+
+ continuous = self.get_opt("continuous")
+ debug = self.get_opt("debug")
+ ipv6 = self.get_opt("ipv6")
+
+ cmd = ""
+ if (mode == "server"):
+ logging.debug("TCPConnection: running as server")
+ cmd += "./tcp_listen"
+ elif (mode == "client"):
+ logging.debug("TCPConnection: running as client")
+ cmd += "./tcp_connect"
+ else:
+ raise Exception("Invalid mode value for TCPConnection test module!")
+
+ cmd += " -a %s -p %s" % (address, portrange)
+
+ if continuous and bool_it(continuous):
+ cmd += " -c"
+
+ if debug and bool_it(debug):
+ cmd += " -d"
+
+ if ipv6 and bool_it(ipv6):
+ cmd += " -6"
+
+ output = self.exec_from("tcp_conn", cmd, die_on_err=False, log_outputs=True)[0]
+
+ logging.debug("TCPConnection done, inspecting logs ...")
+
+ m = None
+ if (mode == "client"):
+ m = re.search("made [0-9]* connections", output)
+ elif (mode == "server"):
+ m = re.search("handled [0-9]* connections", output)
+
+ if m is None:
+ return self.set_fail({'msg': "Unexpected error"})
+ else:
+ return self.set_pass({'msg': m.group(0)})
diff --git a/regression-tests/tests/21/test_tools/tcp_conn/Makefile b/regression-tests/tests/21/test_tools/tcp_conn/Makefile
new file mode 100644
index 0000000..a570641
--- /dev/null
+++ b/regression-tests/tests/21/test_tools/tcp_conn/Makefile
@@ -0,0 +1,12 @@
+CC=gcc
+
+all: tcp_listen tcp_connect
+
+tcp_listen: tcp_listen.c
+ $(CC) -o tcp_listen tcp_listen.c -pthread -lrt
+
+tcp_connect: tcp_connect.c
+ $(CC) -o tcp_connect tcp_connect.c -pthread -lrt
+
+clean:
+ rm -f tcp_connect tcp_listen
diff --git a/regression-tests/tests/21/test_tools/tcp_conn/lnst-setup.sh b/regression-tests/tests/21/test_tools/tcp_conn/lnst-setup.sh
new file mode 100755
index 0000000..2aad486
--- /dev/null
+++ b/regression-tests/tests/21/test_tools/tcp_conn/lnst-setup.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+make
diff --git a/regression-tests/tests/21/test_tools/tcp_conn/tcp_connect.c b/regression-tests/tests/21/test_tools/tcp_conn/tcp_connect.c
new file mode 100644
index 0000000..3bb4597
--- /dev/null
+++ b/regression-tests/tests/21/test_tools/tcp_conn/tcp_connect.c
@@ -0,0 +1,281 @@
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/wait.h>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <arpa/inet.h>
+
+#include <errno.h>
+#include <signal.h>
+#include <semaphore.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#define IPCKEY 5678
+
+int connection_handlers[1024];
+int handlers_count;
+int *connection_count;
+
+int debug_on = 0;
+int cont = 0;
+int *term_flag;
+
+sem_t *mutex;
+
+int usage()
+{
+ printf("./tcp_connect -p [port_range] -a [ipaddr] [-d] [-c] [-6]\n");
+ return 0;
+}
+
+#define MSG_MAX 256
+char msg[MSG_MAX];
+
+void debug(char* msg)
+{
+ if (debug_on)
+ {
+ printf("Debug: %s\n", msg);
+ }
+}
+
+void terminate_connections(int p)
+{
+ debug("signalled");
+ *term_flag = 1;
+}
+
+int handle_connections(char* host, int port, int ipv6)
+{
+ int conn_sock;
+ struct sockaddr_in my_addr;
+ struct sockaddr_in6 my_addr6;
+ char data[] = "abcdefghijklmnopqrstuvwxyz0123456789";
+ char buf[21*10*strlen(data)+1];
+ int family;
+
+ snprintf(msg, MSG_MAX, "Starting connection on %s port %i", host, port);
+ debug(msg);
+
+ if (ipv6)
+ {
+ family = my_addr6.sin6_family = AF_INET6;
+ my_addr6.sin6_port = htons(port);
+ if (inet_pton(AF_INET6, host, &my_addr6.sin6_addr) != 1) {
+ perror("fail on inet_pton");
+ return 1;
+ }
+ }
+ else
+ {
+ family = my_addr.sin_family = AF_INET;
+ my_addr.sin_port = htons(port);
+ if (inet_aton(host, &(my_addr.sin_addr)) == 0)
+ {
+ printf("failed on inet_aton()\n");
+ return 1;
+ }
+ }
+
+ do
+ {
+ conn_sock = socket(family, SOCK_STREAM, 0);
+ if (conn_sock == -1)
+ {
+ perror("fail on socket()");
+ return 1;
+ }
+
+ struct sockaddr* sa;
+ socklen_t sa_len;
+ if (ipv6)
+ {
+ sa = (struct sockaddr*) &my_addr6;
+ sa_len = sizeof(struct sockaddr_in6);
+ }
+ else
+ {
+ sa = (struct sockaddr*) &my_addr;
+ sa_len = sizeof(struct sockaddr_in);
+ }
+
+ if (connect(conn_sock, sa, sa_len) == -1)
+ {
+ perror("fail on connect");
+ return 1;
+ }
+
+ sem_wait(mutex);
+ *connection_count += 1;
+ sem_post(mutex);
+
+ int bursts = 5*(random() % 10) + 1;
+ int b;
+ int sum = 0;
+
+ for (b=0; b < bursts; b++)
+ {
+ int parts = 20*(random() % 10) + 1;
+ int j;
+
+ sum += parts*strlen(data);
+ for (j = 0; j < parts; j++)
+ {
+ strncpy(buf + (j*strlen(data)), data, strlen(data));
+ }
+
+ if (write(conn_sock, buf, parts * strlen(data)) == -1)
+ {
+ perror("failed to send data");
+ return 1;
+ }
+ usleep(100*(random()%100));
+ }
+
+ snprintf(msg, MSG_MAX, "sent %i bytes (bursts: %i)", sum, bursts);
+ debug(msg);
+ snprintf(msg, MSG_MAX, "closing connection on port %i", port);
+ debug(msg);
+
+ close(conn_sock);
+ } while (cont && (*term_flag) == 0);
+
+ return 0;
+}
+
+int main(int argc, char **argv)
+{
+ int rc;
+ int p;
+ char port_str[256];
+ char str_port_start[128];
+ char str_port_end[128];
+ char host_str[16] = "\0";
+ int start_port;
+ int end_port;
+ int opt;
+ char *delimiter;
+ struct sigaction sa;
+ int shm;
+ int ipv6 = 0;
+
+ term_flag = mmap(NULL, sizeof *term_flag, PROT_READ | PROT_WRITE,
+ MAP_SHARED | MAP_ANONYMOUS, -1, 0);
+ *term_flag = 0;
+
+ connection_count = mmap(NULL, sizeof *connection_count, PROT_READ | PROT_WRITE,
+ MAP_SHARED | MAP_ANONYMOUS, -1, 0);
+ *connection_count = 0;
+
+ /* counter synchronization stuff - semaphore and shared memory */
+ if ((shm = shm_open("myshm", O_RDWR | O_CREAT, S_IRWXU)) < 0) {
+ perror("shm_open");
+ exit(1);
+ }
+
+ if ( ftruncate(shm, sizeof(sem_t)) < 0 ) {
+ perror("ftruncate");
+ exit(1);
+ }
+
+ /* place shared mutex into shared memory */
+ if ((mutex = (sem_t*) mmap(NULL, sizeof(sem_t), PROT_READ | PROT_WRITE, MAP_SHARED, shm, 0)) == MAP_FAILED) {
+ perror("mmap");
+ exit(1);
+ }
+
+ if( sem_init(mutex,1,1) < 0)
+ {
+ perror("semaphore initilization");
+ exit(0);
+ }
+
+ /* signal handling */
+ memset(&sa, 0, sizeof(sa));
+
+ sa.sa_handler = &terminate_connections;
+ sigaction(SIGTERM, &sa, NULL);
+ sigaction(SIGINT, &sa, NULL);
+
+ handlers_count = 0;
+
+ /* collect program args */
+ while ((opt = getopt(argc, argv, "p:a:dc6")) != -1) {
+ switch (opt) {
+ case 'p':
+ strncpy(port_str, optarg, 256);
+ port_str[256-1]='\0';
+ delimiter = strchr(port_str, '-');
+ if (delimiter == NULL)
+ {
+ usage();
+ return 1;
+ }
+ strncpy(str_port_start, port_str, delimiter - port_str);
+ str_port_start[delimiter - port_str] = '\0';
+ strncpy(str_port_end, delimiter+1, strlen(port_str) - (delimiter+1-port_str));
+ start_port = atoi(str_port_start);
+ end_port = atoi(str_port_end);
+ break;
+ case 'a':
+ strncpy(host_str, optarg, 64);
+ host_str[16-1] = '\0';
+ break;
+ case 'd':
+ debug_on = 1;
+ break;
+ case 'c':
+ cont = 1;
+ break;
+ case '6':
+ ipv6 = 1;
+ break;
+ }
+ }
+
+ if (strlen(host_str) == 0)
+ {
+ usage();
+ return 1;
+ }
+
+ /* spawn process to handle every port specified */
+ for (p = start_port; p < end_port; p++){
+ if ((rc = fork()) > 0)
+ {
+ /* parent, add pid to the list */
+ connection_handlers[handlers_count++] = rc;
+ }
+ else if (rc == 0)
+ {
+ /* child */
+ sa.sa_handler = SIG_DFL;
+ sigaction(SIGTERM, &sa, NULL);
+ sigaction(SIGINT, &sa, NULL);
+ handle_connections(host_str, p, ipv6);
+ return 0;
+ }
+ }
+
+ /* gather children */
+ int child_status;
+ int i;
+ for (i=0; i < handlers_count; i++)
+ {
+ wait(&child_status);
+ debug("worker finished");
+ }
+
+ debug("tcp_connect finished");
+
+ printf("made %i connections\n", *connection_count);
+
+ return 0;
+}
diff --git a/regression-tests/tests/21/test_tools/tcp_conn/tcp_listen.c b/regression-tests/tests/21/test_tools/tcp_conn/tcp_listen.c
new file mode 100644
index 0000000..7a292fe
--- /dev/null
+++ b/regression-tests/tests/21/test_tools/tcp_conn/tcp_listen.c
@@ -0,0 +1,330 @@
+#include <stdio.h>
+#include <unistd.h>
+#include <string.h>
+#include <stdlib.h>
+#include <sys/wait.h>
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
+#include <netinet/ip.h>
+#include <arpa/inet.h>
+
+#include <errno.h>
+#include <signal.h>
+#include <semaphore.h>
+#include <sys/mman.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+
+#define IPCKEY 5678
+
+int listener_count;
+int listeners[1024];
+int *connection_count;
+
+int debug_on = 0;
+int cont = 0;
+int *term_flag;
+
+sem_t *mutex;
+
+int usage()
+{
+ printf("./tcp_listen -p [port_range] -a [ipaddr] [-d] [-c] [-6]\n");
+ return 0;
+}
+
+void debug(char* msg)
+{
+ if (debug_on)
+ {
+ printf("Debug: %s\n", msg);
+ }
+}
+
+#define MSG_MAX 256
+char msg[MSG_MAX];
+
+void terminate_connections(int p)
+{
+ debug("signal received, killing servers");
+ *term_flag = 1;
+}
+
+int handle_connections(char* host, int port, int ipv6)
+{
+ int listen_sock;
+ struct sockaddr_in my_addr;
+ struct sockaddr_in6 my_addr6;
+ socklen_t my_addr_size = sizeof(my_addr);
+ socklen_t my_addr6_size = sizeof(my_addr6);
+ int remote_sock;
+ struct sockaddr_in remote;
+ struct sockaddr_in6 remote6;
+ socklen_t remote_size = sizeof(remote);
+ socklen_t remote6_size = sizeof(remote6);
+ char data[256];
+ int family;
+
+ snprintf(msg, MSG_MAX, "Starting listener on %s port %i", host, port);
+ debug(msg);
+
+ if (ipv6)
+ {
+ family = AF_INET6;
+ bzero(&my_addr6, my_addr6_size);
+ my_addr6.sin6_family = family;
+ my_addr6.sin6_port = htons(port);
+ if (inet_pton(AF_INET6, host, &(my_addr6.sin6_addr)) != 1)
+ {
+ printf("failed on inet_pton()\n");
+ return 1;
+ }
+ }
+ else
+ {
+ family = AF_INET;
+ bzero(&my_addr, my_addr_size);
+ my_addr.sin_family = family;
+ my_addr.sin_port = htons(port);
+ if (inet_aton(host, &(my_addr.sin_addr)) == 0)
+ {
+ printf("failed on inet_aton()\n");
+ return 1;
+ }
+ }
+
+ if ((listen_sock = socket(family, SOCK_STREAM, 0)) == -1)
+ {
+ perror("fail on socket creation");
+ return 1;
+ }
+
+ int on = 1;
+ if (setsockopt(listen_sock, SOL_SOCKET, SO_REUSEADDR, (const char*) &on,
+ sizeof(on)) == -1)
+ {
+ perror("fail on setsockopt");
+ return 1;
+ }
+
+ struct sockaddr* sa;
+ socklen_t sa_len;
+ if (ipv6)
+ {
+ sa = (struct sockaddr*) &my_addr6;
+ sa_len = my_addr6_size;
+ }
+ else
+ {
+ sa = (struct sockaddr*) &my_addr;
+ sa_len = my_addr_size;
+ }
+
+ if (bind(listen_sock, sa, sa_len))
+ {
+ perror("fail on bind");
+ return 1;
+ }
+
+ if (listen(listen_sock, 0))
+ {
+ perror("fail on listen");
+ return 1;
+ }
+
+ do
+ {
+ struct in_addr ra = remote.sin_addr;
+ struct in6_addr ra6 = remote6.sin6_addr;
+ char host_address_str[256];
+ ssize_t read_rc;
+ struct sockaddr* r_sockaddr;
+ socklen_t* r_sockaddr_size;
+
+ if (ipv6)
+ {
+ bzero(&remote6, remote6_size);
+ r_sockaddr = (struct sockaddr*) &remote6;
+ r_sockaddr_size = &remote6_size;
+ }
+ else
+ {
+ bzero(&remote, remote_size);
+ r_sockaddr = (struct sockaddr*) &remote;
+ r_sockaddr_size = &remote_size;
+ }
+
+ /* handle single connection */
+ remote_sock = accept(listen_sock, r_sockaddr, r_sockaddr_size);
+ if (remote_sock == -1)
+ {
+ perror("failure on accept");
+ close(listen_sock);
+ return 1;
+ }
+
+ sem_wait(mutex);
+ *connection_count += 1;
+ sem_post(mutex);
+
+ if (ipv6)
+ inet_ntop(AF_INET6, &ra6, host_address_str, 255);
+ else
+ inet_ntop(AF_INET, &ra, host_address_str, 255);
+
+ snprintf(msg, MSG_MAX, "accepted connection from host %s port %i", host_address_str, port);
+ debug(msg);
+
+ int sum = 0;
+ while (read_rc = read(remote_sock, &data, 256))
+ {
+ sum += read_rc;
+ }
+
+ snprintf(msg, MSG_MAX, "connection closed, read %d bytes (%i)", sum, port);
+ debug(msg);
+ close(remote_sock);
+ } while (cont && (*term_flag) == 0);
+
+ close(listen_sock);
+
+ return 0;
+}
+
+int main(int argc, char **argv)
+{
+ int rc;
+ int p;
+ char port_str[256];
+ char str_port_start[128];
+ char str_port_end[128];
+ char host_str[16] = "\0";
+ int start_port;
+ int end_port;
+ int opt;
+ char *delimiter;
+ struct sigaction sa;
+ struct sigaction sa2;
+ int shm;
+ int ipv6 = 0;
+
+ term_flag = mmap(NULL, sizeof *term_flag, PROT_READ | PROT_WRITE,
+ MAP_SHARED | MAP_ANONYMOUS, -1, 0);
+ *term_flag = 0;
+
+ connection_count = mmap(NULL, sizeof *connection_count, PROT_READ | PROT_WRITE,
+ MAP_SHARED | MAP_ANONYMOUS, -1, 0);
+ *connection_count = 0;
+
+ /* counter synchronization stuff - semaphore and shared memory */
+ if ((shm = shm_open("myshm", O_RDWR | O_CREAT, S_IRWXU)) < 0) {
+ perror("shm_open");
+ exit(1);
+ }
+
+ if ( ftruncate(shm, sizeof(sem_t)) < 0 ) {
+ perror("ftruncate");
+ exit(1);
+ }
+
+ /* place shared mutex into shared memory */
+ if ((mutex = (sem_t*) mmap(NULL, sizeof(sem_t), PROT_READ | PROT_WRITE, MAP_SHARED, shm, 0)) == MAP_FAILED) {
+ perror("mmap");
+ exit(1);
+ }
+
+ if( sem_init(mutex,1,1) < 0)
+ {
+ perror("semaphore initilization");
+ exit(0);
+ }
+
+ /* signal handling */
+ memset(&sa, 0, sizeof(sa));
+ memset(&sa2, 0, sizeof(sa2));
+
+ sa.sa_handler = &terminate_connections;
+ sigaction(SIGTERM, &sa, NULL);
+ sigaction(SIGINT, &sa, NULL);
+
+ /* collect program args */
+ while ((opt = getopt(argc, argv, "p:a:dc6")) != -1) {
+ switch (opt) {
+ case 'p':
+ strncpy(port_str, optarg, 256);
+ port_str[256-1]='\0';
+ delimiter = strchr(port_str, '-');
+ if (delimiter == NULL)
+ {
+ usage();
+ return 1;
+ }
+ strncpy(str_port_start, port_str, delimiter - port_str);
+ str_port_start[delimiter - port_str] = '\0';
+ strncpy(str_port_end, delimiter+1, strlen(port_str) - (delimiter+1-port_str));
+ start_port = atoi(str_port_start);
+ end_port = atoi(str_port_end);
+ break;
+ case 'a':
+ strncpy(host_str, optarg, 64);
+ host_str[16-1] = '\0';
+ break;
+ case 'd':
+ debug_on = 1;
+ break;
+ case 'c':
+ cont = 1;
+ break;
+ case '6':
+ ipv6 = 1;
+ break;
+ }
+ }
+
+ if (strlen(host_str) == 0)
+ {
+ usage();
+ return 1;
+ }
+
+ listener_count = 0;
+ /* spawn process to handle every port specified */
+ for (p = start_port; p < end_port; p++){
+ if ((rc = fork()) > 0)
+ {
+ /* parent, add pid to the list */
+ listeners[listener_count++] = rc;
+ }
+ else if (rc == 0)
+ {
+ /* child */
+ sa.sa_handler = SIG_DFL;
+ sigaction(SIGTERM, &sa, NULL);
+ sigaction(SIGINT, &sa, NULL);
+
+ /* run the main processing loop */
+ handle_connections(host_str, p, ipv6);
+ return 0;
+ }
+ }
+
+ /* gather children */
+ int child_status;
+ int i;
+ for (i=0; i < listener_count; i++)
+ {
+ while (wait(&child_status) == -1 && errno == EINTR)
+ {
+ ;
+ }
+ debug("worker finished");
+ }
+
+ debug("tcp_listener finished");
+
+ printf("handled %i connections\n", *connection_count);
+
+ return 0;
+}
diff --git a/regression-tests/tests/22/desc b/regression-tests/tests/22/desc
new file mode 100644
index 0000000..0882b9c
--- /dev/null
+++ b/regression-tests/tests/22/desc
@@ -0,0 +1,3 @@
+Two Slave Machine configs referencing the same machine
+
+https://github.com/jpirko/lnst/issues/32
diff --git a/regression-tests/tests/22/lnst-ctl.conf b/regression-tests/tests/22/lnst-ctl.conf
new file mode 100644
index 0000000..81f1561
--- /dev/null
+++ b/regression-tests/tests/22/lnst-ctl.conf
@@ -0,0 +1,2 @@
+[environment]
+machine_pool_dirs += ./pool
diff --git a/regression-tests/tests/22/pool/slave1.xml b/regression-tests/tests/22/pool/slave1.xml
new file mode 100644
index 0000000..f739d2b
--- /dev/null
+++ b/regression-tests/tests/22/pool/slave1.xml
@@ -0,0 +1,6 @@
+<slavemachine>
+ <params>
+ <param name="hostname" value="example.com"/>
+ <param name="libvirt_domain" value="example"/>
+ </params>
+</slavemachine>
diff --git a/regression-tests/tests/22/pool/slave2.xml b/regression-tests/tests/22/pool/slave2.xml
new file mode 100644
index 0000000..f739d2b
--- /dev/null
+++ b/regression-tests/tests/22/pool/slave2.xml
@@ -0,0 +1,6 @@
+<slavemachine>
+ <params>
+ <param name="hostname" value="example.com"/>
+ <param name="libvirt_domain" value="example"/>
+ </params>
+</slavemachine>
diff --git a/regression-tests/tests/22/recipe.xml b/regression-tests/tests/22/recipe.xml
new file mode 100644
index 0000000..7565af0
--- /dev/null
+++ b/regression-tests/tests/22/recipe.xml
@@ -0,0 +1,26 @@
+<lnstrecipe>
+ <network>
+ <host id="tm1">
+ <interfaces>
+ <eth id="nic1" label="testnet">
+ <addresses>
+ <address value="192.168.131.201/24"/>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ <host id="tm2">
+ <interfaces>
+ <eth id="nic1" label="testnet">
+ <addresses>
+ <address value="192.168.131.202/24"/>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ </network>
+
+ <task>
+ <run host="tm1" command="ip a"/>
+ </task>
+</lnstrecipe>
diff --git a/regression-tests/tests/22/run.sh b/regression-tests/tests/22/run.sh
new file mode 100755
index 0000000..14442b2
--- /dev/null
+++ b/regression-tests/tests/22/run.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+
+. ../lib.sh
+
+init_test
+
+lnst-ctl -c lnst-ctl.conf -d run recipe.xml | tee test.log
+rv=${PIPESTATUS[0]}
+
+log=`cat test.log`
+
+print_separator
+assert_status "error" "$rv"
+assert_log "error" "You have the same machine listed twice in your pool" "$log"
+
+rm -f test.log
+
+end_test
diff --git a/regression-tests/tests/23/desc b/regression-tests/tests/23/desc
new file mode 100644
index 0000000..a75ee4d
--- /dev/null
+++ b/regression-tests/tests/23/desc
@@ -0,0 +1,3 @@
+synced resources not visible in network namespaces
+
+https://github.com/jpirko/lnst/issues/93
diff --git a/regression-tests/tests/23/lnst-ctl.conf b/regression-tests/tests/23/lnst-ctl.conf
new file mode 100644
index 0000000..a4d654d
--- /dev/null
+++ b/regression-tests/tests/23/lnst-ctl.conf
@@ -0,0 +1,2 @@
+[environment]
+test_module_dirs = ./test_modules
diff --git a/regression-tests/tests/23/recipe.xml b/regression-tests/tests/23/recipe.xml
new file mode 100644
index 0000000..1866430
--- /dev/null
+++ b/regression-tests/tests/23/recipe.xml
@@ -0,0 +1,42 @@
+<lnstrecipe>
+ <network>
+ <host id="tm1">
+ <interfaces>
+ <eth id="nic1" label="testnet"/>
+ <veth_pair>
+ <veth id="veth1"/>
+ <veth id="veth2" netns="test_ns">
+ <addresses>
+ <address value="192.168.131.201/24"/>
+ </addresses>
+ </veth>
+ </veth_pair>
+ <bridge id="br">
+ <slaves>
+ <slave id="nic1"/>
+ <slave id="veth1"/>
+ </slaves>
+ </bridge>
+ </interfaces>
+ </host>
+ <host id="tm2">
+ <interfaces>
+ <eth id="nic1" label="testnet">
+ <addresses>
+ <address value="192.168.131.202/24"/>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ </network>
+
+ <task>
+ <run host="tm1" module="IcmpPing" netns="test_ns">
+ <options>
+ <option name="addr" value="{ip(tm2, nic1)}"/>
+ <option name="count" value="40"/>
+ <option name="interval" value="0"/>
+ </options>
+ </run>
+ </task>
+</lnstrecipe>
diff --git a/regression-tests/tests/23/run.sh b/regression-tests/tests/23/run.sh
new file mode 100755
index 0000000..a972660
--- /dev/null
+++ b/regression-tests/tests/23/run.sh
@@ -0,0 +1,19 @@
+#!/bin/bash
+
+. ../lib.sh
+
+init_test
+
+touch test_modules/*
+
+lnst-ctl -c lnst-ctl.conf -d run recipe.xml | tee test.log
+rv=${PIPESTATUS[0]}
+
+log=`cat test.log`
+
+print_separator
+assert_status "pass" "$rv"
+
+rm -f test.log
+
+end_test
diff --git a/regression-tests/tests/23/test_modules/IcmpPing.py b/regression-tests/tests/23/test_modules/IcmpPing.py
new file mode 100644
index 0000000..5b9d888
--- /dev/null
+++ b/regression-tests/tests/23/test_modules/IcmpPing.py
@@ -0,0 +1,71 @@
+"""
+This module defines icmp ping test
+
+Copyright 2011 Red Hat, Inc.
+Licensed under the GNU General Public License, version 2 as
+published by the Free Software Foundation; see COPYING for details.
+"""
+
+__author__ = """
+jpirko(a)redhat.com (Jiri Pirko)
+"""
+
+import logging
+import re
+from lnst.Common.TestsCommon import TestGeneric
+from lnst.Common.ExecCmd import exec_cmd
+
+class IcmpPing(TestGeneric):
+ def _compose_cmd(self):
+ addr = self.get_mopt("addr", opt_type="addr")
+ cmd = "ping %s" % addr
+ count = self.get_opt("count")
+ if count:
+ cmd += " -c %s" % count
+ interval = self.get_opt("interval")
+ if interval:
+ cmd += " -i %s" % interval
+ iface = self.get_opt("iface")
+ if iface:
+ cmd += " -I %s" % iface
+ size = self.get_opt("size")
+ if size:
+ cmd += " -s %s" % size
+ return cmd
+
+ def run(self):
+ cmd = self._compose_cmd()
+ limit_rate = self.get_opt("limit_rate", default=80)
+
+ data_stdout = exec_cmd(cmd, die_on_err=False)[0]
+ stat_pttr1 = r'(\d+) packets transmitted, (\d+) received'
+ stat_pttr2 = r'rtt min/avg/max/mdev = (\d+\.\d+)/(\d+\.\d+)/(\d+\.\d+)/(\d+\.\d+) ms'
+
+ match = re.search(stat_pttr1, data_stdout)
+ if not match:
+ res_data = {"msg": "expected pattern not found"}
+ return self.set_fail(res_data)
+
+ trans_pkts, recv_pkts = match.groups()
+ rate = int(round((float(recv_pkts) / float(trans_pkts)) * 100))
+ logging.debug("Transmitted \"%s\", received \"%s\", "
+ "rate \"%d%%\", limit_rate \"%d%%\""
+ % (trans_pkts, recv_pkts, rate, limit_rate))
+
+ res_data = {"rate": rate,
+ "limit_rate": limit_rate}
+
+ match = re.search(stat_pttr2, data_stdout)
+ if match:
+ tmin, tavg, tmax, tmdev = [float(x) for x in match.groups()]
+ logging.debug("rtt min \"%.3f\", avg \"%.3f\", max \"%.3f\", "
+ "mdev \"%.3f\"" % (tmin, tavg, tmax, tmdev))
+
+ res_data["rtt_min"] = tmin
+ res_data["rtt_max"] = tmax
+
+ if rate < limit_rate:
+ res_data["msg"] = "rate is lower than limit"
+ return self.set_fail(res_data)
+
+ return self.set_pass(res_data)
diff --git a/regression-tests/tests/24/desc b/regression-tests/tests/24/desc
new file mode 100644
index 0000000..5669380
--- /dev/null
+++ b/regression-tests/tests/24/desc
@@ -0,0 +1,6 @@
+timeout attribute is ignored
+
+This is tested by setting different timeouts to background commands and parsing
+logs to see if the test failed because of a timeout or finished succesfully.
+
+https://github.com/jpirko/lnst/issues/67
diff --git a/regression-tests/tests/24/recipe_fail.xml b/regression-tests/tests/24/recipe_fail.xml
new file mode 100644
index 0000000..39bfe3d
--- /dev/null
+++ b/regression-tests/tests/24/recipe_fail.xml
@@ -0,0 +1,33 @@
+<lnstrecipe>
+ <network>
+ <host id="tm1">
+ <interfaces>
+ <eth id="nic1" label="testnet">
+ <addresses>
+ <address value="192.168.131.201/24"/>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ <host id="tm2">
+ <interfaces>
+ <eth id="nic1" label="testnet">
+ <addresses>
+ <address value="192.168.131.202/24"/>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ </network>
+
+ <task>
+ <run host="tm1" module="IcmpPing" bg_id="test" timeout="10">
+ <options>
+ <option name="addr" value="{ip(tm2, nic1)}"/>
+ <option name="count" value="70"/>
+ <option name="interval" value="1"/>
+ </options>
+ </run>
+ <wait host="tm1" bg_id="test"/>
+ </task>
+</lnstrecipe>
diff --git a/regression-tests/tests/24/recipe_pass.xml b/regression-tests/tests/24/recipe_pass.xml
new file mode 100644
index 0000000..5896c33
--- /dev/null
+++ b/regression-tests/tests/24/recipe_pass.xml
@@ -0,0 +1,33 @@
+<lnstrecipe>
+ <network>
+ <host id="tm1">
+ <interfaces>
+ <eth id="nic1" label="testnet">
+ <addresses>
+ <address value="192.168.131.201/24"/>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ <host id="tm2">
+ <interfaces>
+ <eth id="nic1" label="testnet">
+ <addresses>
+ <address value="192.168.131.202/24"/>
+ </addresses>
+ </eth>
+ </interfaces>
+ </host>
+ </network>
+
+ <task>
+ <run host="tm1" module="IcmpPing" bg_id="test" timeout="30">
+ <options>
+ <option name="addr" value="{ip(tm2, nic1)}"/>
+ <option name="count" value="10"/>
+ <option name="interval" value="1"/>
+ </options>
+ </run>
+ <wait host="tm1" bg_id="test"/>
+ </task>
+</lnstrecipe>
diff --git a/regression-tests/tests/24/run.sh b/regression-tests/tests/24/run.sh
new file mode 100755
index 0000000..1aff4a3
--- /dev/null
+++ b/regression-tests/tests/24/run.sh
@@ -0,0 +1,22 @@
+#!/bin/bash
+
+. ../lib.sh
+
+init_test
+
+lnst-ctl -d run recipe_fail.xml | tee test.log
+rv1=${PIPESTATUS[0]}
+log1=`cat test.log`
+
+lnst-ctl -d run recipe_pass.xml | tee test.log
+rv2=${PIPESTATUS[0]}
+log2=`cat test.log`
+
+print_separator
+assert_status "fail" "$rv1"
+assert_log "INFO" "RPC connection to machine \w* timed out" "$log1"
+assert_status "pass" "$rv2"
+
+rm -f test.log
+
+end_test
9 years, 3 months
[lnst] XmlProcessing: handle invalid recipe exception
by Jiří Pírko
commit d6466702b5b3f0e95858fda46311db450af5ea86
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Fri Jan 16 14:06:03 2015 +0100
XmlProcessing: handle invalid recipe exception
When lnst-ctl reads an invalid recipe xml file it would crash with an
exception, ignoring any other recipes that should have been tested.
This commit fixes that issue by handling the exception and instead of
ending the controller, setting the recipe result to FAIL and continuing
to the next recipe if posible.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst-ctl | 26 +++++++++++++++++++-------
lnst/Controller/XmlProcessing.py | 2 +-
2 files changed, 20 insertions(+), 8 deletions(-)
---
diff --git a/lnst-ctl b/lnst-ctl
index d249c32..128b6df 100755
--- a/lnst-ctl
+++ b/lnst-ctl
@@ -24,6 +24,7 @@ from lnst.Common.Utils import mkdir_p
from lnst.Controller.NetTestController import NetTestController, NetTestError
from lnst.Controller.NetTestController import NoMatchError
from lnst.Controller.NetTestResultSerializer import NetTestResultSerializer
+from lnst.Controller.XmlProcessing import XmlProcessingError
RETVAL_PASS = 0
RETVAL_FAIL = 1
@@ -94,13 +95,24 @@ def get_recipe_result(action, file_path, log_ctl, res_serializer,
recipe_head_log_entry(file_path, matches)
res_serializer.add_recipe(file_path, matches)
- nettestctl = NetTestController(file_path, log_ctl,
- res_serializer=res_serializer,
- pool_checks=pool_checks,
- packet_capture=packet_capture,
- defined_aliases=defined_aliases,
- overriden_aliases=overriden_aliases,
- reduce_sync=reduce_sync)
+ res = {}
+ try:
+ nettestctl = NetTestController(file_path, log_ctl,
+ res_serializer=res_serializer,
+ pool_checks=pool_checks,
+ packet_capture=packet_capture,
+ defined_aliases=defined_aliases,
+ overriden_aliases=overriden_aliases,
+ reduce_sync=reduce_sync)
+ except XmlProcessingError as err:
+ log_exc_traceback()
+ logging.error(err)
+ res["passed"] = False
+ res["err_msg"] = str(err)
+ retval = RETVAL_ERR
+ res_serializer.set_recipe_result(res)
+ return retval
+
while True:
res = {}
if matches == 1:
diff --git a/lnst/Controller/XmlProcessing.py b/lnst/Controller/XmlProcessing.py
index 40debae..b8d1127 100644
--- a/lnst/Controller/XmlProcessing.py
+++ b/lnst/Controller/XmlProcessing.py
@@ -67,7 +67,7 @@ class XmlProcessingError(Exception):
if self._line or self._col:
loc = "%s%s:" % (line, col)
- return "%s:%s %s" % (filename, loc, self._msg)
+ return "Parser error: %s:%s %s" % (filename, loc, self._msg)
class XmlDataIterator:
def __init__(self, iterator):
9 years, 3 months
[PATCH] NetTestSlave: signal handling for lnst-slave in netns
by Ondrej Lichtner
From: Ondrej Lichtner <olichtne(a)redhat.com>
This commit modifies signal handling for lnst-slave processes running in
non-root network namespaces to:
* when a SIGHUP, SIGTERM or SIGINT is recieved resend this signal to the
parent process that is running in the root netns and it will
coordinate deconfiguration
* when SIGUSR1 is recieved the main server loop will be interrupted like
it would with the previous signal handling
This solves the issue of deconfiguration races and crashes happening
when doing Ctrl-C from the terminal after lnst-ctl config-only was
called.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
---
lnst/Slave/NetTestSlave.py | 13 ++++++++++++-
1 file changed, 12 insertions(+), 1 deletion(-)
diff --git a/lnst/Slave/NetTestSlave.py b/lnst/Slave/NetTestSlave.py
index c63c719..8eb1f99 100644
--- a/lnst/Slave/NetTestSlave.py
+++ b/lnst/Slave/NetTestSlave.py
@@ -516,6 +516,7 @@ class SlaveMethods:
self._server_handler.add_netns(netns, read_pipe)
return None
elif pid == 0:
+ self._slave_server.set_netns_sighandlers()
#create new network namespace
libc_name = ctypes.util.find_library("c")
#from sched.h
@@ -564,7 +565,7 @@ class SlaveMethods:
return False
else:
netns_pid = self._net_namespaces[netns]["pid"]
- os.kill(netns_pid, signal.SIGTERM)
+ os.kill(netns_pid, signal.SIGUSR1)
os.waitpid(netns_pid, 0)
logging.debug("Network namespace %s removed." % netns)
@@ -859,3 +860,13 @@ class NetTestSlave:
def _signal_die_handler(self, signum, frame):
logging.info("Caught signal %d -> dying" % signum)
self._finished = True
+
+ def _parent_resend_signal_handler(self, signum, frame):
+ logging.info("Caught signal %d -> resending to parent" % signum)
+ os.kill(os.getppid(), signum)
+
+ def set_netns_sighandlers(self):
+ signal.signal(signal.SIGHUP, self._parent_resend_signal_handler)
+ signal.signal(signal.SIGINT, self._parent_resend_signal_handler)
+ signal.signal(signal.SIGTERM, self._parent_resend_signal_handler)
+ signal.signal(signal.SIGUSR1, self._signal_die_handler)
--
2.1.0
9 years, 3 months
[lnst] regression-tests: update tests 6 and 7
by Jiří Pírko
commit 07e84868e8df02d117c64a5a2a2df9326bfe6626
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Fri Jan 16 14:06:02 2015 +0100
regression-tests: update tests 6 and 7
These two tests don't require the use of a custom pool so I updated them
to reflect that.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
regression-tests/tests/6/lnst-ctl.conf | 2 --
regression-tests/tests/6/run.sh | 6 +-----
regression-tests/tests/7/lnst-ctl.conf | 2 --
regression-tests/tests/7/run.sh | 6 +-----
4 files changed, 2 insertions(+), 14 deletions(-)
---
diff --git a/regression-tests/tests/6/run.sh b/regression-tests/tests/6/run.sh
index 3882d0d..02534e0 100755
--- a/regression-tests/tests/6/run.sh
+++ b/regression-tests/tests/6/run.sh
@@ -4,9 +4,7 @@
init_test
-ln -s ../../env/pool
-
-log=`lnst-ctl -c lnst-ctl.conf -d run recipe.xml`
+log=`lnst-ctl -d run recipe.xml`
rv=$?
echo "$log"
@@ -18,6 +16,4 @@ assert_log ".*" "3_\(\([a-fA-F0-9]\{2\}:\?\)\{6\}\)_\1_" "$log"
assert_status "pass" "$rv"
-rm -f ./pool
-
end_test
diff --git a/regression-tests/tests/7/run.sh b/regression-tests/tests/7/run.sh
index 3882d0d..02534e0 100755
--- a/regression-tests/tests/7/run.sh
+++ b/regression-tests/tests/7/run.sh
@@ -4,9 +4,7 @@
init_test
-ln -s ../../env/pool
-
-log=`lnst-ctl -c lnst-ctl.conf -d run recipe.xml`
+log=`lnst-ctl -d run recipe.xml`
rv=$?
echo "$log"
@@ -18,6 +16,4 @@ assert_log ".*" "3_\(\([a-fA-F0-9]\{2\}:\?\)\{6\}\)_\1_" "$log"
assert_status "pass" "$rv"
-rm -f ./pool
-
end_test
9 years, 3 months