Merge lp:~jeffmarcom/opencompute/add-checkbox-ocp-package into lp:opencompute/checkbox
- add-checkbox-ocp-package
- Merge into checkbox
Proposed by
Jeff Marcom
Status: | Merged |
---|---|
Approved by: | Jeff Lane |
Approved revision: | 2150 |
Merged at revision: | 2143 |
Proposed branch: | lp:~jeffmarcom/opencompute/add-checkbox-ocp-package |
Merge into: | lp:opencompute/checkbox |
Diff against target: |
649 lines (+547/-6) 10 files modified
bin/checkbox-ocp (+18/-0) checkbox_ocp/cli_interface.py (+477/-0) debian/changelog (+9/-2) debian/checkbox-ocp.install (+3/-0) debian/checkbox-ocp.links (+1/-0) debian/checkbox-ocp.postinst (+7/-0) debian/control (+10/-1) debian/rules (+3/-1) examples/checkbox-ocp.ini (+17/-0) setup.py (+2/-2) |
To merge this branch: | bzr merge lp:~jeffmarcom/opencompute/add-checkbox-ocp-package |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jeff Lane | Approve | ||
Review via email: mp+181350@code.launchpad.net |
Commit message
This adds a checkbox-ocp package to the list of built debian packages. This commit also bumps the overall changelog version to 1.16.6 so that it does not conflict with a previous checkbox installed package version.
Description of the change
This adds a checkbox-ocp package to the list of built debian packages. This commit also bumps the overall changelog version to 1.16.6 so that it does not conflict with a previous checkbox installed package version.
To post a comment you must log in.
- 2150. By Jeff Marcom
-
Updated checkbox-ocp.ini to call proper module interface
Signed-off-by: Jeff Marcom <email address hidden>
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === added file 'bin/checkbox-ocp' | |||
2 | --- bin/checkbox-ocp 1970-01-01 00:00:00 +0000 | |||
3 | +++ bin/checkbox-ocp 2013-08-21 16:43:19 +0000 | |||
4 | @@ -0,0 +1,18 @@ | |||
5 | 1 | #!/bin/bash | ||
6 | 2 | |||
7 | 3 | export XDG_CACHE_HOME=${XDG_CACHE_HOME:-$HOME/.cache} | ||
8 | 4 | export CHECKBOX_DATA=${CHECKBOX_DATA:-.} | ||
9 | 5 | export CHECKBOX_SHARE=${CHECKBOX_SHARE:-.} | ||
10 | 6 | export CHECKBOX_OPTIONS=${CHECKBOX_OPTIONS:---whitelist-file=$CHECKBOX_SHARE/data/whitelists/opencompute-ready-local.whitelist} | ||
11 | 7 | export PYTHONPATH=$PYTHONPATH:$CHECKBOX_SHARE | ||
12 | 8 | |||
13 | 9 | if [ $CHECKBOX_DATA != '.' ] | ||
14 | 10 | then | ||
15 | 11 | old_data=$HOME/.checkbox | ||
16 | 12 | if [ -d $old_data ] && [ ! -d $CHECKBOX_DATA ] | ||
17 | 13 | then | ||
18 | 14 | mv -f $old_data $CHECKBOX_DATA | ||
19 | 15 | fi | ||
20 | 16 | fi | ||
21 | 17 | |||
22 | 18 | python3 $CHECKBOX_SHARE/run "$@" $CHECKBOX_SHARE/configs/$(basename $0).ini | ||
23 | 0 | 19 | ||
24 | === added directory 'checkbox_ocp' | |||
25 | === added file 'checkbox_ocp/__init__.py' | |||
26 | === added file 'checkbox_ocp/cli_interface.py' | |||
27 | --- checkbox_ocp/cli_interface.py 1970-01-01 00:00:00 +0000 | |||
28 | +++ checkbox_ocp/cli_interface.py 2013-08-21 16:43:19 +0000 | |||
29 | @@ -0,0 +1,477 @@ | |||
30 | 1 | # | ||
31 | 2 | # This file is part of Checkbox. | ||
32 | 3 | # | ||
33 | 4 | # Copyright 2008 Canonical Ltd. | ||
34 | 5 | # | ||
35 | 6 | # Checkbox is free software: you can redistribute it and/or modify | ||
36 | 7 | # it under the terms of the GNU General Public License as published by | ||
37 | 8 | # the Free Software Foundation, either version 3 of the License, or | ||
38 | 9 | # (at your option) any later version. | ||
39 | 10 | # | ||
40 | 11 | # Checkbox is distributed in the hope that it will be useful, | ||
41 | 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
42 | 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
43 | 14 | # GNU General Public License for more details. | ||
44 | 15 | # | ||
45 | 16 | # You should have received a copy of the GNU General Public License | ||
46 | 17 | # along with Checkbox. If not, see <http://www.gnu.org/licenses/>. | ||
47 | 18 | # | ||
48 | 19 | import re | ||
49 | 20 | import sys | ||
50 | 21 | import string | ||
51 | 22 | import termios | ||
52 | 23 | |||
53 | 24 | from gettext import gettext as _ | ||
54 | 25 | |||
55 | 26 | from checkbox.user_interface import (UserInterface, ANSWER_TO_STATUS, | ||
56 | 27 | ALL_ANSWERS, YES_ANSWER, NO_ANSWER, SKIP_ANSWER) | ||
57 | 28 | |||
58 | 29 | |||
59 | 30 | ANSWER_TO_OPTION = { | ||
60 | 31 | YES_ANSWER: _("yes"), | ||
61 | 32 | NO_ANSWER: _("no"), | ||
62 | 33 | SKIP_ANSWER: _("skip")} | ||
63 | 34 | |||
64 | 35 | OPTION_TO_ANSWER = dict((o, a) for a, o in ANSWER_TO_OPTION.items()) | ||
65 | 36 | |||
66 | 37 | |||
67 | 38 | class CLIDialog: | ||
68 | 39 | """Command line dialog wrapper.""" | ||
69 | 40 | |||
70 | 41 | def __init__(self, text): | ||
71 | 42 | self.text = text | ||
72 | 43 | self.visible = False | ||
73 | 44 | |||
74 | 45 | def put(self, text): | ||
75 | 46 | sys.stdout.write(text) | ||
76 | 47 | sys.stdout.flush() | ||
77 | 48 | |||
78 | 49 | def put_line(self, line): | ||
79 | 50 | self.put("%s\n" % line) | ||
80 | 51 | |||
81 | 52 | def put_newline(self): | ||
82 | 53 | self.put("\n") | ||
83 | 54 | |||
84 | 55 | def get(self, label=None, limit=1, separator=termios.CEOT): | ||
85 | 56 | if label is not None: | ||
86 | 57 | self.put_newline() | ||
87 | 58 | self.put(label) | ||
88 | 59 | |||
89 | 60 | fileno = sys.stdin.fileno() | ||
90 | 61 | saved_attributes = termios.tcgetattr(fileno) | ||
91 | 62 | attributes = termios.tcgetattr(fileno) | ||
92 | 63 | attributes[3] &= ~(termios.ICANON | termios.ECHO) | ||
93 | 64 | attributes[6][termios.VMIN] = 1 | ||
94 | 65 | attributes[6][termios.VTIME] = 0 | ||
95 | 66 | termios.tcsetattr(fileno, termios.TCSANOW, attributes) | ||
96 | 67 | |||
97 | 68 | input = [] | ||
98 | 69 | escape = 0 | ||
99 | 70 | try: | ||
100 | 71 | while len(input) < limit: | ||
101 | 72 | ch = sys.stdin.read(1) | ||
102 | 73 | if ord(ch) == separator: | ||
103 | 74 | break | ||
104 | 75 | elif ord(ch) == 0o33: # ESC | ||
105 | 76 | escape = 1 | ||
106 | 77 | elif ord(ch) == termios.CERASE or ord(ch) == 0o10: | ||
107 | 78 | if len(input): | ||
108 | 79 | self.put("\010 \010") | ||
109 | 80 | del input[-1] | ||
110 | 81 | elif ord(ch) == termios.CKILL: | ||
111 | 82 | self.put("\010 \010" * len(input)) | ||
112 | 83 | input = [] | ||
113 | 84 | else: | ||
114 | 85 | if not escape: | ||
115 | 86 | input.append(ch) | ||
116 | 87 | self.put(ch) | ||
117 | 88 | elif escape == 1: | ||
118 | 89 | if ch == "[": | ||
119 | 90 | escape = 2 | ||
120 | 91 | else: | ||
121 | 92 | escape = 0 | ||
122 | 93 | elif escape == 2: | ||
123 | 94 | escape = 0 | ||
124 | 95 | finally: | ||
125 | 96 | termios.tcsetattr(fileno, termios.TCSANOW, saved_attributes) | ||
126 | 97 | |||
127 | 98 | return "".join(input) | ||
128 | 99 | |||
129 | 100 | def show(self): | ||
130 | 101 | self.visible = True | ||
131 | 102 | self.put_newline() | ||
132 | 103 | self.put_line(self.text) | ||
133 | 104 | |||
134 | 105 | |||
135 | 106 | class CLIChoiceDialog(CLIDialog): | ||
136 | 107 | |||
137 | 108 | def __init__(self, text): | ||
138 | 109 | super(CLIChoiceDialog, self).__init__(text) | ||
139 | 110 | self.keys = [] | ||
140 | 111 | self.options = [] | ||
141 | 112 | |||
142 | 113 | def get(self, *args, **kwargs): | ||
143 | 114 | response = super(CLIChoiceDialog, self).get(*args, **kwargs) | ||
144 | 115 | try: | ||
145 | 116 | return self.keys.index(response[0]) | ||
146 | 117 | except ValueError: | ||
147 | 118 | return -1 | ||
148 | 119 | |||
149 | 120 | def run(self, label=None, defaults=[]): | ||
150 | 121 | if not self.visible: | ||
151 | 122 | self.show() | ||
152 | 123 | |||
153 | 124 | try: | ||
154 | 125 | # Only one option | ||
155 | 126 | if len(self.keys) <= 1: | ||
156 | 127 | self.get(_("Press any key to continue...")) | ||
157 | 128 | return 0 | ||
158 | 129 | # Multiple choices | ||
159 | 130 | while True: | ||
160 | 131 | self.put_newline() | ||
161 | 132 | for key, option in zip(self.keys, self.options): | ||
162 | 133 | default = "*" if option in defaults else " " | ||
163 | 134 | self.put_line("%s %s: %s" % (default, key, option)) | ||
164 | 135 | |||
165 | 136 | response = self.get(_("Please choose (%s): ") % | ||
166 | 137 | ("/".join(self.keys))) | ||
167 | 138 | if response >= 0: | ||
168 | 139 | return response | ||
169 | 140 | |||
170 | 141 | if label is not None: | ||
171 | 142 | self.put_line(label) | ||
172 | 143 | |||
173 | 144 | except KeyboardInterrupt: | ||
174 | 145 | self.put_newline() | ||
175 | 146 | raise | ||
176 | 147 | |||
177 | 148 | def add_option(self, option, key=None): | ||
178 | 149 | if key is None: | ||
179 | 150 | keys = option.lower() + \ | ||
180 | 151 | string.ascii_letters + \ | ||
181 | 152 | string.digits + \ | ||
182 | 153 | string.punctuation | ||
183 | 154 | |||
184 | 155 | keys = keys.replace(' ', '') | ||
185 | 156 | keys = keys.replace('+', '') | ||
186 | 157 | |||
187 | 158 | for key in keys: | ||
188 | 159 | if key not in self.keys: | ||
189 | 160 | break | ||
190 | 161 | self.keys.append(key) | ||
191 | 162 | self.options.append(option) | ||
192 | 163 | |||
193 | 164 | |||
194 | 165 | class CLIReportDialog(CLIDialog): | ||
195 | 166 | """ | ||
196 | 167 | Display test results | ||
197 | 168 | """ | ||
198 | 169 | STATUS = {'pass': '[0;32m{0}[0m', | ||
199 | 170 | 'fail': '[0;31m{0}[0m'} | ||
200 | 171 | |||
201 | 172 | def __init__(self, text, results): | ||
202 | 173 | super(CLIReportDialog, self).__init__(text) | ||
203 | 174 | self.results = results | ||
204 | 175 | |||
205 | 176 | def run(self): | ||
206 | 177 | """ | ||
207 | 178 | Show root of the tree | ||
208 | 179 | and provide the ability to further display subtress | ||
209 | 180 | """ | ||
210 | 181 | root = self.results | ||
211 | 182 | title = self.text | ||
212 | 183 | self._display(title, root) | ||
213 | 184 | |||
214 | 185 | def _is_suite(self, root): | ||
215 | 186 | """ | ||
216 | 187 | Return True if root contains a suite | ||
217 | 188 | that is, a job containing other jobs | ||
218 | 189 | """ | ||
219 | 190 | return all(issubclass(type(value), dict) | ||
220 | 191 | for value in root.values()) | ||
221 | 192 | |||
222 | 193 | def _display(self, title, root): | ||
223 | 194 | """ | ||
224 | 195 | Display dialog until user decides to exit | ||
225 | 196 | (recursively for subtrees) | ||
226 | 197 | """ | ||
227 | 198 | while True: | ||
228 | 199 | self.put_newline() | ||
229 | 200 | self.put_newline() | ||
230 | 201 | self.put_line(title) | ||
231 | 202 | self.put_newline() | ||
232 | 203 | |||
233 | 204 | keys = [] | ||
234 | 205 | options = [] | ||
235 | 206 | |||
236 | 207 | def add_option(option, key=None): | ||
237 | 208 | """ | ||
238 | 209 | Add option to list | ||
239 | 210 | and generate automatic key value | ||
240 | 211 | if not provided | ||
241 | 212 | """ | ||
242 | 213 | if key is None: | ||
243 | 214 | key = string.ascii_lowercase[len(keys)] | ||
244 | 215 | keys.append(key) | ||
245 | 216 | options.append(option) | ||
246 | 217 | |||
247 | 218 | for job_name, job_data in sorted(root.items()): | ||
248 | 219 | if self._is_suite(job_data): | ||
249 | 220 | add_option(job_name) | ||
250 | 221 | self.put_line('{key}: {option}' | ||
251 | 222 | .format(key=keys[-1], | ||
252 | 223 | option=options[-1])) | ||
253 | 224 | else: | ||
254 | 225 | job_status = job_data.get('status') | ||
255 | 226 | status_string = (self.STATUS.get(job_status, '{0}') | ||
256 | 227 | .format(job_status)) | ||
257 | 228 | self.put_line(' {name} [{status}]' | ||
258 | 229 | .format(name=job_name, | ||
259 | 230 | status=status_string)) | ||
260 | 231 | |||
261 | 232 | add_option(_("Space when finished"), " ") | ||
262 | 233 | self.put_line('{key}: {option}' | ||
263 | 234 | .format(key=keys[-1], | ||
264 | 235 | option=options[-1])) | ||
265 | 236 | |||
266 | 237 | response = self.get(_("Please choose (%s): ") % ("/".join(keys))) | ||
267 | 238 | |||
268 | 239 | if response != ' ': | ||
269 | 240 | try: | ||
270 | 241 | selected_option = options[keys.index(response)] | ||
271 | 242 | except ValueError: | ||
272 | 243 | # Display again menu | ||
273 | 244 | continue | ||
274 | 245 | |||
275 | 246 | # Display new menu with the contents of the selected option | ||
276 | 247 | self._display(selected_option, root[selected_option]) | ||
277 | 248 | else: | ||
278 | 249 | # Exit from this menu display | ||
279 | 250 | # (display again parent menu or exit) | ||
280 | 251 | break | ||
281 | 252 | |||
282 | 253 | |||
283 | 254 | class CLITextDialog(CLIDialog): | ||
284 | 255 | |||
285 | 256 | limit = 255 | ||
286 | 257 | separator = termios.CEOT | ||
287 | 258 | |||
288 | 259 | def run(self, label=None): | ||
289 | 260 | if not self.visible: | ||
290 | 261 | self.show() | ||
291 | 262 | |||
292 | 263 | self.put_newline() | ||
293 | 264 | try: | ||
294 | 265 | return self.get(label, self.limit, self.separator) | ||
295 | 266 | except KeyboardInterrupt: | ||
296 | 267 | self.put_newline() | ||
297 | 268 | raise | ||
298 | 269 | |||
299 | 270 | |||
300 | 271 | class CLILineDialog(CLITextDialog): | ||
301 | 272 | |||
302 | 273 | limit = 80 | ||
303 | 274 | separator = ord("\n") | ||
304 | 275 | |||
305 | 276 | |||
306 | 277 | class Twirly(object): | ||
307 | 278 | def __init__(self): | ||
308 | 279 | self.index = 0 | ||
309 | 280 | self.twirlies = "-\\|/" | ||
310 | 281 | |||
311 | 282 | def next(self): | ||
312 | 283 | next_twirly = self.twirlies[self.index] | ||
313 | 284 | self.index = (self.index + 1) % len(self.twirlies) | ||
314 | 285 | return next_twirly | ||
315 | 286 | |||
316 | 287 | |||
317 | 288 | class CLIProgressDialog(CLIDialog): | ||
318 | 289 | """Command line progress dialog wrapper.""" | ||
319 | 290 | |||
320 | 291 | def __init__(self, text): | ||
321 | 292 | super(CLIProgressDialog, self).__init__(text) | ||
322 | 293 | self.progress_count = 0 | ||
323 | 294 | self.twirly = Twirly() | ||
324 | 295 | |||
325 | 296 | def set(self, progress=None): | ||
326 | 297 | self.progress_count = (self.progress_count + 1) % 5 | ||
327 | 298 | if self.progress_count: | ||
328 | 299 | return | ||
329 | 300 | |||
330 | 301 | if progress != None: | ||
331 | 302 | self.put("\r%u%%" % (progress * 100)) | ||
332 | 303 | else: | ||
333 | 304 | self.put("\b\b") | ||
334 | 305 | self.put(self.twirly.next()) | ||
335 | 306 | self.put(" ") | ||
336 | 307 | sys.stdout.flush() | ||
337 | 308 | |||
338 | 309 | |||
339 | 310 | class CLIInterface(UserInterface): | ||
340 | 311 | |||
341 | 312 | def _toggle_results(self, key, options, results): | ||
342 | 313 | if isinstance(results, dict): | ||
343 | 314 | if key in results: | ||
344 | 315 | del results[key] | ||
345 | 316 | |||
346 | 317 | elif key in options: | ||
347 | 318 | if isinstance(options[key], dict): | ||
348 | 319 | results[key] = {} | ||
349 | 320 | elif isinstance(options[key], (list, tuple)): | ||
350 | 321 | results[key] = [] | ||
351 | 322 | else: | ||
352 | 323 | results[key] = None | ||
353 | 324 | |||
354 | 325 | for k in options[key]: | ||
355 | 326 | self._toggle_results(k, options[key], results[key]) | ||
356 | 327 | |||
357 | 328 | elif isinstance(results, (list, tuple)): | ||
358 | 329 | if key in results: | ||
359 | 330 | results.remove(key) | ||
360 | 331 | elif key in options: | ||
361 | 332 | results.append(key) | ||
362 | 333 | |||
363 | 334 | def show_progress_start(self, text): | ||
364 | 335 | self.progress = CLIProgressDialog(text) | ||
365 | 336 | self.progress.show() | ||
366 | 337 | |||
367 | 338 | def show_progress_pulse(self): | ||
368 | 339 | self.progress.set() | ||
369 | 340 | |||
370 | 341 | def show_text(self, text, previous=None, next=None): | ||
371 | 342 | dialog = CLIChoiceDialog(text) | ||
372 | 343 | dialog.run() | ||
373 | 344 | |||
374 | 345 | def show_entry(self, text, value, showSubmitToHexr=False, label=None, previous=None, next=None): | ||
375 | 346 | dialog = CLILineDialog(text) | ||
376 | 347 | |||
377 | 348 | return (dialog.run(), False) | ||
378 | 349 | |||
379 | 350 | def show_check(self, text, options=[], default=[]): | ||
380 | 351 | dialog = CLIChoiceDialog(text) | ||
381 | 352 | for option in options: | ||
382 | 353 | dialog.add_option(option) | ||
383 | 354 | |||
384 | 355 | dialog.add_option(_("Space when finished"), " ") | ||
385 | 356 | |||
386 | 357 | results = default | ||
387 | 358 | while True: | ||
388 | 359 | response = dialog.run(defaults=results) | ||
389 | 360 | if response >= len(options): | ||
390 | 361 | break | ||
391 | 362 | |||
392 | 363 | result = options[response] | ||
393 | 364 | self._toggle_results(result, options, results) | ||
394 | 365 | |||
395 | 366 | return (results, False) | ||
396 | 367 | |||
397 | 368 | def show_radio(self, text, options=[], default=None): | ||
398 | 369 | dialog = CLIChoiceDialog(text) | ||
399 | 370 | for option in options: | ||
400 | 371 | dialog.add_option(option) | ||
401 | 372 | |||
402 | 373 | # Show options dialog | ||
403 | 374 | response = dialog.run() | ||
404 | 375 | return options[response] | ||
405 | 376 | |||
406 | 377 | def show_tree(self, text, options={}, default={}, deselect_warning=""): | ||
407 | 378 | keys = sorted(options.keys()) | ||
408 | 379 | |||
409 | 380 | dialog = CLIChoiceDialog(text) | ||
410 | 381 | for option in keys: | ||
411 | 382 | dialog.add_option(option) | ||
412 | 383 | |||
413 | 384 | dialog.add_option(_("Combine with character above to expand node"), | ||
414 | 385 | "+") | ||
415 | 386 | dialog.add_option(_("Space when finished"), " ") | ||
416 | 387 | |||
417 | 388 | do_expand = False | ||
418 | 389 | results = default | ||
419 | 390 | while True: | ||
420 | 391 | response = dialog.run(defaults=results) | ||
421 | 392 | if response > len(options): | ||
422 | 393 | break | ||
423 | 394 | |||
424 | 395 | elif response == len(options): | ||
425 | 396 | response = dialog.get() | ||
426 | 397 | do_expand = True | ||
427 | 398 | |||
428 | 399 | else: | ||
429 | 400 | do_expand = False | ||
430 | 401 | |||
431 | 402 | # Invalid response | ||
432 | 403 | if response < 0: | ||
433 | 404 | continue | ||
434 | 405 | |||
435 | 406 | # Toggle results | ||
436 | 407 | result = keys[response] | ||
437 | 408 | if not do_expand: | ||
438 | 409 | self._toggle_results(result, options, results) | ||
439 | 410 | continue | ||
440 | 411 | |||
441 | 412 | # Expand tree | ||
442 | 413 | dialog.visible = False | ||
443 | 414 | if options[result]: | ||
444 | 415 | branch_results = results.get(result, {}) | ||
445 | 416 | self.show_tree(result, options[result], branch_results) | ||
446 | 417 | if branch_results and result not in results: | ||
447 | 418 | results[result] = branch_results | ||
448 | 419 | |||
449 | 420 | return results | ||
450 | 421 | |||
451 | 422 | def show_report(self, text, results): | ||
452 | 423 | """ | ||
453 | 424 | Show test case results in a tree hierarchy | ||
454 | 425 | """ | ||
455 | 426 | dialog = CLIReportDialog(text, results) | ||
456 | 427 | dialog.run() | ||
457 | 428 | |||
458 | 429 | def show_test(self, test, runner): | ||
459 | 430 | options = list([ANSWER_TO_OPTION[a] for a in ALL_ANSWERS]) | ||
460 | 431 | if "command" in test: | ||
461 | 432 | options.append(_("test")) | ||
462 | 433 | |||
463 | 434 | if re.search(r"\$output", test["description"]): | ||
464 | 435 | output = runner(test)[1] | ||
465 | 436 | else: | ||
466 | 437 | output = "" | ||
467 | 438 | |||
468 | 439 | while True: | ||
469 | 440 | # Show option dialog | ||
470 | 441 | description = string.Template(test["description"]).substitute({ | ||
471 | 442 | "output": output.strip()}) | ||
472 | 443 | dialog = CLIChoiceDialog(description) | ||
473 | 444 | |||
474 | 445 | for option in options: | ||
475 | 446 | dialog.add_option(option, option[0]) | ||
476 | 447 | |||
477 | 448 | # Get option from dialog | ||
478 | 449 | response = dialog.run() | ||
479 | 450 | option = options[response] | ||
480 | 451 | if response < len(ALL_ANSWERS): | ||
481 | 452 | break | ||
482 | 453 | |||
483 | 454 | output = runner(test)[1] | ||
484 | 455 | |||
485 | 456 | options[-1] = _("test again") | ||
486 | 457 | |||
487 | 458 | answer = OPTION_TO_ANSWER[option] | ||
488 | 459 | if answer == NO_ANSWER: | ||
489 | 460 | text = _("Further information:") | ||
490 | 461 | dialog = CLITextDialog(text) | ||
491 | 462 | test["data"] = dialog.run(_("Please type here and press" | ||
492 | 463 | " Ctrl-D when finished:\n")) | ||
493 | 464 | else: | ||
494 | 465 | test["data"] = "" | ||
495 | 466 | |||
496 | 467 | test["status"] = ANSWER_TO_STATUS[answer] | ||
497 | 468 | |||
498 | 469 | def show_info(self, text, options=[], default=None): | ||
499 | 470 | return self.show_radio(text, options, default) | ||
500 | 471 | |||
501 | 472 | def show_error(self, primary_text, | ||
502 | 473 | secondary_text=None, detailed_text=None): | ||
503 | 474 | text = filter(None, [primary_text, secondary_text, detailed_text]) | ||
504 | 475 | text = '\n'.join(text) | ||
505 | 476 | dialog = CLIChoiceDialog("Error: %s" % text) | ||
506 | 477 | dialog.run() | ||
507 | 0 | 478 | ||
508 | === modified file 'debian/changelog' | |||
509 | --- debian/changelog 2013-08-19 20:46:26 +0000 | |||
510 | +++ debian/changelog 2013-08-21 16:43:19 +0000 | |||
511 | @@ -1,4 +1,12 @@ | |||
513 | 1 | checkbox (0.16.6~OCP) UNRELEASED; urgency=low | 1 | checkbox (1.16.6~OCP) UNRELEASED; urgency=low |
514 | 2 | |||
515 | 3 | [ Jeff Marcom ] | ||
516 | 4 | * Added checkbox-ocp package | ||
517 | 5 | |||
518 | 6 | -- Jeff Marcom <jeff.marcom@canonical.com> Wed, 21 Aug 2013 12:20:24 -0400 | ||
519 | 7 | |||
520 | 8 | |||
521 | 9 | checkbox (0.16.6~OCPubuntu1) UNRELEASED; urgency=low | ||
522 | 2 | 10 | ||
523 | 3 | * INITIAL RELEASE: | 11 | * INITIAL RELEASE: |
524 | 4 | based on checkbox 0.16.6 from lp:checkbox with modificiations specific to | 12 | based on checkbox 0.16.6 from lp:checkbox with modificiations specific to |
525 | @@ -17,4 +25,3 @@ | |||
526 | 17 | checkbox/tests/ - Cleaned up unit tests that were looking for things | 25 | checkbox/tests/ - Cleaned up unit tests that were looking for things |
527 | 18 | removed in this merge. | 26 | removed in this merge. |
528 | 19 | 27 | ||
529 | 20 | -- Jeff Marcom <jeff.marcom@canonical.com> Wed, 31 Jul 2013 19:36:52 -0400 | ||
530 | 21 | 28 | ||
531 | === added file 'debian/checkbox-ocp.install' | |||
532 | --- debian/checkbox-ocp.install 1970-01-01 00:00:00 +0000 | |||
533 | +++ debian/checkbox-ocp.install 2013-08-21 16:43:19 +0000 | |||
534 | @@ -0,0 +1,3 @@ | |||
535 | 1 | usr/bin/checkbox-ocp | ||
536 | 2 | usr/lib/python*/*-packages/checkbox_ocp/* | ||
537 | 3 | usr/share/checkbox/examples/checkbox-ocp.ini | ||
538 | 0 | 4 | ||
539 | === added file 'debian/checkbox-ocp.links' | |||
540 | --- debian/checkbox-ocp.links 1970-01-01 00:00:00 +0000 | |||
541 | +++ debian/checkbox-ocp.links 2013-08-21 16:43:19 +0000 | |||
542 | @@ -0,0 +1,1 @@ | |||
543 | 1 | usr/share/man/man1/checkbox.1.gz usr/share/man/man1/checkbox-ocp.1.gz | ||
544 | 0 | 2 | ||
545 | === added file 'debian/checkbox-ocp.postinst' | |||
546 | --- debian/checkbox-ocp.postinst 1970-01-01 00:00:00 +0000 | |||
547 | +++ debian/checkbox-ocp.postinst 2013-08-21 16:43:19 +0000 | |||
548 | @@ -0,0 +1,7 @@ | |||
549 | 1 | #! /bin/sh -e | ||
550 | 2 | |||
551 | 3 | base_package="checkbox" | ||
552 | 4 | . /usr/share/debconf/confmodule | ||
553 | 5 | . /usr/share/checkbox/install/postinst | ||
554 | 6 | |||
555 | 7 | #DEBHELPER# | ||
556 | 0 | 8 | ||
557 | === modified file 'debian/control' | |||
558 | --- debian/control 2013-07-05 16:43:48 +0000 | |||
559 | +++ debian/control 2013-08-21 16:43:19 +0000 | |||
560 | @@ -47,7 +47,7 @@ | |||
561 | 47 | python3-gi | 47 | python3-gi |
562 | 48 | Suggests: bonnie++, | 48 | Suggests: bonnie++, |
563 | 49 | bootchart, | 49 | bootchart, |
565 | 50 | checkbox-cli | checkbox-gtk, | 50 | checkbox-cli | checkbox-ocp, checkbox-gtk, |
566 | 51 | curl, | 51 | curl, |
567 | 52 | ethtool, | 52 | ethtool, |
568 | 53 | fwts, | 53 | fwts, |
569 | @@ -80,6 +80,15 @@ | |||
570 | 80 | . | 80 | . |
571 | 81 | This package provides a command line interface for answering tests. | 81 | This package provides a command line interface for answering tests. |
572 | 82 | 82 | ||
573 | 83 | Package: checkbox-ocp | ||
574 | 84 | Architecture: all | ||
575 | 85 | Depends: checkbox (>= ${source:Version}), ${misc:Depends} | ||
576 | 86 | Description: Command line interface of checkbox for the Open Compute Project | ||
577 | 87 | This project provides an extensible interface for system testing on | ||
578 | 88 | Open Compute platforms. | ||
579 | 89 | . | ||
580 | 90 | This package provides a command line interface for answering tests. | ||
581 | 91 | |||
582 | 83 | Package: checkbox-urwid | 92 | Package: checkbox-urwid |
583 | 84 | Architecture: all | 93 | Architecture: all |
584 | 85 | Depends: checkbox (>= ${source:Version}), python3-urwid, ${misc:Depends} | 94 | Depends: checkbox (>= ${source:Version}), python3-urwid, ${misc:Depends} |
585 | 86 | 95 | ||
586 | === modified file 'debian/rules' | |||
587 | --- debian/rules 2013-07-05 16:43:48 +0000 | |||
588 | +++ debian/rules 2013-08-21 16:43:19 +0000 | |||
589 | @@ -25,6 +25,7 @@ | |||
590 | 25 | 25 | ||
591 | 26 | override_dh_installdeb: | 26 | override_dh_installdeb: |
592 | 27 | cp debian/checkbox.postrm debian/checkbox-cli.postrm | 27 | cp debian/checkbox.postrm debian/checkbox-cli.postrm |
593 | 28 | cp debian/checkbox.postrm debian/checkbox-ocp.postrm | ||
594 | 28 | cp debian/checkbox.postrm debian/checkbox-urwid.postrm | 29 | cp debian/checkbox.postrm debian/checkbox-urwid.postrm |
595 | 29 | cp debian/checkbox.postrm debian/checkbox-gtk.postrm | 30 | cp debian/checkbox.postrm debian/checkbox-gtk.postrm |
596 | 30 | cp debian/checkbox.postrm debian/checkbox-qt.postrm | 31 | cp debian/checkbox.postrm debian/checkbox-qt.postrm |
597 | @@ -34,6 +35,7 @@ | |||
598 | 34 | override_dh_installdocs: | 35 | override_dh_installdocs: |
599 | 35 | dh_installdocs -pcheckbox ./README | 36 | dh_installdocs -pcheckbox ./README |
600 | 36 | dh_installdocs -pcheckbox-cli ./README | 37 | dh_installdocs -pcheckbox-cli ./README |
601 | 38 | dh_installdocs -pcheckbox-ocp ./README | ||
602 | 37 | dh_installdocs -pcheckbox-urwid ./README | 39 | dh_installdocs -pcheckbox-urwid ./README |
603 | 38 | dh_installdocs -pcheckbox-gtk ./README | 40 | dh_installdocs -pcheckbox-gtk ./README |
604 | 39 | dh_installdocs -pcheckbox-qt ./README | 41 | dh_installdocs -pcheckbox-qt ./README |
605 | @@ -42,6 +44,6 @@ | |||
606 | 42 | 44 | ||
607 | 43 | override_dh_clean: | 45 | override_dh_clean: |
608 | 44 | -find . -name \*.mo -exec rm {} \; | 46 | -find . -name \*.mo -exec rm {} \; |
610 | 45 | -rm -f debian/checkbox-cli.postrm debian/checkbox-urwid.postrm debian/checkbox-gtk.postrm debian/checkbox-qt.postrm debian/checkbox-hw-collection.postrm | 47 | -rm -f debian/checkbox-cli.postrm debian/checkbox-ocp.postrm debian/checkbox-cli.postrmebian/checkbox-urwid.postrm debian/checkbox-gtk.postrm debian/checkbox-qt.postrm debian/checkbox-hw-collection.postrm |
611 | 46 | debconf-updatepo | 48 | debconf-updatepo |
612 | 47 | dh_clean | 49 | dh_clean |
613 | 48 | 50 | ||
614 | === added file 'examples/checkbox-ocp.ini' | |||
615 | --- examples/checkbox-ocp.ini 1970-01-01 00:00:00 +0000 | |||
616 | +++ examples/checkbox-ocp.ini 2013-08-21 16:43:19 +0000 | |||
617 | @@ -0,0 +1,17 @@ | |||
618 | 1 | [DEFAULT] | ||
619 | 2 | |||
620 | 3 | # Space separated list of files to include as a dependency for the | ||
621 | 4 | # CLI interface. | ||
622 | 5 | includes = %(checkbox_share)s/configs/checkbox.ini | ||
623 | 6 | |||
624 | 7 | [checkbox/plugins/user_interface] | ||
625 | 8 | |||
626 | 9 | # Module where the user interface implementation is defined. | ||
627 | 10 | interface_module = checkbox_ocp.cli_interface | ||
628 | 11 | |||
629 | 12 | # Class implementing the UserInterface interface. | ||
630 | 13 | interface_class = CLIInterface | ||
631 | 14 | |||
632 | 15 | [checkbox/plugins] | ||
633 | 16 | |||
634 | 17 | blacklist = hexr_prompt hexr_transport | ||
635 | 0 | 18 | ||
636 | === modified file 'setup.py' | |||
637 | --- setup.py 2013-07-05 16:43:48 +0000 | |||
638 | +++ setup.py 2013-08-21 16:43:19 +0000 | |||
639 | @@ -266,8 +266,8 @@ | |||
640 | 266 | ], | 266 | ], |
641 | 267 | }, | 267 | }, |
642 | 268 | scripts=[ | 268 | scripts=[ |
645 | 269 | "bin/checkbox-cli", "bin/checkbox-gtk", "bin/checkbox-urwid", | 269 | "bin/checkbox-cli", "bin/checkbox-ocp", "bin/checkbox-gtk", |
646 | 270 | "bin/checkbox-qt", "bin/checkbox-hw-collection"], | 270 | "bin/checkbox-urwid", "bin/checkbox-qt", "bin/checkbox-hw-collection"], |
647 | 271 | packages=find_packages(), | 271 | packages=find_packages(), |
648 | 272 | package_data={ | 272 | package_data={ |
649 | 273 | "": ["cputable"]}, | 273 | "": ["cputable"]}, |
Builds and seems to be ok.