summaryrefslogtreecommitdiffstats
path: root/asdc-tests/src/test/resources/CI/tests/getServiceListTest
diff options
context:
space:
mode:
Diffstat (limited to 'asdc-tests/src/test/resources/CI/tests/getServiceListTest')
-rw-r--r--asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/images/mysql.pngbin0 -> 63119 bytes
-rw-r--r--asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/mysql.yml85
-rw-r--r--asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/install_mysql.sh28
-rw-r--r--asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/start_mysql.sh105
-rw-r--r--asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/images/mysql.pngbin0 -> 63119 bytes
-rw-r--r--asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/mysql.yml85
-rw-r--r--asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/install_mysql2.sh28
-rw-r--r--asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/start_mysql2.sh105
-rw-r--r--asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/topology.txt1
-rw-r--r--asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/topologyTemplate.txt2
-rw-r--r--asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/images/mysql.pngbin0 -> 63119 bytes
-rw-r--r--asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/mysql.yml85
-rw-r--r--asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/images/mysql.pngbin0 -> 63119 bytes
-rw-r--r--asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/mysql.yml85
-rw-r--r--asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/topology.txt1
-rw-r--r--asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/topologyTemplate.txt2
16 files changed, 612 insertions, 0 deletions
diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/images/mysql.png b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/images/mysql.png
new file mode 100644
index 0000000000..8e02f49b7b
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/images/mysql.png
Binary files differ
diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/mysql.yml b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/mysql.yml
new file mode 100644
index 0000000000..e0a0c6458e
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/mysql.yml
@@ -0,0 +1,85 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03
+description: MySQL RDBMS installation on a specific mounted volume path.
+template_name: mysql-getServiceArtifactListTest
+template_version: 1.1.1-SNAPSHOT
+template_author: FastConnect
+
+imports:
+ - "tosca-normative-types-root:1.0.0.wd03-SNAPSHOT"
+ - "tosca-normative-types-compute:1.0.0.wd03-SNAPSHOT"
+ - "tosca-normative-types-database:1.0.0.wd03-SNAPSHOT"
+ - "tosca-normative-types-DBMS:1.0.0.wd03-SNAPSHOT"
+
+node_types:
+ alien.nodes.Mysql-getServiceArtifactListTest:
+ derived_from: tosca.nodes.Database
+ description: >
+ A node to install MySQL v5.5 database with data
+ on a specific attached volume.
+ capabilities:
+ host:
+ type: alien.capabilities.MysqlDatabase-getServiceArtifactListTest
+ properties:
+ valid_node_types: [ tosca.nodes.WebApplication ]
+ requirements:
+ - host: tosca.nodes.Compute
+ type: tosca.relationships.HostedOn
+ tags:
+ icon: /images/mysql.png
+ properties:
+ db_port:
+ type: integer
+ default: 3306
+ description: The port on which the underlying database service will listen to data.
+ db_name:
+ type: string
+ required: true
+ default: wordpress
+ description: The logical name of the database.
+ db_user:
+ type: string
+ default: pass
+ description: The special user account used for database administration.
+ db_password:
+ type: string
+ default: pass
+ description: The password associated with the user account provided in the ‘db_user’ property.
+ bind_address:
+ type: boolean
+ default: true
+ required: false
+ description: If true,the server accepts TCP/IP connections on all server host IPv4 interfaces.
+ storage_path:
+ type: string
+ default: /mountedStorage
+ constraints:
+ - valid_values: [ "/mountedStorage", "/var/mysql" ]
+ interfaces:
+ Standard:
+ create: scripts/install_mysql.sh
+ start:
+ inputs:
+ VOLUME_HOME: { get_property: [SELF, storage_path] }
+ PORT: { get_property: [SELF, db_port] }
+ DB_NAME: { get_property: [SELF, db_name] }
+ DB_USER: { get_property: [SELF, db_user] }
+ DB_PASSWORD: { get_property: [SELF, db_password] }
+ BIND_ADRESS: { get_property: [SELF, bind_address] }
+ implementation: scripts/start_mysql.sh
+ fastconnect.cloudify.extensions:
+ start_detection:
+ inputs:
+ PORT: { get_property: [SELF, db_port] }
+ implementation: scripts/mysql_start_detection.groovy
+ artifacts:
+ - scripts: scripts
+ type: tosca.artifacts.File
+
+capability_types:
+ alien.capabilities.MysqlDatabase-getServiceArtifactListTest:
+ derived_from: tosca.capabilities.Container
+
+artifact_types:
+ tosca.artifacts.GroovyScript-getServiceArtifactListTest:
+ description: A groovy script (.groovy file)
+ file_ext: [groovy]
diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/install_mysql.sh b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/install_mysql.sh
new file mode 100644
index 0000000000..400bcf40cb
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/install_mysql.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+echo "Debian based MYSQL install 5..."
+LOCK="/tmp/lockaptget"
+
+while true; do
+ if mkdir "${LOCK}" &>/dev/null; then
+ echo "MySQL take the lock"
+ break;
+ fi
+ echo "Waiting the end of one of our recipes..."
+ sleep 0.5
+done
+
+while sudo fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
+ echo "Waiting for other software managers to finish..."
+ sleep 0.5
+done
+sudo rm -f /var/lib/dpkg/lock
+
+sudo apt-get update || (sleep 15; sudo apt-get update || exit ${1})
+sudo DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-server-5.5 pwgen || exit ${1}
+rm -rf "${LOCK}"
+
+sudo /etc/init.d/mysql stop
+sudo rm -rf /var/lib/apt/lists/*
+sudo rm -rf /var/lib/mysql/*
+echo "MySQL Installation complete." \ No newline at end of file
diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/start_mysql.sh b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/start_mysql.sh
new file mode 100644
index 0000000000..648bd45756
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/start_mysql.sh
@@ -0,0 +1,105 @@
+#!/bin/bash
+
+echo "------------------------ ENV ------------------------"
+echo "ENV VAR USED VOLUME_HOME : $VOLUME_HOME"
+echo "ENV VAR USED PORT : $PORT"
+echo "ENV VAR USED DB_NAME : $DB_NAME"
+echo "ENV VAR USED DB_USER : $DB_USER"
+echo "ENV VAR USED DB_PASSWORD : $DB_PASSWORD"
+echo "---------------------------- ------------------------"
+
+CURRENT_PATH=`dirname "$0"`
+
+function StartMySQL {
+ echo "Starting MYSQL..."
+ sudo /etc/init.d/mysql stop
+ sudo /usr/bin/mysqld_safe > /dev/null 2>&1 &
+ RET=1
+ while [[ RET -ne 0 ]]; do
+ echo "=> Waiting for confirmation of MySQL service startup"
+ sleep 5
+ sudo mysql -uroot -e "status" > /dev/null 2>&1
+ RET=$?
+ done
+}
+
+function AllowFileSystemToMySQL {
+ MYSQL_DATA_DIR=$VOLUME_HOME/data
+ MYSQL_LOG=$VOLUME_HOME/logs
+
+ echo "Setting data directory to $MYSQL_DATA_DIR an logs to $MYSQL_LOG ..."
+ if sudo test ! -d $MYSQL_DATA_DIR; then
+ echo "Creating DATA dir > $MYSQL_DATA_DIR ..."
+ sudo mkdir -p $MYSQL_DATA_DIR
+ # mysql as owner and group owner
+ sudo chown -R mysql:mysql $MYSQL_DATA_DIR
+ fi
+ if sudo test ! -d $MYSQL_LOG; then
+ echo "Creating LOG dir > $MYSQL_LOG ..."
+ sudo mkdir -p $MYSQL_LOG
+ # mysql as owner and group owner
+ sudo chown -R mysql:mysql $MYSQL_LOG
+ fi
+
+ # edit app mysql permission in : /etc/apparmor.d/usr.sbin.mysqld
+ COUNT_LINE=`sudo cat /etc/apparmor.d/usr.sbin.mysqld | wc -l`
+ sudo sed -i "$(($COUNT_LINE)) i $MYSQL_DATA_DIR/ r," /etc/apparmor.d/usr.sbin.mysqld
+ sudo sed -i "$(($COUNT_LINE)) i $MYSQL_DATA_DIR/** rwk," /etc/apparmor.d/usr.sbin.mysqld
+ sudo sed -i "$(($COUNT_LINE)) i $MYSQL_LOG/ r," /etc/apparmor.d/usr.sbin.mysqld
+ sudo sed -i "$(($COUNT_LINE)) i $MYSQL_LOG/** rwk," /etc/apparmor.d/usr.sbin.mysqld
+
+ # reload app permission manager service
+ sudo service apparmor reload
+}
+
+function UpdateMySQLConf {
+ echo "Updating MySQL conf files [DATA, LOGS]..."
+ sudo sed -i "s:/var/lib/mysql:$MYSQL_DATA_DIR:g" /etc/mysql/my.cnf
+ sudo sed -i "s:/var/log/mysql/error.log:$MYSQL_LOG/error.log:g" /etc/mysql/my.cnf
+ sudo sed -i "s:3306:$PORT:g" /etc/mysql/my.cnf
+
+ if sudo test ! -f /usr/share/mysql/my-default.cnf; then
+ sudo cp /etc/mysql/my.cnf /usr/share/mysql/my-default.cnf
+ fi
+ if sudo test ! -f /etc/mysql/conf.d/mysqld_charset.cnf; then
+ sudo cp $configs/mysqld_charset.cnf /etc/mysql/conf.d/mysqld_charset.cnf
+ fi
+
+ if [ "$BIND_ADRESS" == "true" ]; then
+ sudo sed -i "s/bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
+ fi
+}
+
+function InitMySQLDb {
+ # create database DB_NAME
+ if [ "$DB_NAME" ]; then
+ echo "INIT DATABASE $DB_NAME"
+ sudo mysql -u root -e "CREATE DATABASE $DB_NAME";
+ fi
+
+ # create user and give rights
+ if [ "$DB_USER" ]; then
+ echo "CREATE USER $DB_USER WITH PASSWORD $DB_PASSWORD AND GRAND RIGHTS ON $DB_NAME"
+ sudo mysql -uroot -e "CREATE USER '${DB_USER}'@'%' IDENTIFIED BY '$DB_PASSWORD'"
+ sudo mysql -uroot -e "GRANT ALL PRIVILEGES ON ${DB_NAME}.* TO '${DB_USER}'@'%' WITH GRANT OPTION"
+ sudo mysql -uroot -e "FLUSH PRIVILEGES"
+ fi
+}
+
+# Create a new database path to the attched volume
+if sudo test ! -d $VOLUME_HOME/data; then
+ echo "=> An empty or uninitialized MySQL volume is detected in $VOLUME_HOME/data"
+ AllowFileSystemToMySQL
+ UpdateMySQLConf
+ echo "=> Init new database path to $MYSQL_DATA_DIR"
+ sudo mysql_install_db --basedir=/usr --datadir=$MYSQL_DATA_DIR
+ echo "=> MySQL database initialized !"
+else
+ echo "=> Using an existing volume of MySQL"
+ AllowFileSystemToMySQL
+ UpdateMySQLConf
+fi
+
+# Finally start MySQL with new configuration
+StartMySQL
+InitMySQLDb \ No newline at end of file
diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/images/mysql.png b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/images/mysql.png
new file mode 100644
index 0000000000..8e02f49b7b
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/images/mysql.png
Binary files differ
diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/mysql.yml b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/mysql.yml
new file mode 100644
index 0000000000..dc5ff158c8
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/mysql.yml
@@ -0,0 +1,85 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03
+description: MySQL RDBMS installation on a specific mounted volume path.
+template_name: mysql-getServiceArtifactListTest2
+template_version: 1.1.1-SNAPSHOT
+template_author: FastConnect
+
+imports:
+ - "tosca-normative-types-root:1.0.0.wd03-SNAPSHOT"
+ - "tosca-normative-types-compute:1.0.0.wd03-SNAPSHOT"
+ - "tosca-normative-types-database:1.0.0.wd03-SNAPSHOT"
+ - "tosca-normative-types-DBMS:1.0.0.wd03-SNAPSHOT"
+
+node_types:
+ alien.nodes.Mysql-getServiceArtifactListTest2:
+ derived_from: tosca.nodes.Database
+ description: >
+ A node to install MySQL v5.5 database with data
+ on a specific attached volume.
+ capabilities:
+ host:
+ type: alien.capabilities.MysqlDatabase-getServiceArtifactListTest2
+ properties:
+ valid_node_types: [ tosca.nodes.WebApplication ]
+ requirements:
+ - host: tosca.nodes.Compute
+ type: tosca.relationships.HostedOn
+ tags:
+ icon: /images/mysql.png
+ properties:
+ db_port:
+ type: integer
+ default: 3306
+ description: The port on which the underlying database service will listen to data.
+ db_name:
+ type: string
+ required: true
+ default: wordpress
+ description: The logical name of the database.
+ db_user:
+ type: string
+ default: pass
+ description: The special user account used for database administration.
+ db_password:
+ type: string
+ default: pass
+ description: The password associated with the user account provided in the ‘db_user’ property.
+ bind_address:
+ type: boolean
+ default: true
+ required: false
+ description: If true,the server accepts TCP/IP connections on all server host IPv4 interfaces.
+ storage_path:
+ type: string
+ default: /mountedStorage
+ constraints:
+ - valid_values: [ "/mountedStorage", "/var/mysql" ]
+ interfaces:
+ Standard:
+ create: scripts/install_mysql.sh
+ start:
+ inputs:
+ VOLUME_HOME: { get_property: [SELF, storage_path] }
+ PORT: { get_property: [SELF, db_port] }
+ DB_NAME: { get_property: [SELF, db_name] }
+ DB_USER: { get_property: [SELF, db_user] }
+ DB_PASSWORD: { get_property: [SELF, db_password] }
+ BIND_ADRESS: { get_property: [SELF, bind_address] }
+ implementation: scripts/start_mysql.sh
+ fastconnect.cloudify.extensions:
+ start_detection:
+ inputs:
+ PORT: { get_property: [SELF, db_port] }
+ implementation: scripts/mysql_start_detection.groovy
+ artifacts:
+ - scripts: scripts
+ type: tosca.artifacts.File
+
+capability_types:
+ alien.capabilities.MysqlDatabase-getServiceArtifactListTest2:
+ derived_from: tosca.capabilities.Container
+
+artifact_types:
+ tosca.artifacts.GroovyScript-getServiceArtifactListTest2:
+ description: A groovy script (.groovy file)
+ file_ext: [groovy]
diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/install_mysql2.sh b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/install_mysql2.sh
new file mode 100644
index 0000000000..400bcf40cb
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/install_mysql2.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+echo "Debian based MYSQL install 5..."
+LOCK="/tmp/lockaptget"
+
+while true; do
+ if mkdir "${LOCK}" &>/dev/null; then
+ echo "MySQL take the lock"
+ break;
+ fi
+ echo "Waiting the end of one of our recipes..."
+ sleep 0.5
+done
+
+while sudo fuser /var/lib/dpkg/lock >/dev/null 2>&1 ; do
+ echo "Waiting for other software managers to finish..."
+ sleep 0.5
+done
+sudo rm -f /var/lib/dpkg/lock
+
+sudo apt-get update || (sleep 15; sudo apt-get update || exit ${1})
+sudo DEBIAN_FRONTEND=noninteractive apt-get -y install mysql-server-5.5 pwgen || exit ${1}
+rm -rf "${LOCK}"
+
+sudo /etc/init.d/mysql stop
+sudo rm -rf /var/lib/apt/lists/*
+sudo rm -rf /var/lib/mysql/*
+echo "MySQL Installation complete." \ No newline at end of file
diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/start_mysql2.sh b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/start_mysql2.sh
new file mode 100644
index 0000000000..648bd45756
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/start_mysql2.sh
@@ -0,0 +1,105 @@
+#!/bin/bash
+
+echo "------------------------ ENV ------------------------"
+echo "ENV VAR USED VOLUME_HOME : $VOLUME_HOME"
+echo "ENV VAR USED PORT : $PORT"
+echo "ENV VAR USED DB_NAME : $DB_NAME"
+echo "ENV VAR USED DB_USER : $DB_USER"
+echo "ENV VAR USED DB_PASSWORD : $DB_PASSWORD"
+echo "---------------------------- ------------------------"
+
+CURRENT_PATH=`dirname "$0"`
+
+function StartMySQL {
+ echo "Starting MYSQL..."
+ sudo /etc/init.d/mysql stop
+ sudo /usr/bin/mysqld_safe > /dev/null 2>&1 &
+ RET=1
+ while [[ RET -ne 0 ]]; do
+ echo "=> Waiting for confirmation of MySQL service startup"
+ sleep 5
+ sudo mysql -uroot -e "status" > /dev/null 2>&1
+ RET=$?
+ done
+}
+
+function AllowFileSystemToMySQL {
+ MYSQL_DATA_DIR=$VOLUME_HOME/data
+ MYSQL_LOG=$VOLUME_HOME/logs
+
+ echo "Setting data directory to $MYSQL_DATA_DIR an logs to $MYSQL_LOG ..."
+ if sudo test ! -d $MYSQL_DATA_DIR; then
+ echo "Creating DATA dir > $MYSQL_DATA_DIR ..."
+ sudo mkdir -p $MYSQL_DATA_DIR
+ # mysql as owner and group owner
+ sudo chown -R mysql:mysql $MYSQL_DATA_DIR
+ fi
+ if sudo test ! -d $MYSQL_LOG; then
+ echo "Creating LOG dir > $MYSQL_LOG ..."
+ sudo mkdir -p $MYSQL_LOG
+ # mysql as owner and group owner
+ sudo chown -R mysql:mysql $MYSQL_LOG
+ fi
+
+ # edit app mysql permission in : /etc/apparmor.d/usr.sbin.mysqld
+ COUNT_LINE=`sudo cat /etc/apparmor.d/usr.sbin.mysqld | wc -l`
+ sudo sed -i "$(($COUNT_LINE)) i $MYSQL_DATA_DIR/ r," /etc/apparmor.d/usr.sbin.mysqld
+ sudo sed -i "$(($COUNT_LINE)) i $MYSQL_DATA_DIR/** rwk," /etc/apparmor.d/usr.sbin.mysqld
+ sudo sed -i "$(($COUNT_LINE)) i $MYSQL_LOG/ r," /etc/apparmor.d/usr.sbin.mysqld
+ sudo sed -i "$(($COUNT_LINE)) i $MYSQL_LOG/** rwk," /etc/apparmor.d/usr.sbin.mysqld
+
+ # reload app permission manager service
+ sudo service apparmor reload
+}
+
+function UpdateMySQLConf {
+ echo "Updating MySQL conf files [DATA, LOGS]..."
+ sudo sed -i "s:/var/lib/mysql:$MYSQL_DATA_DIR:g" /etc/mysql/my.cnf
+ sudo sed -i "s:/var/log/mysql/error.log:$MYSQL_LOG/error.log:g" /etc/mysql/my.cnf
+ sudo sed -i "s:3306:$PORT:g" /etc/mysql/my.cnf
+
+ if sudo test ! -f /usr/share/mysql/my-default.cnf; then
+ sudo cp /etc/mysql/my.cnf /usr/share/mysql/my-default.cnf
+ fi
+ if sudo test ! -f /etc/mysql/conf.d/mysqld_charset.cnf; then
+ sudo cp $configs/mysqld_charset.cnf /etc/mysql/conf.d/mysqld_charset.cnf
+ fi
+
+ if [ "$BIND_ADRESS" == "true" ]; then
+ sudo sed -i "s/bind-address.*/bind-address = 0.0.0.0/" /etc/mysql/my.cnf
+ fi
+}
+
+function InitMySQLDb {
+ # create database DB_NAME
+ if [ "$DB_NAME" ]; then
+ echo "INIT DATABASE $DB_NAME"
+ sudo mysql -u root -e "CREATE DATABASE $DB_NAME";
+ fi
+
+ # create user and give rights
+ if [ "$DB_USER" ]; then
+ echo "CREATE USER $DB_USER WITH PASSWORD $DB_PASSWORD AND GRAND RIGHTS ON $DB_NAME"
+ sudo mysql -uroot -e "CREATE USER '${DB_USER}'@'%' IDENTIFIED BY '$DB_PASSWORD'"
+ sudo mysql -uroot -e "GRANT ALL PRIVILEGES ON ${DB_NAME}.* TO '${DB_USER}'@'%' WITH GRANT OPTION"
+ sudo mysql -uroot -e "FLUSH PRIVILEGES"
+ fi
+}
+
+# Create a new database path to the attched volume
+if sudo test ! -d $VOLUME_HOME/data; then
+ echo "=> An empty or uninitialized MySQL volume is detected in $VOLUME_HOME/data"
+ AllowFileSystemToMySQL
+ UpdateMySQLConf
+ echo "=> Init new database path to $MYSQL_DATA_DIR"
+ sudo mysql_install_db --basedir=/usr --datadir=$MYSQL_DATA_DIR
+ echo "=> MySQL database initialized !"
+else
+ echo "=> Using an existing volume of MySQL"
+ AllowFileSystemToMySQL
+ UpdateMySQLConf
+fi
+
+# Finally start MySQL with new configuration
+StartMySQL
+InitMySQLDb \ No newline at end of file
diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/topology.txt b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/topology.txt
new file mode 100644
index 0000000000..cb3c3e8546
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/topology.txt
@@ -0,0 +1 @@
+{"id":"6a4b2f9d-7fe1-482d-af11-97f483dff5b7","delegateId":"9c063349-2259-40fe-97f1-7c40e659e1b0","delegateType":"topologytemplate","dependencies":[{"name":"tosca-normative-types-DBMS","version":"1.0.0.wd03-SNAPSHOT"},{"name":"mysql-getServiceArtifactListTest2","version":"1.1.1-SNAPSHOT"},{"name":"tosca-normative-types-softwareComponent","version":"1.0.0.wd03-SNAPSHOT"},{"name":"tosca-normative-types-compute","version":"1.0.0.wd03-SNAPSHOT"},{"name":"tosca-normative-types-root","version":"1.0.0.wd03-SNAPSHOT"},{"name":"mysql-getServiceArtifactListTest","version":"1.1.1-SNAPSHOT"},{"name":"tosca-normative-types-database","version":"1.0.0.wd03-SNAPSHOT"}],"nodeTemplates":[{"key":"Mysql-getServiceArtifactListTest","value":{"type":"alien.nodes.Mysql-getServiceArtifactListTest","name":null,"properties":{"bind_address":"true","storage_path":"/mountedStorage","db_port":"3306","db_name":"wordpress","db_user":"pass","db_password":"pass"},"attributes":{"tosca_id":null,"tosca_name":null},"relationships":{"hostedOnCompute":{"type":"tosca.relationships.HostedOn","target":"Compute","requirementName":"host","requirementType":"tosca.nodes.Compute","targetedCapabilityName":"host"}},"requirements":{"dependency":{"type":"tosca.capabilities.Root","properties":null},"host":{"type":"tosca.nodes.Compute","properties":null}},"capabilities":{"database_endpoint":{"type":"tosca.capabilities.DatabaseEndpoint","properties":{"port":null,"protocol":{"value":"tcp","definition":false},"url_path":null,"secure":{"value":"false","definition":false}}},"host":{"type":"alien.capabilities.MysqlDatabase-getServiceArtifactListTest","properties":{"valid_node_types":null}},"root":{"type":"tosca.capabilities.Root","properties":null}},"artifacts":{"scripts":{"artifactType":"tosca.artifacts.File","artifactRef":"scripts","artifactName":"scripts","artifactRepository":null}}}},{"key":"Compute","value":{"type":"tosca.nodes.Compute","name":null,"properties":{"disk_size":null,"num_cpus":null,"os_distribution":null,"os_arch":null,"mem_size":null,"os_type":null,"os_version":null},"attributes":{"ip_address":null,"tosca_id":null,"tosca_name":null},"relationships":null,"requirements":{"dependency":{"type":"tosca.capabilities.Root","properties":null},"network":{"type":"tosca.capabilities.Connectivity","properties":null}},"capabilities":{"host":{"type":"tosca.capabilities.Container","properties":{"valid_node_types":null}},"root":{"type":"tosca.capabilities.Root","properties":null},"attach":{"type":"tosca.capabilities.Attachment","properties":null},"scalable":{"type":"tosca.capabilities.Scalable","properties":{"max_intances":{"value":"1","definition":false},"default_instances":{"value":"1","definition":false},"min_intances":{"value":"1","definition":false}}}},"artifacts":null}},{"key":"Mysql-getServiceArtifactListTest2","value":{"type":"alien.nodes.Mysql-getServiceArtifactListTest2","name":null,"properties":{"bind_address":"true","storage_path":"/mountedStorage","db_port":"3306","db_name":"wordpress","db_user":"pass","db_password":"pass"},"attributes":{"tosca_id":null,"tosca_name":null},"relationships":{"hostedOnCompute":{"type":"tosca.relationships.HostedOn","target":"Compute","requirementName":"host","requirementType":"tosca.nodes.Compute","targetedCapabilityName":"host"}},"requirements":{"dependency":{"type":"tosca.capabilities.Root","properties":null},"host":{"type":"tosca.nodes.Compute","properties":null}},"capabilities":{"database_endpoint":{"type":"tosca.capabilities.DatabaseEndpoint","properties":{"port":null,"protocol":{"value":"tcp","definition":false},"url_path":null,"secure":{"value":"false","definition":false}}},"host":{"type":"alien.capabilities.MysqlDatabase-getServiceArtifactListTest2","properties":{"valid_node_types":null}},"root":{"type":"tosca.capabilities.Root","properties":null}},"artifacts":{"scripts":{"artifactType":"tosca.artifacts.File","artifactRef":"scripts","artifactName":"scripts","artifactRepository":null}}}}]} \ No newline at end of file
diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/topologyTemplate.txt b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/topologyTemplate.txt
new file mode 100644
index 0000000000..f0d0849db8
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/topologyTemplate.txt
@@ -0,0 +1,2 @@
+{"id":"9c063349-2259-40fe-97f1-7c40e659e1b0","name":"Andrey","description":null,"topologyId":"6a4b2f9d-7fe1-482d-af11-97f483dff5b7"}
+
diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/images/mysql.png b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/images/mysql.png
new file mode 100644
index 0000000000..8e02f49b7b
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/images/mysql.png
Binary files differ
diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/mysql.yml b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/mysql.yml
new file mode 100644
index 0000000000..4ee2c8ca88
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/mysql.yml
@@ -0,0 +1,85 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03
+description: MySQL RDBMS installation on a specific mounted volume path.
+template_name: mysql-getServiceArtifactListNoContentTest
+template_version: 1.1.1-SNAPSHOT
+template_author: FastConnect
+
+imports:
+ - "tosca-normative-types-root:1.0.0.wd03-SNAPSHOT"
+ - "tosca-normative-types-compute:1.0.0.wd03-SNAPSHOT"
+ - "tosca-normative-types-database:1.0.0.wd03-SNAPSHOT"
+ - "tosca-normative-types-DBMS:1.0.0.wd03-SNAPSHOT"
+
+node_types:
+ alien.nodes.Mysql-getServiceArtifactListNoContentTest:
+ derived_from: tosca.nodes.Database
+ description: >
+ A node to install MySQL v5.5 database with data
+ on a specific attached volume.
+ capabilities:
+ host:
+ type: alien.capabilities.MysqlDatabase-getServiceArtifactListNoContentTest
+ properties:
+ valid_node_types: [ tosca.nodes.WebApplication ]
+ requirements:
+ - host: tosca.nodes.Compute
+ type: tosca.relationships.HostedOn
+ tags:
+ icon: /images/mysql.png
+ properties:
+ db_port:
+ type: integer
+ default: 3306
+ description: The port on which the underlying database service will listen to data.
+ db_name:
+ type: string
+ required: true
+ default: wordpress
+ description: The logical name of the database.
+ db_user:
+ type: string
+ default: pass
+ description: The special user account used for database administration.
+ db_password:
+ type: string
+ default: pass
+ description: The password associated with the user account provided in the ‘db_user’ property.
+ bind_address:
+ type: boolean
+ default: true
+ required: false
+ description: If true,the server accepts TCP/IP connections on all server host IPv4 interfaces.
+ storage_path:
+ type: string
+ default: /mountedStorage
+ constraints:
+ - valid_values: [ "/mountedStorage", "/var/mysql" ]
+ interfaces:
+ Standard:
+ create: scripts/install_mysql.sh
+ start:
+ inputs:
+ VOLUME_HOME: { get_property: [SELF, storage_path] }
+ PORT: { get_property: [SELF, db_port] }
+ DB_NAME: { get_property: [SELF, db_name] }
+ DB_USER: { get_property: [SELF, db_user] }
+ DB_PASSWORD: { get_property: [SELF, db_password] }
+ BIND_ADRESS: { get_property: [SELF, bind_address] }
+ implementation: scripts/start_mysql.sh
+ fastconnect.cloudify.extensions:
+ start_detection:
+ inputs:
+ PORT: { get_property: [SELF, db_port] }
+ implementation: scripts/mysql_start_detection.groovy
+ artifacts:
+ - scripts: scripts
+ type: tosca.artifacts.File
+
+capability_types:
+ alien.capabilities.MysqlDatabase-getServiceArtifactListNoContentTest:
+ derived_from: tosca.capabilities.Container
+
+artifact_types:
+ tosca.artifacts.GroovyScript-getServiceArtifactListNoContentTest:
+ description: A groovy script (.groovy file)
+ file_ext: [groovy]
diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/images/mysql.png b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/images/mysql.png
new file mode 100644
index 0000000000..8e02f49b7b
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/images/mysql.png
Binary files differ
diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/mysql.yml b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/mysql.yml
new file mode 100644
index 0000000000..b564dd0c4e
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/mysql.yml
@@ -0,0 +1,85 @@
+tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03
+description: MySQL RDBMS installation on a specific mounted volume path.
+template_name: mysql-getServiceArtifactListNoContentTest2
+template_version: 1.1.1-SNAPSHOT
+template_author: FastConnect
+
+imports:
+ - "tosca-normative-types-root:1.0.0.wd03-SNAPSHOT"
+ - "tosca-normative-types-compute:1.0.0.wd03-SNAPSHOT"
+ - "tosca-normative-types-database:1.0.0.wd03-SNAPSHOT"
+ - "tosca-normative-types-DBMS:1.0.0.wd03-SNAPSHOT"
+
+node_types:
+ alien.nodes.Mysql-getServiceArtifactListNoContentTest2:
+ derived_from: tosca.nodes.Database
+ description: >
+ A node to install MySQL v5.5 database with data
+ on a specific attached volume.
+ capabilities:
+ host:
+ type: alien.capabilities.MysqlDatabase-getServiceArtifactListNoContentTest2
+ properties:
+ valid_node_types: [ tosca.nodes.WebApplication ]
+ requirements:
+ - host: tosca.nodes.Compute
+ type: tosca.relationships.HostedOn
+ tags:
+ icon: /images/mysql.png
+ properties:
+ db_port:
+ type: integer
+ default: 3306
+ description: The port on which the underlying database service will listen to data.
+ db_name:
+ type: string
+ required: true
+ default: wordpress
+ description: The logical name of the database.
+ db_user:
+ type: string
+ default: pass
+ description: The special user account used for database administration.
+ db_password:
+ type: string
+ default: pass
+ description: The password associated with the user account provided in the ‘db_user’ property.
+ bind_address:
+ type: boolean
+ default: true
+ required: false
+ description: If true,the server accepts TCP/IP connections on all server host IPv4 interfaces.
+ storage_path:
+ type: string
+ default: /mountedStorage
+ constraints:
+ - valid_values: [ "/mountedStorage", "/var/mysql" ]
+ interfaces:
+ Standard:
+ create: scripts/install_mysql.sh
+ start:
+ inputs:
+ VOLUME_HOME: { get_property: [SELF, storage_path] }
+ PORT: { get_property: [SELF, db_port] }
+ DB_NAME: { get_property: [SELF, db_name] }
+ DB_USER: { get_property: [SELF, db_user] }
+ DB_PASSWORD: { get_property: [SELF, db_password] }
+ BIND_ADRESS: { get_property: [SELF, bind_address] }
+ implementation: scripts/start_mysql.sh
+ fastconnect.cloudify.extensions:
+ start_detection:
+ inputs:
+ PORT: { get_property: [SELF, db_port] }
+ implementation: scripts/mysql_start_detection.groovy
+ artifacts:
+ - scripts: scripts
+ type: tosca.artifacts.File
+
+capability_types:
+ alien.capabilities.MysqlDatabase-getServiceArtifactListNoContentTest2:
+ derived_from: tosca.capabilities.Container
+
+artifact_types:
+ tosca.artifacts.GroovyScript-getServiceArtifactListNoContentTest2:
+ description: A groovy script (.groovy file)
+ file_ext: [groovy]
diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/topology.txt b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/topology.txt
new file mode 100644
index 0000000000..279351879a
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/topology.txt
@@ -0,0 +1 @@
+{"id":"3293c9c8-a162-43fc-b8d1-431399f89cb7","delegateId":"25845cce-05c8-4502-b5fe-abfd6bd6f28e","delegateType":"topologytemplate","dependencies":[{"name":"tosca-normative-types-DBMS","version":"1.0.0.wd03-SNAPSHOT"},{"name":"tosca-normative-types-softwareComponent","version":"1.0.0.wd03-SNAPSHOT"},{"name":"tosca-normative-types-compute","version":"1.0.0.wd03-SNAPSHOT"},{"name":"mysql-getServiceArtifactListNoContentTest2","version":"1.1.1-SNAPSHOT"},{"name":"tosca-normative-types-root","version":"1.0.0.wd03-SNAPSHOT"},{"name":"tosca-normative-types-database","version":"1.0.0.wd03-SNAPSHOT"}],"nodeTemplates":[{"key":"Mysql-getServiceArtifactListNoContentTest2","value":{"type":"alien.nodes.Mysql-getServiceArtifactListNoContentTest2","name":null,"properties":{"bind_address":"true","storage_path":"/mountedStorage","db_port":"3306","db_name":"wordpress","db_user":"pass","db_password":"pass"},"attributes":{"tosca_id":null,"tosca_name":null},"relationships":null,"requirements":{"dependency":{"type":"tosca.capabilities.Root","properties":null},"host":{"type":"tosca.nodes.Compute","properties":null}},"capabilities":{"database_endpoint":{"type":"tosca.capabilities.DatabaseEndpoint","properties":{"port":null,"protocol":{"value":"tcp","definition":false},"url_path":null,"secure":{"value":"false","definition":false}}},"host":{"type":"alien.capabilities.MysqlDatabase-getServiceArtifactListNoContentTest2","properties":{"valid_node_types":null}},"root":{"type":"tosca.capabilities.Root","properties":null}},"artifacts":{"scripts":{"artifactType":"tosca.artifacts.File","artifactRef":"scripts","artifactName":"scripts","artifactRepository":null}}}},{"key":"Compute","value":{"type":"tosca.nodes.Compute","name":null,"properties":{"disk_size":null,"num_cpus":null,"os_distribution":null,"os_arch":null,"mem_size":null,"os_type":null,"os_version":null},"attributes":{"ip_address":null,"tosca_id":null,"tosca_name":null},"relationships":{"dependsOnMysql-getServiceArtifactListNoContentTest2":{"type":"tosca.relationships.DependsOn","target":"Mysql-getServiceArtifactListNoContentTest2","requirementName":"dependency","requirementType":"tosca.capabilities.Root","targetedCapabilityName":"root"}},"requirements":{"dependency":{"type":"tosca.capabilities.Root","properties":null},"network":{"type":"tosca.capabilities.Connectivity","properties":null}},"capabilities":{"host":{"type":"tosca.capabilities.Container","properties":{"valid_node_types":null}},"root":{"type":"tosca.capabilities.Root","properties":null},"attach":{"type":"tosca.capabilities.Attachment","properties":null},"scalable":{"type":"tosca.capabilities.Scalable","properties":{"max_intances":{"value":"1","definition":false},"default_instances":{"value":"1","definition":false},"min_intances":{"value":"1","definition":false}}}},"artifacts":null}}]} \ No newline at end of file
diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/topologyTemplate.txt b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/topologyTemplate.txt
new file mode 100644
index 0000000000..3c342f6cd1
--- /dev/null
+++ b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/topologyTemplate.txt
@@ -0,0 +1,2 @@
+{"id":"25845cce-05c8-4502-b5fe-abfd6bd6f28e","name":"ServiceArtListNoContent","description":null,"topologyId":"3293c9c8-a162-43fc-b8d1-431399f89cb7"}
+