ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From nc...@apache.org
Subject [1/4] ambari git commit: AMBARI-20871. Unify repository file creation (ncole)
Date Thu, 27 Apr 2017 20:23:34 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-feature-AMBARI-12556 13d806b85 -> b68662490


http://git-wip-us.apache.org/repos/asf/ambari/blob/b6866249/ambari-server/src/test/python/stacks/2.0.6/hooks/before-INSTALL/test_before_install.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/hooks/before-INSTALL/test_before_install.py
b/ambari-server/src/test/python/stacks/2.0.6/hooks/before-INSTALL/test_before_install.py
index 082d200..008a1e7 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/hooks/before-INSTALL/test_before_install.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/hooks/before-INSTALL/test_before_install.py
@@ -61,3 +61,33 @@ class TestHookBeforeInstall(RMFTestCase):
     self.assertResourceCalled('Package', 'unzip', retry_count=5, retry_on_repo_unavailability=False)
     self.assertResourceCalled('Package', 'curl', retry_count=5, retry_on_repo_unavailability=False)
     self.assertNoMoreResources()
+
+
+
+  def test_hook_default_repository_file(self):
+    self.executeScript("2.0.6/hooks/before-INSTALL/scripts/hook.py",
+                       classname="BeforeInstallHook",
+                       command="hook",
+                       config_file="repository_file.json"
+    )
+    self.assertResourceCalled('Repository', 'HDP-2.2-repo-4',
+        action=['create'],
+        base_url='http://repo1/HDP/centos5/2.x/updates/2.2.0.0',
+        components=['HDP', 'main'],
+        mirror_list=None,
+        repo_file_name='ambari-hdp-4',
+        repo_template='[{{repo_id}}]\nname={{repo_id}}\n{% if mirror_list %}mirrorlist={{mirror_list}}{%
else %}baseurl={{base_url}}{% endif %}\n\npath=/\nenabled=1\ngpgcheck=0',
+        append_to_file=False)
+
+    self.assertResourceCalled('Repository', 'HDP-UTILS-1.1.0.20-repo-4',
+        action=['create'],
+        base_url='http://repo1/HDP-UTILS/centos5/2.x/updates/2.2.0.0',
+        components=['HDP-UTILS', 'main'],
+        mirror_list=None,
+        repo_file_name='ambari-hdp-4',
+        repo_template='[{{repo_id}}]\nname={{repo_id}}\n{% if mirror_list %}mirrorlist={{mirror_list}}{%
else %}baseurl={{base_url}}{% endif %}\n\npath=/\nenabled=1\ngpgcheck=0',
+        append_to_file=True)
+
+    self.assertResourceCalled('Package', 'unzip', retry_count=5, retry_on_repo_unavailability=False)
+    self.assertResourceCalled('Package', 'curl', retry_count=5, retry_on_repo_unavailability=False)
+    self.assertNoMoreResources()


Mime
View raw message