You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@accumulo.apache.org by md...@apache.org on 2013/12/31 22:38:50 UTC

[04/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 <md...@cloudera.com>


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/master
Commit: d605ebb52a14d4d1964b01dcb5bb5ccad4fa6fb9
Parents: f56ae10
Author: Sean Busbey <bu...@clouderagovt.com>
Authored: Sat Dec 28 01:31:48 2013 -0600
Committer: Mike Drob <md...@cloudera.com>
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('<configuration>\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():