From 6292b2a07fc6a2da2b64917cb42947d7b6f079da Mon Sep 17 00:00:00 2001 From: Ken Chen Date: Tue, 1 Sep 2015 15:59:44 +0800 Subject: [PATCH] Enable anti_affinity feature in scenario test Currently Anti_affinity feature is disabled in scenario test. We enable this by changing the validate SCHEMA. It will be an array of role strings. Change-Id: I764f47b54418f173dc0fd4d2c8f0593d49059cb5 --- sahara/tests/scenario/README.rst | 26 ++++++++++---------- sahara/tests/scenario/validation.py | 6 ++++- sahara/tests/scenario_unit/vanilla2_7_1.yaml | 3 +++ 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/sahara/tests/scenario/README.rst b/sahara/tests/scenario/README.rst index 1a355bdd..46faf91c 100644 --- a/sahara/tests/scenario/README.rst +++ b/sahara/tests/scenario/README.rst @@ -270,19 +270,19 @@ Section "cluster_template" This section is dictionary-type. -+----------------------+---------+----------+-----------+---------------------------------------+ -| Fields | Type | Required | Default | Value | -+======================+=========+==========+===========+=======================================+ -| name | string | True | | name for cluster template | -+----------------------+---------+----------+-----------+---------------------------------------+ -| description | string | | Empty | description | -+----------------------+---------+----------+-----------+---------------------------------------+ -| cluster_configs | object | | | name_of_config_section: config: value | -+----------------------+---------+----------+-----------+---------------------------------------+ -| node_group_templates | object | True | | name_of_node_group: count | -+----------------------+---------+----------+-----------+---------------------------------------+ -| anti_affinity | boolean | | False | | -+----------------------+---------+----------+-----------+---------------------------------------+ ++----------------------+--------+----------+-----------+---------------------------------------+ +| Fields | Type | Required | Default | Value | ++======================+========+==========+===========+=======================================+ +| name | string | True | | name for cluster template | ++----------------------+--------+----------+-----------+---------------------------------------+ +| description | string | | Empty | description | ++----------------------+--------+----------+-----------+---------------------------------------+ +| cluster_configs | object | | | name_of_config_section: config: value | ++----------------------+--------+----------+-----------+---------------------------------------+ +| node_group_templates | object | True | | name_of_node_group: count | ++----------------------+--------+----------+-----------+---------------------------------------+ +| anti_affinity | array | | Empty | array of roles | ++----------------------+--------+----------+-----------+---------------------------------------+ Section "cluster" diff --git a/sahara/tests/scenario/validation.py b/sahara/tests/scenario/validation.py index 5841d41f..f8e3d4f5 100644 --- a/sahara/tests/scenario/validation.py +++ b/sahara/tests/scenario/validation.py @@ -223,7 +223,11 @@ SCHEMA = { } }, "anti_affinity": { - "type": "boolean" + "type": "array", + "items": { + "type": "string", + "minLength": 1 + } } }, "required": ["name", "node_group_templates"], diff --git a/sahara/tests/scenario_unit/vanilla2_7_1.yaml b/sahara/tests/scenario_unit/vanilla2_7_1.yaml index cb58872b..aee2904f 100644 --- a/sahara/tests/scenario_unit/vanilla2_7_1.yaml +++ b/sahara/tests/scenario_unit/vanilla2_7_1.yaml @@ -41,6 +41,9 @@ clusters: node_group_templates: master: 1 worker: 3 + anti_affinity: + - namenode + - datanode scenario: - run_jobs - scale