=== modified file 'doc/changes.rst'
@@ -1,6 +1,8 @@
Version History
***************
+ * Add reset command
+
.. _version_0_5:
Version 0.5
=== modified file 'lava_test/commands.py'
@@ -1,4 +1,4 @@
-# Copyright (c) 2010, 2011 Linaro
+# Copyright (c) 2010, 2011, 2012 Linaro
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -15,6 +15,7 @@
import logging
import os
+import shutil
import subprocess
from lava_tool.interface import Command as LavaCommand
@@ -27,7 +28,7 @@
from lava_test.core.artifacts import TestArtifacts
from lava_test.core.config import get_config
from lava_test.core.loader import TestLoader
-
+from lava_test.utils import Cache
class Command(LavaCommand, ITestInstallerObserver, ITestRunnerObserver):
@@ -431,3 +432,21 @@
raise LavaCommandError("Unable to unregister test: %s" % exc)
except KeyError:
raise LavaCommandError("There is no test_url")
+
+
+class reset(Command):
+ """
+ Reset the lava-test environment by removing
+ cached items, all registerered simple declactive tests and configuration files
+ """
+
+ def invoke(self):
+ print "Delete " + self._config.configdir
+ shutil.rmtree(self._config.configdir, ignore_errors=True)
+ print "Delete " + self._config.installdir
+ shutil.rmtree(self._config.installdir, ignore_errors=True)
+ print "Delete " + self._config.resultsdir
+ shutil.rmtree(self._config.resultsdir, ignore_errors=True)
+ cache = Cache.get_instance()
+ print "Delete " + cache.cache_dir
+ shutil.rmtree(cache.cache_dir, ignore_errors=True)
\ No newline at end of file
=== modified file 'setup.py'
@@ -1,6 +1,6 @@
#!/usr/bin/env python
-# Copyright (c) 2010, 2011 Linaro
+# Copyright (c) 2010, 2011, 2012 Linaro
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -43,6 +43,7 @@
show=lava_test.commands:show
register_test=lava_test.commands:register_test
unregister_test=lava_test.commands:unregister_test
+ reset=lava_test.commands:reset
""",
classifiers=[
"Development Status :: 3 - Alpha",