| 1 |
+----------------------------------+ |
| 2 |
| Setup #1 (basic functionalities) | |
| 3 |
+----------------------------------+ |
| 4 |
|
| 5 |
|
| 6 |
You need a VM with 13 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 IP 1.1.1.1 |
| 14 |
bond34 eth3 + eth4 mode=1 miimon=100 IP 2.2.2.2 route 102.0.0.0/8 |
| 15 |
team56 eth5 + eth6 lacp IP 3.3.3.3 route 103.0.0.0/8 |
| 16 |
bridge78 eth7 + eth8 IP 4.4.4.4 route 104.0.0.0/8 |
| 17 |
vlan1eth9 eth9.1 IP 5.5.5.5 route 105.0.0.0/8 |
| 18 |
eth10 IP 6.6.6.6 route 106.0.0.0/8 |
| 19 |
team1112 eth11 + eth12 activebackup IP 7.7.7.7 route 107.0.0.0/8 |
| 20 |
|
| 21 |
routes: |
| 22 |
default via 192.168.122.1 dev eth0 |
| 23 |
102.0.0.0/8 via 2.2.2.254 dev bond34 |
| 24 |
103.0.0.0/8 via 3.3.3.254 dev team56 |
| 25 |
104.0.0.0/8 via 4.4.4.254 dev bridge78 |
| 26 |
105.0.0.0/8 via 5.5.5.254 dev eth9.1 |
| 27 |
106.0.0.0/8 via 6.6.6.254 dev eth10 |
| 28 |
107.0.0.0/8 via 7.7.7.254 dev team1112 |
| 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 |
default via 192.168.122.1 dev eth0 |
| 57 |
102.0.0.0/8 via 2.2.2.254 dev bond34 |
| 58 |
103.0.0.0/8 via 3.3.3.254 dev team56 |
| 59 |
104.0.0.0/8 via 4.4.4.254 dev bridge78 |
| 60 |
105.0.0.0/8 via 5.5.5.254 dev eth9.1 |
| 61 |
106.0.0.0/8 via 6.6.6.254 dev eth10 |
| 62 |
107.0.0.0/8 via 7.7.7.254 dev team1112 |
| 63 |
|
| 64 |
|
| 65 |
Test Case #2: simplification |
| 66 |
------------ |
| 67 |
|
| 68 |
SIMPLIFY_BONDING=y SIMPLIFY_BRIDGE=y SIMPLIFY_TEAMING=y |
| 69 |
|
| 70 |
Expected results: |
| 71 |
|
| 72 |
bond12 -> bond12 (not simplified because mode=4) |
| 73 |
bond34 -> eth3 |
| 74 |
team56 -> team56 (not simplified because runner=lacp) |
| 75 |
bridge78 -> eth7 |
| 76 |
team1112 -> eth11 |
| 77 |
default via 192.168.122.1 dev eth0 |
| 78 |
102.0.0.0/8 via 2.2.2.254 dev eth3 |
| 79 |
103.0.0.0/8 via 3.3.3.254 dev team56 |
| 80 |
104.0.0.0/8 via 4.4.4.254 dev eth7 |
| 81 |
105.0.0.0/8 via 5.5.5.254 dev eth9.1 |
| 82 |
106.0.0.0/8 via 6.6.6.254 dev eth10 |
| 83 |
107.0.0.0/8 via 7.7.7.254 dev eth11 |
| 84 |
|
| 85 |
|
| 86 |
Test Case #3: standard with eth2, eth4, eth6, eth8, eth10, eth12 DOWN |
| 87 |
------------ |
| 88 |
|
| 89 |
for eth in eth2 eth4 eth6 eth8 eth10 eth12; do ifdown $eth; done |
| 90 |
|
| 91 |
Expected results: |
| 92 |
|
| 93 |
eth2, eth4, eth6, eth8, eth10 not in file |
| 94 |
default via 192.168.122.1 dev eth0 |
| 95 |
102.0.0.0/8 via 2.2.2.254 dev bond34 |
| 96 |
103.0.0.0/8 via 3.3.3.254 dev team56 |
| 97 |
104.0.0.0/8 via 4.4.4.254 dev bridge78 |
| 98 |
105.0.0.0/8 via 5.5.5.254 dev eth9.1 |
| 99 |
107.0.0.0/8 via 7.7.7.254 dev team1112 |
| 100 |
|
| 101 |
|
| 102 |
Test Case #4: simplification with eth2, eth4, eth6, eth8, eth10, eth12 DOWN |
| 103 |
------------ |
| 104 |
|
| 105 |
for eth in eth2 eth4 eth6 eth8 eth10 eth12; do ifdown $eth; done |
| 106 |
|
| 107 |
Expected results: |
| 108 |
|
| 109 |
eth4, eth6, eth8, eth10, eth12 not in file |
| 110 |
default via 192.168.122.1 dev eth0 |
| 111 |
102.0.0.0/8 via 2.2.2.254 dev eth3 |
| 112 |
103.0.0.0/8 via 3.3.3.254 dev team56 |
| 113 |
104.0.0.0/8 via 4.4.4.254 dev eth7 |
| 114 |
105.0.0.0/8 via 5.5.5.254 dev eth9.1 |
| 115 |
107.0.0.0/8 via 7.7.7.254 dev eth11 |
| 116 |
|
| 117 |
|
| 118 |
Test Case #5: standard with eth1, eth3, eth5, eth7, eth9, eth11 DOWN |
| 119 |
------------ |
| 120 |
|
| 121 |
for eth in eth1 eth3 eth5 eth7 eth9 eth11; do ifdown $eth; done |
| 122 |
|
| 123 |
Expected results: |
| 124 |
|
| 125 |
eth2, eth4, eth6, eth8, eth10 not in file |
| 126 |
default via 192.168.122.1 dev eth0 |
| 127 |
102.0.0.0/8 via 2.2.2.254 dev bond34 |
| 128 |
103.0.0.0/8 via 3.3.3.254 dev team56 |
| 129 |
104.0.0.0/8 via 4.4.4.254 dev bridge78 |
| 130 |
106.0.0.0/8 via 6.6.6.254 dev eth10 |
| 131 |
107.0.0.0/8 via 7.7.7.254 dev team1112 |
| 132 |
|
| 133 |
|
| 134 |
Test Case #6: simplification with eth1, eth3, eth5, eth7, eth9, eth11 DOWN |
| 135 |
------------ |
| 136 |
|
| 137 |
for eth in eth1 eth3 eth5 eth7 eth9 eth11; do ifdown $eth; done |
| 138 |
|
| 139 |
Expected results: |
| 140 |
|
| 141 |
eth4, eth6, eth8, eth10 not in file |
| 142 |
default via 192.168.122.1 dev eth0 |
| 143 |
102.0.0.0/8 via 2.2.2.254 dev eth4 |
| 144 |
103.0.0.0/8 via 3.3.3.254 dev team56 |
| 145 |
104.0.0.0/8 via 4.4.4.254 dev eth8 |
| 146 |
106.0.0.0/8 via 6.6.6.254 dev eth10 |
| 147 |
107.0.0.0/8 via 7.7.7.254 dev eth12 |
| 148 |
|
| 149 |
|
| 150 |
Test Case #7: IP address mapping |
| 151 |
------------ |
| 152 |
|
| 153 |
# cat mappings/ip_addresses |
| 154 |
bond12 1.1.1.100/16 |
| 155 |
bond34 2.2.2.100/16 |
| 156 |
#team56 3.3.3.100/16 |
| 157 |
bridge78 4.4.4.100/24 |
| 158 |
#eth9.1 5.5.5.100/24 |
| 159 |
eth10 6.6.6.100/16 |
| 160 |
team1112 7.7.7.100/16 |
| 161 |
|
| 162 |
Expected results: |
| 163 |
|
| 164 |
bond12 -> 1.1.1.100/16 |
| 165 |
bond34 -> 2.2.2.100/16 |
| 166 |
eth5 -> 3.3.3.3/16 (no mapping) |
| 167 |
bridge78 -> 4.4.4.100/24 |
| 168 |
eth9.1 -> 5.5.5.5/24 (no mapping) |
| 169 |
eth10 -> 6.6.6.100/16 |
| 170 |
team1112 -> 7.7.7.100/16 |
| 171 |
|
| 172 |
|
| 173 |
Test Case #8: IP address mapping & simplification |
| 174 |
------------ |
| 175 |
|
| 176 |
SIMPLIFY_BONDING=y SIMPLIFY_BRIDGE=y SIMPLIFY_TEAMING=y |
| 177 |
|
| 178 |
# cat mappings/ip_addresses |
| 179 |
bond12 1.1.1.100/16 |
| 180 |
bond34 2.2.2.100/16 |
| 181 |
#team56 3.3.3.100/16 |
| 182 |
bridge78 4.4.4.100/24 |
| 183 |
#eth9.1 5.5.5.100/24 |
| 184 |
eth10 6.6.6.100/16 |
| 185 |
team1112 7.7.7.100/16 |
| 186 |
|
| 187 |
Expected results: |
| 188 |
|
| 189 |
bond12 -> 1.1.1.100/16 |
| 190 |
eth3 -> 2.2.2.100/16 |
| 191 |
eth5 -> 3.3.3.3/16 (no mapping) |
| 192 |
eth7 -> 4.4.4.100/24 |
| 193 |
eth9.1 -> 5.5.5.5/24 (no mapping) |
| 194 |
eth10 -> 6.6.6.100/16 |
| 195 |
eth11 -> 7.7.7.100/16 |