3
from abrek.command import AbrekCmd
4
from abrek.testdef import testloader
6
class cmd_version(AbrekCmd):
5
class cmd_version(abrek.command.AbrekCmd):
6
""" Show the version of abrek
7
10
def run(self, argv):
9
12
print abrek.__version__
11
class cmd_install(AbrekCmd):
14
class cmd_help(abrek.command.AbrekCmd):
15
""" Get help on abrek commands
17
Usage: abrek help [command]
19
If the command name is ommited, calling the help command will return a
20
list of valid commands.
24
print "Available commands:"
25
for cmd in abrek.command.get_all_cmds():
28
print "To access extended help on a command use 'abrek help " \
31
cmd = abrek.command.get_command(argv[0])
35
print "No command found for '%s'" % argv[0]
37
class cmd_install(abrek.command.AbrekCmd):
40
Usage: abrek install TEST_NAME
12
42
def run(self, argv):
14
44
print "please specify the name of the test to install"
16
test = testloader(argv[0])
46
test = abrek.testdef.testloader(argv[0])
19
49
except RuntimeError as strerror:
20
50
print "Test installation error: %s" % strerror
23
class cmd_run(AbrekCmd):
53
class cmd_run(abrek.command.AbrekCmd):
56
Usage: abrek run TEST_NAME
24
58
def run(self, argv):
26
60
print "please specify the name of the test to run"
28
test = testloader(argv[0])
62
test = abrek.testdef.testloader(argv[0])
31
65
except Exception as strerror:
32
66
print "Test execution error: %s" % strerror
35
class cmd_uninstall(AbrekCmd):
69
class cmd_uninstall(abrek.command.AbrekCmd):
72
Usage: abrek uninstall TEST_NAME
36
74
def run(self, argv):
38
76
print "please specify the name of the test to uninstall"
40
test = testloader(argv[0])
78
test = abrek.testdef.testloader(argv[0])
43
81
except Exception as strerror: