Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CONF
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UvA
CONF
Commits
f77f926b
Commit
f77f926b
authored
Feb 21, 2020
by
Spiros Koulouzis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
renamed Orchestrator type
parent
66eecd36
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
32 deletions
+32
-32
capabilities.yaml
TOSCA/types/capabilities.yaml
+1
-1
test_planner.py
planner/test/test_planner.py
+31
-31
No files found.
TOSCA/types/capabilities.yaml
View file @
f77f926b
...
...
@@ -2,7 +2,7 @@ tosca_definitions_version: tosca_simple_yaml_1_0
capability_types
:
tosca.capabilities.ARTICONF.Orchestrator
:
tosca.capabilities.ARTICONF.
docker.
Orchestrator
:
derived_from
:
tosca.capabilities.Container
properties
:
some_properties
:
...
...
planner/test/test_planner.py
View file @
f77f926b
...
...
@@ -26,36 +26,10 @@ def get_tosca_files_path(file_name):
class
MyTestCase
(
unittest
.
TestCase
):
# def test_planner1(self):
# logger = logging.getLogger(__name__)
#
# input_tosca_file_path = get_tosca_files_path('application_example_updated.yaml')
#
# self.assertEqual(True, os.path.exists(input_tosca_file_path),
# "Input TOSCA file: " + input_tosca_file_path + " not found")
#
# conf = {'url': "http://host"}
# spec_service = SpecService(conf)
# test_planner = Planner(input_tosca_file_path, spec_service)
# test_tosca_template = test_planner.resolve_requirements()
# test_tosca_template = test_planner.set_infrastructure_specifications()
# template_dict = tosca_helper.get_tosca_template_2_topology_template_dictionary(test_tosca_template)
# logger.info("template ----: \n" + yaml.dump(template_dict))
# ToscaTemplate(yaml_dict_tpl=copy.deepcopy(template_dict))
#
# test_response = {'toscaTemplate': template_dict}
#
# response = {'toscaTemplate': template_dict}
# output_current_milli_time = int(round(time.time() * 1000))
# response["creationDate"] = output_current_milli_time
# response["parameters"] = []
# print("Output message:" + json.dumps(response))
# self.assertEqual(True, True)
def
test_planner_policies
(
self
):
def
test_planner1
(
self
):
logger
=
logging
.
getLogger
(
__name__
)
input_tosca_file_path
=
get_tosca_files_path
(
'
lifeWatch_vre1
.yaml'
)
input_tosca_file_path
=
get_tosca_files_path
(
'
application_example_updated
.yaml'
)
self
.
assertEqual
(
True
,
os
.
path
.
exists
(
input_tosca_file_path
),
"Input TOSCA file: "
+
input_tosca_file_path
+
" not found"
)
...
...
@@ -67,7 +41,6 @@ class MyTestCase(unittest.TestCase):
test_tosca_template
=
test_planner
.
set_infrastructure_specifications
()
template_dict
=
tosca_helper
.
get_tosca_template_2_topology_template_dictionary
(
test_tosca_template
)
logger
.
info
(
"template ----:
\n
"
+
yaml
.
dump
(
template_dict
))
print
(
yaml
.
dump
(
template_dict
))
ToscaTemplate
(
yaml_dict_tpl
=
copy
.
deepcopy
(
template_dict
))
test_response
=
{
'toscaTemplate'
:
template_dict
}
...
...
@@ -76,6 +49,33 @@ class MyTestCase(unittest.TestCase):
output_current_milli_time
=
int
(
round
(
time
.
time
()
*
1000
))
response
[
"creationDate"
]
=
output_current_milli_time
response
[
"parameters"
]
=
[]
# print("Output message:" + json.dumps(response))
print
(
"Output message:"
+
json
.
dumps
(
response
))
self
.
assertEqual
(
True
,
True
)
# def test_planner_policies(self):
# logger = logging.getLogger(__name__)
#
# input_tosca_file_path = get_tosca_files_path('lifeWatch_vre1.yaml')
#
# self.assertEqual(True, os.path.exists(input_tosca_file_path),
# "Input TOSCA file: " + input_tosca_file_path + " not found")
#
# conf = {'url': "http://host"}
# spec_service = SpecService(conf)
# test_planner = Planner(input_tosca_file_path, spec_service)
# test_tosca_template = test_planner.resolve_requirements()
# test_tosca_template = test_planner.set_infrastructure_specifications()
# template_dict = tosca_helper.get_tosca_template_2_topology_template_dictionary(test_tosca_template)
# logger.info("template ----: \n" + yaml.dump(template_dict))
# print(yaml.dump(template_dict))
# ToscaTemplate(yaml_dict_tpl=copy.deepcopy(template_dict))
#
# test_response = {'toscaTemplate': template_dict}
#
# response = {'toscaTemplate': template_dict}
# output_current_milli_time = int(round(time.time() * 1000))
# response["creationDate"] = output_current_milli_time
# response["parameters"] = []
# # print("Output message:" + json.dumps(response))
#
# self.assertEqual(True, True)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment