Merge lp:~pwlars/lava-dispatcher/magma-merges into lp:lava-dispatcher

Proposed by Paul Larson
Status: Merged
Merged at revision: 48
Proposed branch: lp:~pwlars/lava-dispatcher/magma-merges
Merge into: lp:lava-dispatcher
Diff against target: 132 lines (+35/-7)
5 files modified
lava/dispatcher/__init__.py (+4/-0)
lava/dispatcher/actions/abrek.py (+2/-2)
lava/dispatcher/actions/boot_control.py (+8/-1)
lava/dispatcher/actions/launch_control.py (+20/-3)
lava/dispatcher/config.py (+1/-1)
To merge this branch: bzr merge lp:~pwlars/lava-dispatcher/magma-merges
Reviewer Review Type Date Requested Status
Linaro Validation Team Pending
Review via email: mp+61841@code.launchpad.net

Description of the change

Updates trunk with the important bits of what is actually running
currently. A few workarounds still exist here, but bugs exist for them
in lp to track them.

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lava/dispatcher/__init__.py'
2--- lava/dispatcher/__init__.py 2011-04-29 18:16:01 +0000
3+++ lava/dispatcher/__init__.py 2011-05-20 22:53:40 +0000
4@@ -80,3 +80,7 @@
5
6 def get_metadata(self):
7 return self.metadata
8+
9+ def get_test_run(self):
10+ self.add_result('job_complete', self.job_status)
11+ return self._test_run
12
13=== modified file 'lava/dispatcher/actions/abrek.py'
14--- lava/dispatcher/actions/abrek.py 2011-04-29 17:05:24 +0000
15+++ lava/dispatcher/actions/abrek.py 2011-05-20 22:53:40 +0000
16@@ -20,7 +20,7 @@
17 """
18 abrek test tool deployment to test image rootfs by chroot
19 """
20- def run(self, tests):
21+ def run(self, tests, timeout=2400):
22 client = self.client
23 #Make sure in master image
24 #, or exception can be caught and do boot_master_image()
25@@ -65,7 +65,7 @@
26 try:
27 client.run_shell_command(
28 'chroot /mnt/root abrek help',
29- response = "list-tests", timeout = 10)
30+ response = "list-tests")
31 except:
32 raise OperationFailed("abrek deployment failed")
33
34
35=== modified file 'lava/dispatcher/actions/boot_control.py'
36--- lava/dispatcher/actions/boot_control.py 2011-04-29 17:05:24 +0000
37+++ lava/dispatcher/actions/boot_control.py 2011-05-20 22:53:40 +0000
38@@ -8,7 +8,14 @@
39 client = self.client
40 #Workaround for commands coming too quickly at this point
41 client.proc.sendline("")
42- client.boot_linaro_image()
43+ status = 'pass'
44+ try:
45+ client.boot_linaro_image()
46+ except:
47+ status = 'fail'
48+ raise
49+ finally:
50+ self.context.test_data.add_result("boot_image", status)
51
52 class cmd_boot_master_image(BaseAction):
53 """ Call client code to boot to the master image
54
55=== modified file 'lava/dispatcher/actions/launch_control.py'
56--- lava/dispatcher/actions/launch_control.py 2011-05-02 22:20:43 +0000
57+++ lava/dispatcher/actions/launch_control.py 2011-05-20 22:53:40 +0000
58@@ -4,6 +4,7 @@
59 from lava.dispatcher.config import LAVA_RESULT_DIR, MASTER_STR, LAVA_SERVER_IP
60 import socket
61 from threading import Thread
62+import time
63 import xmlrpclib
64
65 class cmd_submit_results(BaseAction):
66@@ -45,6 +46,9 @@
67
68 t = ResultUploader()
69 t.start()
70+ #XXX: Odd problem where we sometimes get stuck here. This is just
71+ # a hacky workaround to see if it's a race
72+ time.sleep(60)
73 client.run_shell_command(
74 'cat bundle.lst |nc %s %d' % (LAVA_SERVER_IP, t.get_port()),
75 response = MASTER_STR)
76@@ -55,6 +59,9 @@
77 for bundle in bundle_list:
78 t = ResultUploader()
79 t.start()
80+ #XXX: Odd problem where we sometimes get stuck here. This is just
81+ # a hacky workaround to see if it's a race
82+ time.sleep(60)
83 client.run_shell_command(
84 'cat /tmp/%s/%s | nc %s %s' % (LAVA_RESULT_DIR, bundle,
85 LAVA_SERVER_IP, t.get_port()),
86@@ -64,16 +71,25 @@
87 self.all_bundles.append(json.loads(content))
88
89 main_bundle = self.combine_bundles()
90- srv.put(main_bundle, 'lava-dispatcher.bundle', stream)
91+ main_bundle['test_runs'].append(self.context.test_data.get_test_run())
92+ for test_run in main_bundle['test_runs']:
93+ attributes = test_run.get('attributes',{})
94+ attributes.update(self.context.test_data.get_metadata())
95+ test_run['attributes'] = attributes
96+ json_bundle = json.dumps(main_bundle)
97+ srv.put(json_bundle, 'lava-dispatcher.bundle', stream)
98
99 def combine_bundles(self):
100 if not self.all_bundles:
101- return
102+ return {
103+ "test_runs": [],
104+ "format": "Dashboard Bundle Format 1.2"
105+ }
106 main_bundle = self.all_bundles.pop(0)
107 test_runs = main_bundle['test_runs']
108 for bundle in self.all_bundles:
109 test_runs += bundle['test_runs']
110- return json.dumps(main_bundle)
111+ return main_bundle
112
113
114 class ResultUploader(Thread):
115@@ -104,3 +120,4 @@
116 if not data:
117 break
118 self.data = self.data + data
119+ self.s.close()
120
121=== modified file 'lava/dispatcher/config.py'
122--- lava/dispatcher/config.py 2011-05-03 18:35:43 +0000
123+++ lava/dispatcher/config.py 2011-05-20 22:53:40 +0000
124@@ -60,7 +60,7 @@
125 BOARDS = {
126 "panda01": PandaBoard,
127 "panda02": PandaBoard,
128- "beagle01": BeagleBoard,
129+ "beaglexm01": BeagleBoard,
130 "bbg01": Mx51evkBoard,
131 "mx53loco01": Mx53locoBoard,
132 }

Subscribers

People subscribed via source and target branches