Commit a277eebf authored by Spiros Koulouzis's avatar Spiros Koulouzis

add outputs

parent a327a290
description: TOSCA example
imports:
- nodes: https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/nodes.yaml
- capabilities: https://raw.githubusercontent.com/skoulouzis/DRIP/DRIP_3.0/TOSCA/types/capabilities.yaml
......@@ -26,10 +25,23 @@ topology_template:
num_cores: 2
os: ubuntu 16
type: tosca.nodes.ARTICONF.VM.Compute
compute_2:
interfaces:
Standard:
create: dumy.yaml
properties:
disk_size: 50000 MB
mem_size: 6000 MB
num_cores: 2
os: ubuntu 16
type: tosca.nodes.ARTICONF.VM.Compute
kubernetes:
interfaces:
Standard:
create: interfaces/playbooks/kubernetes_install.yaml
properties:
min_masters_num: 1
min_workers_num: 1
requirements:
- host:
capability: tosca.capabilities.ARTICONF.VM.topology
......@@ -78,6 +90,19 @@ topology_template:
node: kubernetes
relationship: tosca.relationships.HostedOn
type: tosca.nodes.ARTICONF.Container.Application.Docker
topology_1:
interfaces:
Standard:
create: dumy.yaml
properties:
domain: UNC BEN (Chapel Hill, NC USA)
provider: ExoGeni
requirements:
- vm:
capability: tosca.capabilities.ARTICONF.VM
node: compute_2
relationship: tosca.relationships.DependsOn
type: tosca.nodes.ARTICONF.VM.topology
topology:
interfaces:
Standard:
......@@ -133,4 +158,17 @@ topology_template:
targets:
- mysql
type: tosca.policies.ARTICONF.FaultTolerance
outputs:
private_ip_compute:
description: The private IP address of the application’s first tier.
value: { get_attribute: [compute, private_ip] }
private_ip_compute_1:
description: The private IP address of the application’s second tier.
value: { get_attribute: [compute_1, private_ip] }
private_ip_compute_2:
description: The private IP address of the application’s second tier.
value: { get_attribute: [compute_2, private_ip] }
tosca_definitions_version: tosca_simple_yaml_1_0
......@@ -25,14 +25,11 @@ import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import nl.uva.sne.drip.commons.sure_tosca.client.ApiClient;
import nl.uva.sne.drip.commons.sure_tosca.client.ApiException;
import nl.uva.sne.drip.commons.sure_tosca.client.Configuration;
import nl.uva.sne.drip.commons.sure_tosca.client.DefaultApi;
import nl.uva.sne.drip.model.ToscaTemplate;
import org.apache.commons.io.FileUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;
/**
*
......
......@@ -2,10 +2,18 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="e478ccae-5352-4e8e-9efb-3f5cda44e877" name="Default Changelist" comment="">
<change beforePath="$PROJECT_DIR$/../TOSCA/application_example_2_topologies.yaml" beforeDir="false" afterPath="$PROJECT_DIR$/../TOSCA/application_example_2_topologies.yaml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/commons/utils/ToscaHelper.java" beforeDir="false" afterPath="$PROJECT_DIR$/../drip-commons/src/main/java/nl/uva/sne/drip/commons/utils/ToscaHelper.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/__main__.py" beforeDir="false" afterPath="$PROJECT_DIR$/__main__.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/service/simple_spec_alayzer.py" beforeDir="false" afterPath="$PROJECT_DIR$/service/simple_spec_alayzer.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/test/test_planner.py" beforeDir="false" afterPath="$PROJECT_DIR$/test/test_planner.py" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../drip_planner2/venv/lib/python3.6/site-packages/easy-install.pth" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../drip_planner2/venv/lib/python3.6/site-packages/prettytable.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../drip_planner2/venv/lib/python3.6/site-packages/pyparsing.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../drip_planner2/venv/lib/python3.6/site-packages/setuptools-40.8.0-py3.6.egg" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../drip_planner2/venv/lib/python3.6/site-packages/setuptools.pth" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../drip_planner2/venv/lib/python3.6/site-packages/six.py" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/../jenkins_pipeline" beforeDir="false" afterPath="$PROJECT_DIR$/../jenkins_pipeline" afterDir="false" />
<change beforePath="$PROJECT_DIR$/../test.sh" beforeDir="false" afterPath="$PROJECT_DIR$/../test.sh" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="SHOW_DIALOG" value="false" />
......@@ -50,7 +58,7 @@
</list>
</option>
</component>
<component name="RunManager" selected="Python.__main__">
<component name="RunManager" selected="Python tests.Unittests for test_planner.MyTestCase.test_something">
<configuration name="__main__" type="PythonConfigurationType" factoryName="Python" temporary="true">
<module name="drip-planner" />
<option name="INTERPRETER_OPTIONS" value="" />
......@@ -72,6 +80,20 @@
<option name="INPUT_FILE" value="" />
<method v="2" />
</configuration>
<configuration name="Unittests for test_planner.MyTestCase.test_something" type="tests" factoryName="Unittests" temporary="true" nameIsGenerated="true">
<module name="drip-planner" />
<option name="INTERPRETER_OPTIONS" value="" />
<option name="PARENT_ENVS" value="true" />
<option name="SDK_HOME" value="" />
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/test" />
<option name="IS_MODULE_SDK" value="true" />
<option name="ADD_CONTENT_ROOTS" value="true" />
<option name="ADD_SOURCE_ROOTS" value="true" />
<option name="_new_additionalArguments" value="&quot;&quot;" />
<option name="_new_target" value="&quot;test_planner.MyTestCase.test_something&quot;" />
<option name="_new_targetType" value="&quot;PYTHON&quot;" />
<method v="2" />
</configuration>
<configuration name="Unittests in test_planner.py" type="tests" factoryName="Unittests" temporary="true" nameIsGenerated="true">
<module name="drip-planner" />
<option name="INTERPRETER_OPTIONS" value="" />
......@@ -89,11 +111,13 @@
<list>
<item itemvalue="Python.__main__" />
<item itemvalue="Python tests.Unittests in test_planner.py" />
<item itemvalue="Python tests.Unittests for test_planner.MyTestCase.test_something" />
</list>
<recent_temporary>
<list>
<item itemvalue="Python.__main__" />
<item itemvalue="Python tests.Unittests for test_planner.MyTestCase.test_something" />
<item itemvalue="Python tests.Unittests in test_planner.py" />
<item itemvalue="Python.__main__" />
</list>
</recent_temporary>
</component>
......@@ -178,7 +202,14 @@
<option name="project" value="LOCAL" />
<updated>1573214191545</updated>
</task>
<option name="localTasksCounter" value="11" />
<task id="LOCAL-00011" summary="fixed test">
<created>1573214561640</created>
<option name="number" value="00011" />
<option name="presentableId" value="LOCAL-00011" />
<option name="project" value="LOCAL" />
<updated>1573214561640</updated>
</task>
<option name="localTasksCounter" value="12" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
......@@ -204,7 +235,8 @@
<MESSAGE value="added tosca-parser" />
<MESSAGE value="added matplotlib" />
<MESSAGE value="fixed default property setting" />
<option name="LAST_COMMIT_MESSAGE" value="fixed default property setting" />
<MESSAGE value="fixed test" />
<option name="LAST_COMMIT_MESSAGE" value="fixed test" />
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
......@@ -220,9 +252,9 @@
<option name="timeStamp" value="9" />
</line-breakpoint>
<line-breakpoint enabled="true" suspend="THREAD" type="python-line">
<url>file://$PROJECT_DIR$/service/simple_spec_alayzer.py</url>
<line>25</line>
<option name="timeStamp" value="20" />
<url>file://$PROJECT_DIR$/test/test_planner.py</url>
<line>22</line>
<option name="timeStamp" value="21" />
</line-breakpoint>
</breakpoints>
</breakpoint-manager>
......
......@@ -19,10 +19,12 @@ class MyTestCase(unittest.TestCase):
def test_something(self):
logger = logging.getLogger(__name__)
tosca_path = "../TOSCA/"
input_tosca_file_path = tosca_path + '/application_example_updated.yaml'
dir_path = os.path.dirname(os.path.realpath(__file__))
tosca_path = "../../TOSCA/"
input_tosca_file_path = tosca_path + '/application_example_updated.yaml'
if not os.path.exists(input_tosca_file_path):
tosca_path = "../TOSCA/"
input_tosca_file_path = tosca_path + '/application_example_updated.yaml'
self.assertEqual(True, os.path.exists(input_tosca_file_path),
"Input TOSCA file: " + input_tosca_file_path + " not found")
......
......@@ -22,8 +22,8 @@ pipeline {
stage('Test') {
steps {
echo 'Testing'
sh "mvn test"
sh "cd drip-planner && venv/bin/python3 -m unittest test/test_planner.py"
sh "cd drip-planner && venv/bin/python3 -m unittest discover"
sh "cd sure_tosca-flask-server && venv/bin/python3 -m unittest discover"
}
}
stage('Deploy') {
......
......@@ -2,4 +2,9 @@
mvn test
cd drip-planner && python3 -m unittest test/test_planner.py
python3.6 --version
cd drip-planner && venv/bin/python3 -m unittest test/test_planner.py
cd sure_tosca-flask-server && venv/bin/python3 -m unittest sure_tosca/test/test_default_controller.py
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