forked from teslamotors/fleet-telemetry
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_configs_test.go
109 lines (103 loc) · 1.93 KB
/
test_configs_test.go
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
97
98
99
100
101
102
103
104
105
106
107
108
109
package config
const TestConfig = `{
"host": "127.0.0.1",
"port": 443,
"status_port": 8080,
"log_level": "info",
"json_log_enable": true,
"namespace": "tesla_telemetry",
"reliable_ack": true,
"reliable_ack_workers": 15,
"kafka": {
"bootstrap.servers": "some.broker1:9093,some.broker1:9093",
"ssl.ca.location": "kafka.ca",
"ssl.certificate.location": "kafka.crt",
"ssl.key.location": "kafka.key",
"queue.buffering.max.messages": 1000000
},
"monitoring": {
"prometheus_metrics_port": 9090,
"profiler_port": 4269,
"profiling_path": "/tmp/fleet-telemetry/profile"
},
"rate_limit": {
"enabled": true,
"message_interval_time": 30,
"message_limit": 1000
},
"records": {
"FS": ["kafka"]
},
"tls": {
"ca_file": "tesla.ca",
"server_cert": "your_own_cert.crt",
"server_key": "your_own_key.key"
}
}
`
const TestSmallConfig = `
{
"host": "127.0.0.1",
"port": 443,
"status_port": 8080,
"namespace": "tesla_telemetry",
"kafka": {
"bootstrap.servers": "some.broker1:9093,some.broker1:9093",
"ssl.ca.location": "kafka.ca",
"ssl.certificate.location": "kafka.crt",
"ssl.key.location": "kafka.key",
"queue.buffering.max.messages": 1000000
},
"records": {
"FS": ["kafka"]
},
"tls": {
"ca_file": "tesla.ca",
"server_cert": "your_own_cert.crt",
"server_key": "your_own_key.key"
}
}
`
const TestPubsubConfig = `
{
"host": "127.0.0.1",
"port": 443,
"status_port": 8080,
"pubsub": {
"gcp_project_id": "some-project-id",
"reliable_ack": "true"
},
"records": {
"FS": ["pubsub"]
}
}
`
const BadTopicConfig = `
{
"host": "127.0.0.1",
"port": "",
}`
const TestZMQConfig = `
{
"host": "127.0.0.1",
"port": 443,
"status_port": 8080,
"zmq": {
"addr": "tcp://127.0.0.1:5288"
},
"records": {
"FS": ["zmq"]
}
}
`
const TestTransmitDecodedRecords = `
{
"host": "127.0.0.1",
"port": 443,
"status_port": 8080,
"transmit_decoded_records": true,
"records": {
"FS": ["logger"]
}
}
`