Skip to content

Commit fe0d9e9

Browse files
committed
Validate occurrences in relationships
Check that the number of occurences of the relationships of a template is correct related with the definition of the type. Also fix other tests that do not pass this new test. Related-Bug: 2044266 Change-Id: I3dfa56d4e48454983daacc4b210017be1123683a
1 parent 386c260 commit fe0d9e9

26 files changed

Lines changed: 218 additions & 10 deletions
-3.61 KB
Binary file not shown.
34 Bytes
Binary file not shown.

samples/tests/data/containers/test_container_docker_mysql.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,4 +41,8 @@ topology_template:
4141
num_cpus: 1
4242
disk_size: 10 GB
4343
mem_size: 2 MB
44+
requirements:
45+
- host: my_server
4446

47+
my_server:
48+
type: tosca.nodes.Compute

samples/tests/data/custom_types/logstash.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
tosca_definitions_version: tosca_simple_yaml_1_0
22

3+
imports:
4+
- elasticsearch: data/custom_types/elasticsearch.yaml
5+
36
description: >
47
Logstash is a tool for receiving, processing and outputting logs. All kinds
58
of logs. System logs, webserver logs, error logs, application logs, and just

samples/tests/data/extensions/tosca_helloworld_nfv.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ topology_template:
1313
id: vnf1
1414
vendor: acmetelco
1515
version: 1.0
16+
requirements:
17+
- virtualLink: PrivateNetwork
1618

1719
VDU1:
1820
type: tosca.nodes.nfv.VDU
@@ -24,6 +26,11 @@ topology_template:
2426
requirements:
2527
- virtualLink: PrivateNetwork
2628
- virtualBinding: VDU1
29+
# Added to pass the requirement validation
30+
# as the tosca.nodes.nfv.CP inherits from tosca.nodes.Port
31+
# This type was removed from the final version of the NFV profile
32+
- link: PrivateNetwork
33+
- binding: VDU1
2734

2835
PrivateNetwork:
2936
type: tosca.nodes.nfv.VL

samples/tests/data/functions/test_get_implicit_attribute.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ topology_template:
1919
type: ServerNode
2020
properties:
2121
notification_port: 8000
22+
requirements:
23+
- host: my_server_host
24+
25+
my_server_host:
26+
type: tosca.nodes.Compute
2227

2328
outputs:
2429
ip_address:

samples/tests/data/interfaces/test_custom_interface_in_template.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,8 @@ topology_template:
2121
inputs:
2222
param3:
2323
type: string
24+
requirements:
25+
- host: my_server
26+
27+
my_server:
28+
type: tosca.nodes.Compute

samples/tests/data/interfaces/test_custom_interface_invalid_operation.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,8 @@ topology_template:
1717
inputs:
1818
param3:
1919
type: string
20+
requirements:
21+
- host: compute
22+
23+
compute:
24+
type: tosca.nodes.Compute

samples/tests/data/interfaces/test_custom_interface_notifications.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ topology_template:
1515
CustomOp:
1616
notifications:
1717
CustomNo:
18+
requirements:
19+
- host: compute
20+
21+
compute:
22+
type: tosca.nodes.Compute
1823

1924
interface_types:
2025
tosca.interfaces.CustomInterface:

samples/tests/data/interfaces/test_custom_interface_operations.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,11 @@ topology_template:
1414
operations:
1515
CustomOp: # operation from interface_type with additional outputs
1616
outputs:
17+
requirements:
18+
- host: compute
19+
20+
compute:
21+
type: tosca.nodes.Compute
1722

1823
interface_types:
1924
tosca.interfaces.CustomInterface:

0 commit comments

Comments
 (0)