From patchwork Sat Mar 10 13:23:09 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Le Chi Thu X-Patchwork-Id: 7201 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id C249B23E13 for ; Sat, 10 Mar 2012 13:23:13 +0000 (UTC) Received: from mail-iy0-f180.google.com (mail-iy0-f180.google.com [209.85.210.180]) by fiordland.canonical.com (Postfix) with ESMTP id 81379A180EE for ; Sat, 10 Mar 2012 13:23:13 +0000 (UTC) Received: by mail-iy0-f180.google.com with SMTP id e36so4946022iag.11 for ; Sat, 10 Mar 2012 05:23:13 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf :content-type:mime-version:x-launchpad-project:x-launchpad-branch :x-launchpad-message-rationale:x-launchpad-branch-revision-number :x-launchpad-notification-type:to:from:subject:message-id:date :reply-to:sender:errors-to:precedence:x-generated-by :x-launchpad-hash:x-gm-message-state; bh=63WvCL7WOy56Z+K52p/vVY/rXDqZkU3/RAPF+sjrb8k=; b=PHaq/gNvrhjzpC0odLI88Je85enpU6MACTNk06EBGYYdCSIDKHVB3exTJS9qXVnXHt ohwLk3aCdJD8jFvooUK9Yg8R7bfg8JxUuVc1diMxFF2O4aDYt04NqPuSFDsOP3LhtEIt +yqsRFKYkGlcIFKoWFiCRFR6kGxvWJ6JwNjHC0BoXmVqZOPx1yKU915nTmPDn+HIgrT6 FG2KkUiwfgVJ+p7jDuW7jmQTBanZYPtnyCDYLuWFbrUi4cesyoRIZi8WE9B2YeYX/lKJ ZXd3FombNTAadLD+7o6FaCpFrefY4pfaz/15vgdVPlHreBfL0eSIlE9rNbDGRVs2u0Ep LkvA== Received: by 10.50.158.133 with SMTP id wu5mr9309289igb.50.1331385793301; Sat, 10 Mar 2012 05:23:13 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.231.53.18 with SMTP id k18csp7437ibg; Sat, 10 Mar 2012 05:23:12 -0800 (PST) Received: by 10.180.92.34 with SMTP id cj2mr12863527wib.20.1331385791977; Sat, 10 Mar 2012 05:23:11 -0800 (PST) Received: from indium.canonical.com (indium.canonical.com. [91.189.90.7]) by mx.google.com with ESMTPS id r8si7576398wif.11.2012.03.10.05.23.09 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 10 Mar 2012 05:23:11 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) client-ip=91.189.90.7; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of bounces@canonical.com designates 91.189.90.7 as permitted sender) smtp.mail=bounces@canonical.com Received: from ackee.canonical.com ([91.189.89.26]) by indium.canonical.com with esmtp (Exim 4.71 #1 (Debian)) id 1S6MGL-0004fR-Pb for ; Sat, 10 Mar 2012 13:23:09 +0000 Received: from ackee.canonical.com (localhost [127.0.0.1]) by ackee.canonical.com (Postfix) with ESMTP id AFF5FE0584 for ; Sat, 10 Mar 2012 13:23:09 +0000 (UTC) MIME-Version: 1.0 X-Launchpad-Project: lava-test X-Launchpad-Branch: ~linaro-validation/lava-test/trunk X-Launchpad-Message-Rationale: Subscriber X-Launchpad-Branch-Revision-Number: 128 X-Launchpad-Notification-Type: branch-revision To: Linaro Patch Tracker From: noreply@launchpad.net Subject: [Branch ~linaro-validation/lava-test/trunk] Rev 128: Added reset command Message-Id: <20120310132309.5123.95013.launchpad@ackee.canonical.com> Date: Sat, 10 Mar 2012 13:23:09 -0000 Reply-To: noreply@launchpad.net Sender: bounces@canonical.com Errors-To: bounces@canonical.com Precedence: bulk X-Generated-By: Launchpad (canonical.com); Revision="14914"; Instance="launchpad-lazr.conf" X-Launchpad-Hash: 47f68b047f203571556b1d10034e4826f5d0c421 X-Gm-Message-State: ALoCoQnfVKrKaqFOwNVD4WhDY8ViGgg3MSunex40FxiUvd82oqGRCnhAc7vtG49n017u3MYAXOQb Merge authors: Le Chi Thu le.chi.thu@linaro.org Related merge proposals: https://code.launchpad.net/~le-chi-thu/lava-test/add-reset-command/+merge/96013 proposed by: Le Chi Thu (le-chi-thu) review: Approve - Zygmunt Krynicki (zkrynicki) review: Resubmit - Le Chi Thu (le-chi-thu) ------------------------------------------------------------ revno: 128 [merge] committer: Le Chi Thu le.chi.thu@linaro.org branch nick: trunk timestamp: Sat 2012-03-10 14:21:53 +0100 message: Added reset command modified: doc/changes.rst lava_test/commands.py setup.py --- lp:lava-test https://code.launchpad.net/~linaro-validation/lava-test/trunk You are subscribed to branch lp:lava-test. To unsubscribe from this branch go to https://code.launchpad.net/~linaro-validation/lava-test/trunk/+edit-subscription === modified file 'doc/changes.rst' --- doc/changes.rst 2012-03-08 16:59:15 +0000 +++ doc/changes.rst 2012-03-10 13:21:53 +0000 @@ -1,6 +1,8 @@ Version History *************** + * Add reset command + .. _version_0_5: Version 0.5 === modified file 'lava_test/commands.py' --- lava_test/commands.py 2012-03-05 21:43:48 +0000 +++ lava_test/commands.py 2012-03-10 13:21:53 +0000 @@ -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' --- setup.py 2012-02-06 15:48:33 +0000 +++ setup.py 2012-03-02 14:21:13 +0000 @@ -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",