summaryrefslogtreecommitdiffstats
path: root/tosca2heat/tosca-parser/toscaparser/tests
diff options
context:
space:
mode:
authorshangxdy <shang.xiaodong@zte.com.cn>2016-12-05 14:23:25 +0800
committershangxdy <shang.xiaodong@zte.com.cn>2016-12-09 23:40:40 +0800
commitd098a14d69bf78b7674ec5d75003c21250e640bc (patch)
treef2ecde70b315149ecbc78d71a135fe0e5cd391a0 /tosca2heat/tosca-parser/toscaparser/tests
parentc72383042c976022d8b49b3fc77a4c1a1b735ec0 (diff)
Add output validation for substitution mappings
1. The outputs defined by the topology template have to match the attributes of the node type or the substituted node template, 2.The observable attributes of the substituted node template have to be defined as attributes of the node type or outputs in the topology template. The patch will be submitted to openstack too. JIRA: PARSER-115 Change-Id: Ifa62be9d5c1be79ceacfa1ae6e3835b2de446f88 Signed-off-by: shangxdy <shang.xiaodong@zte.com.cn>
Diffstat (limited to 'tosca2heat/tosca-parser/toscaparser/tests')
-rw-r--r--tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/databasesubsystem.yaml8
-rw-r--r--tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/queuingsubsystem.yaml15
-rw-r--r--tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/transactionsubsystem.yaml6
-rw-r--r--tosca2heat/tosca-parser/toscaparser/tests/test_topology_template.py2
4 files changed, 23 insertions, 8 deletions
diff --git a/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/databasesubsystem.yaml b/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/databasesubsystem.yaml
index ebf1856..6990679 100644
--- a/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/databasesubsystem.yaml
+++ b/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/databasesubsystem.yaml
@@ -75,10 +75,10 @@ topology_template:
distribution: Ubuntu
version: 14.04
- outputs:
- receiver_ip:
- description: private IP address of the database application
- value: { get_attribute: [ server, private_address ] }
+# outputs:
+# receiver_ip:
+# description: private IP address of the database application
+# value: { get_attribute: [ server, private_address ] }
# It seems current _process_intrisic_function can not handle more than 2 arguments, save it for later
# receiver_port:
# description: Port of the message receiver endpoint
diff --git a/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/queuingsubsystem.yaml b/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/queuingsubsystem.yaml
index 76fa7e2..8c4cc76 100644
--- a/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/queuingsubsystem.yaml
+++ b/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/queuingsubsystem.yaml
@@ -61,9 +61,18 @@ topology_template:
version: 14.04
outputs:
- receiver_ip:
- description: private IP address of the message receiver application
- value: { get_attribute: [ server, private_address ] }
+# receiver_ip:
+# description: private IP address of the message receiver application
+# value: { get_attribute: [ server, private_address ] }
+
+ server_ip:
+ description: server_ip of the message receiver application
+ value: { get_input: server_ip }
+
+ server_port:
+ description: server_port of the message receiver application
+ value: { get_input: server_port }
+
# It seems current _process_intrisic_function can not handle more than 2 arguments, save it for later
# receiver_port:
# description: Port of the message receiver endpoint
diff --git a/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/transactionsubsystem.yaml b/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/transactionsubsystem.yaml
index 0f145a3..7b839d7 100644
--- a/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/transactionsubsystem.yaml
+++ b/tosca2heat/tosca-parser/toscaparser/tests/data/topology_template/transactionsubsystem.yaml
@@ -77,6 +77,12 @@ topology_template:
receiver_ip:
description: private IP address of the message receiver application
value: { get_attribute: [ server, private_address ] }
+
+ receiver_port:
+ description: receiver_port of the message receiver application
+ value: { get_input: receiver_port }
+
+
# It seems current _process_intrisic_function can not handle more than 2 arguments, save it for later
# receiver_port:
# description: Port of the message receiver endpoint
diff --git a/tosca2heat/tosca-parser/toscaparser/tests/test_topology_template.py b/tosca2heat/tosca-parser/toscaparser/tests/test_topology_template.py
index 6974d52..eb8d589 100644
--- a/tosca2heat/tosca-parser/toscaparser/tests/test_topology_template.py
+++ b/tosca2heat/tosca-parser/toscaparser/tests/test_topology_template.py
@@ -154,7 +154,7 @@ class TopologyTemplateTest(TestCase):
def test_outputs(self):
self.assertEqual(
- ['receiver_ip'],
+ sorted(['receiver_ip', 'receiver_port']),
sorted([output.name for output in self.topo.outputs]))
def test_groups(self):