| 1 |
+----------------------------------+ |
| 2 |
| Setup #2 (crazy networking) | |
| 3 |
+----------------------------------+ |
| 4 |
|
| 5 |
|
| 6 |
You need a VM with 11 network interfaces (eth0 being the main interface). |
| 7 |
All interfaces except eth0 can be non-reachable. |
| 8 |
|
| 9 |
kvm.xml is an example template of such VM. |
| 10 |
|
| 11 |
|
| 12 |
eth0 IP 192.168.122.x/24 default 192.168.122.1 (x=177) |
| 13 |
bond12 eth1 + eth2 mode=4 miimon=1000 |
| 14 |
vlan1bond12 bond12.1 IP 1.1.1.1 route 101.0.0.0/8 |
| 15 |
bond34 eth3 + eth4 mode=1 miimon=100 |
| 16 |
vlan2bond34 bond34.2 |
| 17 |
bridge2 bond34.2 IP 2.2.2.2 route 102.0.0.0/8 |
| 18 |
team567 eth5.5 + eth6 + eth7 IP 3.3.3.3 route 103.0.0.0/8 |
| 19 |
team89 eth8 + eth9 |
| 20 |
vlan3team89 team89.3 |
| 21 |
bridge3 eth10.3 + team89.3 IP 4.4.4.4 route 104.0.0.0/8 |
| 22 |
|
| 23 |
routes: |
| 24 |
default via 192.168.122.1 dev eth0 |
| 25 |
101.0.0.0/8 via 1.1.1.254 dev bond12 |
| 26 |
102.0.0.0/8 via 2.2.2.254 dev bridge2 |
| 27 |
103.0.0.0/8 via 3.3.3.254 dev team567 |
| 28 |
104.0.0.0/8 via 4.4.4.254 dev bridge3 |
| 29 |
|
| 30 |
|
| 31 |
Running the unit tests: |
| 32 |
---------------------- |
| 33 |
|
| 34 |
After copying the network configuration files and rebooting the system, |
| 35 |
|
| 36 |
from the VM, run the following command: |
| 37 |
|
| 38 |
# for i in $(seq 1 8); do ./tcase${i}.sh; done |
| 39 |
|
| 40 |
This will record the generated network+route files. |
| 41 |
|
| 42 |
Then to verify result, run the following command (this will take down the |
| 43 |
network, except eth0): |
| 44 |
|
| 45 |
# for i in $(seq 1 8); do ./verify.sh tcase${i}_results; done |
| 46 |
|
| 47 |
|
| 48 |
------------------------------------------------------------------------------- |
| 49 |
|
| 50 |
|
| 51 |
Test Case #1: standard |
| 52 |
------------ |
| 53 |
|
| 54 |
Expected results: |
| 55 |
|
| 56 |
team567 -> eth5.5 |
| 57 |
team89 -> eth8 |
| 58 |
101.0.0.0/8 via 1.1.1.254 dev bond12.1 |
| 59 |
102.0.0.0/8 via 2.2.2.254 dev bridge2 |
| 60 |
103.0.0.0/8 via 3.3.3.254 dev eth5.5 |
| 61 |
104.0.0.0/8 via 4.4.4.254 dev bridge3 |
| 62 |
|
| 63 |
|
| 64 |
Test Case #2: simplification |
| 65 |
------------ |
| 66 |
|
| 67 |
SIMPLIFY_BONDING=y SIMPLIFY_BRIDGE=y SIMPLIFY_TEAMING=y |
| 68 |
|
| 69 |
Expected results: |
| 70 |
|
| 71 |
bond12 -> bond12 (not simplified, because mode=4) |
| 72 |
bond34 -> eth3 |
| 73 |
bridge2 -> eth3.2 |
| 74 |
team567 -> eth5.5 |
| 75 |
team89 -> team89 (not simplified, because runner=lacp) |
| 76 |
bridge3 -> eth10.3 |
| 77 |
|
| 78 |
|
| 79 |
Test Case #3: standard with eth2, eth4, eth6, eth8, eth10 DOWN |
| 80 |
------------ |
| 81 |
|
| 82 |
for eth in eth2 eth4 eth6 eth8 eth10; do ifdown $eth; done |
| 83 |
|
| 84 |
Expected results: |
| 85 |
|
| 86 |
eth2, eth4, eth6, eth8, eth10 not in file |
| 87 |
team567 -> eth5.5 |
| 88 |
team89 -> eth9 |
| 89 |
101.0.0.0/8 via 1.1.1.254 dev bond12.1 |
| 90 |
102.0.0.0/8 via 2.2.2.254 dev bridge2 |
| 91 |
103.0.0.0/8 via 3.3.3.254 dev eth5.5 |
| 92 |
104.0.0.0/8 via 4.4.4.254 dev bridge3 |
| 93 |
|
| 94 |
|
| 95 |
Test Case #4: simplification with eth2, eth4, eth6, eth8, eth10 DOWN |
| 96 |
------------ |
| 97 |
|
| 98 |
for eth in eth2 eth4 eth6 eth8 eth10; do ifdown $eth; done |
| 99 |
|
| 100 |
Expected results: |
| 101 |
|
| 102 |
eth2, eth4, eth6, eth8, eth10 not in file |
| 103 |
bond34 -> eth3 |
| 104 |
bridge2 -> eth3.2 |
| 105 |
team567 -> eth5.5 |
| 106 |
team89 -> eth9 |
| 107 |
bridge3 -> eth9.3 |
| 108 |
101.0.0.0/8 via 1.1.1.254 dev eth1.1 |
| 109 |
102.0.0.0/8 via 2.2.2.254 dev eth3.2 |
| 110 |
103.0.0.0/8 via 3.3.3.254 dev eth5.5 |
| 111 |
104.0.0.0/8 via 4.4.4.254 dev eth9.3 |
| 112 |
|
| 113 |
|
| 114 |
Test Case #5: standard with eth1, eth3, eth5, eth7, eth9 DOWN |
| 115 |
------------ |
| 116 |
|
| 117 |
for eth in eth1 eth3 eth5 eth7 eth9; do ifdown $eth; done |
| 118 |
|
| 119 |
Expected results: |
| 120 |
|
| 121 |
eth2, eth4, eth6, eth8, eth10 not in file |
| 122 |
team567 -> eth6 |
| 123 |
team89 -> eth8 |
| 124 |
101.0.0.0/8 via 1.1.1.254 dev bond12.1 |
| 125 |
102.0.0.0/8 via 2.2.2.254 dev bridge2 |
| 126 |
103.0.0.0/8 via 3.3.3.254 dev eth6 |
| 127 |
104.0.0.0/8 via 4.4.4.254 dev bridge3 |
| 128 |
|
| 129 |
|
| 130 |
Test Case #6: simplification with eth1, eth3, eth5, eth7, eth9 DOWN |
| 131 |
------------ |
| 132 |
|
| 133 |
for eth in eth1 eth3 eth5 eth7 eth9; do ifdown $eth; done |
| 134 |
|
| 135 |
Expected results: |
| 136 |
|
| 137 |
eth2, eth4, eth6, eth8, eth10 not in file |
| 138 |
bond34 -> eth4 |
| 139 |
team567 -> eth6 |
| 140 |
team89 -> eth8 |
| 141 |
bridge2 -> eth4.2 |
| 142 |
bridge3 -> eth10.3 |
| 143 |
101.0.0.0/8 via 1.1.1.254 dev eth2.1 |
| 144 |
102.0.0.0/8 via 2.2.2.254 dev eth4.2 |
| 145 |
103.0.0.0/8 via 3.3.3.254 dev eth6 |
| 146 |
104.0.0.0/8 via 4.4.4.254 dev eth10.3 |
| 147 |
|
| 148 |
|
| 149 |
Test Case #7: IP address mapping |
| 150 |
------------ |
| 151 |
|
| 152 |
# cat mappings/ip_addresses |
| 153 |
bond12.1 1.1.1.100/16 |
| 154 |
#bridge2 2.2.2.100/24 |
| 155 |
team567 3.3.3.100/16 |
| 156 |
bridge3 4.4.4.100/24 |
| 157 |
|
| 158 |
Expected results: |
| 159 |
|
| 160 |
bond12.1 -> 1.1.1.100/16 |
| 161 |
bridge2 -> 2.2.2.1/24 (no mapping) |
| 162 |
eth5.5 -> 3.3.3.100/16 |
| 163 |
bridge3 -> 4.4.4.100/24 |
| 164 |
|
| 165 |
|
| 166 |
Test Case #8: IP address mapping & simplification |
| 167 |
------------ |
| 168 |
|
| 169 |
SIMPLIFY_BONDING=y SIMPLIFY_BRIDGE=y SIMPLIFY_TEAMING=y |
| 170 |
|
| 171 |
# cat mappings/ip_addresses |
| 172 |
bond12.1 1.1.1.100/16 |
| 173 |
#bridge2 2.2.2.100/24 |
| 174 |
team567 3.3.3.100/16 |
| 175 |
bridge3 4.4.4.100/24 |
| 176 |
|
| 177 |
Expected results: |
| 178 |
|
| 179 |
eth1.1 -> 1.1.1.100/16 |
| 180 |
eth3.2 -> 2.2.2.1/24 (no mapping) |
| 181 |
eth5.5 -> 3.3.3.100/16 |
| 182 |
eth10.3 -> 4.4.4.100/24 |