Commit b2b61ce3 authored by Alfonso Orta's avatar Alfonso Orta

Merge branch 'develop' into 'staging'

Develop

See merge request !9
parents bb0e67be 4f75266a
HTTP/1.1 200
Server: nginx/1.19.3
Date: Tue, 20 Oct 2020 10:57:17 GMT
Content-Type: text/plain;charset=UTF-8
Content-Length: 3008
Connection: keep-alive
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Access-Control-Allow-Origin: *
tosca_definitions_version: "tosca_simple_yaml_1_0"
topology_template:
node_templates:
compute:
properties:
disk_size: "40000 MB"
mem_size: "1000 MB"
num_cores: 1
os: "Ubuntu 18.04"
user_name: "vm_user"
interfaces:
Standard:
create: "dumy.yaml"
type: "tosca.nodes.QC.VM.Compute"
compute_1:
properties:
disk_size: "40000 MB"
mem_size: "1000 MB"
num_cores: 1
os: "Ubuntu 18.04"
user_name: "vm_user"
interfaces:
Standard:
create: "dumy.yaml"
type: "tosca.nodes.QC.VM.Compute"
gluster_fs:
requirements:
- host:
capability: "tosca.capabilities.QC.VM.topology"
node: "topology"
relationship: "tosca.relationships.HostedOn"
interfaces:
Standard:
create:
inputs:
repository: "https://github.com/bityoga/mysome_glusterfs.git"
resources:
- "001.requirements.yml"
- "002.setup_glusterfs_infra.yml"
- "003.setup_glusterfs_cluster.yml"
- "004.mount_glusterfs.yml"
type: "tosca.nodes.QC.Application.GlusterFS"
topology:
properties:
domain: "Ireland"
provider: "EC2"
requirements:
- vm:
capability: "tosca.capabilities.QC.VM"
node: "compute"
relationship: "tosca.relationships.DependsOn"
- vm:
capability: "tosca.capabilities.QC.VM"
node: "compute_1"
relationship: "tosca.relationships.DependsOn"
- vm:
capability: "tosca.capabilities.QC.VM"
node: "compute_1"
relationship: "tosca.relationships.DependsOn"
interfaces:
CloudsStorm:
delete:
inputs:
code_type: "SEQ"
object_type: "SubTopology"
hscale:
inputs:
code_type: "SEQ"
object_type: "SubTopology"
provision:
inputs:
code_type: "SEQ"
object_type: "SubTopology"
start:
inputs:
code_type: "SEQ"
object_type: "SubTopology"
stop:
inputs:
code_type: "SEQ"
object_type: "SubTopology"
type: "tosca.nodes.QC.VM.topology"
artifacts:
provisioned_files:
required: false
type: "string"
description: "TOSCA example"
imports:
- nodes: "https://raw.githubusercontent.com/qcdis-sdia/sdia-tosca/master/types/nodes.yaml"
- data: "https://raw.githubusercontent.com/qcdis-sdia/sdia-tosca/master/types/data.yml"
- capabilities: "https://raw.githubusercontent.com/qcdis-sdia/sdia-tosca/master/types/capabilities.yaml"
- policies: "https://raw.githubusercontent.com/qcdis-sdia/sdia-tosca/master/types/policies.yaml"
- interfaces: "https://raw.githubusercontent.com/qcdis-sdia/sdia-tosca/master/types/interfaces.yml"
#!/bin/bash #!/bin/bash
cd ../ cd ../
cd sure_tosca-flask-server && venv/bin/pip3 install -r test-requirements.txt && venv/bin/python3 -m unittest discover python3 -m venv venv
cd sure_tosca-flask-server && python3 -m venv venv && venv/bin/pip3 install -r test-requirements.txt && venv/bin/pip3 install -r requirements.txt && venv/bin/python3 -m unittest discover
if [ $? -eq 0 ] if [ $? -eq 0 ]
then then
echo "------- sure_tosca-flask-server tests successful------" echo "------- sure_tosca-flask-server tests successful------"
...@@ -35,48 +36,53 @@ then ...@@ -35,48 +36,53 @@ then
echo "------- Java tests successful------" echo "------- Java tests successful------"
else else
echo "Java tests Failed" echo "Java tests Failed"
docker stack rm conf-test
exit 1 exit 1
fi fi
cd planner && venv/bin/python3 -m unittest discover cd planner && python3 -m venv venv && venv/bin/pip3 install -r test-requirements.txt && venv/bin/pip3 install -r requirements.txt && venv/bin/python3 -m unittest discover
if [ $? -eq 0 ] if [ $? -eq 0 ]
then then
echo "------- Planner tests successful------" echo "------- Planner tests successful------"
else else
echo "Planner tests Failed" echo "Planner tests Failed"
docker stack rm conf-test
exit 1 exit 1
fi fi
cd ../ cd ../
cd sure_tosca-client_python_stubs && venv/bin/python3 -m unittest discover cd sure_tosca-client_python_stubs && python3 -m venv venv && venv/bin/pip3 install -r test-requirements.txt && venv/bin/pip3 install -r requirements.txt && venv/bin/python3 -m unittest discover
if [ $? -eq 0 ] if [ $? -eq 0 ]
then then
echo "------- sure_tosca-client_python_stubs tests successful------" echo "------- sure_tosca-client_python_stubs tests successful------"
else else
echo "sure_tosca-client_python_stubs tests Failed" echo "sure_tosca-client_python_stubs tests Failed"
docker stack rm conf-test
exit 1 exit 1
fi fi
cd ../ cd ../
cd semaphore-python-client-generated && venv/bin/python3 -m unittest discover cd semaphore-python-client-generated && python3 -m venv venv && venv/bin/pip3 install -r test-requirements.txt && venv/bin/pip3 install -r requirements.txt && venv/bin/python3 -m unittest discover
if [ $? -eq 0 ] if [ $? -eq 0 ]
then then
echo "------- semaphore-python-client-generated tests successful ------" echo "------- semaphore-python-client-generated tests successful ------"
else else
echo "semaphore-python-client-generated tests Failed" echo "semaphore-python-client-generated tests Failed"
docker stack rm conf-test
exit 1 exit 1
fi fi
cd ../ #cd ../
cd deployer && venv/bin/python3 -m unittest discover #cd deployer && python3 -m venv venv && venv/bin/pip3 install -U pip setuptools && venv/bin/pip3 install -r test-requirements.txt && venv/bin/pip3 install -r requirements.txt && venv/bin/python3 -m unittest discover
if [ $? -eq 0 ] #if [ $? -eq 0 ]
then #then
echo "------- deployer tests successful ------" # echo "------- deployer tests successful ------"
else #else
echo "deployer tests Failed" # echo "deployer tests Failed"
exit 1 # docker stack rm conf-test
fi # exit 1
#fi
docker stack rm conf-test docker stack rm conf-test
...@@ -12,3 +12,4 @@ python_dateutil==2.8.1 ...@@ -12,3 +12,4 @@ python_dateutil==2.8.1
# setuptools==46.1.3 # setuptools==46.1.3
# urllib3==1.25.8 # urllib3==1.25.8
kubernetes==11.0.0 kubernetes==11.0.0
sure_tosca_client==1.0.0
\ No newline at end of file
...@@ -5,3 +5,4 @@ networkx==2.4 ...@@ -5,3 +5,4 @@ networkx==2.4
pyyaml==5.3.1 pyyaml==5.3.1
tosca-parser==2.1.1 tosca-parser==2.1.1
matplotlib==3.2.1 matplotlib==3.2.1
requests==2.24.0
\ No newline at end of file
...@@ -5,3 +5,4 @@ nose>=1.3.7 ...@@ -5,3 +5,4 @@ nose>=1.3.7
pluggy==0.13.1 pluggy==0.13.1
randomize==0.14 randomize==0.14
Werkzeug==1.0.0 Werkzeug==1.0.0
requests==2.24.0
\ No newline at end of file
...@@ -36,20 +36,19 @@ class MyTestCase(unittest.TestCase): ...@@ -36,20 +36,19 @@ class MyTestCase(unittest.TestCase):
input_tosca_file_path = self.get_remote_tosca_file(url) input_tosca_file_path = self.get_remote_tosca_file(url)
self.run_test(input_tosca_file_path) self.run_test(input_tosca_file_path)
# def test_docker(self):
def test_docker(self): # url = 'https://raw.githubusercontent.com/qcdis-sdia/sdia-tosca/master/examples/application_example_updated.yaml'
url = 'https://raw.githubusercontent.com/qcdis-sdia/sdia-tosca/master/examples/application_example_updated.yaml' # input_tosca_file_path = self.get_remote_tosca_file(url)
input_tosca_file_path = self.get_remote_tosca_file(url) # self.run_test(input_tosca_file_path)
self.run_test(input_tosca_file_path)
url = 'https://raw.githubusercontent.com/qcdis-sdia/sdia-tosca/master/examples/lifeWatch_vre1.yaml' url = 'https://raw.githubusercontent.com/qcdis-sdia/sdia-tosca/master/examples/lifeWatch_vre1.yaml'
input_tosca_file_path = self.get_remote_tosca_file(url) input_tosca_file_path = self.get_remote_tosca_file(url)
self.run_test(input_tosca_file_path) self.run_test(input_tosca_file_path)
def test_kubernetes(self): # def test_kubernetes(self):
url = 'https://raw.githubusercontent.com/qcdis-sdia/sdia-tosca/master/examples/kubernetes.yaml' # url = 'https://raw.githubusercontent.com/qcdis-sdia/sdia-tosca/master/examples/kubernetes.yaml'
input_tosca_file_path = self.get_remote_tosca_file(url) # input_tosca_file_path = self.get_remote_tosca_file(url)
self.run_test(input_tosca_file_path) # self.run_test(input_tosca_file_path)
def test_topology(self): def test_topology(self):
url = 'https://raw.githubusercontent.com/qcdis-sdia/sdia-tosca/master/examples/topology.yaml' url = 'https://raw.githubusercontent.com/qcdis-sdia/sdia-tosca/master/examples/topology.yaml'
......
...@@ -7,3 +7,4 @@ tinydb==3.15.2 ...@@ -7,3 +7,4 @@ tinydb==3.15.2
tosca-parser==2.0.0 tosca-parser==2.0.0
flask-restx==0.2.0 flask-restx==0.2.0
werkzeug==1.0.1 werkzeug==1.0.1
six==1.15.0
\ No newline at end of file
import logging
import connexion
from flask_testing import TestCase
from sure_tosca.encoder import JSONEncoder
class BaseTestCase(TestCase):
def create_app(self):
logging.getLogger('connexion.operation').setLevel('ERROR')
app = connexion.App(__name__, specification_dir='../swagger/')
app.app.json_encoder = JSONEncoder
app.add_api('swagger.yaml')
return app.app
...@@ -5,3 +5,4 @@ nose>=1.3.7 ...@@ -5,3 +5,4 @@ nose>=1.3.7
pluggy>=0.13.1 pluggy>=0.13.1
randomize>=0.14 randomize>=0.14
Werkzeug==1.0.0 Werkzeug==1.0.0
six==1.15.0
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment