-
Notifications
You must be signed in to change notification settings - Fork 18
/
simulate
executable file
·96 lines (79 loc) · 2.21 KB
/
simulate
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
#!/bin/sh
parodus_port=16014
aker_port=16015
mocktr181_port=16016
if [[ -z "${URL}" ]]; then
URL="http://petasos:6400"
fi
if [[ -z "${FIRMWARE}" ]]; then
FIRMWARE="mock-rdkb-firmware"
fi
if [[ -z "${BOOT_TIME}" ]]; then
BOOT_TIME=$(date +%s)
fi
if [[ -z "${HW_MANUFACTURER}" ]]; then
HW_MANUFACTURER="Example Inc."
fi
if [[ -z "${REBOOT_REASON}" ]]; then
REBOOT_REASON="unknown"
fi
if [[ -z "${SERIAL_NUMBER}" ]]; then
SERIAL_NUMBER="mock-rdkb-simulator"
fi
if [[ -z "${PARTNER_ID}" ]]; then
PARTNER_ID="comcast"
fi
if [[ -z "${CMAC}" ]]; then
CMAC="112233445566"
fi
if [[ -z "${TOKEN_SERVER_URL}" ]]; then
TOKEN_SERVER_URL="http://themis:6501/issue"
fi
if [[ -z "${SSL_CERT_PATH}" ]]; then
SSL_CERT_PATH="/etc/ssl/certs/ca-certificates.crt"
fi
#In this docker-compose cluster, themis has mtls disabled so
#feel free to ignore the --client-cert-path flag value
#it is required by parodus to fetch a token
if [[ -z "${CLIENT_CERT_PATH}" ]]; then
CLIENT_CERT_PATH="/etc/ssl/certs/ca-certificates.crt"
fi
# MTLS_CLIENT_* is used to authenticate with talaria.
if [[ -z "${MTLS_CLIENT_CERT_PATH}" ]]; then
MTLS_CLIENT_CERT_PATH=""
fi
if [[ -z "${MTLS_CLIENT_KEY_PATH}" ]]; then
MTLS_CLIENT_KEY_PATH=""
fi
parodus --hw-model=aker-testing \
--ssl-cert-path=$SSL_CERT_PATH \
--client-cert-path=$CLIENT_CERT_PATH \
--mtls-client-cert-path=$MTLS_CLIENT_CERT_PATH \
--mtls-client-key-path=$MTLS_CLIENT_KEY_PATH \
--hw-serial-number=$SERIAL_NUMBER \
--hw-manufacturer=$HW_MANUFACTURER \
--hw-mac=$CMAC \
--hw-last-reboot-reason=$REBOOT_REASON \
--fw-name=$FIRMWARE \
--boot-time=$BOOT_TIME \
--partner-id=$PARTNER_ID \
--parodus-local-url=tcp://127.0.0.1:$parodus_port \
--webpa-ping-timeout=60 \
--token-server-url=$TOKEN_SERVER_URL \
--webpa-backoff-max=2 \
--webpa-interface-used=eth0 \
--webpa-url=$URL \
--force-ipv4 &
P1=$!
aker -p tcp://127.0.0.1:$parodus_port \
-c tcp://127.0.0.1:$aker_port \
-w echo \
-d /tmp/aker-data.msgpack \
-f /tmp/aker-data.msgpack.md5 \
-m 128 >/dev/null &
P2=$!
mock_tr181 -p $parodus_port \
-c $mocktr181_port \
-d /etc/mock_tr181.json >/dev/null &
P3=$!
wait $P1 $P2 $P3