-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtest_perl_json.sh
executable file
·63 lines (44 loc) · 1.27 KB
/
test_perl_json.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/bin/bash
unset proxy
unset http_proxy
## ----- ----- ----- ----- ----- ----- ----- ----- ----- -----#
## tests to exercise perl-json api #
## ----- ----- ----- ----- ----- ----- ----- ----- ----- -----#
# ares-f30m64.jbr.candelatech.com
HOST=${1:-localhost}
BASEURL="http://${HOST}:8080"
HELPURL="${BASEURL}/help"
FORMURL="${BASEURL}/cli-form"
JSONURL="${BASEURL}/cli-json"
function Get() {
[ -f /tmp/$$.result ] && rm -f /tmp/$$.result
curl -sq -H 'Accept: application/json' "${BASEURL}${@}" &> /tmp/$$.result
wc -l /tmp/$$.result
if [[ $? = 0 ]]; then
json_reformat < /tmp/$$.result
fi
}
# test that we have a connection to lfclient
echo "Testing $HOST $BASEURL"
Get /port/1/1/eth1 || exit 1
cd json
./port_test.pl --host $HOST --ssid kedtest-wpa2 --pass kedtest-wpa2
sleep 1
./test_sta_mode.pl --host $HOST
sleep 1
./json_port_test3.sh $HOST
## ----- ----- ----- ----- ----- ----- ----- ----- ----- -----#
# create a pair of redirect ports
RDD=('rd0a' 'rd0b' 'rd1a' 'rd1b')
# create a wanlink between two of them
WL='wl1'
WLEP=("${WL}-A" "${WL}-B")
# create a layer 3 connection between the a-side rdds
CX='tcp1'
EPS=("${CX}-A" "${CX}-B")
# start the wanlink
# start the layer3
# print port stats after 30 seconds
###
###
###