Return-Path: X-Original-To: apmail-accumulo-commits-archive@www.apache.org Delivered-To: apmail-accumulo-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 4E102104F5 for ; Tue, 31 Dec 2013 21:38:49 +0000 (UTC) Received: (qmail 72532 invoked by uid 500); 31 Dec 2013 21:38:48 -0000 Delivered-To: apmail-accumulo-commits-archive@accumulo.apache.org Received: (qmail 72416 invoked by uid 500); 31 Dec 2013 21:38:48 -0000 Mailing-List: contact commits-help@accumulo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@accumulo.apache.org Delivered-To: mailing list commits@accumulo.apache.org Received: (qmail 72326 invoked by uid 99); 31 Dec 2013 21:38:48 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Dec 2013 21:38:48 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 0A93190CE2E; Tue, 31 Dec 2013 21:38:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: mdrob@apache.org To: commits@accumulo.apache.org Date: Tue, 31 Dec 2013 21:38:49 -0000 Message-Id: <5c8bb1cdcdb54f4eb1b016e8c1683f72@git.apache.org> In-Reply-To: <62334464548b4f0fa7651dcb53d60a1a@git.apache.org> References: <62334464548b4f0fa7651dcb53d60a1a@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [03/10] git commit: ACCUMULO-2109 make sure functional tests clean up generate accumulo-site file. ACCUMULO-2109 make sure functional tests clean up generate accumulo-site file. Signed-off-by: Mike Drob Project: http://git-wip-us.apache.org/repos/asf/accumulo/repo Commit: http://git-wip-us.apache.org/repos/asf/accumulo/commit/d605ebb5 Tree: http://git-wip-us.apache.org/repos/asf/accumulo/tree/d605ebb5 Diff: http://git-wip-us.apache.org/repos/asf/accumulo/diff/d605ebb5 Branch: refs/heads/1.6.0-SNAPSHOT Commit: d605ebb52a14d4d1964b01dcb5bb5ccad4fa6fb9 Parents: f56ae10 Author: Sean Busbey Authored: Sat Dec 28 01:31:48 2013 -0600 Committer: Mike Drob Committed: Tue Dec 31 13:31:14 2013 -0800 ---------------------------------------------------------------------- test/system/auto/TestUtils.py | 8 ++++++-- test/system/auto/simple/readwrite.py | 5 ++--- test/system/auto/simple/zooCacheTest.py | 4 ++-- 3 files changed, 10 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/accumulo/blob/d605ebb5/test/system/auto/TestUtils.py ---------------------------------------------------------------------- diff --git a/test/system/auto/TestUtils.py b/test/system/auto/TestUtils.py index f6eca67..3101cf9 100755 --- a/test/system/auto/TestUtils.py +++ b/test/system/auto/TestUtils.py @@ -47,6 +47,7 @@ if os.getenv('ACCUMULO_CONF_DIR'): else: ACCUMULO_CONF_DIR = os.path.join(ACCUMULO_HOME, 'conf') SITE = "test-" + ID +SITE_PATH = os.path.join(ACCUMULO_CONF_DIR, SITE) WALOG = os.path.join(ACCUMULO_HOME, 'walogs', ID) @@ -261,7 +262,7 @@ class TestUtilsMixin: self.pkill(host, 'org.apache.accumulo.start', signal) def create_config_file(self, settings): - fp = open(os.path.join(ACCUMULO_CONF_DIR, SITE), 'w') + fp = open(SITE_PATH, 'w') fp.write('\n') settings = self.settings.copy() settings.update({ 'instance.zookeeper.host': ZOOKEEPERS, @@ -433,6 +434,9 @@ class TestUtilsMixin: if os.path.exists(LOG_MONITOR_BACKUP): os.rename(LOG_MONITOR_BACKUP, LOG_MONITOR) + def clean_config_file(self): + os.unlink(SITE_PATH) + def sleep(self, secs): log.debug("Sleeping %f seconds" % secs) sleep.sleep(secs) @@ -455,7 +459,7 @@ class TestUtilsMixin: self.wait(self.runOn(self.masterHost(), ['rm', '-rf', WALOG])) self.wait(self.runOn(self.masterHost(), ['rm', '-rf', ACCUMULO_HOME + '/logs/' + ID])) self.clean_logging() - os.unlink(os.path.join(ACCUMULO_HOME, 'conf', SITE)) + self.clean_config_file() def createTable(self, table, splitFile=None): if splitFile : http://git-wip-us.apache.org/repos/asf/accumulo/blob/d605ebb5/test/system/auto/simple/readwrite.py ---------------------------------------------------------------------- diff --git a/test/system/auto/simple/readwrite.py b/test/system/auto/simple/readwrite.py index 1e89a8d..13d2afa 100755 --- a/test/system/auto/simple/readwrite.py +++ b/test/system/auto/simple/readwrite.py @@ -20,7 +20,7 @@ import unittest import time import sys -from TestUtils import TestUtilsMixin, FUZZ, ACCUMULO_HOME, SITE +from TestUtils import TestUtilsMixin, FUZZ, SITE_PATH log = logging.getLogger('test.auto') @@ -151,9 +151,8 @@ class SunnyLG(SunnyDayTest): } def runTest(self): SunnyDayTest.runTest(self) - cfg = os.path.join(ACCUMULO_HOME, 'conf', SITE) import config - dir = config.parse(cfg)['instance.dfs.dir'] + dir = config.parse(SITE_PATH)['instance.dfs.dir'] handle = self.runOn(self.masterHost(), [self.accumulo_sh(), 'org.apache.accumulo.core.file.rfile.PrintInfo', http://git-wip-us.apache.org/repos/asf/accumulo/blob/d605ebb5/test/system/auto/simple/zooCacheTest.py ---------------------------------------------------------------------- diff --git a/test/system/auto/simple/zooCacheTest.py b/test/system/auto/simple/zooCacheTest.py index b9beacb..998d800 100755 --- a/test/system/auto/simple/zooCacheTest.py +++ b/test/system/auto/simple/zooCacheTest.py @@ -18,7 +18,7 @@ import shutil import unittest import time -from TestUtils import TestUtilsMixin, ACCUMULO_HOME, SITE, ZOOKEEPERS +from TestUtils import TestUtilsMixin, ZOOKEEPERS class ZooCacheTest(TestUtilsMixin, unittest.TestCase): "Zoo Cache Test" @@ -44,7 +44,7 @@ class ZooCacheTest(TestUtilsMixin, unittest.TestCase): self.waitForStop(handleR3, 1) def tearDown(self): - os.unlink(os.path.join(ACCUMULO_HOME, 'conf', SITE)) + self.clean_config_file() shutil.rmtree('/tmp/zcTest-42', ignore_errors=True, onerror=None) def suite():