ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject ambari git commit: AMBARI-16839. Need ability to ignoreBadMounts for YARN (aonishuk)
Date Wed, 25 May 2016 10:10:45 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk ad2e1a9b7 -> b052df6b9


AMBARI-16839. Need ability to ignoreBadMounts for YARN (aonishuk)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/b052df6b
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/b052df6b
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/b052df6b

Branch: refs/heads/trunk
Commit: b052df6b94c8d7d60acd89c1085c0f3599155aa1
Parents: ad2e1a9
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Wed May 25 13:10:44 2016 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Wed May 25 13:10:44 2016 +0300

----------------------------------------------------------------------
 .../resource_management/TestDatanodeHelper.py   | 22 ++++++-------
 .../test_alert_datanode_unmounted_data_dir.py   |  8 ++---
 .../python/stacks/2.0.6/HDFS/test_datanode.py   |  6 ++--
 .../stacks/2.0.6/YARN/test_nodemanager.py       | 34 --------------------
 4 files changed, 18 insertions(+), 52 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b052df6b/ambari-agent/src/test/python/resource_management/TestDatanodeHelper.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/resource_management/TestDatanodeHelper.py b/ambari-agent/src/test/python/resource_management/TestDatanodeHelper.py
index 956168a..4dfada3 100644
--- a/ambari-agent/src/test/python/resource_management/TestDatanodeHelper.py
+++ b/ambari-agent/src/test/python/resource_management/TestDatanodeHelper.py
@@ -20,7 +20,7 @@ import logging
 from unittest import TestCase
 from mock.mock import Mock, MagicMock, patch
 
-from resource_management.libraries.functions import dfs_datanode_helper
+from resource_management.libraries.functions import mounted_dirs_helper
 from resource_management.core.logger import Logger
 from resource_management import Directory
 
@@ -66,7 +66,7 @@ class TestDatanodeHelper(TestCase):
   params.user_group = "hadoop_test"
 
 
-  @patch("resource_management.libraries.functions.dfs_datanode_helper.Directory")
+  @patch("resource_management.libraries.functions.mounted_dirs_helper.Directory")
   @patch.object(Logger, "warning")
   @patch.object(Logger, "info")
   @patch.object(Logger, "error")
@@ -79,7 +79,7 @@ class TestDatanodeHelper(TestCase):
     params.dfs_data_dir = "/grid/0/data  ,  /grid/1/data  ,/GRID/2/Data/"
 
     # Function under test
-    dfs_datanode_helper.handle_mounted_dirs(fake_create_dir, params.dfs_data_dir, params.data_dir_mount_file,
update_cache=False)
+    mounted_dirs_helper.handle_mounted_dirs(fake_create_dir, params.dfs_data_dir, params.data_dir_mount_file,
update_cache=False)
 
     for (name, args, kwargs) in log_info.mock_calls:
       print args[0]
@@ -92,11 +92,11 @@ class TestDatanodeHelper(TestCase):
 
     self.assertEquals(0, log_error.call_count)
 
-  @patch("resource_management.libraries.functions.dfs_datanode_helper.Directory")
+  @patch("resource_management.libraries.functions.mounted_dirs_helper.Directory")
   @patch.object(Logger, "info")
   @patch.object(Logger, "error")
-  @patch.object(dfs_datanode_helper, "get_dir_to_mount_from_file")
-  @patch.object(dfs_datanode_helper, "get_mount_point_for_dir")
+  @patch.object(mounted_dirs_helper, "get_dir_to_mount_from_file")
+  @patch.object(mounted_dirs_helper, "get_mount_point_for_dir")
   @patch.object(os.path, "isdir")
   @patch.object(os.path, "exists")
   def test_grid_becomes_unmounted(self, mock_os_exists, mock_os_isdir, mock_get_mount_point,
@@ -113,7 +113,7 @@ class TestDatanodeHelper(TestCase):
     mock_get_mount_point.side_effect = ["/dev0", "/dev1", "/"] * 2
     mock_os_isdir.side_effect = [False, False, False] + [True, True, True]
     # Function under test
-    dfs_datanode_helper.handle_mounted_dirs(fake_create_dir, self.params.dfs_data_dir, self.params.data_dir_mount_file,
update_cache=False)
+    mounted_dirs_helper.handle_mounted_dirs(fake_create_dir, self.params.dfs_data_dir, self.params.data_dir_mount_file,
update_cache=False)
     for (name, args, kwargs) in log_info.mock_calls:
       print args[0]
 
@@ -125,11 +125,11 @@ class TestDatanodeHelper(TestCase):
     self.assertEquals(1, log_error.call_count)
     self.assertTrue("Directory /grid/2/data does not exist and became unmounted from /dev2"
in error_msg)
 
-  @patch("resource_management.libraries.functions.dfs_datanode_helper.Directory")
+  @patch("resource_management.libraries.functions.mounted_dirs_helper.Directory")
   @patch.object(Logger, "info")
   @patch.object(Logger, "error")
-  @patch.object(dfs_datanode_helper, "get_dir_to_mount_from_file")
-  @patch.object(dfs_datanode_helper, "get_mount_point_for_dir")
+  @patch.object(mounted_dirs_helper, "get_dir_to_mount_from_file")
+  @patch.object(mounted_dirs_helper, "get_mount_point_for_dir")
   @patch.object(os.path, "isdir")
   @patch.object(os.path, "exists")
   def test_grid_becomes_remounted(self, mock_os_exists, mock_os_isdir, mock_get_mount_point,
@@ -147,7 +147,7 @@ class TestDatanodeHelper(TestCase):
     mock_os_isdir.side_effect = [False, False, False] + [True, True, True]
 
     # Function under test
-    dfs_datanode_helper.handle_mounted_dirs(fake_create_dir, self.params.data_dir_mount_file,
self.params.data_dir_mount_file, update_cache=False)
+    mounted_dirs_helper.handle_mounted_dirs(fake_create_dir, self.params.data_dir_mount_file,
self.params.data_dir_mount_file, update_cache=False)
 
     for (name, args, kwargs) in log_info.mock_calls:
       print args[0]

http://git-wip-us.apache.org/repos/asf/ambari/blob/b052df6b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_alert_datanode_unmounted_data_dir.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_alert_datanode_unmounted_data_dir.py
b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_alert_datanode_unmounted_data_dir.py
index 18c9c72..c9bd187 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_alert_datanode_unmounted_data_dir.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_alert_datanode_unmounted_data_dir.py
@@ -93,7 +93,7 @@ class TestAlertDataNodeUnmountedDataDir(RMFTestCase):
     self.assertTrue(messages is not None and len(messages) == 1)
     self.assertTrue("File not found, {0}".format(DATA_DIR_MOUNT_HIST_FILE_PATH) in messages[0])
 
-  @patch("resource_management.libraries.functions.dfs_datanode_helper.get_dir_to_mount_from_file")
+  @patch("resource_management.libraries.functions.mounted_dirs_helper.get_dir_to_mount_from_file")
   @patch("resource_management.libraries.functions.file_system.get_mount_point_for_dir")
   @patch("os.path.exists")
   @patch("os.path.isdir")
@@ -119,7 +119,7 @@ class TestAlertDataNodeUnmountedDataDir(RMFTestCase):
     self.assertTrue(messages is not None and len(messages) == 1)
     self.assertTrue("Data dir(s) are fine" in messages[0])
 
-  @patch("resource_management.libraries.functions.dfs_datanode_helper.get_dir_to_mount_from_file")
+  @patch("resource_management.libraries.functions.mounted_dirs_helper.get_dir_to_mount_from_file")
   @patch("resource_management.libraries.functions.file_system.get_mount_point_for_dir")
   @patch("os.path.exists")
   @patch("os.path.isdir")
@@ -144,7 +144,7 @@ class TestAlertDataNodeUnmountedDataDir(RMFTestCase):
     self.assertTrue(messages is not None and len(messages) == 1)
     self.assertTrue("Data dir(s) are fine" in messages[0])
 
-  @patch("resource_management.libraries.functions.dfs_datanode_helper.get_dir_to_mount_from_file")
+  @patch("resource_management.libraries.functions.mounted_dirs_helper.get_dir_to_mount_from_file")
   @patch("resource_management.libraries.functions.file_system.get_mount_point_for_dir")
   @patch("os.path.exists")
   @patch("os.path.isdir")
@@ -168,7 +168,7 @@ class TestAlertDataNodeUnmountedDataDir(RMFTestCase):
     self.assertTrue(messages is not None and len(messages) == 1)
     self.assertTrue("Detected at least one data dir on a mount point, but these are writing
to the root partition: /grid/0/data, /grid/1/data" in messages[0])
 
-  @patch("resource_management.libraries.functions.dfs_datanode_helper.get_dir_to_mount_from_file")
+  @patch("resource_management.libraries.functions.mounted_dirs_helper.get_dir_to_mount_from_file")
   @patch("resource_management.libraries.functions.file_system.get_mount_point_for_dir")
   @patch("os.path.exists")
   @patch("os.path.isdir")

http://git-wip-us.apache.org/repos/asf/ambari/blob/b052df6b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_datanode.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_datanode.py b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_datanode.py
index 62081f1..1c3c5b7 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_datanode.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_datanode.py
@@ -23,7 +23,7 @@ from mock.mock import MagicMock, patch
 from resource_management.libraries.script.script import Script
 from resource_management.core import shell
 from resource_management.core.exceptions import Fail
-import resource_management.libraries.functions.dfs_datanode_helper
+import resource_management.libraries.functions.mounted_dirs_helper
 
 @patch.object(resource_management.libraries.functions, 'check_process_status', new = MagicMock())
 @patch.object(Script, 'format_package_name', new = MagicMock())
@@ -347,7 +347,7 @@ class TestDatanode(RMFTestCase):
                               create_parents = True,
                               cd_access='a'
                               )
-    content = resource_management.libraries.functions.dfs_datanode_helper.DIR_TO_MOUNT_HEADER
+    content = resource_management.libraries.functions.mounted_dirs_helper.DIR_TO_MOUNT_HEADER
     self.assertResourceCalled('File', '/var/lib/ambari-agent/data/datanode/dfs_data_dir_mount.hist',
                               owner = 'hdfs',
                               group = 'hadoop',
@@ -423,7 +423,7 @@ class TestDatanode(RMFTestCase):
                               create_parents = True,
                               cd_access='a'
                               )
-    content = resource_management.libraries.functions.dfs_datanode_helper.DIR_TO_MOUNT_HEADER
+    content = resource_management.libraries.functions.mounted_dirs_helper.DIR_TO_MOUNT_HEADER
     self.assertResourceCalled('File', '/var/lib/ambari-agent/data/datanode/dfs_data_dir_mount.hist',
                               owner = 'hdfs',
                               group = 'hadoop',

http://git-wip-us.apache.org/repos/asf/ambari/blob/b052df6b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py
index ab402bd..3afea7a 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py
@@ -157,22 +157,6 @@ class TestNodeManager(RMFTestCase):
         mode = 0775,
         owner = 'yarn',
     )
-    self.assertResourceCalled('Directory', '/hadoop/yarn/log',
-                              owner = 'yarn',
-                              group = 'hadoop',
-                              create_parents = True,
-                              ignore_failures = True,
-                              mode = 0775,
-                              cd_access='a'
-                              )
-    self.assertResourceCalled('Directory', '/hadoop/yarn/log1',
-                              owner = 'yarn',
-                              group = 'hadoop',
-                              create_parents = True,
-                              ignore_failures = True,
-                              mode = 0775,
-                              cd_access='a'
-                              )
     self.assertResourceCalled('File', '/var/lib/ambari-agent/data/yarn/yarn_log_dir_mount.hist',
         content = '\n# This file keeps track of the last known mount-point for each dir.\n#
It is safe to delete, since it will get regenerated the next time that the component of the
service starts.\n# However, it is not advised to delete this file since Ambari may\n# re-create
a dir that used to be mounted on a drive but is now mounted on the root.\n# Comments begin
with a hash (#) symbol\n# dir,mount_point\n',
         owner = 'hdfs',
@@ -201,24 +185,6 @@ class TestNodeManager(RMFTestCase):
                               cd_access='a',
                               recursive_mode_flags = {'d': 'a+rwx', 'f': 'a+rw'}
                               )
-    self.assertResourceCalled('Directory', '/hadoop/yarn/local',
-        group = 'hadoop',
-        cd_access = 'a',
-        recursive_mode_flags = {'d': 'a+rwx', 'f': 'a+rw'},
-        create_parents = True,
-        ignore_failures = True,
-        mode = 0755,
-        owner = 'yarn',
-    )
-    self.assertResourceCalled('Directory', '/hadoop/yarn/local1',
-        group = 'hadoop',
-        cd_access = 'a',
-        recursive_mode_flags = {'d': 'a+rwx', 'f': 'a+rw'},
-        create_parents = True,
-        ignore_failures = True,
-        mode = 0755,
-        owner = 'yarn',
-    )
     self.assertResourceCalled('File', '/var/lib/ambari-agent/data/yarn/yarn_local_dir_mount.hist',
         content = '\n# This file keeps track of the last known mount-point for each dir.\n#
It is safe to delete, since it will get regenerated the next time that the component of the
service starts.\n# However, it is not advised to delete this file since Ambari may\n# re-create
a dir that used to be mounted on a drive but is now mounted on the root.\n# Comments begin
with a hash (#) symbol\n# dir,mount_point\n',
         owner = 'hdfs',


Mime
View raw message