summaryrefslogtreecommitdiff
path: root/qemu-boot-test
blob: e6187b57f1c046e578e159208f38da4e2622d710 (plain)
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
#!/usr/bin/python

import images
import sys

if len(sys.argv) != 2:
    print "Usage: qemu-boot-test <image type>"
    print "Currently supported image types are:"
    print "\tLinaroImage"
    print "\tDebianVersatile"
    sys.exit(1)

test_image = sys.argv[1]
qemu_test = getattr(images, test_image)
try:
    print "Testing: %s" % test_image
    print "Booting image"
    qemu_test.boot()
    print "Shutting down image"
    qemu_test.shutdown()
    print '-'*70
    print 'PASS: %s' % test_image
    print '-'*70
except:
    print "Error: %s" % sys.exc_info()[1]
    print '-'*70
    print 'FAIL: %s' % test_image
    print '-'*70
    sys.exit(-1)