blob: 3e33002bff58e18d0cfd64f629b7330778ef93d3 [file] [log] [blame]
Hila Ben Abraham47583d12014-05-22 04:39:31 -05001#!/usr/bin/env bash
2workDir=$1
Eric Newberrybef49472017-05-08 22:49:05 -07003testLog=$workDir/logs/nfdc_test.log
Hila Ben Abraham47583d12014-05-22 04:39:31 -05004source $workDir/../multi-host.conf
5source $workDir/include.sh
6
7#compress IPv6
8IP6_A1=$(python -c "import sys; import socket; result = socket.getaddrinfo('$IP6_A1', None); family, socktype, proto, canonname,(address, port, flow_info, scope_id) = result[0]; print address")
9
Eric Newberrybef49472017-05-08 22:49:05 -070010remoteFaceIdUdp4=$(check_nfdc_face_existence none udp4://$IP4_A1)
Hila Ben Abraham47583d12014-05-22 04:39:31 -050011if [[ -z "$remoteFaceIdUdp4" ]]; then
12 exit 3
13fi
14
Eric Newberrybef49472017-05-08 22:49:05 -070015remoteFaceIdTcp4=$(check_nfdc_face_existence none tcp4://$IP4_A1)
Hila Ben Abraham47583d12014-05-22 04:39:31 -050016if [[ -z "$remoteFaceIdTcp4" ]]; then
17 exit 3
18fi
19
Eric Newberrybef49472017-05-08 22:49:05 -070020remoteFaceIdUdp6=$(check_nfdc_face_existence none udp6://[$IP6_A1])
Hila Ben Abraham47583d12014-05-22 04:39:31 -050021if [[ -z "$remoteFaceIdUdp6" ]]; then
22 exit 3
23fi
24
Eric Newberrybef49472017-05-08 22:49:05 -070025remoteFaceIdTcp6=$(check_nfdc_face_existence none tcp6://[$IP6_A1])
Hila Ben Abraham47583d12014-05-22 04:39:31 -050026if [[ -z "$remoteFaceIdTcp6" ]]; then
27 exit 3
28fi
29
Eric Newberrybef49472017-05-08 22:49:05 -070030check_nfdc_face_counters $remoteFaceIdUdp4 udp4://$IP4_A1 'in' $NUM_OF_PINGS
Hila Ben Abraham47583d12014-05-22 04:39:31 -050031if [[ $? -ne 0 ]]; then
32 exit 3
33fi
34
Eric Newberrybef49472017-05-08 22:49:05 -070035check_nfdc_face_counters $remoteFaceIdTcp4 tcp4://$IP4_A1 'in' $NUM_OF_PINGS
Hila Ben Abraham47583d12014-05-22 04:39:31 -050036if [[ $? -ne 0 ]]; then
37 exit 3
38fi
39
Eric Newberrybef49472017-05-08 22:49:05 -070040check_nfdc_face_counters $remoteFaceIdUdp6 udp6://[$IP6_A1] 'in' $NUM_OF_PINGS
Hila Ben Abraham47583d12014-05-22 04:39:31 -050041if [[ $? -ne 0 ]]; then
42 exit 3
43fi
44
Eric Newberrybef49472017-05-08 22:49:05 -070045check_nfdc_face_counters $remoteFaceIdTcp6 tcp6://[$IP6_A1] 'in' $NUM_OF_PINGS
Hila Ben Abraham47583d12014-05-22 04:39:31 -050046if [[ $? -ne 0 ]]; then
47 exit 3
48fi
49
Hila Ben Abraham47583d12014-05-22 04:39:31 -050050exit 0