diff options
author | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-02-27 16:00:51 +0000 |
---|---|---|
committer | Lars Wirzenius <lars.wirzenius@codethink.co.uk> | 2012-02-27 16:00:51 +0000 |
commit | 4f5bcd48ba02a2913a7f45edb0ada7a0e73c01ba (patch) | |
tree | 369d06f509c12f3b8a00a632d34cc4c19cc9580d /morph | |
parent | 42a9f54d191940dd1a155e91363fb5041ca63c05 (diff) | |
download | morph-4f5bcd48ba02a2913a7f45edb0ada7a0e73c01ba.tar.gz |
Remove the system testing subcommands and related code
This we a proof-of-concept, and we want to explore various options of
how to do this, so let's not keep the code in morph. The code also has
no tests, so it is already likely to have bit-rotted.
If we decide we want to, we can always resurrect it from git history.
Diffstat (limited to 'morph')
-rwxr-xr-x | morph | 61 |
1 files changed, 0 insertions, 61 deletions
@@ -80,16 +80,6 @@ class Morph(cliapp.Application): 'build things in a staging chroot ' '(require real root to use)') - self.settings.boolean(['test-console'], - 'show what the system outputs on the serial ' - 'console during tests') - self.settings.integer(['test-timeout'], - 'abort test if system doesn\'t produce ' - 'expected output in TIMEOUT seconds ' - '(default: %default)', - metavar='TIMEOUT', - default=10) - self.settings.string_list(['worker'], 'IP or host name of a machine to distribute ' 'build work to', @@ -152,57 +142,6 @@ class Morph(cliapp.Application): return ret - def cmd_testsysimg(self, args): - '''Run tests for a built system image. - - Command line arguments are the filename of the system image, - and the filenames of the Python modules that contain the test - "stories". Each module must have a variable called "story", - which is a list of tuples. Each tuple is either two strings - (one to send, the other a regular expression for what is expected - in return), or two strings and a timeout in seconds. - - testsysimg runs the image under KVM, and accesses it via a - serial console, and runs the test stories, one by one. - - ''' - - if not args: - raise cliapp.AppException('Missing command line arguments. ' - 'Run with --help to see usage.') - - system = morphlib.tester.KvmSystem(args[0], - verbose=self.settings['test-console'], - timeout=self.settings['test-timeout']) - - for filename in args[1:]: - self.msg('Running %s' % filename) - module = morphlib.tester.load_module(filename) - story_steps = getattr(module, 'story') - story = morphlib.tester.TestStory(system, story_steps, self.msg) - story.run() - self.msg('Finished OK.') - - def cmd_test(self, args): - '''Build and test a system morphology. - - The tests are specified in the morphology's test-stories field. - - ''' - - for morph, built in self.cmd_build(args): - if morph.kind == 'system': - self.msg('running tests on system %s' % morph.name) - assert len(built) == 1 - image_filename = built.values()[0] - morphdir = os.path.dirname(morph.filename) - stories = [os.path.join(morphdir, x) - for x in morph.test_stories] - self.cmd_testsysimg([image_filename] + stories) - else: - self.msg('not testing %s %s (not a system)' % - (morph.kind, morph.name)) - def cmd_show_dependencies(self, args): '''Dumps the dependency tree of all input morphologies.''' |