summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorSiddharth Ravikumar <sravik@bgsu.edu>2015-02-13 11:11:02 -0500
committerSiddharth Ravikumar <sravik@bgsu.edu>2015-02-13 11:11:02 -0500
commitc9a5290224dd7254a23cb6e5e3baa43a21fd2362 (patch)
tree226633ec6324179cf2448247f15d54300719a967 /tests
parent9448a121130bfd7964b3d08e19799538ae189374 (diff)
tests/utils.py: added new function rm_nodedirs.
rm_nodedirs purges the node directories. This function will be used later to remove the test node directories.
Diffstat (limited to 'tests')
-rw-r--r--tests/utils.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/utils.py b/tests/utils.py
index 8b974ed..f21bd38 100644
--- a/tests/utils.py
+++ b/tests/utils.py
@@ -22,7 +22,7 @@ from nose.tools import *
from os import path, remove, rmdir
from combox.config import config_cb, get_nodedirs
-from combox.file import relative_path
+from combox.file import relative_path, purge_dir
def get_input_func():
"""Returns the input function
@@ -57,6 +57,17 @@ def get_config():
return config_cb(config_dir, pass_func, input_func, write=False)
+def rm_nodedirs(config):
+ """Removes node directories"""
+ nodes = get_nodedirs(config)
+ for node in nodes:
+ try:
+ purge_dir(node)
+ rmdir(node)
+ except OSError, e:
+ print "Problem deleting", node, e
+
+
def shardedp(f):
"""Checks if file's shards exists in the node directories"""