Blame SOURCES/rear-bz1639705.patch

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