Blame SOURCES/rear-bz1639705.patch

f25f8e
diff --git a/tests/setup1/README b/tests/setup1/README
f25f8e
index 75bc000b..1cc4faa8 100644
f25f8e
--- a/tests/setup1/README
f25f8e
+++ b/tests/setup1/README
f25f8e
@@ -3,7 +3,7 @@
f25f8e
                    +----------------------------------+
f25f8e
 
f25f8e
 
f25f8e
-You need a VM with 10 network interfaces (eth0 being the main interface).
f25f8e
+You need a VM with 13 network interfaces (eth0 being the main interface).
f25f8e
 All interfaces except eth0 can be non-reachable.
f25f8e
 
f25f8e
 kvm.xml is an example template of such VM.
f25f8e
@@ -12,10 +12,11 @@ kvm.xml is an example template of such VM.
f25f8e
 eth0		IP 192.168.122.x/24 default 192.168.122.1 (x=177)
f25f8e
 bond12		eth1 + eth2 mode=4 miimon=1000 IP 1.1.1.1
f25f8e
 bond34		eth3 + eth4 mode=1 miimon=100 IP 2.2.2.2 route 102.0.0.0/8
f25f8e
-team56		eth5 + eth6 IP 3.3.3.3 route 103.0.0.0/8
f25f8e
+team56		eth5 + eth6 lacp IP 3.3.3.3 route 103.0.0.0/8
f25f8e
 bridge78	eth7 + eth8 IP 4.4.4.4 route 104.0.0.0/8
f25f8e
 vlan1eth9	eth9.1 IP 5.5.5.5 route 105.0.0.0/8
f25f8e
 eth10		IP 6.6.6.6 route 106.0.0.0/8
f25f8e
+team1112	eth11 + eth12 activebackup IP 7.7.7.7 route 107.0.0.0/8
f25f8e
 
f25f8e
 routes:
f25f8e
 default via 192.168.122.1 dev eth0
f25f8e
@@ -24,23 +25,24 @@ default via 192.168.122.1 dev eth0
f25f8e
 104.0.0.0/8 via 4.4.4.254 dev bridge78
f25f8e
 105.0.0.0/8 via 5.5.5.254 dev eth9.1
f25f8e
 106.0.0.0/8 via 6.6.6.254 dev eth10
f25f8e
+107.0.0.0/8 via 7.7.7.254 dev team1112
f25f8e
 
f25f8e
 
f25f8e
 Running the unit tests:
f25f8e
 ----------------------
f25f8e
 
f25f8e
-After copying the files and making sure the script has been adapted,
f25f8e
+After copying the network configuration files and rebooting the system,
f25f8e
 
f25f8e
 from the VM, run the following command:
f25f8e
 
f25f8e
-# for i in $(seq 1 8); do ./tcase$i.sh; done
f25f8e
+# for i in $(seq 1 8); do ./tcase${i}.sh; done
f25f8e
 
f25f8e
 This will record the generated network+route files.
f25f8e
 
f25f8e
 Then to verify result, run the following command (this will take down the
f25f8e
 network, except eth0):
f25f8e
 
f25f8e
-# for i in $(seq 1 8); do ./verify.sh tcase$i_results; done
f25f8e
+# for i in $(seq 1 8); do ./verify.sh tcase${i}_results; done
f25f8e
 
f25f8e
 
f25f8e
 -------------------------------------------------------------------------------
f25f8e
@@ -51,92 +53,98 @@ Test Case #1: standard
f25f8e
 
f25f8e
 Expected results:
f25f8e
 
f25f8e
-team56 -> eth5
f25f8e
 default via 192.168.122.1 dev eth0
f25f8e
 102.0.0.0/8 via 2.2.2.254 dev bond34
f25f8e
-103.0.0.0/8 via 3.3.3.254 dev eth5
f25f8e
+103.0.0.0/8 via 3.3.3.254 dev team56
f25f8e
 104.0.0.0/8 via 4.4.4.254 dev bridge78
f25f8e
 105.0.0.0/8 via 5.5.5.254 dev eth9.1
f25f8e
 106.0.0.0/8 via 6.6.6.254 dev eth10
f25f8e
+107.0.0.0/8 via 7.7.7.254 dev team1112
f25f8e
 
f25f8e
 
f25f8e
 Test Case #2: simplification
f25f8e
 ------------
f25f8e
 
f25f8e
-SIMPLIFY_BONDING=y SIMPLIFY_BRIDGE=y
f25f8e
+SIMPLIFY_BONDING=y SIMPLIFY_BRIDGE=y SIMPLIFY_TEAMING=y
f25f8e
 
f25f8e
 Expected results:
f25f8e
 
f25f8e
-bond12 -> eth1
f25f8e
+bond12 -> bond12 (not simplified because mode=4)
f25f8e
 bond34 -> eth3
f25f8e
-team56 -> eth5
f25f8e
+team56 -> team56 (not simplified because runner=lacp)
f25f8e
 bridge78 -> eth7
f25f8e
+team1112 -> eth11
f25f8e
 default via 192.168.122.1 dev eth0
f25f8e
 102.0.0.0/8 via 2.2.2.254 dev eth3
f25f8e
-103.0.0.0/8 via 3.3.3.254 dev eth5
f25f8e
+103.0.0.0/8 via 3.3.3.254 dev team56
f25f8e
 104.0.0.0/8 via 4.4.4.254 dev eth7
f25f8e
 105.0.0.0/8 via 5.5.5.254 dev eth9.1
f25f8e
 106.0.0.0/8 via 6.6.6.254 dev eth10
f25f8e
+107.0.0.0/8 via 7.7.7.254 dev eth11
f25f8e
 
f25f8e
 
f25f8e
-Test Case #3: standard with eth2, eth4, eth6, eth8, eth10 DOWN
f25f8e
+Test Case #3: standard with eth2, eth4, eth6, eth8, eth10, eth12 DOWN
f25f8e
 ------------
f25f8e
 
f25f8e
-for eth in eth2 eth4 eth6 eth8 eth10; do ifdown $eth; done
f25f8e
+for eth in eth2 eth4 eth6 eth8 eth10 eth12; do ifdown $eth; done
f25f8e
 
f25f8e
 Expected results:
f25f8e
 
f25f8e
 eth2, eth4, eth6, eth8, eth10 not in file
f25f8e
 default via 192.168.122.1 dev eth0
f25f8e
 102.0.0.0/8 via 2.2.2.254 dev bond34
f25f8e
-103.0.0.0/8 via 3.3.3.254 dev eth5
f25f8e
+103.0.0.0/8 via 3.3.3.254 dev team56
f25f8e
 104.0.0.0/8 via 4.4.4.254 dev bridge78
f25f8e
 105.0.0.0/8 via 5.5.5.254 dev eth9.1
f25f8e
+107.0.0.0/8 via 7.7.7.254 dev team1112
f25f8e
 
f25f8e
 
f25f8e
-Test Case #4: simplification with eth2, eth4, eth6, eth8, eth10 DOWN
f25f8e
+Test Case #4: simplification with eth2, eth4, eth6, eth8, eth10, eth12 DOWN
f25f8e
 ------------
f25f8e
 
f25f8e
-for eth in eth2 eth4 eth6 eth8 eth10; do ifdown $eth; done
f25f8e
+for eth in eth2 eth4 eth6 eth8 eth10 eth12; do ifdown $eth; done
f25f8e
 
f25f8e
 Expected results:
f25f8e
 
f25f8e
-eth2, eth4, eth6, eth8, eth10 not in file
f25f8e
+eth4, eth6, eth8, eth10, eth12 not in file
f25f8e
 default via 192.168.122.1 dev eth0
f25f8e
 102.0.0.0/8 via 2.2.2.254 dev eth3
f25f8e
-103.0.0.0/8 via 3.3.3.254 dev eth5
f25f8e
+103.0.0.0/8 via 3.3.3.254 dev team56
f25f8e
 104.0.0.0/8 via 4.4.4.254 dev eth7
f25f8e
 105.0.0.0/8 via 5.5.5.254 dev eth9.1
f25f8e
+107.0.0.0/8 via 7.7.7.254 dev eth11
f25f8e
 
f25f8e
 
f25f8e
-Test Case #5: standard with eth1, eth3, eth5, eth7, eth9 DOWN
f25f8e
+Test Case #5: standard with eth1, eth3, eth5, eth7, eth9, eth11 DOWN
f25f8e
 ------------
f25f8e
 
f25f8e
-for eth in eth1 eth3 eth5 eth7 eth9; do ifdown $eth; done
f25f8e
+for eth in eth1 eth3 eth5 eth7 eth9 eth11; do ifdown $eth; done
f25f8e
 
f25f8e
 Expected results:
f25f8e
 
f25f8e
 eth2, eth4, eth6, eth8, eth10 not in file
f25f8e
 default via 192.168.122.1 dev eth0
f25f8e
 102.0.0.0/8 via 2.2.2.254 dev bond34
f25f8e
-103.0.0.0/8 via 3.3.3.254 dev eth6
f25f8e
+103.0.0.0/8 via 3.3.3.254 dev team56
f25f8e
 104.0.0.0/8 via 4.4.4.254 dev bridge78
f25f8e
 106.0.0.0/8 via 6.6.6.254 dev eth10
f25f8e
+107.0.0.0/8 via 7.7.7.254 dev team1112
f25f8e
 
f25f8e
 
f25f8e
-Test Case #6: simplification with eth1, eth3, eth5, eth7, eth9 DOWN
f25f8e
+Test Case #6: simplification with eth1, eth3, eth5, eth7, eth9, eth11 DOWN
f25f8e
 ------------
f25f8e
 
f25f8e
-for eth in eth1 eth3 eth5 eth7 eth9; do ifdown $eth; done
f25f8e
+for eth in eth1 eth3 eth5 eth7 eth9 eth11; do ifdown $eth; done
f25f8e
 
f25f8e
 Expected results:
f25f8e
 
f25f8e
-eth2, eth4, eth6, eth8, eth10 not in file
f25f8e
+eth4, eth6, eth8, eth10 not in file
f25f8e
 default via 192.168.122.1 dev eth0
f25f8e
 102.0.0.0/8 via 2.2.2.254 dev eth4
f25f8e
-103.0.0.0/8 via 3.3.3.254 dev eth6
f25f8e
+103.0.0.0/8 via 3.3.3.254 dev team56
f25f8e
 104.0.0.0/8 via 4.4.4.254 dev eth8
f25f8e
 106.0.0.0/8 via 6.6.6.254 dev eth10
f25f8e
+107.0.0.0/8 via 7.7.7.254 dev eth12
f25f8e
 
f25f8e
 
f25f8e
 Test Case #7: IP address mapping
f25f8e
@@ -149,6 +157,7 @@ bond34	2.2.2.100/16
f25f8e
 bridge78	4.4.4.100/24
f25f8e
 #eth9.1	5.5.5.100/24
f25f8e
 eth10	6.6.6.100/16
f25f8e
+team1112	7.7.7.100/16
f25f8e
 
f25f8e
 Expected results:
f25f8e
 
f25f8e
@@ -156,14 +165,15 @@ bond12 -> 1.1.1.100/16
f25f8e
 bond34 -> 2.2.2.100/16
f25f8e
 eth5 -> 3.3.3.3/16 (no mapping)
f25f8e
 bridge78 -> 4.4.4.100/24
f25f8e
-eth9.1 => 5.5.5.5/24 (no mapping)
f25f8e
-eth10 => 6.6.6.100/16
f25f8e
+eth9.1 -> 5.5.5.5/24 (no mapping)
f25f8e
+eth10 -> 6.6.6.100/16
f25f8e
+team1112 -> 7.7.7.100/16
f25f8e
 
f25f8e
 
f25f8e
 Test Case #8: IP address mapping & simplification
f25f8e
 ------------
f25f8e
 
f25f8e
-SIMPLIFY_BONDING=y SIMPLIFY_BRIDGE=y
f25f8e
+SIMPLIFY_BONDING=y SIMPLIFY_BRIDGE=y SIMPLIFY_TEAMING=y
f25f8e
 
f25f8e
 # cat mappings/ip_addresses 
f25f8e
 bond12	1.1.1.100/16
f25f8e
@@ -172,12 +182,14 @@ bond34	2.2.2.100/16
f25f8e
 bridge78	4.4.4.100/24
f25f8e
 #eth9.1	5.5.5.100/24
f25f8e
 eth10	6.6.6.100/16
f25f8e
+team1112	7.7.7.100/16
f25f8e
 
f25f8e
 Expected results:
f25f8e
 
f25f8e
-eth1 => 1.1.1.100/16
f25f8e
-eth3 => 2.2.2.100/16
f25f8e
-eth5 => 3.3.3.3/16 (no mapping)
f25f8e
-eth7 => 4.4.4.100/24
f25f8e
-eth9.1 => 5.5.5.5/24 (no mapping)
f25f8e
-eth10 => 6.6.6.100/16
f25f8e
+bond12 -> 1.1.1.100/16
f25f8e
+eth3 -> 2.2.2.100/16
f25f8e
+eth5 -> 3.3.3.3/16 (no mapping)
f25f8e
+eth7 -> 4.4.4.100/24
f25f8e
+eth9.1 -> 5.5.5.5/24 (no mapping)
f25f8e
+eth10 -> 6.6.6.100/16
f25f8e
+eth11 -> 7.7.7.100/16
f25f8e
diff --git a/tests/setup1/etc/sysconfig/network-scripts/ifcfg-eth11 b/tests/setup1/etc/sysconfig/network-scripts/ifcfg-eth11
f25f8e
new file mode 100644
f25f8e
index 00000000..f8709b3e
f25f8e
--- /dev/null
f25f8e
+++ b/tests/setup1/etc/sysconfig/network-scripts/ifcfg-eth11
f25f8e
@@ -0,0 +1,6 @@
f25f8e
+NAME="eth11"
f25f8e
+DEVICE="eth11"
f25f8e
+ONBOOT="yes"
f25f8e
+TEAM_MASTER="team1112"
f25f8e
+DEVICETYPE="TeamPort"
f25f8e
+TYPE="Ethernet"
f25f8e
diff --git a/tests/setup1/etc/sysconfig/network-scripts/ifcfg-eth12 b/tests/setup1/etc/sysconfig/network-scripts/ifcfg-eth12
f25f8e
new file mode 100644
f25f8e
index 00000000..a5d62722
f25f8e
--- /dev/null
f25f8e
+++ b/tests/setup1/etc/sysconfig/network-scripts/ifcfg-eth12
f25f8e
@@ -0,0 +1,6 @@
f25f8e
+NAME="eth12"
f25f8e
+DEVICE="eth12"
f25f8e
+ONBOOT="yes"
f25f8e
+TEAM_MASTER="team1112"
f25f8e
+DEVICETYPE="TeamPort"
f25f8e
+TYPE="Ethernet"
f25f8e
diff --git a/tests/setup1/etc/sysconfig/network-scripts/ifcfg-team1112 b/tests/setup1/etc/sysconfig/network-scripts/ifcfg-team1112
f25f8e
new file mode 100644
f25f8e
index 00000000..fd48fb47
f25f8e
--- /dev/null
f25f8e
+++ b/tests/setup1/etc/sysconfig/network-scripts/ifcfg-team1112
f25f8e
@@ -0,0 +1,9 @@
f25f8e
+DEVICE="team1112"
f25f8e
+TEAM_CONFIG='{"device":"team1112","runner":{"name":"activebackup"},"link_watch":{"name":"ethtool"},"ports":{"eth11":{"prio":-10,"sticky":true},"eth12":{"prio":100}}}'
f25f8e
+PROXY_METHOD="none"
f25f8e
+BROWSER_ONLY="no"
f25f8e
+NAME="team1112"
f25f8e
+ONBOOT="yes"
f25f8e
+DEVICETYPE="Team"
f25f8e
+IPADDR=7.7.7.7
f25f8e
+PREFIX=16
f25f8e
diff --git a/tests/setup1/etc/sysconfig/network-scripts/route-team1112 b/tests/setup1/etc/sysconfig/network-scripts/route-team1112
f25f8e
new file mode 100644
f25f8e
index 00000000..d3e82f33
f25f8e
--- /dev/null
f25f8e
+++ b/tests/setup1/etc/sysconfig/network-scripts/route-team1112
f25f8e
@@ -0,0 +1 @@
f25f8e
+107.0.0.0/8 via 7.7.7.254
f25f8e
diff --git a/tests/setup1/kvm.xml b/tests/setup1/kvm.xml
f25f8e
index 3e7e84aa..2e7d10cf 100644
f25f8e
--- a/tests/setup1/kvm.xml
f25f8e
+++ b/tests/setup1/kvm.xml
f25f8e
@@ -106,6 +106,14 @@
f25f8e
       <model type='virtio'/>
f25f8e
       <address type='pci' domain='0x0000' bus='0x00' slot='0x12' function='0x0'/>
f25f8e
     </interface>
f25f8e
+    <interface type='network'>
f25f8e
+      <model type='virtio'/>
f25f8e
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x13' function='0x0'/>
f25f8e
+    </interface>
f25f8e
+    <interface type='network'>
f25f8e
+      <model type='virtio'/>
f25f8e
+      <address type='pci' domain='0x0000' bus='0x00' slot='0x14' function='0x0'/>
f25f8e
+    </interface>
f25f8e
     <serial type='pty'>
f25f8e
       <target port='0'/>
f25f8e
     </serial>
f25f8e
diff --git a/tests/setup1/mappings/ip_addresses b/tests/setup1/mappings/ip_addresses
f25f8e
index 145300b9..102fdfcf 100644
f25f8e
--- a/tests/setup1/mappings/ip_addresses
f25f8e
+++ b/tests/setup1/mappings/ip_addresses
f25f8e
@@ -4,3 +4,4 @@ bond34	2.2.2.100/16
f25f8e
 bridge78	4.4.4.100/24
f25f8e
 #eth9.1	5.5.5.100/24
f25f8e
 eth10	6.6.6.100/16
f25f8e
+team1112	7.7.7.100/16
f25f8e
diff --git a/tests/setup1/run.sh b/tests/setup1/run.sh
f25f8e
index 8dbc436b..3de8a5ba 100644
f25f8e
--- a/tests/setup1/run.sh
f25f8e
+++ b/tests/setup1/run.sh
f25f8e
@@ -4,9 +4,9 @@ echo
f25f8e
 echo "$0"
f25f8e
 echo
f25f8e
 
f25f8e
-REAR_DIR="/path/to/rear/sources"
f25f8e
+REAR_DIR="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")/../..")"
f25f8e
 
f25f8e
-RESULT_DIR="/root/$(basename $0 .sh)_results"
f25f8e
+RESULT_DIR="$(readlink -f "$(dirname "${BASH_SOURCE[0]}")")/$(basename $0 .sh)_results"
f25f8e
 mkdir -p $RESULT_DIR
f25f8e
 
f25f8e
 function DebugPrint () {
f25f8e
@@ -41,9 +41,10 @@ function has_binary () {
f25f8e
 	which $1 >/dev/null 2>&1
f25f8e
 }
f25f8e
 
f25f8e
-TMP_DIR=/root/tmp
f25f8e
+TMP_DIR="/tmp/$(basename "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")")"
f25f8e
 
f25f8e
-rm -fr $TMP_DIR
f25f8e
+rm -fr $TMP_DIR >/dev/null 2>&1
f25f8e
+mkdir -p $TMP_DIR
f25f8e
 
f25f8e
 # Add to sed -e below to test "ip_link_supports_bridge='false'" (RHEL6)
f25f8e
 #    -e "s#\$ip_link_supports_bridge#'false'#" \
f25f8e
@@ -53,13 +54,13 @@ rm -fr $TMP_DIR
f25f8e
 
f25f8e
 # Add to sed -e below to have code using 'brctl' instead of 'ip link' (RHEL6)
f25f8e
 #    -e "s#\$net_devices_have_lower_links#'false'#" \
f25f8e
-sed -e "s#^network_devices_setup_script=.*#network_devices_setup_script=/tmp/60-network-devices.sh#" \
f25f8e
-    $REAR_DIR/usr/share/rear/rescue/GNU/Linux/310_network_devices.sh > /tmp/310_network_devices.sh
f25f8e
-sed "s#^netscript=.*#netscript=/tmp/62-routing.sh#" $REAR_DIR/usr/share/rear/rescue/GNU/Linux/350_routing.sh > /tmp/350_routing.sh
f25f8e
+sed -e "s#^network_devices_setup_script=.*#network_devices_setup_script=$TMP_DIR/60-network-devices.sh#" \
f25f8e
+    $REAR_DIR/usr/share/rear/rescue/GNU/Linux/310_network_devices.sh > $TMP_DIR/310_network_devices.sh
f25f8e
+sed "s#^network_routing_setup_script=.*#network_routing_setup_script=$TMP_DIR/62-routing.sh#" $REAR_DIR/usr/share/rear/rescue/GNU/Linux/350_routing.sh > $TMP_DIR/350_routing.sh
f25f8e
 
f25f8e
-. /tmp/310_network_devices.sh
f25f8e
-. /tmp/350_routing.sh
f25f8e
+. $TMP_DIR/310_network_devices.sh
f25f8e
+. $TMP_DIR/350_routing.sh
f25f8e
 
f25f8e
-for f in /tmp/60-network-devices.sh /tmp/62-routing.sh; do
f25f8e
+for f in $TMP_DIR/60-network-devices.sh $TMP_DIR/62-routing.sh; do
f25f8e
 	grep -v "dev eth0" $f > $RESULT_DIR/$(basename $f)
f25f8e
 done
f25f8e
diff --git a/tests/setup1/tcase1.sh b/tests/setup1/tcase1.sh
f25f8e
index 597f3f5c..7b5032c7 100755
f25f8e
--- a/tests/setup1/tcase1.sh
f25f8e
+++ b/tests/setup1/tcase1.sh
f25f8e
@@ -1,6 +1,5 @@
f25f8e
 #!/bin/bash
f25f8e
 
f25f8e
 unset CONFIG_DIR
f25f8e
-#CONFIG_DIR=/root
f25f8e
 
f25f8e
-. ./run.sh
f25f8e
+. "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/run.sh
f25f8e
diff --git a/tests/setup1/tcase1_results/ip_a.expected b/tests/setup1/tcase1_results/ip_a.expected
f25f8e
index e039f6f9..415d840b 100644
f25f8e
--- a/tests/setup1/tcase1_results/ip_a.expected
f25f8e
+++ b/tests/setup1/tcase1_results/ip_a.expected
f25f8e
@@ -2,14 +2,15 @@ eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master b
f25f8e
 eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond12 state UP qlen 1000
f25f8e
 eth3: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond34 state UP qlen 1000
f25f8e
 eth4: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond34 state UP qlen 1000
f25f8e
-eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
-    inet 3.3.3.3/16 scope global eth5
f25f8e
-eth6: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
+eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team56 state UP qlen 1000
f25f8e
+eth6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team56 state UP qlen 1000
f25f8e
 eth7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bridge78 state UP qlen 1000
f25f8e
 eth8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bridge78 state UP qlen 1000
f25f8e
 eth9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
 eth10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
     inet 6.6.6.6/16 scope global eth10
f25f8e
+eth11: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team1112 state UP qlen 1000
f25f8e
+eth12: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team1112 state UP qlen 1000
f25f8e
 bond12: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
     inet 1.1.1.1/16 scope global bond12
f25f8e
 bond34: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
@@ -18,3 +19,7 @@ bridge78: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen
f25f8e
     inet 4.4.4.4/24 scope global bridge78
f25f8e
 eth9.1@eth9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
     inet 5.5.5.5/24 scope global eth9.1
f25f8e
+team1112: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+    inet 7.7.7.7/16 scope global team1112
f25f8e
+team56: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+    inet 3.3.3.3/16 scope global team56
f25f8e
diff --git a/tests/setup1/tcase1_results/ip_r.expected b/tests/setup1/tcase1_results/ip_r.expected
f25f8e
index 0e5ee87c..f246714c 100644
f25f8e
--- a/tests/setup1/tcase1_results/ip_r.expected
f25f8e
+++ b/tests/setup1/tcase1_results/ip_r.expected
f25f8e
@@ -3,9 +3,11 @@
f25f8e
 104.0.0.0/8 via 4.4.4.254 
f25f8e
 105.0.0.0/8 via 5.5.5.254 
f25f8e
 106.0.0.0/8 via 6.6.6.254 
f25f8e
+107.0.0.0/8 via 7.7.7.254 
f25f8e
 1.1.0.0/16 proto kernel scope link src 1.1.1.1 
f25f8e
 2.2.0.0/16 proto kernel scope link src 2.2.2.2 
f25f8e
 3.3.0.0/16 proto kernel scope link src 3.3.3.3 
f25f8e
 4.4.4.0/24 proto kernel scope link src 4.4.4.4 
f25f8e
 5.5.5.0/24 proto kernel scope link src 5.5.5.5 
f25f8e
 6.6.0.0/16 proto kernel scope link src 6.6.6.6 
f25f8e
+7.7.0.0/16 proto kernel scope link src 7.7.7.7 
f25f8e
diff --git a/tests/setup1/tcase2.sh b/tests/setup1/tcase2.sh
f25f8e
index faa39396..65d1aa34 100755
f25f8e
--- a/tests/setup1/tcase2.sh
f25f8e
+++ b/tests/setup1/tcase2.sh
f25f8e
@@ -1,9 +1,9 @@
f25f8e
 #!/bin/bash
f25f8e
 
f25f8e
 unset CONFIG_DIR
f25f8e
-#CONFIG_DIR=/root
f25f8e
 
f25f8e
 export SIMPLIFY_BONDING=y
f25f8e
 export SIMPLIFY_BRIDGE=y
f25f8e
+export SIMPLIFY_TEAMING=y
f25f8e
 
f25f8e
-. ./run.sh
f25f8e
+. "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/run.sh
f25f8e
diff --git a/tests/setup1/tcase2_results/ip_a.expected b/tests/setup1/tcase2_results/ip_a.expected
f25f8e
index 51280843..21c5e686 100644
f25f8e
--- a/tests/setup1/tcase2_results/ip_a.expected
f25f8e
+++ b/tests/setup1/tcase2_results/ip_a.expected
f25f8e
@@ -1,17 +1,22 @@
f25f8e
-eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
-    inet 1.1.1.1/16 scope global eth1
f25f8e
-eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
+bond12: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+    inet 1.1.1.1/16 scope global bond12
f25f8e
+eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond12 state UP qlen 1000
f25f8e
+eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond12 state UP qlen 1000
f25f8e
 eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
     inet 2.2.2.2/16 scope global eth3
f25f8e
 eth4: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
-eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
-    inet 3.3.3.3/16 scope global eth5
f25f8e
-eth6: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
+eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team56 state UP qlen 1000
f25f8e
+eth6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team56 state UP qlen 1000
f25f8e
 eth7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
     inet 4.4.4.4/24 scope global eth7
f25f8e
 eth8: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 eth9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
 eth10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
     inet 6.6.6.6/16 scope global eth10
f25f8e
+eth11: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
+    inet 7.7.7.7/16 scope global eth11
f25f8e
+eth12: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 eth9.1@eth9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
     inet 5.5.5.5/24 scope global eth9.1
f25f8e
+team56: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+    inet 3.3.3.3/16 scope global team56
f25f8e
diff --git a/tests/setup1/tcase2_results/ip_r.expected b/tests/setup1/tcase2_results/ip_r.expected
f25f8e
index 0e5ee87c..f246714c 100644
f25f8e
--- a/tests/setup1/tcase2_results/ip_r.expected
f25f8e
+++ b/tests/setup1/tcase2_results/ip_r.expected
f25f8e
@@ -3,9 +3,11 @@
f25f8e
 104.0.0.0/8 via 4.4.4.254 
f25f8e
 105.0.0.0/8 via 5.5.5.254 
f25f8e
 106.0.0.0/8 via 6.6.6.254 
f25f8e
+107.0.0.0/8 via 7.7.7.254 
f25f8e
 1.1.0.0/16 proto kernel scope link src 1.1.1.1 
f25f8e
 2.2.0.0/16 proto kernel scope link src 2.2.2.2 
f25f8e
 3.3.0.0/16 proto kernel scope link src 3.3.3.3 
f25f8e
 4.4.4.0/24 proto kernel scope link src 4.4.4.4 
f25f8e
 5.5.5.0/24 proto kernel scope link src 5.5.5.5 
f25f8e
 6.6.0.0/16 proto kernel scope link src 6.6.6.6 
f25f8e
+7.7.0.0/16 proto kernel scope link src 7.7.7.7 
f25f8e
diff --git a/tests/setup1/tcase3.sh b/tests/setup1/tcase3.sh
f25f8e
index 45ce04ce..7ab38f3b 100755
f25f8e
--- a/tests/setup1/tcase3.sh
f25f8e
+++ b/tests/setup1/tcase3.sh
f25f8e
@@ -1,10 +1,9 @@
f25f8e
 #!/bin/bash
f25f8e
 
f25f8e
 unset CONFIG_DIR
f25f8e
-#CONFIG_DIR=/root
f25f8e
 
f25f8e
-for eth in eth2 eth4 eth6 eth8 eth10; do ifdown $eth; done
f25f8e
+for eth in eth2 eth4 eth6 eth8 eth10 eth12; do ifdown $eth; done
f25f8e
 
f25f8e
-. ./run.sh
f25f8e
+. "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/run.sh
f25f8e
 
f25f8e
-for eth in eth2 eth4 eth6 eth8 eth10; do ifup $eth; done
f25f8e
+for eth in eth2 eth4 eth6 eth8 eth10 eth12; do ifup $eth; done
f25f8e
diff --git a/tests/setup1/tcase3_results/ip_a.expected b/tests/setup1/tcase3_results/ip_a.expected
f25f8e
index 9adf521d..6071fb27 100644
f25f8e
--- a/tests/setup1/tcase3_results/ip_a.expected
f25f8e
+++ b/tests/setup1/tcase3_results/ip_a.expected
f25f8e
@@ -2,13 +2,14 @@ eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master b
f25f8e
 eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 eth3: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond34 state UP qlen 1000
f25f8e
 eth4: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
-eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
-    inet 3.3.3.3/16 scope global eth5
f25f8e
+eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team56 state UP qlen 1000
f25f8e
 eth6: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 eth7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bridge78 state UP qlen 1000
f25f8e
 eth8: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 eth9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
 eth10: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
+eth11: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team1112 state UP qlen 1000
f25f8e
+eth12: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 bond12: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
     inet 1.1.1.1/16 scope global bond12
f25f8e
 bond34: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
@@ -17,3 +18,7 @@ bridge78: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen
f25f8e
     inet 4.4.4.4/24 scope global bridge78
f25f8e
 eth9.1@eth9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
     inet 5.5.5.5/24 scope global eth9.1
f25f8e
+team56: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+    inet 3.3.3.3/16 scope global team56
f25f8e
+team1112: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+    inet 7.7.7.7/16 scope global team1112
f25f8e
diff --git a/tests/setup1/tcase3_results/ip_r.expected b/tests/setup1/tcase3_results/ip_r.expected
f25f8e
index 62f16947..223a7db1 100644
f25f8e
--- a/tests/setup1/tcase3_results/ip_r.expected
f25f8e
+++ b/tests/setup1/tcase3_results/ip_r.expected
f25f8e
@@ -2,8 +2,10 @@
f25f8e
 103.0.0.0/8 via 3.3.3.254 
f25f8e
 104.0.0.0/8 via 4.4.4.254 
f25f8e
 105.0.0.0/8 via 5.5.5.254 
f25f8e
+107.0.0.0/8 via 7.7.7.254 
f25f8e
 1.1.0.0/16 proto kernel scope link src 1.1.1.1 
f25f8e
 2.2.0.0/16 proto kernel scope link src 2.2.2.2 
f25f8e
 3.3.0.0/16 proto kernel scope link src 3.3.3.3 
f25f8e
 4.4.4.0/24 proto kernel scope link src 4.4.4.4 
f25f8e
 5.5.5.0/24 proto kernel scope link src 5.5.5.5 
f25f8e
+7.7.0.0/16 proto kernel scope link src 7.7.7.7 
f25f8e
diff --git a/tests/setup1/tcase4.sh b/tests/setup1/tcase4.sh
f25f8e
index d28d2606..ac22ea73 100755
f25f8e
--- a/tests/setup1/tcase4.sh
f25f8e
+++ b/tests/setup1/tcase4.sh
f25f8e
@@ -1,13 +1,13 @@
f25f8e
 #!/bin/bash
f25f8e
 
f25f8e
 unset CONFIG_DIR
f25f8e
-#CONFIG_DIR=/root
f25f8e
 
f25f8e
 export SIMPLIFY_BONDING=y
f25f8e
 export SIMPLIFY_BRIDGE=y
f25f8e
+export SIMPLIFY_TEAMING=y
f25f8e
 
f25f8e
-for eth in eth2 eth4 eth6 eth8 eth10; do ifdown $eth; done
f25f8e
+for eth in eth2 eth4 eth6 eth8 eth10 eth12; do ifdown $eth; done
f25f8e
 
f25f8e
-. ./run.sh
f25f8e
+. "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/run.sh
f25f8e
 
f25f8e
-for eth in eth2 eth4 eth6 eth8 eth10; do ifup $eth; done
f25f8e
+for eth in eth2 eth4 eth6 eth8 eth10 eth12; do ifup $eth; done
f25f8e
diff --git a/tests/setup1/tcase4_results/ip_a.expected b/tests/setup1/tcase4_results/ip_a.expected
f25f8e
index e12bd4d0..7112b5af 100644
f25f8e
--- a/tests/setup1/tcase4_results/ip_a.expected
f25f8e
+++ b/tests/setup1/tcase4_results/ip_a.expected
f25f8e
@@ -1,16 +1,21 @@
f25f8e
-eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
-    inet 1.1.1.1/16 scope global eth1
f25f8e
+bond12: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+    inet 1.1.1.1/16 scope global bond12
f25f8e
+eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond12 state UP qlen 1000
f25f8e
 eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
     inet 2.2.2.2/16 scope global eth3
f25f8e
 eth4: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
-eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
-    inet 3.3.3.3/16 scope global eth5
f25f8e
+eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team56 state UP qlen 1000
f25f8e
 eth6: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 eth7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
     inet 4.4.4.4/24 scope global eth7
f25f8e
 eth8: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 eth9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
 eth10: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
+eth11: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
+    inet 7.7.7.7/16 scope global eth11
f25f8e
+eth12: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 eth9.1@eth9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
     inet 5.5.5.5/24 scope global eth9.1
f25f8e
+team56: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+    inet 3.3.3.3/16 scope global team56
f25f8e
diff --git a/tests/setup1/tcase4_results/ip_r.expected b/tests/setup1/tcase4_results/ip_r.expected
f25f8e
index 62f16947..223a7db1 100644
f25f8e
--- a/tests/setup1/tcase4_results/ip_r.expected
f25f8e
+++ b/tests/setup1/tcase4_results/ip_r.expected
f25f8e
@@ -2,8 +2,10 @@
f25f8e
 103.0.0.0/8 via 3.3.3.254 
f25f8e
 104.0.0.0/8 via 4.4.4.254 
f25f8e
 105.0.0.0/8 via 5.5.5.254 
f25f8e
+107.0.0.0/8 via 7.7.7.254 
f25f8e
 1.1.0.0/16 proto kernel scope link src 1.1.1.1 
f25f8e
 2.2.0.0/16 proto kernel scope link src 2.2.2.2 
f25f8e
 3.3.0.0/16 proto kernel scope link src 3.3.3.3 
f25f8e
 4.4.4.0/24 proto kernel scope link src 4.4.4.4 
f25f8e
 5.5.5.0/24 proto kernel scope link src 5.5.5.5 
f25f8e
+7.7.0.0/16 proto kernel scope link src 7.7.7.7 
f25f8e
diff --git a/tests/setup1/tcase5.sh b/tests/setup1/tcase5.sh
f25f8e
index adb09bda..dc786a8a 100755
f25f8e
--- a/tests/setup1/tcase5.sh
f25f8e
+++ b/tests/setup1/tcase5.sh
f25f8e
@@ -1,10 +1,9 @@
f25f8e
 #!/bin/bash
f25f8e
 
f25f8e
 unset CONFIG_DIR
f25f8e
-#CONFIG_DIR=/root
f25f8e
 
f25f8e
-for eth in eth1 eth3 eth5 eth7 eth9; do ifdown $eth; done
f25f8e
+for eth in eth1 eth3 eth5 eth7 eth9 eth11; do ifdown $eth; done
f25f8e
 
f25f8e
-. ./run.sh
f25f8e
+. "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/run.sh
f25f8e
 
f25f8e
-for eth in eth1 eth3 eth5 eth7 eth9; do ifup $eth; done
f25f8e
+for eth in eth1 eth3 eth5 eth7 eth9 eth11; do ifup $eth; done
f25f8e
diff --git a/tests/setup1/tcase5_results/ip_a.expected b/tests/setup1/tcase5_results/ip_a.expected
f25f8e
index bd1152c8..e55915fc 100644
f25f8e
--- a/tests/setup1/tcase5_results/ip_a.expected
f25f8e
+++ b/tests/setup1/tcase5_results/ip_a.expected
f25f8e
@@ -3,16 +3,21 @@ eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master b
f25f8e
 eth3: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 eth4: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond34 state UP qlen 1000
f25f8e
 eth5: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
-eth6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
-    inet 3.3.3.3/16 scope global eth6
f25f8e
+eth6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team56 state UP qlen 1000
f25f8e
 eth7: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 eth8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bridge78 state UP qlen 1000
f25f8e
 eth9: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 eth10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
     inet 6.6.6.6/16 scope global eth10
f25f8e
+eth11: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
+eth12: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team1112 state UP qlen 1000
f25f8e
 bond12: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
     inet 1.1.1.1/16 scope global bond12
f25f8e
 bond34: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
     inet 2.2.2.2/16 scope global bond34
f25f8e
 bridge78: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
     inet 4.4.4.4/24 scope global bridge78
f25f8e
+team1112: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+    inet 7.7.7.7/16 scope global team1112
f25f8e
+team56: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+    inet 3.3.3.3/16 scope global team56
f25f8e
diff --git a/tests/setup1/tcase5_results/ip_r.expected b/tests/setup1/tcase5_results/ip_r.expected
f25f8e
index 87a8f9fe..50638c8a 100644
f25f8e
--- a/tests/setup1/tcase5_results/ip_r.expected
f25f8e
+++ b/tests/setup1/tcase5_results/ip_r.expected
f25f8e
@@ -2,8 +2,10 @@
f25f8e
 103.0.0.0/8 via 3.3.3.254 
f25f8e
 104.0.0.0/8 via 4.4.4.254 
f25f8e
 106.0.0.0/8 via 6.6.6.254 
f25f8e
+107.0.0.0/8 via 7.7.7.254 
f25f8e
 1.1.0.0/16 proto kernel scope link src 1.1.1.1 
f25f8e
 2.2.0.0/16 proto kernel scope link src 2.2.2.2 
f25f8e
 3.3.0.0/16 proto kernel scope link src 3.3.3.3 
f25f8e
 4.4.4.0/24 proto kernel scope link src 4.4.4.4 
f25f8e
 6.6.0.0/16 proto kernel scope link src 6.6.6.6 
f25f8e
+7.7.0.0/16 proto kernel scope link src 7.7.7.7 
f25f8e
diff --git a/tests/setup1/tcase6.sh b/tests/setup1/tcase6.sh
f25f8e
index 0f11c0ae..698b88c3 100755
f25f8e
--- a/tests/setup1/tcase6.sh
f25f8e
+++ b/tests/setup1/tcase6.sh
f25f8e
@@ -1,13 +1,13 @@
f25f8e
 #!/bin/bash
f25f8e
 
f25f8e
 unset CONFIG_DIR
f25f8e
-#CONFIG_DIR=/root
f25f8e
 
f25f8e
 export SIMPLIFY_BONDING=y
f25f8e
 export SIMPLIFY_BRIDGE=y
f25f8e
+export SIMPLIFY_TEAMING=y
f25f8e
 
f25f8e
-for eth in eth1 eth3 eth5 eth7 eth9; do ifdown $eth; done
f25f8e
+for eth in eth1 eth3 eth5 eth7 eth9 eth11; do ifdown $eth; done
f25f8e
 
f25f8e
-. ./run.sh
f25f8e
+. "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/run.sh
f25f8e
 
f25f8e
-for eth in eth1 eth3 eth5 eth7 vlan1eth9; do ifup $eth; done
f25f8e
+for eth in eth1 eth3 eth5 eth7 vlan1eth9 eth11; do ifup $eth; done
f25f8e
diff --git a/tests/setup1/tcase6_results/ip_a.expected b/tests/setup1/tcase6_results/ip_a.expected
f25f8e
index c04e1e12..4f086280 100644
f25f8e
--- a/tests/setup1/tcase6_results/ip_a.expected
f25f8e
+++ b/tests/setup1/tcase6_results/ip_a.expected
f25f8e
@@ -1,15 +1,20 @@
f25f8e
+bond12: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+    inet 1.1.1.1/16 scope global bond12
f25f8e
 eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
-eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
-    inet 1.1.1.1/16 scope global eth2
f25f8e
+eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond12 state UP qlen 1000
f25f8e
 eth3: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 eth4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
     inet 2.2.2.2/16 scope global eth4
f25f8e
 eth5: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
-eth6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
-    inet 3.3.3.3/16 scope global eth6
f25f8e
+eth6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team56 state UP qlen 1000
f25f8e
 eth7: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 eth8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
     inet 4.4.4.4/24 scope global eth8
f25f8e
 eth9: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 eth10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
     inet 6.6.6.6/16 scope global eth10
f25f8e
+eth11: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
+eth12: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
+    inet 7.7.7.7/16 scope global eth12
f25f8e
+team56: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+    inet 3.3.3.3/16 scope global team56
f25f8e
diff --git a/tests/setup1/tcase6_results/ip_r.expected b/tests/setup1/tcase6_results/ip_r.expected
f25f8e
index 87a8f9fe..50638c8a 100644
f25f8e
--- a/tests/setup1/tcase6_results/ip_r.expected
f25f8e
+++ b/tests/setup1/tcase6_results/ip_r.expected
f25f8e
@@ -2,8 +2,10 @@
f25f8e
 103.0.0.0/8 via 3.3.3.254 
f25f8e
 104.0.0.0/8 via 4.4.4.254 
f25f8e
 106.0.0.0/8 via 6.6.6.254 
f25f8e
+107.0.0.0/8 via 7.7.7.254 
f25f8e
 1.1.0.0/16 proto kernel scope link src 1.1.1.1 
f25f8e
 2.2.0.0/16 proto kernel scope link src 2.2.2.2 
f25f8e
 3.3.0.0/16 proto kernel scope link src 3.3.3.3 
f25f8e
 4.4.4.0/24 proto kernel scope link src 4.4.4.4 
f25f8e
 6.6.0.0/16 proto kernel scope link src 6.6.6.6 
f25f8e
+7.7.0.0/16 proto kernel scope link src 7.7.7.7 
f25f8e
diff --git a/tests/setup1/tcase7.sh b/tests/setup1/tcase7.sh
f25f8e
index 57b3cdff..7dc07f63 100755
f25f8e
--- a/tests/setup1/tcase7.sh
f25f8e
+++ b/tests/setup1/tcase7.sh
f25f8e
@@ -1,5 +1,5 @@
f25f8e
 #!/bin/bash
f25f8e
 
f25f8e
-CONFIG_DIR=/root
f25f8e
+CONFIG_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
f25f8e
 
f25f8e
-. ./run.sh
f25f8e
+. "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/run.sh
f25f8e
diff --git a/tests/setup1/tcase7_results/ip_a.expected b/tests/setup1/tcase7_results/ip_a.expected
f25f8e
index c6ace88f..dba7dab6 100644
f25f8e
--- a/tests/setup1/tcase7_results/ip_a.expected
f25f8e
+++ b/tests/setup1/tcase7_results/ip_a.expected
f25f8e
@@ -2,14 +2,15 @@ eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master b
f25f8e
 eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond12 state UP qlen 1000
f25f8e
 eth3: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond34 state UP qlen 1000
f25f8e
 eth4: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond34 state UP qlen 1000
f25f8e
-eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
-    inet 3.3.3.3/16 scope global eth5
f25f8e
-eth6: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
+eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team56 state UP qlen 1000
f25f8e
+eth6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team56 state UP qlen 1000
f25f8e
 eth7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bridge78 state UP qlen 1000
f25f8e
 eth8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bridge78 state UP qlen 1000
f25f8e
 eth9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
 eth10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
     inet 6.6.6.100/16 scope global eth10
f25f8e
+eth11: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team1112 state UP qlen 1000
f25f8e
+eth12: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team1112 state UP qlen 1000
f25f8e
 bond12: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
     inet 1.1.1.100/16 scope global bond12
f25f8e
 bond34: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
@@ -18,3 +19,7 @@ bridge78: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen
f25f8e
     inet 4.4.4.100/24 scope global bridge78
f25f8e
 eth9.1@eth9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
     inet 5.5.5.5/24 scope global eth9.1
f25f8e
+team1112: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+    inet 7.7.7.100/16 scope global team1112
f25f8e
+team56: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+    inet 3.3.3.3/16 scope global team56
f25f8e
diff --git a/tests/setup1/tcase7_results/ip_r.expected b/tests/setup1/tcase7_results/ip_r.expected
f25f8e
index 2481d7f3..a89163a6 100644
f25f8e
--- a/tests/setup1/tcase7_results/ip_r.expected
f25f8e
+++ b/tests/setup1/tcase7_results/ip_r.expected
f25f8e
@@ -3,9 +3,11 @@
f25f8e
 104.0.0.0/8 via 4.4.4.254 
f25f8e
 105.0.0.0/8 via 5.5.5.254 
f25f8e
 106.0.0.0/8 via 6.6.6.254 
f25f8e
+107.0.0.0/8 via 7.7.7.254 
f25f8e
 1.1.0.0/16 proto kernel scope link src 1.1.1.100 
f25f8e
 2.2.0.0/16 proto kernel scope link src 2.2.2.100 
f25f8e
 3.3.0.0/16 proto kernel scope link src 3.3.3.3 
f25f8e
 4.4.4.0/24 proto kernel scope link src 4.4.4.100 
f25f8e
 5.5.5.0/24 proto kernel scope link src 5.5.5.5 
f25f8e
 6.6.0.0/16 proto kernel scope link src 6.6.6.100 
f25f8e
+7.7.0.0/16 proto kernel scope link src 7.7.7.100 
f25f8e
diff --git a/tests/setup1/tcase8.sh b/tests/setup1/tcase8.sh
f25f8e
index c40c5e15..6982d005 100755
f25f8e
--- a/tests/setup1/tcase8.sh
f25f8e
+++ b/tests/setup1/tcase8.sh
f25f8e
@@ -1,8 +1,9 @@
f25f8e
 #!/bin/bash
f25f8e
 
f25f8e
-CONFIG_DIR=/root
f25f8e
+CONFIG_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
f25f8e
 
f25f8e
 export SIMPLIFY_BONDING=y
f25f8e
 export SIMPLIFY_BRIDGE=y
f25f8e
+export SIMPLIFY_TEAMING=y
f25f8e
 
f25f8e
-. ./run.sh
f25f8e
+. "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/run.sh
f25f8e
diff --git a/tests/setup1/tcase8_results/ip_a.expected b/tests/setup1/tcase8_results/ip_a.expected
f25f8e
index 6801434d..fb0e2d1e 100644
f25f8e
--- a/tests/setup1/tcase8_results/ip_a.expected
f25f8e
+++ b/tests/setup1/tcase8_results/ip_a.expected
f25f8e
@@ -1,17 +1,22 @@
f25f8e
-eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
-    inet 1.1.1.100/16 scope global eth1
f25f8e
-eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
+bond12: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+    inet 1.1.1.100/16 scope global bond12
f25f8e
+eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond12 state UP qlen 1000
f25f8e
+eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond12 state UP qlen 1000
f25f8e
 eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
     inet 2.2.2.100/16 scope global eth3
f25f8e
 eth4: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
-eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
-    inet 3.3.3.3/16 scope global eth5
f25f8e
-eth6: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
+eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team56 state UP qlen 1000
f25f8e
+eth6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team56 state UP qlen 1000
f25f8e
 eth7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
     inet 4.4.4.100/24 scope global eth7
f25f8e
 eth8: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 eth9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
 eth10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
     inet 6.6.6.100/16 scope global eth10
f25f8e
+eth11: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
+    inet 7.7.7.100/16 scope global eth11
f25f8e
+eth12: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 eth9.1@eth9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
     inet 5.5.5.5/24 scope global eth9.1
f25f8e
+team56: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+    inet 3.3.3.3/16 scope global team56
f25f8e
diff --git a/tests/setup1/tcase8_results/ip_r.expected b/tests/setup1/tcase8_results/ip_r.expected
f25f8e
index 2481d7f3..a89163a6 100644
f25f8e
--- a/tests/setup1/tcase8_results/ip_r.expected
f25f8e
+++ b/tests/setup1/tcase8_results/ip_r.expected
f25f8e
@@ -3,9 +3,11 @@
f25f8e
 104.0.0.0/8 via 4.4.4.254 
f25f8e
 105.0.0.0/8 via 5.5.5.254 
f25f8e
 106.0.0.0/8 via 6.6.6.254 
f25f8e
+107.0.0.0/8 via 7.7.7.254 
f25f8e
 1.1.0.0/16 proto kernel scope link src 1.1.1.100 
f25f8e
 2.2.0.0/16 proto kernel scope link src 2.2.2.100 
f25f8e
 3.3.0.0/16 proto kernel scope link src 3.3.3.3 
f25f8e
 4.4.4.0/24 proto kernel scope link src 4.4.4.100 
f25f8e
 5.5.5.0/24 proto kernel scope link src 5.5.5.5 
f25f8e
 6.6.0.0/16 proto kernel scope link src 6.6.6.100 
f25f8e
+7.7.0.0/16 proto kernel scope link src 7.7.7.100 
f25f8e
diff --git a/tests/setup1/verify.sh b/tests/setup1/verify.sh
f25f8e
index a9fd9c6c..146d017b 100755
f25f8e
--- a/tests/setup1/verify.sh
f25f8e
+++ b/tests/setup1/verify.sh
f25f8e
@@ -32,7 +32,7 @@ DEVICES="$( ls /sys/class/net/ | egrep -wv "(bonding_masters|eth0|lo)" )"
f25f8e
 
f25f8e
 for dev in $DEVICES; do
f25f8e
 	ip addr show dev $dev
f25f8e
-done 2>/dev/null | egrep -w "(mtu|inet)" | sed "s/^[0-9]*: //" > $tmpfile_ipa
f25f8e
+done 2>/dev/null | egrep -w "(mtu|inet)" | sed -e "s/^[0-9]*: //" -e "s/ group \S* / /" > $tmpfile_ipa
f25f8e
 
f25f8e
 for dev in $DEVICES; do
f25f8e
 	ip r show dev $dev
f25f8e
diff --git a/tests/setup2/README b/tests/setup2/README
f25f8e
index 40731f83..34b123fb 100644
f25f8e
--- a/tests/setup2/README
f25f8e
+++ b/tests/setup2/README
f25f8e
@@ -3,7 +3,7 @@
f25f8e
                    +----------------------------------+
f25f8e
 
f25f8e
 
f25f8e
-You need a VM with 10 network interfaces (eth0 being the main interface).
f25f8e
+You need a VM with 11 network interfaces (eth0 being the main interface).
f25f8e
 All interfaces except eth0 can be non-reachable.
f25f8e
 
f25f8e
 kvm.xml is an example template of such VM.
f25f8e
@@ -31,18 +31,18 @@ default via 192.168.122.1 dev eth0
f25f8e
 Running the unit tests:
f25f8e
 ----------------------
f25f8e
 
f25f8e
-After copying the files and making sure the script has been adapted,
f25f8e
+After copying the network configuration files and rebooting the system,
f25f8e
 
f25f8e
 from the VM, run the following command:
f25f8e
 
f25f8e
-# for i in $(seq 1 8); do ./tcase$i.sh; done
f25f8e
+# for i in $(seq 1 8); do ./tcase${i}.sh; done
f25f8e
 
f25f8e
 This will record the generated network+route files.
f25f8e
 
f25f8e
 Then to verify result, run the following command (this will take down the
f25f8e
 network, except eth0):
f25f8e
 
f25f8e
-# for i in $(seq 1 8); do ./verify.sh tcase$i_results; done
f25f8e
+# for i in $(seq 1 8); do ./verify.sh tcase${i}_results; done
f25f8e
 
f25f8e
 
f25f8e
 -------------------------------------------------------------------------------
f25f8e
@@ -64,15 +64,15 @@ team89 -> eth8
f25f8e
 Test Case #2: simplification
f25f8e
 ------------
f25f8e
 
f25f8e
-SIMPLIFY_BONDING=y SIMPLIFY_BRIDGE=y
f25f8e
+SIMPLIFY_BONDING=y SIMPLIFY_BRIDGE=y SIMPLIFY_TEAMING=y
f25f8e
 
f25f8e
 Expected results:
f25f8e
 
f25f8e
-bond12 -> eth1
f25f8e
+bond12 -> bond12 (not simplified, because mode=4)
f25f8e
 bond34 -> eth3
f25f8e
 bridge2 -> eth3.2
f25f8e
 team567 -> eth5.5
f25f8e
-team89 -> eth8
f25f8e
+team89 -> team89 (not simplified, because runner=lacp)
f25f8e
 bridge3 -> eth10.3
f25f8e
 
f25f8e
 
f25f8e
@@ -100,7 +100,6 @@ for eth in eth2 eth4 eth6 eth8 eth10; do ifdown $eth; done
f25f8e
 Expected results:
f25f8e
 
f25f8e
 eth2, eth4, eth6, eth8, eth10 not in file
f25f8e
-bond12 -> eth1
f25f8e
 bond34 -> eth3
f25f8e
 bridge2 -> eth3.2
f25f8e
 team567 -> eth5.5
f25f8e
@@ -136,7 +135,6 @@ for eth in eth1 eth3 eth5 eth7 eth9; do ifdown $eth; done
f25f8e
 Expected results:
f25f8e
 
f25f8e
 eth2, eth4, eth6, eth8, eth10 not in file
f25f8e
-bond12 -> eth2
f25f8e
 bond34 -> eth4
f25f8e
 team567 -> eth6
f25f8e
 team89 -> eth8
f25f8e
@@ -168,7 +166,7 @@ bridge3 -> 4.4.4.100/24
f25f8e
 Test Case #8: IP address mapping & simplification
f25f8e
 ------------
f25f8e
 
f25f8e
-SIMPLIFY_BONDING=y SIMPLIFY_BRIDGE=y
f25f8e
+SIMPLIFY_BONDING=y SIMPLIFY_BRIDGE=y SIMPLIFY_TEAMING=y
f25f8e
 
f25f8e
 # cat mappings/ip_addresses 
f25f8e
 bond12.1	1.1.1.100/16
f25f8e
diff --git a/tests/setup2/tcase1.sh b/tests/setup2/tcase1.sh
f25f8e
index 597f3f5c..7b5032c7 100755
f25f8e
--- a/tests/setup2/tcase1.sh
f25f8e
+++ b/tests/setup2/tcase1.sh
f25f8e
@@ -1,6 +1,5 @@
f25f8e
 #!/bin/bash
f25f8e
 
f25f8e
 unset CONFIG_DIR
f25f8e
-#CONFIG_DIR=/root
f25f8e
 
f25f8e
-. ./run.sh
f25f8e
+. "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/run.sh
f25f8e
diff --git a/tests/setup2/tcase1_results/ip_a.expected b/tests/setup2/tcase1_results/ip_a.expected
f25f8e
index 8e36b66c..23a2d8df 100644
f25f8e
--- a/tests/setup2/tcase1_results/ip_a.expected
f25f8e
+++ b/tests/setup2/tcase1_results/ip_a.expected
f25f8e
@@ -14,10 +14,12 @@ eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master b
f25f8e
 eth3: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond34 state UP qlen 1000
f25f8e
 eth4: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond34 state UP qlen 1000
f25f8e
 eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
-eth5.5@eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
-    inet 3.3.3.3/16 scope global eth5.5
f25f8e
-eth6: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
-eth7: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
-eth8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
-eth8.3@eth8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master bridge3 state UP qlen 1000
f25f8e
-eth9: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
+eth5.5@eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master team567 state UP qlen 1000
f25f8e
+eth6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team567 state UP qlen 1000
f25f8e
+eth7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team567 state UP qlen 1000
f25f8e
+eth8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team89 state UP qlen 1000
f25f8e
+eth9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team89 state UP qlen 1000
f25f8e
+team567: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+    inet 3.3.3.3/16 scope global team567
f25f8e
+team89: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+team89.3@team89: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master bridge3 state UP qlen 1000
f25f8e
diff --git a/tests/setup2/tcase2.sh b/tests/setup2/tcase2.sh
f25f8e
index faa39396..65d1aa34 100755
f25f8e
--- a/tests/setup2/tcase2.sh
f25f8e
+++ b/tests/setup2/tcase2.sh
f25f8e
@@ -1,9 +1,9 @@
f25f8e
 #!/bin/bash
f25f8e
 
f25f8e
 unset CONFIG_DIR
f25f8e
-#CONFIG_DIR=/root
f25f8e
 
f25f8e
 export SIMPLIFY_BONDING=y
f25f8e
 export SIMPLIFY_BRIDGE=y
f25f8e
+export SIMPLIFY_TEAMING=y
f25f8e
 
f25f8e
-. ./run.sh
f25f8e
+. "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/run.sh
f25f8e
diff --git a/tests/setup2/tcase2_results/ip_a.expected b/tests/setup2/tcase2_results/ip_a.expected
f25f8e
index b2043ea2..097c6ed8 100644
f25f8e
--- a/tests/setup2/tcase2_results/ip_a.expected
f25f8e
+++ b/tests/setup2/tcase2_results/ip_a.expected
f25f8e
@@ -1,10 +1,11 @@
f25f8e
-eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
+bond12.1@bond12: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+    inet 1.1.1.1/16 scope global bond12.1
f25f8e
+bond12: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond12 state UP qlen 1000
f25f8e
 eth10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
 eth10.3@eth10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
     inet 4.4.4.4/24 scope global eth10.3
f25f8e
-eth1.1@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
-    inet 1.1.1.1/16 scope global eth1.1
f25f8e
-eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
+eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond12 state UP qlen 1000
f25f8e
 eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
 eth3.2@eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
     inet 2.2.2.2/24 scope global eth3.2
f25f8e
diff --git a/tests/setup2/tcase3.sh b/tests/setup2/tcase3.sh
f25f8e
index d23a1198..3b792b42 100755
f25f8e
--- a/tests/setup2/tcase3.sh
f25f8e
+++ b/tests/setup2/tcase3.sh
f25f8e
@@ -1,10 +1,9 @@
f25f8e
 #!/bin/bash
f25f8e
 
f25f8e
 unset CONFIG_DIR
f25f8e
-#CONFIG_DIR=/root
f25f8e
 
f25f8e
 for eth in eth2 eth4 eth6 eth8 eth10; do ifdown $eth; done
f25f8e
 
f25f8e
-. ./run.sh
f25f8e
+. "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/run.sh
f25f8e
 
f25f8e
 for eth in eth2 eth4 eth6 eth8 vlan3eth10; do ifup $eth; done
f25f8e
diff --git a/tests/setup2/tcase3_results/ip_a.expected b/tests/setup2/tcase3_results/ip_a.expected
f25f8e
index 0b0c00ba..6cbcf572 100644
f25f8e
--- a/tests/setup2/tcase3_results/ip_a.expected
f25f8e
+++ b/tests/setup2/tcase3_results/ip_a.expected
f25f8e
@@ -13,10 +13,12 @@ eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 eth3: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond34 state UP qlen 1000
f25f8e
 eth4: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
-eth5.5@eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
-    inet 3.3.3.3/16 scope global eth5.5
f25f8e
+eth5.5@eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master team567 state UP qlen 1000
f25f8e
 eth6: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
-eth7: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
+eth7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team567 state UP qlen 1000
f25f8e
 eth8: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
-eth9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
-eth9.3@eth9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master bridge3 state UP qlen 1000
f25f8e
+eth9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team89 state UP qlen 1000
f25f8e
+team567: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+    inet 3.3.3.3/16 scope global team567
f25f8e
+team89.3@team89: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master bridge3 state UP qlen 1000
f25f8e
+team89: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
diff --git a/tests/setup2/tcase4.sh b/tests/setup2/tcase4.sh
f25f8e
index f66236ff..5d8cfdd5 100755
f25f8e
--- a/tests/setup2/tcase4.sh
f25f8e
+++ b/tests/setup2/tcase4.sh
f25f8e
@@ -1,13 +1,13 @@
f25f8e
 #!/bin/bash
f25f8e
 
f25f8e
 unset CONFIG_DIR
f25f8e
-#CONFIG_DIR=/root
f25f8e
 
f25f8e
 export SIMPLIFY_BONDING=y
f25f8e
 export SIMPLIFY_BRIDGE=y
f25f8e
+export SIMPLIFY_TEAMING=y
f25f8e
 
f25f8e
 for eth in eth2 eth4 eth6 eth8 eth10; do ifdown $eth; done
f25f8e
 
f25f8e
-. ./run.sh
f25f8e
+. "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/run.sh
f25f8e
 
f25f8e
 for eth in eth2 eth4 eth6 eth8 vlan3eth10; do ifup $eth; done
f25f8e
diff --git a/tests/setup2/tcase4_results/ip_a.expected b/tests/setup2/tcase4_results/ip_a.expected
f25f8e
index 8171a018..6afa74e5 100644
f25f8e
--- a/tests/setup2/tcase4_results/ip_a.expected
f25f8e
+++ b/tests/setup2/tcase4_results/ip_a.expected
f25f8e
@@ -1,7 +1,8 @@
f25f8e
-eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
+bond12.1@bond12: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+    inet 1.1.1.1/16 scope global bond12.1
f25f8e
+bond12: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond12 state UP qlen 1000
f25f8e
 eth10: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
-eth1.1@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
-    inet 1.1.1.1/16 scope global eth1.1
f25f8e
 eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
 eth3.2@eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
@@ -13,6 +14,7 @@ eth5.5@eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP q
f25f8e
 eth6: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 eth7: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 eth8: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
-eth9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
-eth9.3@eth9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
-    inet 4.4.4.4/24 scope global eth9.3
f25f8e
+eth9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team89 state UP qlen 1000
f25f8e
+team89: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+team89.3@team89: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+    inet 4.4.4.4/24 scope global team89.3
f25f8e
diff --git a/tests/setup2/tcase5.sh b/tests/setup2/tcase5.sh
f25f8e
index 1085a80d..e332d9af 100755
f25f8e
--- a/tests/setup2/tcase5.sh
f25f8e
+++ b/tests/setup2/tcase5.sh
f25f8e
@@ -1,10 +1,9 @@
f25f8e
 #!/bin/bash
f25f8e
 
f25f8e
 unset CONFIG_DIR
f25f8e
-#CONFIG_DIR=/root
f25f8e
 
f25f8e
 for eth in eth1 eth3 eth5 eth7 eth9; do ifdown $eth; done
f25f8e
 
f25f8e
-. ./run.sh
f25f8e
+. "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/run.sh
f25f8e
 
f25f8e
 for eth in eth1 eth3 vlan5eth5 eth7 eth9; do ifup $eth; done
f25f8e
diff --git a/tests/setup2/tcase5_results/ip_a.expected b/tests/setup2/tcase5_results/ip_a.expected
f25f8e
index 4841575c..2d08e19c 100644
f25f8e
--- a/tests/setup2/tcase5_results/ip_a.expected
f25f8e
+++ b/tests/setup2/tcase5_results/ip_a.expected
f25f8e
@@ -14,9 +14,11 @@ eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master b
f25f8e
 eth3: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 eth4: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond34 state UP qlen 1000
f25f8e
 eth5: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
-eth6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
-    inet 3.3.3.3/16 scope global eth6
f25f8e
+eth6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team567 state UP qlen 1000
f25f8e
 eth7: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
-eth8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
-eth8.3@eth8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master bridge3 state UP qlen 1000
f25f8e
+eth8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team89 state UP qlen 1000
f25f8e
 eth9: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
+team567: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+    inet 3.3.3.3/16 scope global team567
f25f8e
+team89: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+team89.3@team89: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master bridge3 state UP qlen 1000
f25f8e
diff --git a/tests/setup2/tcase6.sh b/tests/setup2/tcase6.sh
f25f8e
index 998672bf..b9a5153f 100755
f25f8e
--- a/tests/setup2/tcase6.sh
f25f8e
+++ b/tests/setup2/tcase6.sh
f25f8e
@@ -1,13 +1,13 @@
f25f8e
 #!/bin/bash
f25f8e
 
f25f8e
 unset CONFIG_DIR
f25f8e
-#CONFIG_DIR=/root
f25f8e
 
f25f8e
 export SIMPLIFY_BONDING=y
f25f8e
 export SIMPLIFY_BRIDGE=y
f25f8e
+export SIMPLIFY_TEAMING=y
f25f8e
 
f25f8e
 for eth in eth1 eth3 eth5 eth7 eth9; do ifdown $eth; done
f25f8e
 
f25f8e
-. ./run.sh
f25f8e
+. "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/run.sh
f25f8e
 
f25f8e
 for eth in eth1 eth3 vlan5eth5 eth7 eth9; do ifup $eth; done
f25f8e
diff --git a/tests/setup2/tcase6_results/ip_a.expected b/tests/setup2/tcase6_results/ip_a.expected
f25f8e
index 879aff9b..4239377a 100644
f25f8e
--- a/tests/setup2/tcase6_results/ip_a.expected
f25f8e
+++ b/tests/setup2/tcase6_results/ip_a.expected
f25f8e
@@ -1,10 +1,11 @@
f25f8e
+bond12.1@bond12: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+    inet 1.1.1.1/16 scope global bond12.1
f25f8e
+bond12: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
 eth1: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 eth10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
 eth10.3@eth10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
     inet 4.4.4.4/24 scope global eth10.3
f25f8e
-eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
-eth2.1@eth2: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
-    inet 1.1.1.1/16 scope global eth2.1
f25f8e
+eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond12 state UP qlen 1000
f25f8e
 eth3: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
 eth4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
 eth4.2@eth4: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
diff --git a/tests/setup2/tcase7.sh b/tests/setup2/tcase7.sh
f25f8e
index 57b3cdff..7dc07f63 100755
f25f8e
--- a/tests/setup2/tcase7.sh
f25f8e
+++ b/tests/setup2/tcase7.sh
f25f8e
@@ -1,5 +1,5 @@
f25f8e
 #!/bin/bash
f25f8e
 
f25f8e
-CONFIG_DIR=/root
f25f8e
+CONFIG_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
f25f8e
 
f25f8e
-. ./run.sh
f25f8e
+. "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/run.sh
f25f8e
diff --git a/tests/setup2/tcase7_results/ip_a.expected b/tests/setup2/tcase7_results/ip_a.expected
f25f8e
index a1825c41..4136fb4b 100644
f25f8e
--- a/tests/setup2/tcase7_results/ip_a.expected
f25f8e
+++ b/tests/setup2/tcase7_results/ip_a.expected
f25f8e
@@ -14,10 +14,12 @@ eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master b
f25f8e
 eth3: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond34 state UP qlen 1000
f25f8e
 eth4: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond34 state UP qlen 1000
f25f8e
 eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
-eth5.5@eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
-    inet 3.3.3.100/16 scope global eth5.5
f25f8e
-eth6: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
-eth7: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
-eth8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
-eth8.3@eth8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master bridge3 state UP qlen 1000
f25f8e
-eth9: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
+eth5.5@eth5: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master team567 state UP qlen 1000
f25f8e
+eth6: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team567 state UP qlen 1000
f25f8e
+eth7: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team567 state UP qlen 1000
f25f8e
+eth8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team89 state UP qlen 1000
f25f8e
+eth9: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master team89 state UP qlen 1000
f25f8e
+team567: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+    inet 3.3.3.100/16 scope global team567
f25f8e
+team89: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+team89.3@team89: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master bridge3 state UP qlen 1000
f25f8e
diff --git a/tests/setup2/tcase8.sh b/tests/setup2/tcase8.sh
f25f8e
index c40c5e15..6982d005 100755
f25f8e
--- a/tests/setup2/tcase8.sh
f25f8e
+++ b/tests/setup2/tcase8.sh
f25f8e
@@ -1,8 +1,9 @@
f25f8e
 #!/bin/bash
f25f8e
 
f25f8e
-CONFIG_DIR=/root
f25f8e
+CONFIG_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"
f25f8e
 
f25f8e
 export SIMPLIFY_BONDING=y
f25f8e
 export SIMPLIFY_BRIDGE=y
f25f8e
+export SIMPLIFY_TEAMING=y
f25f8e
 
f25f8e
-. ./run.sh
f25f8e
+. "$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")"/run.sh
f25f8e
diff --git a/tests/setup2/tcase8_results/ip_a.expected b/tests/setup2/tcase8_results/ip_a.expected
f25f8e
index 28140aa1..19e11934 100644
f25f8e
--- a/tests/setup2/tcase8_results/ip_a.expected
f25f8e
+++ b/tests/setup2/tcase8_results/ip_a.expected
f25f8e
@@ -1,10 +1,11 @@
f25f8e
-eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
+bond12.1@bond12: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+    inet 1.1.1.100/16 scope global bond12.1
f25f8e
+bond12: <BROADCAST,MULTICAST,MASTER,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
+eth1: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond12 state UP qlen 1000
f25f8e
 eth10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
 eth10.3@eth10: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
     inet 4.4.4.100/24 scope global eth10.3
f25f8e
-eth1.1@eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
-    inet 1.1.1.100/16 scope global eth1.1
f25f8e
-eth2: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 1000
f25f8e
+eth2: <BROADCAST,MULTICAST,SLAVE,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast master bond12 state UP qlen 1000
f25f8e
 eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
f25f8e
 eth3.2@eth3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
f25f8e
     inet 2.2.2.2/24 scope global eth3.2
f25f8e
diff --git a/usr/share/rear/conf/default.conf b/usr/share/rear/conf/default.conf
f25f8e
index 796f228a..ef118998 100644
f25f8e
--- a/usr/share/rear/conf/default.conf
f25f8e
+++ b/usr/share/rear/conf/default.conf
f25f8e
@@ -2237,15 +2237,16 @@ USE_CFG2HTML=
f25f8e
 # If SKIP_CFG2HTML is enabled, skip this script (backward compatibility) - the var will become obsolete in rear-1.18
f25f8e
 # SKIP_CFG2HTML=
f25f8e
 
f25f8e
-# Simplify bonding setups by configuring always the first active device of a bond
f25f8e
-SIMPLIFY_BONDING=
f25f8e
+# Simplify bonding setups by configuring always the first active device of a
f25f8e
+# bond, except when mode is 4 (IEEE 802.3ad policy)
f25f8e
+SIMPLIFY_BONDING=no
f25f8e
 
f25f8e
 # Simplify bridge setups by configuring always the first active device of a bridge
f25f8e
-SIMPLIFY_BRIDGE=
f25f8e
+SIMPLIFY_BRIDGE=no
f25f8e
 
f25f8e
-# Simplify team setups by configuring always the first active device of a team
f25f8e
-# Current implementation only supports this mode
f25f8e
-#SIMPLIFY_TEAM=
f25f8e
+# Simplify team setups by configuring always the first active device of a team,
f25f8e
+# except when runner is 'lacp' (IEEE 802.3ad policy)
f25f8e
+SIMPLIFY_TEAMING=no
f25f8e
 
f25f8e
 # Serial Console support is enabled if serial devices are found on the system and
f25f8e
 # then matching kernel command line parameters like 'console=ttyS0,9600 console=ttyS1,9600'
f25f8e
diff --git a/usr/share/rear/rescue/GNU/Linux/310_network_devices.sh b/usr/share/rear/rescue/GNU/Linux/310_network_devices.sh
f25f8e
index 8d24d2d5..4698618c 100644
f25f8e
--- a/usr/share/rear/rescue/GNU/Linux/310_network_devices.sh
f25f8e
+++ b/usr/share/rear/rescue/GNU/Linux/310_network_devices.sh
f25f8e
@@ -146,7 +146,7 @@ ip link help 2>&1 | grep -qw bridge && ip_link_supports_bridge='true'
f25f8e
 #
f25f8e
 #   - if it is a bond
f25f8e
 #
f25f8e
-#     - if SIMPLIFY_BONDING is set
f25f8e
+#     - if SIMPLIFY_BONDING is set and mode is not 4 (IEEE 802.3ad policy)
f25f8e
 #       - configure the first UP underlying interface using ALGO
f25f8e
 #       - keep record of interface mapping into new underlying interface
f25f8e
 #     - otherwise
f25f8e
@@ -157,10 +157,14 @@ ip link help 2>&1 | grep -qw bridge && ip_link_supports_bridge='true'
f25f8e
 #
f25f8e
 #     - configure the vlan based on parent's interface
f25f8e
 #
f25f8e
-#   - if it is a team, only simplification is currently implemented
f25f8e
+#   - if it is a team
f25f8e
 #
f25f8e
-#     - configure the first UP underlying interface using ALGO
f25f8e
-#     - keep record of interface mapping into new underlying interface
f25f8e
+#     - if SIMPLIFY_TEAMING is set and runner is not 'lacp' (IEEE 802.3ad policy)
f25f8e
+#       - configure the first UP underlying interface using ALGO
f25f8e
+#       - keep record of interface mapping into new underlying interface
f25f8e
+#     - otherwise
f25f8e
+#       - configure the team
f25f8e
+#       - configure all UP underlying interfaces using ALGO
f25f8e
 #
f25f8e
 # - in any case, a given interface is only configured once; when an interface
f25f8e
 #   has already been configured, configuration code should be ignored by
f25f8e
@@ -470,7 +474,7 @@ function handle_bridge () {
f25f8e
     local tmpfile=$( mktemp )
f25f8e
     local itf
f25f8e
 
f25f8e
-    if test "$SIMPLIFY_BRIDGE" ; then
f25f8e
+    if is_true "$SIMPLIFY_BRIDGE" ; then
f25f8e
         for itf in $( get_lower_interfaces $network_interface ) ; do
f25f8e
             DebugPrint "$network_interface has lower interface $itf"
f25f8e
             is_interface_up $itf || continue
f25f8e
@@ -552,6 +556,7 @@ function handle_bridge () {
f25f8e
 }
f25f8e
 
f25f8e
 already_set_up_teams=""
f25f8e
+team_initialized=
f25f8e
 
f25f8e
 function handle_team () {
f25f8e
     local network_interface=$1
f25f8e
@@ -569,13 +574,58 @@ function handle_team () {
f25f8e
     fi
f25f8e
     already_set_up_teams+=" $network_interface"
f25f8e
 
f25f8e
-    # FIXME? Team code below simplifies the configuration, returning first port only
f25f8e
-    # There should a SIMPLIFY_TEAM variable for that
f25f8e
-
f25f8e
     local rc
f25f8e
     local nitfs=0
f25f8e
     local tmpfile=$( mktemp )
f25f8e
     local itf
f25f8e
+    local teaming_runner="$( teamdctl "$network_interface" state item get setup.runner_name )"
f25f8e
+
f25f8e
+    if is_true "$SIMPLIFY_TEAMING" && [ "$teaming_runner" != "lacp" ] ; then
f25f8e
+
f25f8e
+        for itf in $( get_lower_interfaces $network_interface ) ; do
f25f8e
+            DebugPrint "$network_interface has lower interface $itf"
f25f8e
+            is_interface_up $itf || continue
f25f8e
+            is_linked_to_physical $itf || continue
f25f8e
+            handle_interface $itf >$tmpfile
f25f8e
+            rc=$?
f25f8e
+            [ $rc -eq $rc_error ] && continue
f25f8e
+            let nitfs++
f25f8e
+            echo "# Original interface was $network_interface, now is $itf"
f25f8e
+            [ $rc -eq $rc_success ] && cat $tmpfile
f25f8e
+            # itf may have been mapped into some other interface
f25f8e
+            itf=$( get_mapped_network_interface $itf )
f25f8e
+            # We found an interface, so stop here after mapping team to lower interface
f25f8e
+            map_network_interface $network_interface $itf
f25f8e
+            break
f25f8e
+        done
f25f8e
+        rm $tmpfile
f25f8e
+
f25f8e
+        # If we didn't find any lower interface, we are in trouble ...
f25f8e
+        if [ $nitfs -eq 0 ] ; then
f25f8e
+            LogPrintError "Couldn't find any suitable lower interface for '$network_interface'."
f25f8e
+            return $rc_error
f25f8e
+        fi
f25f8e
+
f25f8e
+        # setup_device_params has already been called by interface team was mapped onto
f25f8e
+
f25f8e
+        return $rc_success
f25f8e
+    elif is_true "$SIMPLIFY_TEAMING" ; then
f25f8e
+        # Teaming runner 'lacp' (IEEE 802.3ad policy) cannot be simplified
f25f8e
+        # because there is some special setup on the switch itself, requiring
f25f8e
+        # to keep the system's network interface's configuration intact.
f25f8e
+        LogPrint "Note: not simplifying network configuration for '$network_interface' because teaming runner is 'lacp' (IEEE 802.3ad policy)."
f25f8e
+    fi
f25f8e
+
f25f8e
+    #
f25f8e
+    # Non-simplified teaming mode
f25f8e
+    #
f25f8e
+
f25f8e
+    if [ -z "$team_initialized" ] ; then
f25f8e
+        PROGS=( "${PROGS[@]}" 'teamd' 'teamdctl' )
f25f8e
+        team_initialized="y"
f25f8e
+    fi
f25f8e
+
f25f8e
+    local teamconfig="$( teamdctl -o "$network_interface" config dump actual )"
f25f8e
 
f25f8e
     for itf in $( get_lower_interfaces $network_interface ) ; do
f25f8e
         DebugPrint "$network_interface has lower interface $itf"
f25f8e
@@ -585,13 +635,15 @@ function handle_team () {
f25f8e
         rc=$?
f25f8e
         [ $rc -eq $rc_error ] && continue
f25f8e
         let nitfs++
f25f8e
-        echo "# Original interface was $network_interface, now is $itf"
f25f8e
         [ $rc -eq $rc_success ] && cat $tmpfile
f25f8e
         # itf may have been mapped into some other interface
f25f8e
-        itf=$( get_mapped_network_interface $itf )
f25f8e
-        # We found an interface, so stop here after mapping team to lower interface
f25f8e
-        map_network_interface $network_interface $itf
f25f8e
-        break
f25f8e
+        local newitf=$( get_mapped_network_interface $itf )
f25f8e
+        if [ "$itf" != "$newitf" ] ; then
f25f8e
+            # Fix the teaming configuration
f25f8e
+            teamconfig="$( echo "$teamconfig" | sed "s/\"$itf\"/\"$newitf\"/g" )"
f25f8e
+        fi
f25f8e
+        # Make sure lower device is down before configuring the team
f25f8e
+        echo "ip link set dev $itf down"
f25f8e
     done
f25f8e
     rm $tmpfile
f25f8e
 
f25f8e
@@ -601,12 +653,15 @@ function handle_team () {
f25f8e
         return $rc_error
f25f8e
     fi
f25f8e
 
f25f8e
-    # setup_device_params has already been called by interface team was mapped onto
f25f8e
+    echo "teamd -d -c '$teamconfig'"
f25f8e
+
f25f8e
+    setup_device_params $network_interface
f25f8e
 
f25f8e
     return $rc_success
f25f8e
 }
f25f8e
 
f25f8e
 already_set_up_bonds=""
f25f8e
+bond_initialized=
f25f8e
 
f25f8e
 function handle_bond () {
f25f8e
     local network_interface=$1
f25f8e
@@ -618,22 +673,19 @@ function handle_bond () {
f25f8e
 
f25f8e
     DebugPrint "$network_interface is a bond"
f25f8e
 
f25f8e
-    if [ -z "$already_set_up_bonds" ] ; then
f25f8e
-        if ! test "$SIMPLIFY_BONDING" ; then
f25f8e
-            echo "modprobe bonding"
f25f8e
-            MODULES=( "${MODULES[@]}" 'bonding' )
f25f8e
-        fi
f25f8e
-    elif [[ " $already_set_up_bonds " == *\ $network_interface\ * ]] ; then
f25f8e
+    if [[ " $already_set_up_bonds " == *\ $network_interface\ * ]] ; then
f25f8e
         DebugPrint "$network_interface already handled..."
f25f8e
         return $rc_ignore
f25f8e
     fi
f25f8e
     already_set_up_bonds+=" $network_interface"
f25f8e
 
f25f8e
+    local rc
f25f8e
     local nitfs=0
f25f8e
     local tmpfile=$( mktemp )
f25f8e
     local itf
f25f8e
+    local bonding_mode=$( awk '{ print $2 }' $sysfspath/bonding/mode )
f25f8e
 
f25f8e
-    if test "$SIMPLIFY_BONDING" ; then
f25f8e
+    if is_true "$SIMPLIFY_BONDING" && [ $bonding_mode -ne 4 ] ; then
f25f8e
         for itf in $( get_lower_interfaces $network_interface ) ; do
f25f8e
             DebugPrint "$network_interface has lower interface $itf"
f25f8e
             is_interface_up $itf || continue
f25f8e
@@ -663,13 +715,23 @@ function handle_bond () {
f25f8e
         # setup_device_params has already been called by interface bond was mapped onto
f25f8e
 
f25f8e
         return $rc_success
f25f8e
+    elif is_true "$SIMPLIFY_BONDING" ; then
f25f8e
+        # Bond mode '4' (IEEE 802.3ad policy) cannot be simplified because
f25f8e
+        # there is some special setup on the switch itself, requiring to keep
f25f8e
+        # the system's network interface's configuration intact.
f25f8e
+        LogPrint "Note: not simplifying network configuration for '$network_interface' because bonding mode is '4' (IEEE 802.3ad policy)."
f25f8e
     fi
f25f8e
 
f25f8e
     #
f25f8e
     # Non-simplified bonding mode
f25f8e
     #
f25f8e
 
f25f8e
-    local bonding_mode=$( awk '{ print $2 }' $sysfspath/bonding/mode )
f25f8e
+    if [ -z "$bond_initialized" ] ; then
f25f8e
+        echo "modprobe bonding"
f25f8e
+        MODULES=( "${MODULES[@]}" 'bonding' )
f25f8e
+        bond_initialized="y"
f25f8e
+    fi
f25f8e
+
f25f8e
     local miimon=$( cat $sysfspath/bonding/miimon )
f25f8e
     local use_carrier=$( cat $sysfspath/bonding/use_carrier )
f25f8e
 
f25f8e
@@ -689,7 +751,8 @@ EOT
f25f8e
         is_interface_up $itf || continue
f25f8e
         is_linked_to_physical $itf || continue
f25f8e
         handle_interface $itf >$tmpfile
f25f8e
-        [ $? -eq $rc_error ] && continue
f25f8e
+        rc=$?
f25f8e
+        [ $rc -eq $rc_error ] && continue
f25f8e
         let nitfs++
f25f8e
         [ $rc -eq $rc_success ] && cat $tmpfile
f25f8e
         # itf may have been mapped into some other interface
f25f8e
@@ -884,3 +947,5 @@ unset -f handle_team
f25f8e
 unset -f handle_bond
f25f8e
 unset -f handle_vlan
f25f8e
 unset -f handle_physdev
f25f8e
+
f25f8e
+# vim: set et ts=4 sw=4: