Author: smohanty
Date: Tue Mar 26 21:29:42 2013
New Revision: 1461323
URL: http://svn.apache.org/r1461323
Log:
AMBARI-1715. Ambari Agent Unit Test Failure: TestFileUtil.py. (smohanty)
Modified:
incubator/ambari/trunk/CHANGES.txt
incubator/ambari/trunk/ambari-agent/src/test/python/TestFileUtil.py
Modified: incubator/ambari/trunk/CHANGES.txt
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/CHANGES.txt?rev=1461323&r1=1461322&r2=1461323&view=diff
==============================================================================
--- incubator/ambari/trunk/CHANGES.txt (original)
+++ incubator/ambari/trunk/CHANGES.txt Tue Mar 26 21:29:42 2013
@@ -527,6 +527,8 @@ Trunk (unreleased changes):
BUG FIXES
+ AMBARI-1715. Ambari Agent Unit Test Failure: TestFileUtil.py. (smohanty)
+
AMBARI-1533. Add Nagios check for ambari-agent process for each host in
the cluster. (smohanty)
Modified: incubator/ambari/trunk/ambari-agent/src/test/python/TestFileUtil.py
URL:
http://svn.apache.org/viewvc/incubator/ambari/trunk/ambari-agent/src/test/python/TestFileUtil.py?rev=1461323&r1=1461322&r2=1461323&view=diff
==============================================================================
--- incubator/ambari/trunk/ambari-agent/src/test/python/TestFileUtil.py
(original)
+++ incubator/ambari/trunk/ambari-agent/src/test/python/TestFileUtil.py Tue Mar
26 21:29:42 2013
@@ -21,9 +21,14 @@ limitations under the License.
from unittest import TestCase
from ambari_agent.FileUtil import writeFile, createStructure, deleteStructure
import os, errno
+import tempfile
+from ambari_agent import AmbariConfig
class TestFileUtil(TestCase):
+
def test_createStructure(self):
+ tmpdir = tempfile.gettempdir()
+ AmbariConfig.config.set('agent', 'prefix', tmpdir)
action = { 'clusterId' : 'abc', 'role' : 'hdfs', 'workDirComponent' :
'abc-hdfs' }
result = {}
result = createStructure(action, result)
@@ -35,7 +40,7 @@ class TestFileUtil(TestCase):
"owner" : os.getuid(),
"group" : os.getgid() ,
"permission" : 0700,
- "path" : "/tmp/ambari_file_test/_file_write_test",
+ "path" : os.path.join(tmpdir, "ambari_file_test/_file_write_test"),
"umask" : 022
}
action = {