Skip to content
This repository was archived by the owner on Feb 1, 2024. It is now read-only.

Commit 9134e49

Browse files
authored
Merge pull request qca#7 from qca/master
Update to latest
2 parents ee59516 + f2423c4 commit 9134e49

File tree

4 files changed

+101
-10
lines changed

4 files changed

+101
-10
lines changed

bft

+2-2
Original file line numberDiff line numberDiff line change
@@ -215,9 +215,9 @@ def main():
215215
else:
216216
n = t.__class__.__name__
217217
for k, v in t.logged.items():
218-
info_for_remote_log[n + '.' + k] = v
218+
info_for_remote_log[n + '-' + k] = v
219219
if hasattr(t, 'result_grade'):
220-
info_for_remote_log[n + ".result"] = t.result_grade
220+
info_for_remote_log[n + "-result"] = t.result_grade
221221

222222
try:
223223
if config.logging_server is not None:

devices/openwrt_router.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -92,9 +92,11 @@ def reset(self, break_into_uboot=False):
9292
self.expect('Hit any key ')
9393
self.sendline('\n\n\n\n\n\n\n') # try really hard
9494
self.expect(self.uprompt, timeout=4)
95+
# Confirm we are in uboot by typing any command.
96+
# If we weren't in uboot, we wouldn't see the command
97+
# that we type.
9598
self.sendline('echo FOO')
9699
self.expect('echo FOO', timeout=4)
97-
self.expect('FOO')
98100
self.expect(self.uprompt, timeout=4)
99101
return
100102
except Exception as e:

docs/ELK_SETUP.md

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
ELK Setup
2+
=========
3+
4+
ELK is the short term for a software compilation used by BoardFarm to store, process and visualize test results.
5+
ELK consists of three tools:
6+
7+
* Elasticsearch
8+
* Logstash
9+
* Kibana
10+
11+
For this basic setup guide, we won't even need Logstash as the results are already stored in the correct format in the Elasticsearch database.
12+
13+
Installation
14+
------------
15+
16+
This guide was written for Ubuntu 16.04 LTS and the following versions of Elasticsearch and Kibana:
17+
18+
* Elasticsearch 2.3.3
19+
* Kibana 4.5.1
20+
21+
If you follow this guide and you can't get it working with newer versions, you should try again with these versions.
22+
23+
### Prerequisites
24+
25+
Elasticsearch and Logstash require Java. Elasticsearch recommends Oracle Java 8 but I had no issues using OpenJDK 8. Use whatever you prefer, I'll use OpenJDK in this guide.
26+
27+
apt-get install -y openjdk-8-jre openjdk-8-jdk
28+
29+
Now that we've installed Java, we can go on with Elasticsearch.
30+
31+
### Installing Elasticsearch
32+
33+
We'll just download the Elasticsearch Debian package and install it:
34+
35+
wget https://download.elastic.co/elasticsearch/release/org/elasticsearch/distribution/deb/elasticsearch/2.3.3/elasticsearch-2.3.3.deb
36+
dpkg -i ./elasticsearch-2.3.3.deb
37+
38+
You probably want Elasticsearch to automatically start every time you reboot your machine:
39+
40+
systemctl enable elasticsearch
41+
42+
Now let's edit the Elasticsearch configuration to restrict access from anywhere except the host itself:
43+
44+
nano /etc/elasticsearch/elasticsearch.yml
45+
46+
Look for a line containing 'network.host' and uncomment it. Set the value to 'localhost':
47+
48+
network.host: localhost
49+
50+
This will only allow the machine itself to access Elasticsearch on port 9200. Otherwise, anyone with network access to the machine could access your stored data or shut down the Elasticsearch server.
51+
52+
Finally, restart Elasticsearch to apply the changed settings:
53+
54+
systemctl restart elasticsearch
55+
56+
### Installing Kibana
57+
58+
Kibana is available as a 32-bit package and a 64-bit package, I'm using the 64-bit package in this guide:
59+
60+
wget https://download.elastic.co/kibana/kibana/kibana_4.5.1_amd64.deb
61+
dpkg -i ./kibana_4.5.1_amd64.deb
62+
63+
As we did with Elasticsearch, we'll make Kibana automatically start on bootup:
64+
65+
systemctl enable kibana
66+
67+
You should now be able to access the Kibana webinterface on port 5601. Before visiting the webinterface for the first time, we want to store some data in the Elasticsearch database so Kibana has something to work with when we start it for the first time.
68+
69+
### Configuring BoardFarm
70+
71+
We need to tell BoardFarm to store the data in the Elasticsearch database by specifying the server address in BoardFarm's `config.py`. In this guide, I'm running BoardFarm, Elasticsearch and Kibana on the same host, so I'll use 'localhost' as the server address:
72+
73+
elasticsearch_server = 'localhost'
74+
75+
You should then run a few BoardFarm tests to store some data in the Elasticsearch database. After running the tests, you should see something like this at the end of the output:
76+
77+
Elasticsearch: Data stored at localhost boardfarm-2016.07.05/bft_run/AVW6ozxZoiJNDeD5bFyj
78+
79+
Now, we have data to work with.
80+
81+
### Specifying an index pattern in Kibana
82+
83+
When visiting the Kibana webinterface for the first time, you'll have to specify an index pattern so Kibana knows which logfiles to analyze. BoardFarm stores its data in the format boardfarm-\<yyyy.mm.dd>, so we'll tell Kibana to use 'boardfarm-\*' as the index pattern.
84+
Kibana should then automatically recognize your existing database entries and suggest '@timestamp' as the time-field name.
85+
Click 'create' and you're good to go. You should now see a table with a number of fields, e.g. 'board_type' or 'tests_total'.
86+
87+
*Note: If you now run other testcases with new field names, you'll have to click the 'refresh field list' button at the top of the page, otherwise the new fields won't be displayed.*
88+
89+
You can now go to the 'Discover' page to see your log entries or to the 'Visualize' page to create new visualizations.

tests/iperf_udp_test.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def server_opts_reverse(self, node=lan):
7676
lan_priv_ip = node.get_interface_ipaddr("eth1")
7777
except:
7878
lan_priv_ip = node.get_interface_ipaddr("wlan0")
79-
board.uci_forward_traffic_redirect("tcp", "5001", lan_priv_ip)
79+
board.uci_forward_traffic_redirect("udp", "5001", lan_priv_ip)
8080
self.rip = board.get_interface_ipaddr(board.wan_iface)
8181
return ""
8282

@@ -167,10 +167,10 @@ def forward_ip(self):
167167
return "192.168.1.1"
168168

169169
def runTest(self):
170-
super(iPerfNonRoutedTest, self).runTest(client=lan, server=board)
170+
super(iPerfUDPNonRoutedTest, self).runTest(client=lan, server=board)
171171

172172
def recover(self):
173-
super(iPerfNonRoutedTest, self).recover(client=lan, server=board)
173+
super(iPerfUDPNonRoutedTest, self).recover(client=lan, server=board)
174174

175175
class iPerfUDPReverseTest(iPerfUDPTest):
176176
'''iPerf from WAN to LAN'''
@@ -228,15 +228,15 @@ def reverse_ip(self):
228228
return "4aaa::6"
229229

230230
def server_opts_reverse(self, node):
231-
board.uci_forward_traffic_rule("tcp", "5001", "4aaa::6")
231+
board.uci_forward_traffic_rule("udp", "5001", "4aaa::6")
232232
return "-V -B %s" % self.reverse_ip()
233233

234234
def client_opts(self):
235235
return "-V"
236236

237237
def runTest(self):
238238
ipv6_setup.Set_IPv6_Addresses.runTest(self)
239-
iPerfReverseTest.runTest(self)
239+
iPerfUDPReverseTest.runTest(self)
240240

241241
class iPerfUDPBiDirTest(iPerfUDPTest):
242242
'''iPerf from LAN to/from WAN'''
@@ -308,12 +308,12 @@ def server_opts_forward(self):
308308
return "-V -B %s" % self.forward_ip()
309309

310310
def server_opts_reverse(self, node):
311-
board.uci_forward_traffic_rule("tcp", "5001", "4aaa::6")
311+
board.uci_forward_traffic_rule("udp", "5001", "4aaa::6")
312312
return "-V -B %s" % self.reverse_ip()
313313

314314
def client_opts(self):
315315
return "-V"
316316

317317
def runTest(self):
318318
ipv6_setup.Set_IPv6_Addresses.runTest(self)
319-
iPerfBiDirTest.runTest(self)
319+
iPerfUDPBiDirTest.runTest(self)

0 commit comments

Comments
 (0)