Lines Matching refs:ns1

11 #       ns1           ns2           ns3
19 # ns1 -> gw: ns1, ns2, ns3, should receive the arp request
22 # ns1 -> gw: ns1 should not receive, ns2, ns3 should receive redirects.
24 # ping test: ns1 -> ns2 (block), echo requests will be redirect back
37 NS[1]="ns1-$(mktemp -u XXXXXX)"
118 test_pass "$mode mac ns1-2" || test_fail "$mode mac ns1-2"
120 test_pass "$mode mac ns1-3" || test_fail "$mode mac ns1-3"
130 ip netns exec ${NS[1]} tcpdump -i veth0 -nn -l -e &> ${LOG_DIR}/ns1-1_${mode}.log &
131 ip netns exec ${NS[2]} tcpdump -i veth0 -nn -l -e &> ${LOG_DIR}/ns1-2_${mode}.log &
132 ip netns exec ${NS[3]} tcpdump -i veth0 -nn -l -e &> ${LOG_DIR}/ns1-3_${mode}.log &
144 [ $(grep -cF "who-has 192.0.2.254" ${LOG_DIR}/ns1-1_${mode}.log) -eq 4 ] && \
145 test_pass "$mode arp(F_BROADCAST) ns1-1" || \
146 test_fail "$mode arp(F_BROADCAST) ns1-1"
147 [ $(grep -cF "who-has 192.0.2.254" ${LOG_DIR}/ns1-2_${mode}.log) -eq 2 ] && \
148 test_pass "$mode arp(F_BROADCAST) ns1-2" || \
149 test_fail "$mode arp(F_BROADCAST) ns1-2"
150 [ $(grep -cF "who-has 192.0.2.254" ${LOG_DIR}/ns1-3_${mode}.log) -eq 2 ] && \
151 test_pass "$mode arp(F_BROADCAST) ns1-3" || \
152 test_fail "$mode arp(F_BROADCAST) ns1-3"
154 # ns1 should not receive the redirect echo request, others should
155 [ $(grep -c "ICMP echo request" ${LOG_DIR}/ns1-1_${mode}.log) -eq 4 ] && \
156 test_pass "$mode IPv4 (F_BROADCAST|F_EXCLUDE_INGRESS) ns1-1" || \
157 test_fail "$mode IPv4 (F_BROADCAST|F_EXCLUDE_INGRESS) ns1-1"
158 [ $(grep -c "ICMP echo request" ${LOG_DIR}/ns1-2_${mode}.log) -eq 4 ] && \
159 test_pass "$mode IPv4 (F_BROADCAST|F_EXCLUDE_INGRESS) ns1-2" || \
160 test_fail "$mode IPv4 (F_BROADCAST|F_EXCLUDE_INGRESS) ns1-2"
161 [ $(grep -c "ICMP echo request" ${LOG_DIR}/ns1-3_${mode}.log) -eq 4 ] && \
162 test_pass "$mode IPv4 (F_BROADCAST|F_EXCLUDE_INGRESS) ns1-3" || \
163 test_fail "$mode IPv4 (F_BROADCAST|F_EXCLUDE_INGRESS) ns1-3"
165 # ns1 should receive the echo request, ns2 should not
166 [ $(grep -c "ICMP6, echo request" ${LOG_DIR}/ns1-1_${mode}.log) -eq 4 ] && \
167 test_pass "$mode IPv6 (no flags) ns1-1" || \
168 test_fail "$mode IPv6 (no flags) ns1-1"
169 [ $(grep -c "ICMP6, echo request" ${LOG_DIR}/ns1-2_${mode}.log) -eq 0 ] && \
170 test_pass "$mode IPv6 (no flags) ns1-2" || \
171 test_fail "$mode IPv6 (no flags) ns1-2"