Hila Ben Abraham | 47583d1 | 2014-05-22 04:39:31 -0500 | [diff] [blame] | 1 | #!/usr/bin/env bash |
| 2 | workDir=$1 |
Eric Newberry | bef4947 | 2017-05-08 22:49:05 -0700 | [diff] [blame^] | 3 | testLog=$workDir/logs/nfdc_test.log |
Hila Ben Abraham | 47583d1 | 2014-05-22 04:39:31 -0500 | [diff] [blame] | 4 | source $workDir/../multi-host.conf |
| 5 | source $workDir/include.sh |
| 6 | |
| 7 | #compress IPv6 |
| 8 | IP6_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 Newberry | bef4947 | 2017-05-08 22:49:05 -0700 | [diff] [blame^] | 10 | remoteFaceIdUdp4=$(check_nfdc_face_existence none udp4://$IP4_A1) |
Hila Ben Abraham | 47583d1 | 2014-05-22 04:39:31 -0500 | [diff] [blame] | 11 | if [[ -z "$remoteFaceIdUdp4" ]]; then |
| 12 | exit 3 |
| 13 | fi |
| 14 | |
Eric Newberry | bef4947 | 2017-05-08 22:49:05 -0700 | [diff] [blame^] | 15 | remoteFaceIdTcp4=$(check_nfdc_face_existence none tcp4://$IP4_A1) |
Hila Ben Abraham | 47583d1 | 2014-05-22 04:39:31 -0500 | [diff] [blame] | 16 | if [[ -z "$remoteFaceIdTcp4" ]]; then |
| 17 | exit 3 |
| 18 | fi |
| 19 | |
Eric Newberry | bef4947 | 2017-05-08 22:49:05 -0700 | [diff] [blame^] | 20 | remoteFaceIdUdp6=$(check_nfdc_face_existence none udp6://[$IP6_A1]) |
Hila Ben Abraham | 47583d1 | 2014-05-22 04:39:31 -0500 | [diff] [blame] | 21 | if [[ -z "$remoteFaceIdUdp6" ]]; then |
| 22 | exit 3 |
| 23 | fi |
| 24 | |
Eric Newberry | bef4947 | 2017-05-08 22:49:05 -0700 | [diff] [blame^] | 25 | remoteFaceIdTcp6=$(check_nfdc_face_existence none tcp6://[$IP6_A1]) |
Hila Ben Abraham | 47583d1 | 2014-05-22 04:39:31 -0500 | [diff] [blame] | 26 | if [[ -z "$remoteFaceIdTcp6" ]]; then |
| 27 | exit 3 |
| 28 | fi |
| 29 | |
Eric Newberry | bef4947 | 2017-05-08 22:49:05 -0700 | [diff] [blame^] | 30 | check_nfdc_face_counters $remoteFaceIdUdp4 udp4://$IP4_A1 'in' $NUM_OF_PINGS |
Hila Ben Abraham | 47583d1 | 2014-05-22 04:39:31 -0500 | [diff] [blame] | 31 | if [[ $? -ne 0 ]]; then |
| 32 | exit 3 |
| 33 | fi |
| 34 | |
Eric Newberry | bef4947 | 2017-05-08 22:49:05 -0700 | [diff] [blame^] | 35 | check_nfdc_face_counters $remoteFaceIdTcp4 tcp4://$IP4_A1 'in' $NUM_OF_PINGS |
Hila Ben Abraham | 47583d1 | 2014-05-22 04:39:31 -0500 | [diff] [blame] | 36 | if [[ $? -ne 0 ]]; then |
| 37 | exit 3 |
| 38 | fi |
| 39 | |
Eric Newberry | bef4947 | 2017-05-08 22:49:05 -0700 | [diff] [blame^] | 40 | check_nfdc_face_counters $remoteFaceIdUdp6 udp6://[$IP6_A1] 'in' $NUM_OF_PINGS |
Hila Ben Abraham | 47583d1 | 2014-05-22 04:39:31 -0500 | [diff] [blame] | 41 | if [[ $? -ne 0 ]]; then |
| 42 | exit 3 |
| 43 | fi |
| 44 | |
Eric Newberry | bef4947 | 2017-05-08 22:49:05 -0700 | [diff] [blame^] | 45 | check_nfdc_face_counters $remoteFaceIdTcp6 tcp6://[$IP6_A1] 'in' $NUM_OF_PINGS |
Hila Ben Abraham | 47583d1 | 2014-05-22 04:39:31 -0500 | [diff] [blame] | 46 | if [[ $? -ne 0 ]]; then |
| 47 | exit 3 |
| 48 | fi |
| 49 | |
Hila Ben Abraham | 47583d1 | 2014-05-22 04:39:31 -0500 | [diff] [blame] | 50 | exit 0 |