| Line | |
|---|
| 1 | #!/usr/bin/python |
|---|
| 2 | #--------------------------------------------------------------- |
|---|
| 3 | # Project : tester |
|---|
| 4 | # File : dpytest |
|---|
| 5 | # Copyright : 2009 Splitted-Desktop Systems |
|---|
| 6 | # Author : Frederic Lepied |
|---|
| 7 | # Created On : Sun Feb 1 13:54:41 2009 |
|---|
| 8 | # Purpose : report the list of available tests or information |
|---|
| 9 | # about tests for one system. |
|---|
| 10 | #--------------------------------------------------------------- |
|---|
| 11 | |
|---|
| 12 | import sys |
|---|
| 13 | import settings |
|---|
| 14 | from pxe.models import * |
|---|
| 15 | from pxe.common import * |
|---|
| 16 | from tester.models import * |
|---|
| 17 | |
|---|
| 18 | if len(sys.argv) != 2: |
|---|
| 19 | error('Usage: %s <system name>|-l' % sys.argv[0]) |
|---|
| 20 | |
|---|
| 21 | if sys.argv[1] == '-l': |
|---|
| 22 | for s in TestName.objects.all(): |
|---|
| 23 | print s.name |
|---|
| 24 | else: |
|---|
| 25 | try: |
|---|
| 26 | system = System.objects.get(name=sys.argv[1]) |
|---|
| 27 | except System.DoesNotExist: |
|---|
| 28 | error('System %s not defined' % sys.argv[1]) |
|---|
| 29 | |
|---|
| 30 | print 'Name:', system.name |
|---|
| 31 | |
|---|
| 32 | logs = TestLog.objects.filter(system=system, status='R').order_by('-date') |
|---|
| 33 | |
|---|
| 34 | for l in logs: |
|---|
| 35 | print l.date, l.test_name.name, l.status |
|---|
| 36 | |
|---|
| 37 | # dpytest ends here |
|---|