From 3b89217a8bd52f49fa3e8210450a5bd8ef31ada8 Mon Sep 17 00:00:00 2001 From: Evgeny Sikachev Date: Mon, 14 Sep 2015 15:52:00 +0300 Subject: [PATCH] Adding check of indirect access If in scenario file set is_proxy_gateway: true, need check of indirect access Change-Id: Icf779a9e8cd1145de68f5341720d32c6b0d1ef55 --- etc/scenario/sahara-ci/cdh-5.4.0.yaml.mako | 1 + etc/scenario/sahara-ci/fake.yaml.mako | 1 + etc/scenario/sahara-ci/hdp-2.0.6.yaml.mako | 1 + etc/scenario/sahara-ci/mapr-4.0.2.mrv2.yaml.mako | 1 + etc/scenario/sahara-ci/spark-1.3.1.yaml.mako | 1 + etc/scenario/sahara-ci/transient.yaml.mako | 1 + etc/scenario/sahara-ci/vanilla-2.7.1.yaml.mako | 1 + sahara/tests/scenario/README.rst | 2 +- sahara/tests/scenario/base.py | 11 ++++++++++- sahara/tests/scenario_unit/test_base.py | 3 ++- 10 files changed, 20 insertions(+), 3 deletions(-) diff --git a/etc/scenario/sahara-ci/cdh-5.4.0.yaml.mako b/etc/scenario/sahara-ci/cdh-5.4.0.yaml.mako index 4bf0c9373f..0406d7cb5d 100644 --- a/etc/scenario/sahara-ci/cdh-5.4.0.yaml.mako +++ b/etc/scenario/sahara-ci/cdh-5.4.0.yaml.mako @@ -44,6 +44,7 @@ clusters: - YARN_NODEMANAGER - ZOOKEEPER_SERVER auto_security_group: true + is_proxy_gateway: true - name: master-additional flavor: ${medium_flavor_id} node_processes: diff --git a/etc/scenario/sahara-ci/fake.yaml.mako b/etc/scenario/sahara-ci/fake.yaml.mako index b046eea2db..aada1c4603 100644 --- a/etc/scenario/sahara-ci/fake.yaml.mako +++ b/etc/scenario/sahara-ci/fake.yaml.mako @@ -17,6 +17,7 @@ clusters: - jobtracker - namenode auto_security_group: true + is_proxy_gateway: true cluster_template: name: fake01 node_group_templates: diff --git a/etc/scenario/sahara-ci/hdp-2.0.6.yaml.mako b/etc/scenario/sahara-ci/hdp-2.0.6.yaml.mako index 00814ca5db..054fe41476 100644 --- a/etc/scenario/sahara-ci/hdp-2.0.6.yaml.mako +++ b/etc/scenario/sahara-ci/hdp-2.0.6.yaml.mako @@ -16,6 +16,7 @@ clusters: - SECONDARY_NAMENODE - ZOOKEEPER_SERVER auto_security_group: true + is_proxy_gateway: true - name: worker flavor: ${ci_flavor_id} node_processes: diff --git a/etc/scenario/sahara-ci/mapr-4.0.2.mrv2.yaml.mako b/etc/scenario/sahara-ci/mapr-4.0.2.mrv2.yaml.mako index ba8c18cd68..6dc99fa3d0 100644 --- a/etc/scenario/sahara-ci/mapr-4.0.2.mrv2.yaml.mako +++ b/etc/scenario/sahara-ci/mapr-4.0.2.mrv2.yaml.mako @@ -25,6 +25,7 @@ clusters: auto_security_group: true volumes_per_node: 2 volumes_size: 20 + is_proxy_gateway: true - name: worker flavor: ${ci_flavor_id} node_processes: diff --git a/etc/scenario/sahara-ci/spark-1.3.1.yaml.mako b/etc/scenario/sahara-ci/spark-1.3.1.yaml.mako index 98fb48d1d8..21cd6fc831 100644 --- a/etc/scenario/sahara-ci/spark-1.3.1.yaml.mako +++ b/etc/scenario/sahara-ci/spark-1.3.1.yaml.mako @@ -9,6 +9,7 @@ clusters: - master - namenode auto_security_group: true + is_proxy_gateway: true - name: worker flavor: ${ci_flavor_id} node_processes: diff --git a/etc/scenario/sahara-ci/transient.yaml.mako b/etc/scenario/sahara-ci/transient.yaml.mako index 5ed06eec91..a5a86899bd 100644 --- a/etc/scenario/sahara-ci/transient.yaml.mako +++ b/etc/scenario/sahara-ci/transient.yaml.mako @@ -28,6 +28,7 @@ clusters: - resourcemanager - namenode auto_security_group: true + is_proxy_gateway: true cluster_template: name: transient node_group_templates: diff --git a/etc/scenario/sahara-ci/vanilla-2.7.1.yaml.mako b/etc/scenario/sahara-ci/vanilla-2.7.1.yaml.mako index e9d9208a69..73863374bd 100644 --- a/etc/scenario/sahara-ci/vanilla-2.7.1.yaml.mako +++ b/etc/scenario/sahara-ci/vanilla-2.7.1.yaml.mako @@ -39,6 +39,7 @@ clusters: - secondarynamenode - nodemanager auto_security_group: true + is_proxy_gateway: true cluster_template: name: vanilla271 node_group_templates: diff --git a/sahara/tests/scenario/README.rst b/sahara/tests/scenario/README.rst index a3b782117c..cd34fb6fd8 100644 --- a/sahara/tests/scenario/README.rst +++ b/sahara/tests/scenario/README.rst @@ -237,7 +237,7 @@ This section is an array-type. +---------------------------+------------------+----------+----------+--------------------------------------------------+ | volume_type | string | | | | +---------------------------+------------------+----------+----------+--------------------------------------------------+ -| is_proxy_gateway | boolean | | False | | +| is_proxy_gateway | boolean | | False | use this node as proxy gateway | +---------------------------+------------------+----------+----------+--------------------------------------------------+ diff --git a/sahara/tests/scenario/base.py b/sahara/tests/scenario/base.py index cb81e2c42e..a916dac2f4 100644 --- a/sahara/tests/scenario/base.py +++ b/sahara/tests/scenario/base.py @@ -413,13 +413,22 @@ class BaseTestCase(base.BaseTestCase): with open(template_file) as data: node_groups.append(json.load(data)) + check_indirect_access = False + for ng in node_groups: + if ng.get('is_proxy_gateway'): + check_indirect_access = True + for ng in node_groups: kwargs = dict(ng) kwargs.update(self.plugin_opts) kwargs['flavor_id'] = self._get_flavor_id(kwargs['flavor']) del kwargs['flavor'] kwargs['name'] = utils.rand_name(kwargs['name']) - kwargs['floating_ip_pool'] = floating_ip_pool + if (not kwargs.get('is_proxy_gateway', + False)) and (check_indirect_access): + kwargs['floating_ip_pool'] = None + else: + kwargs['floating_ip_pool'] = floating_ip_pool ng_id = self.__create_node_group_template(**kwargs) ng_id_map[ng['name']] = ng_id return ng_id_map diff --git a/sahara/tests/scenario_unit/test_base.py b/sahara/tests/scenario_unit/test_base.py index 9debd3b4f9..663bdb7faa 100644 --- a/sahara/tests/scenario_unit/test_base.py +++ b/sahara/tests/scenario_unit/test_base.py @@ -91,7 +91,8 @@ class TestBase(testtools.TestCase): { 'name': 'master', 'node_processes': ['namenode', 'oozie', 'resourcemanager'], - 'flavor': '2' + 'flavor': '2', + 'is_proxy_gateway': True }, { 'name': 'worker',