diff options
180 files changed, 710 insertions, 6334 deletions
diff --git a/.gitignore b/.gitignore index d5ce522828..c631ed2376 100644 --- a/.gitignore +++ b/.gitignore @@ -167,4 +167,5 @@ sdc-os-chef/sdc-sanity/chef-repo/cookbooks/sdc-sanity/files/default/testSuites/* /common/openecomp-common-configuration-management/openecomp-configuration-management-cli/dependency-reduced-pom.xml -/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/files/default/tools/*
\ No newline at end of file +/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/files/default/tools/* +/sdc-os-chef/sdc-cassandra/chef-repo/cookbooks/cassandra-actions/attributes/default.rb diff --git a/asdc-tests/pom.xml b/asdc-tests/pom.xml index e9972bd647..bfb7920d51 100644 --- a/asdc-tests/pom.xml +++ b/asdc-tests/pom.xml @@ -10,6 +10,10 @@ <artifactId>sdc-main</artifactId> <version>1.2.0-SNAPSHOT</version> </parent> + + <properties> + <sonar.skip>true</sonar.skip> + </properties> <dependencies> diff --git a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactFileContentTest/images/mysql.png b/asdc-tests/src/test/resources/CI/tests/getResourceArtifactFileContentTest/images/mysql.png Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactFileContentTest/images/mysql.png +++ /dev/null diff --git a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactFileContentTest/mysql.yml b/asdc-tests/src/test/resources/CI/tests/getResourceArtifactFileContentTest/mysql.yml deleted file mode 100644 index f512f8071e..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactFileContentTest/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03 -description: MySQL RDBMS installation on a specific mounted volume path. -template_name: mysql-getResourceArtifactFileContentTest -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-getResourceArtifactFileContentTest: - 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 - 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: - derived_from: tosca.capabilities.Container - -artifact_types: - tosca.artifacts.GroovyScript: - description: A groovy script (.groovy file) - file_ext: [groovy] diff --git a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactFileContentTest/scripts/install_mysql.sh b/asdc-tests/src/test/resources/CI/tests/getResourceArtifactFileContentTest/scripts/install_mysql.sh deleted file mode 100644 index 400bcf40cb..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactFileContentTest/scripts/install_mysql.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/getResourceArtifactFileContentTest/scripts/start_mysql.sh b/asdc-tests/src/test/resources/CI/tests/getResourceArtifactFileContentTest/scripts/start_mysql.sh deleted file mode 100644 index 648bd45756..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactFileContentTest/scripts/start_mysql.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/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/getResourceArtifactListNoContentTest/mysql.yml b/asdc-tests/src/test/resources/CI/tests/getResourceArtifactListNoContentTest/mysql.yml deleted file mode 100644 index 180e247ea2..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactListNoContentTest/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03 -description: MySQL RDBMS installation on a specific mounted volume path. -template_name: mysql-getResourceArtifactListNoContentTest -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-getResourceArtifactListNoContentTest: - 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 - 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: - derived_from: tosca.capabilities.Container - -artifact_types: - tosca.artifacts.GroovyScript: - description: A groovy script (.groovy file) - file_ext: [groovy] diff --git a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactListTest/images/mysql.png b/asdc-tests/src/test/resources/CI/tests/getResourceArtifactListTest/images/mysql.png Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactListTest/images/mysql.png +++ /dev/null diff --git a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactListTest/mysql.yml b/asdc-tests/src/test/resources/CI/tests/getResourceArtifactListTest/mysql.yml deleted file mode 100644 index b8f9bbdc69..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactListTest/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03 -description: MySQL RDBMS installation on a specific mounted volume path. -template_name: mysql-GetResourceArtifactListTest -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-GetResourceArtifactListTest: - 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 - 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: - derived_from: tosca.capabilities.Container - -artifact_types: - tosca.artifacts.GroovyScript: - description: A groovy script (.groovy file) - file_ext: [groovy] diff --git a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactListTest/scripts/install_mysql.sh b/asdc-tests/src/test/resources/CI/tests/getResourceArtifactListTest/scripts/install_mysql.sh deleted file mode 100644 index 400bcf40cb..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactListTest/scripts/install_mysql.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/getResourceArtifactListTest/scripts/start_mysql.sh b/asdc-tests/src/test/resources/CI/tests/getResourceArtifactListTest/scripts/start_mysql.sh deleted file mode 100644 index 648bd45756..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactListTest/scripts/start_mysql.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/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/getResourceArtifactMetadataNoContentTest/mysql.yml b/asdc-tests/src/test/resources/CI/tests/getResourceArtifactMetadataNoContentTest/mysql.yml deleted file mode 100644 index 72ff4f37e0..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactMetadataNoContentTest/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03 -description: MySQL RDBMS installation on a specific mounted volume path. -template_name: mysql-getResourceArtifactMetadataNoContentTest -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-getResourceArtifactMetadataNoContentTest: - 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 - 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: - derived_from: tosca.capabilities.Container - -artifact_types: - tosca.artifacts.GroovyScript: - description: A groovy script (.groovy file) - file_ext: [groovy] diff --git a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactMetadataTest/images/mysql.png b/asdc-tests/src/test/resources/CI/tests/getResourceArtifactMetadataTest/images/mysql.png Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactMetadataTest/images/mysql.png +++ /dev/null diff --git a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactMetadataTest/mysql.yml b/asdc-tests/src/test/resources/CI/tests/getResourceArtifactMetadataTest/mysql.yml deleted file mode 100644 index 527e4a0081..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactMetadataTest/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03 -description: MySQL RDBMS installation on a specific mounted volume path. -template_name: mysql-getResourceArtifactMetadataTest -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-getResourceArtifactMetadataTest: - 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 - 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: - derived_from: tosca.capabilities.Container - -artifact_types: - tosca.artifacts.GroovyScript: - description: A groovy script (.groovy file) - file_ext: [groovy] diff --git a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactMetadataTest/scripts/install_mysql.sh b/asdc-tests/src/test/resources/CI/tests/getResourceArtifactMetadataTest/scripts/install_mysql.sh deleted file mode 100644 index 400bcf40cb..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactMetadataTest/scripts/install_mysql.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/getResourceArtifactMetadataTest/scripts/start_mysql.sh b/asdc-tests/src/test/resources/CI/tests/getResourceArtifactMetadataTest/scripts/start_mysql.sh deleted file mode 100644 index 648bd45756..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactMetadataTest/scripts/start_mysql.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/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/getResourceArtifactPayloadNoContentTest/mysql.yml b/asdc-tests/src/test/resources/CI/tests/getResourceArtifactPayloadNoContentTest/mysql.yml deleted file mode 100644 index 7177a65387..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactPayloadNoContentTest/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03 -description: MySQL RDBMS installation on a specific mounted volume path. -template_name: mysql-getResourceArtifactPayloadNoContentTest -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-getResourceArtifactPayloadNoContentTest: - 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 - 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: - derived_from: tosca.capabilities.Container - -artifact_types: - tosca.artifacts.GroovyScript: - description: A groovy script (.groovy file) - file_ext: [groovy] diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/images/mysql.png b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/images/mysql.png Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/images/mysql.png +++ /dev/null diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/mysql.yml b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/mysql.yml deleted file mode 100644 index e0a0c6458e..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -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/getServiceArtifactListInvalidVersionNotFoundTest/resource1/scripts/install_mysql.sh b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/scripts/install_mysql.sh deleted file mode 100644 index 400bcf40cb..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/scripts/install_mysql.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/getServiceArtifactListInvalidVersionNotFoundTest/resource1/scripts/start_mysql.sh b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/scripts/start_mysql.sh deleted file mode 100644 index 648bd45756..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/scripts/start_mysql.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/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/getServiceArtifactListInvalidVersionNotFoundTest/resource2/images/mysql.png b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/images/mysql.png Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/images/mysql.png +++ /dev/null diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/mysql.yml b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/mysql.yml deleted file mode 100644 index dc5ff158c8..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -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/getServiceArtifactListInvalidVersionNotFoundTest/resource2/scripts/install_mysql2.sh b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/scripts/install_mysql2.sh deleted file mode 100644 index 400bcf40cb..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/scripts/install_mysql2.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/getServiceArtifactListInvalidVersionNotFoundTest/resource2/scripts/start_mysql2.sh b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/scripts/start_mysql2.sh deleted file mode 100644 index 648bd45756..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/scripts/start_mysql2.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/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/getServiceArtifactListInvalidVersionNotFoundTest/topology.txt b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/topology.txt deleted file mode 100644 index cb3c3e8546..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/topology.txt +++ /dev/null @@ -1 +0,0 @@ -{"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/getServiceArtifactListInvalidVersionNotFoundTest/topologyTemplate.txt b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/topologyTemplate.txt deleted file mode 100644 index f0d0849db8..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/topologyTemplate.txt +++ /dev/null @@ -1,2 +0,0 @@ -{"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/getServiceArtifactListNoContentTest/resource1/images/mysql.png b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource1/images/mysql.png Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource1/images/mysql.png +++ /dev/null diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource1/mysql.yml b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource1/mysql.yml deleted file mode 100644 index 4ee2c8ca88..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource1/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -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/getServiceArtifactListNoContentTest/resource2/images/mysql.png b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource2/images/mysql.png Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource2/images/mysql.png +++ /dev/null diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource2/mysql.yml b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource2/mysql.yml deleted file mode 100644 index b564dd0c4e..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource2/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -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/getServiceArtifactListNoContentTest/topology.txt b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/topology.txt deleted file mode 100644 index 279351879a..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/topology.txt +++ /dev/null @@ -1 +0,0 @@ -{"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/getServiceArtifactListNoContentTest/topologyTemplate.txt b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/topologyTemplate.txt deleted file mode 100644 index 3c342f6cd1..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/topologyTemplate.txt +++ /dev/null @@ -1,2 +0,0 @@ -{"id":"25845cce-05c8-4502-b5fe-abfd6bd6f28e","name":"ServiceArtListNoContent","description":null,"topologyId":"3293c9c8-a162-43fc-b8d1-431399f89cb7"} - diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/images/mysql.png b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/images/mysql.png Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/images/mysql.png +++ /dev/null diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/mysql.yml b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/mysql.yml deleted file mode 100644 index e0a0c6458e..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -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/getServiceArtifactListTest/resource1/scripts/install_mysql.sh b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/scripts/install_mysql.sh deleted file mode 100644 index 400bcf40cb..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/scripts/install_mysql.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/getServiceArtifactListTest/resource1/scripts/start_mysql.sh b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/scripts/start_mysql.sh deleted file mode 100644 index 648bd45756..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/scripts/start_mysql.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/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/getServiceArtifactListTest/resource2/images/mysql.png b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/images/mysql.png Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/images/mysql.png +++ /dev/null diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/mysql.yml b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/mysql.yml deleted file mode 100644 index dc5ff158c8..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -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/getServiceArtifactListTest/resource2/scripts/install_mysql2.sh b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/scripts/install_mysql2.sh deleted file mode 100644 index 400bcf40cb..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/scripts/install_mysql2.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/getServiceArtifactListTest/resource2/scripts/start_mysql2.sh b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/scripts/start_mysql2.sh deleted file mode 100644 index 648bd45756..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/scripts/start_mysql2.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/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/getServiceArtifactListTest/topology.txt b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/topology.txt deleted file mode 100644 index cb3c3e8546..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/topology.txt +++ /dev/null @@ -1 +0,0 @@ -{"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/getServiceArtifactListTest/topologyTemplate.txt b/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/topologyTemplate.txt deleted file mode 100644 index f0d0849db8..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/topologyTemplate.txt +++ /dev/null @@ -1,2 +0,0 @@ -{"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/Service1/resource1/images/mysql.png b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/images/mysql.png Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/images/mysql.png +++ /dev/null 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 deleted file mode 100644 index e0a0c6458e..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -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 deleted file mode 100644 index 400bcf40cb..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/install_mysql.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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 deleted file mode 100644 index 648bd45756..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/start_mysql.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/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 Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/images/mysql.png +++ /dev/null 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 deleted file mode 100644 index dc5ff158c8..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -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 deleted file mode 100644 index 400bcf40cb..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/install_mysql2.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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 deleted file mode 100644 index 648bd45756..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/start_mysql2.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/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 deleted file mode 100644 index cb3c3e8546..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/topology.txt +++ /dev/null @@ -1 +0,0 @@ -{"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 deleted file mode 100644 index f0d0849db8..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/topologyTemplate.txt +++ /dev/null @@ -1,2 +0,0 @@ -{"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 Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/images/mysql.png +++ /dev/null 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 deleted file mode 100644 index 4ee2c8ca88..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -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 Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/images/mysql.png +++ /dev/null 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 deleted file mode 100644 index b564dd0c4e..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -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 deleted file mode 100644 index 279351879a..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/topology.txt +++ /dev/null @@ -1 +0,0 @@ -{"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 deleted file mode 100644 index 3c342f6cd1..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/topologyTemplate.txt +++ /dev/null @@ -1,2 +0,0 @@ -{"id":"25845cce-05c8-4502-b5fe-abfd6bd6f28e","name":"ServiceArtListNoContent","description":null,"topologyId":"3293c9c8-a162-43fc-b8d1-431399f89cb7"} - diff --git a/asdc-tests/src/test/resources/CI/tests/uploadComponent/images/mysql.png b/asdc-tests/src/test/resources/CI/tests/uploadComponent/images/mysql.png Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/uploadComponent/images/mysql.png +++ /dev/null diff --git a/asdc-tests/src/test/resources/CI/tests/uploadComponent/mysql.yml b/asdc-tests/src/test/resources/CI/tests/uploadComponent/mysql.yml deleted file mode 100644 index a2eb4d423a..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/uploadComponent/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03 -description: MySQL RDBMS installation on a specific mounted volume path. -template_name: mysql-uploadComponent -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-uploadComponent: - 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 - 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: - derived_from: tosca.capabilities.Container - -artifact_types: - tosca.artifacts.GroovyScript: - description: A groovy script (.groovy file) - file_ext: [groovy] diff --git a/asdc-tests/src/test/resources/CI/tests/uploadComponent/scripts/install_mysql.sh b/asdc-tests/src/test/resources/CI/tests/uploadComponent/scripts/install_mysql.sh deleted file mode 100644 index 400bcf40cb..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/uploadComponent/scripts/install_mysql.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/uploadComponent/scripts/start_mysql.sh b/asdc-tests/src/test/resources/CI/tests/uploadComponent/scripts/start_mysql.sh deleted file mode 100644 index 648bd45756..0000000000 --- a/asdc-tests/src/test/resources/CI/tests/uploadComponent/scripts/start_mysql.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/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/catalog-be/pom.xml b/catalog-be/pom.xml index f4a2c30d99..5b13e028d8 100644 --- a/catalog-be/pom.xml +++ b/catalog-be/pom.xml @@ -611,41 +611,6 @@ </plugin> <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <executions> - <execution> - <id>copy-dependencies</id> - <phase>package</phase> - <goals> - <goal>copy-dependencies</goal> - </goals> - <configuration> - <includeScope>compile</includeScope> - </configuration> - </execution> - <execution> - <id>copy-installed</id> - <phase>install</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - <type>${project.packaging}</type> - </artifactItem> - </artifactItems> - <outputDirectory>${project.parent.basedir}/sdc-os-chef/sdc-backend/</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> - - <plugin> <groupId>com.jcabi</groupId> <artifactId>jcabi-maven-plugin</artifactId> <version>${jcabi.plugin.version}</version> @@ -662,25 +627,6 @@ <artifactId>maven-resources-plugin</artifactId> <version>2.6</version> <executions> - <execution> - <id>copy-normatives</id> - <phase>install</phase> - <goals> - <goal>copy-resources</goal> - </goals> - <configuration> - <outputDirectory>${project.parent.basedir}/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-normatives/files/default</outputDirectory> - <resources> - <resource> - <directory>./target</directory> - <includes> - <include>normatives.tar.gz</include> - </includes> - </resource> - </resources> - </configuration> - </execution> - <execution> <id>copy-tosca-folder</id> <!-- here the phase you need --> diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java index ba26576648..0ae546479a 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ResourceBusinessLogic.java @@ -1869,27 +1869,25 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { log.debug("************* Going to create all nodes {}", yamlName); Either<Map<String, Resource>, ResponseFormat> createdResourcesFromdNodeTypeMap = this.handleNodeTypes(yamlName, resource, topologyTemplateYaml, false, nodeTypesArtifactsToCreate, nodeTypesNewCreatedArtifacts, nodeTypesInfo, csarInfo, nodeName); - log.debug("************* Finished to create all nodes {}", yamlName); if (createdResourcesFromdNodeTypeMap.isRight()) { log.debug("failed to resources from node types status is {}", createdResourcesFromdNodeTypeMap.right().value()); return Either.right(createdResourcesFromdNodeTypeMap.right().value()); } + log.debug("************* Finished to create all nodes {}", yamlName); log.debug("************* Going to create all resource instances {}", yamlName); createResourcesInstancesEither = createResourceInstances(csarInfo.getModifier(), yamlName, resource, uploadComponentInstanceInfoMap, true, false, csarInfo.getCreatedNodes()); - log.debug("************* Finished to create all resource instances {}", yamlName); if (createResourcesInstancesEither.isRight()) { log.debug("failed to create resource instances status is {}", createResourcesInstancesEither.right().value()); result = createResourcesInstancesEither; return createResourcesInstancesEither; } + log.debug("************* Finished to create all resource instances for {}", yamlName); resource = createResourcesInstancesEither.left().value(); log.debug("************* Going to create all relations {}", yamlName); createResourcesInstancesEither = createResourceInstancesRelations(csarInfo.getModifier(), yamlName, resource, uploadComponentInstanceInfoMap); - log.debug("************* Finished to create all relations {}", yamlName); - if (createResourcesInstancesEither.isRight()) { log.debug("failed to create relation between resource instances status is {}", createResourcesInstancesEither.right().value()); result = createResourcesInstancesEither; @@ -1897,6 +1895,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { } else { resource = createResourcesInstancesEither.left().value(); } + log.debug("************* Finished to create all relations {}", yamlName); log.debug("************* Going to create positions {}", yamlName); Either<List<ComponentInstance>, ResponseFormat> eitherSetPosition = compositionBusinessLogic.setPositionsForComponentInstances(resource, csarInfo.getModifier().getUserId()); @@ -4265,7 +4264,6 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { return Either.left(validRegDef); } - @SuppressWarnings("unchecked") public Either<ParsedToscaYamlInfo, ResponseFormat> parseResourceInfoFromYaml(String yamlFileName, Resource resource, String resourceYml, Map<String, String> createdNodesToscaResourceNames, Map<String, NodeTypeInfo> nodeTypesInfo, String nodeName) { Map<String, Object> mappedToscaTemplate; @@ -4319,7 +4317,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { Map<String, Resource> nodeNamespaceMap) { Either<Resource, ResponseFormat> eitherResource = null; - log.debug("createResourceInstances is {} - going to create resource instanse from CSAR", yamlName); + log.debug("{} - going to create resource instanse from CSAR", yamlName); if (uploadResInstancesMap == null || uploadResInstancesMap.isEmpty()) { ResponseFormat responseFormat = componentsUtils.getResponseFormat(ActionStatus.NOT_TOPOLOGY_TOSCA_TEMPLATE); @@ -4334,13 +4332,13 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { Iterator<Entry<String, UploadComponentInstanceInfo>> nodesInfoValue = uploadResInstancesMap.entrySet().iterator(); Map<ComponentInstance, Resource> resourcesInstancesMap = new HashMap<>(); while (nodesInfoValue.hasNext()) { - log.debug("*************Going to create resource instances {}", yamlName); + log.debug("*************Going to create resource instances from {}", yamlName); Entry<String, UploadComponentInstanceInfo> uploadComponentInstanceInfoEntry = nodesInfoValue.next(); UploadComponentInstanceInfo uploadComponentInstanceInfo = uploadComponentInstanceInfoEntry.getValue(); // updating type if the type is node type name - we need to take the // updated name - log.debug("*************Going to create resource instances {}", uploadComponentInstanceInfo.getName()); + log.debug("*************Going to create resource instance {}", uploadComponentInstanceInfo.getName()); if (nodeNamespaceMap.containsKey(uploadComponentInstanceInfo.getType())) { uploadComponentInstanceInfo.setType(nodeNamespaceMap.get(uploadComponentInstanceInfo.getType()).getToscaResourceName()); } @@ -4357,17 +4355,19 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { ComponentTypeEnum containerComponentType = resource.getComponentType(); NodeTypeEnum containerNodeType = containerComponentType.getNodeType(); - - if (containerNodeType.equals(NodeTypeEnum.Resource) && uploadComponentInstanceInfo.getCapabilities() != null) { - Either<Map<String, List<CapabilityDefinition>>, ResponseFormat> getValidComponentInstanceCapabilitiesRes = getValidComponentInstanceCapabilities(refResource.getCapabilities(), uploadComponentInstanceInfo.getCapabilities()); + //************ + if (containerNodeType.equals(NodeTypeEnum.Resource) && MapUtils.isNotEmpty(uploadComponentInstanceInfo.getCapabilities()) && MapUtils.isNotEmpty(refResource.getCapabilities())) { + setCapabilityNamesTypes(refResource.getCapabilities(), uploadComponentInstanceInfo.getCapabilities()); + Either<Map<String, List<CapabilityDefinition>>, ResponseFormat> getValidComponentInstanceCapabilitiesRes = getValidComponentInstanceCapabilities(refResource.getUniqueId(), refResource.getCapabilities(), uploadComponentInstanceInfo.getCapabilities()); if (getValidComponentInstanceCapabilitiesRes.isRight()) { return Either.right(getValidComponentInstanceCapabilitiesRes.right().value()); } else { componentInstance.setCapabilities(getValidComponentInstanceCapabilitiesRes.left().value()); } } + //*********************** if (!existingnodeTypeMap.containsKey(uploadComponentInstanceInfo.getType())) { - log.debug("createResourceInstances - not found lates version for resource instance with name {} and type ", uploadComponentInstanceInfo.getName(), uploadComponentInstanceInfo.getType()); + log.debug("createResourceInstances - not found latest version for resource instance with name {} and type ", uploadComponentInstanceInfo.getName(), uploadComponentInstanceInfo.getType()); ResponseFormat responseFormat = componentsUtils.getResponseFormat(ActionStatus.INVALID_NODE_TEMPLATE, yamlName, uploadComponentInstanceInfo.getName(), uploadComponentInstanceInfo.getType()); return Either.right(responseFormat); } @@ -4417,16 +4417,30 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { return Either.left(eitherGerResource.left().value()); } + + private void setCapabilityNamesTypes(Map<String, List<CapabilityDefinition>> originCapabilities, Map<String, List<UploadCapInfo>> uploadedCapabilities) { + for(Entry<String, List<UploadCapInfo>> currEntry : uploadedCapabilities.entrySet()){ + if(originCapabilities.containsKey(currEntry.getKey())){ + currEntry.getValue().stream().forEach(cap -> cap.setType(currEntry.getKey())); + } + } + + for(Map.Entry<String, List<CapabilityDefinition>> capabilities : originCapabilities.entrySet()){ + capabilities.getValue().stream().forEach(cap -> {if(uploadedCapabilities.containsKey(cap.getName())){uploadedCapabilities.get(cap.getName()).stream().forEach(c -> {c.setName(cap.getName());c.setType(cap.getType());});};}); + } + } + + private Either<Resource, ResponseFormat> validateResourceInstanceBeforeCreate(String yamlName, UploadComponentInstanceInfo uploadComponentInstanceInfo, Map<String, Resource> nodeNamespaceMap) { - log.debug("validateResourceInstanceBeforeCreate - going to validate resource instance with name {} and type before create", uploadComponentInstanceInfo.getName(), uploadComponentInstanceInfo.getType()); + log.debug("going to validate resource instance with name {} and type {} before create", uploadComponentInstanceInfo.getName(), uploadComponentInstanceInfo.getType()); Resource refResource = null; if (nodeNamespaceMap.containsKey(uploadComponentInstanceInfo.getType())) { refResource = nodeNamespaceMap.get(uploadComponentInstanceInfo.getType()); } else { Either<Resource, StorageOperationStatus> findResourceEither = toscaOperationFacade.getLatestCertifiedNodeTypeByToscaResourceName(uploadComponentInstanceInfo.getType()); if (findResourceEither.isRight()) { - log.debug("validateResourceInstanceBeforeCreate - not found lates version for resource instance with name {} and type ", uploadComponentInstanceInfo.getName(), uploadComponentInstanceInfo.getType()); + log.debug("not found lates version for resource instance with name {} and type {}", uploadComponentInstanceInfo.getName(), uploadComponentInstanceInfo.getType()); ResponseFormat responseFormat = componentsUtils.getResponseFormat(componentsUtils.convertFromStorageResponse(findResourceEither.right().value())); return Either.right(responseFormat); } @@ -4435,16 +4449,17 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { } String componentState = refResource.getComponentMetadataDefinition().getMetadataDataDefinition().getState(); if (componentState.equals(LifecycleStateEnum.NOT_CERTIFIED_CHECKOUT.name())) { - log.debug("validateResourceInstanceBeforeCreate - component instance of component {} can not be created because the component is in an illegal state {}.", refResource.getName(), componentState); + log.debug("component instance of component {} can not be created because the component is in an illegal state {}.", refResource.getName(), componentState); ResponseFormat responseFormat = componentsUtils.getResponseFormat(ActionStatus.ILLEGAL_COMPONENT_STATE, refResource.getComponentType().getValue(), refResource.getName(), componentState); return Either.right(responseFormat); } if (!ToscaUtils.isAtomicType(refResource) && refResource.getResourceType() != ResourceTypeEnum.CVFC) { - log.debug("validateResourceInstanceBeforeCreate - ref resource type is ", refResource.getResourceType()); + log.debug("ref resource type is {}", refResource.getResourceType()); ResponseFormat responseFormat = componentsUtils.getResponseFormat(ActionStatus.INVALID_NODE_TEMPLATE, yamlName, uploadComponentInstanceInfo.getName(), uploadComponentInstanceInfo.getType()); return Either.right(responseFormat); } + log.debug("validate resource instance with name {} and type {} before create, successful",uploadComponentInstanceInfo.getName(), uploadComponentInstanceInfo.getType()); return Either.left(refResource); } @@ -7021,7 +7036,7 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { return null; } - private Either<Map<String, List<CapabilityDefinition>>, ResponseFormat> getValidComponentInstanceCapabilities(Map<String, List<CapabilityDefinition>> defaultCapabilities, Map<String, List<UploadCapInfo>> uploadedCapabilities) { + private Either<Map<String, List<CapabilityDefinition>>, ResponseFormat> getValidComponentInstanceCapabilities(String resourceId, Map<String, List<CapabilityDefinition>> defaultCapabilities, Map<String, List<UploadCapInfo>> uploadedCapabilities) { ResponseFormat responseFormat; Map<String, List<CapabilityDefinition>> validCapabilitiesMap = new HashMap<>(); @@ -7031,14 +7046,33 @@ public class ResourceBusinessLogic extends ComponentBusinessLogic { responseFormat = componentsUtils.getResponseFormat(ActionStatus.MISSING_CAPABILITY_TYPE, capabilityType); return Either.right(responseFormat); } else { - CapabilityDefinition delaultCapability = defaultCapabilities.get(capabilityType).get(0); - Either<Boolean, String> validationRes = validateUniquenessUpdateUploadedComponentInstanceCapability(delaultCapability, uploadedCapabilitiesEntry.getValue().get(0)); - if (validationRes.isRight()) { - responseFormat = componentsUtils.getResponseFormat(ActionStatus.PROPERTY_NAME_ALREADY_EXISTS, validationRes.right().value()); + CapabilityDefinition defaultCapability; + if(CollectionUtils.isNotEmpty(defaultCapabilities.get(capabilityType).get(0).getProperties())){ + defaultCapability = defaultCapabilities.get(capabilityType).get(0); + } else { + Either<Component, StorageOperationStatus> getFullComponentRes = toscaOperationFacade.getToscaFullElement(resourceId); + if(getFullComponentRes.isRight()){ + log.debug("Failed to get full component {}. Status is {}. ", resourceId, getFullComponentRes.right().value()); + responseFormat = componentsUtils.getResponseFormat(ActionStatus.COMPONENT_NOT_FOUND, resourceId); + return Either.right(responseFormat); + } + defaultCapability = getFullComponentRes.left().value().getCapabilities().get(capabilityType).get(0); + } + if(CollectionUtils.isEmpty(defaultCapability.getProperties()) && CollectionUtils.isNotEmpty(uploadedCapabilitiesEntry.getValue().get(0).getProperties())){ + log.debug("Failed to validate capability {} of component {}. Property list is empty. ", defaultCapability.getName(), resourceId); + log.debug("Failed to update capability property values. Property list of fetched capability {} is empty. ", defaultCapability.getName()); + responseFormat = componentsUtils.getResponseFormat(ActionStatus.PROPERTY_NOT_FOUND, resourceId); return Either.right(responseFormat); } + if(CollectionUtils.isNotEmpty(defaultCapability.getProperties()) && CollectionUtils.isNotEmpty(uploadedCapabilitiesEntry.getValue().get(0).getProperties())){ + Either<Boolean, String> validationRes = validateUniquenessUpdateUploadedComponentInstanceCapability(defaultCapability, uploadedCapabilitiesEntry.getValue().get(0)); + if (validationRes.isRight()) { + responseFormat = componentsUtils.getResponseFormat(ActionStatus.PROPERTY_NAME_ALREADY_EXISTS, validationRes.right().value()); + return Either.right(responseFormat); + } + } List<CapabilityDefinition> validCapabilityList = new ArrayList<>(); - validCapabilityList.add(delaultCapability); + validCapabilityList.add(defaultCapability); validCapabilitiesMap.put(uploadedCapabilitiesEntry.getKey(), validCapabilityList); } } diff --git a/catalog-be/src/main/resources/config/configuration.yaml b/catalog-be/src/main/resources/config/configuration.yaml index 5242652188..2ae2cccb77 100644 --- a/catalog-be/src/main/resources/config/configuration.yaml +++ b/catalog-be/src/main/resources/config/configuration.yaml @@ -133,6 +133,7 @@ artifactTypes: - SNMP_POLL - SNMP_TRAP - GUIDE + - PLAN licenseTypes: - User @@ -322,6 +323,14 @@ serviceDeploymentArtifacts: - xml OTHER: acceptedTypes: + +#PLAN + PLAN: + acceptedTypes: + - xml + validForResourceTypes: + - VF + - VFC resourceDeploymentArtifacts: HEAT: @@ -439,6 +448,11 @@ resourceDeploymentArtifacts: SNMP_TRAP: acceptedTypes: validForResourceTypes: *allResourceTypes + +#PLAN + PLAN: + acceptedTypes: + - xml resourceInstanceDeploymentArtifacts: HEAT_ENV: @@ -476,6 +490,11 @@ resourceInstanceDeploymentArtifacts: SNMP_TRAP: acceptedTypes: validForResourceTypes: *allResourceTypes + +#PLAN + PLAN: + acceptedTypes: + - xml resourceInformationalArtifacts: CHEF: diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/genericNeutronNet/genericNeutronNet.json b/catalog-be/src/main/resources/import/tosca/heat-types/genericNeutronNet/genericNeutronNet.json new file mode 100644 index 0000000000..d9b008a870 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/heat-types/genericNeutronNet/genericNeutronNet.json @@ -0,0 +1,21 @@ +{ + "payloadName": "genericNeutronNet.yml", + "contactId": "jh0003", + "name": "Generic NeutronNet", + "description": "Generic NeutronNet", + "resourceIconPath": "network", + "resourceType": "VL", + "categories": [ + { + "name": "Generic", + "subcategories": [ + { + "name": "Network Elements" + } + ] + } +], + "tags": [ + "Generic NeutronNet" + ] +}
\ No newline at end of file diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/genericNeutronNet/genericNeutronNet.yml b/catalog-be/src/main/resources/import/tosca/heat-types/genericNeutronNet/genericNeutronNet.yml new file mode 100644 index 0000000000..12dc13e98b --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/heat-types/genericNeutronNet/genericNeutronNet.yml @@ -0,0 +1,36 @@ +tosca_definitions_version: tosca_simple_yaml_1_0 +node_types: + org.openecomp.resource.vl.GenericNeutronNet: + derived_from: org.openecomp.resource.vl.extVL + description: Generic Neutron Network + properties: + network_role: + type: string + description: | + Unique label that defines the role that this network performs. example: vce oam network, vnat sr-iov1 network + network_assignments: + type: org.openecomp.datatypes.network.NetworkAssignments + network_flows: + type: org.openecomp.datatypes.network.NetworkFlows + network_scope: + type: string + network_ecomp_naming: + type: org.openecomp.datatypes.EcompNaming + network_type: + type: string + description: ECOMP supported network types. + default: NEUTRON + provider_network: + type: org.openecomp.datatypes.network.ProviderNetwork + network_technology: + type: string + description: ECOMP supported network technology + default: NEUTRON + network_homing: + type: org.openecomp.datatypes.EcompHoming + capabilities: + virtual_linkable: + type: tosca.capabilities.network.Linkable + occurrences: + - 1 + - UNBOUNDED
\ No newline at end of file diff --git a/catalog-be/src/main/resources/import/tosca/heat-types/genericNeutronNet/genericNeutronNet.zip b/catalog-be/src/main/resources/import/tosca/heat-types/genericNeutronNet/genericNeutronNet.zip Binary files differnew file mode 100644 index 0000000000..ed51f834f3 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/heat-types/genericNeutronNet/genericNeutronNet.zip diff --git a/catalog-be/src/main/resources/import/tosca/onap-types/NSD/NSD.json b/catalog-be/src/main/resources/import/tosca/onap-types/NSD/NSD.json new file mode 100644 index 0000000000..22788ec06c --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/onap-types/NSD/NSD.json @@ -0,0 +1,15 @@ +{ + "payloadName": "NSD.yml", + "contactId": "jh0003", + "name": "NSD", + "description": "NSD", + "resourceIconPath": "network", + "resourceType": "VFC", + "categories": [{ + "name": "Generic", + "subcategories": [{ + "name": "Network Elements" + }] + }], + "tags": ["NSD"] +}
\ No newline at end of file diff --git a/catalog-be/src/main/resources/import/tosca/onap-types/NSD/NSD.yml b/catalog-be/src/main/resources/import/tosca/onap-types/NSD/NSD.yml new file mode 100644 index 0000000000..1b3d8820d5 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/onap-types/NSD/NSD.yml @@ -0,0 +1,41 @@ +tosca_definitions_version: tosca_simple_yaml_1_0_0 +node_types: + org.openecomp.resource.vfc.NSD: + derived_from: tosca.nodes.Root + description: ECOMP Allotted Resource base type all other allotted resources node types derive from + properties: + nsd_id: + type: string + required: true + description: ID of the NSD + nsd_designer: + type: string + required: true + description: Designer of the NSD + nsd_version: + type: string + required: true + description: Version of the NSD + nsd_name: + type: string + required: true + description: Name of the NSD + providing_service_uuid: + type: string + required: true + description: The depending service uuid in order to map the allotted resource to the specific service version + providing_service_invariant_uuid: + type: string + required: true + description: The depending service invariant uuid in order to map the allotted resource to the specific service version + providing_service_name: + type: string + required: true + description: The depending service name in order to map the allotted resource to the specific service version + requirements: + - virtualLink: + capability: tosca.capabilities.network.Linkable + relationship: tosca.relationships.network.LinksTo + capabilities: + virtual_linkable: + type: tosca.capabilities.network.Linkable diff --git a/catalog-be/src/main/resources/import/tosca/onap-types/NSD/NSD.zip b/catalog-be/src/main/resources/import/tosca/onap-types/NSD/NSD.zip Binary files differnew file mode 100644 index 0000000000..d741b50c16 --- /dev/null +++ b/catalog-be/src/main/resources/import/tosca/onap-types/NSD/NSD.zip diff --git a/catalog-be/src/main/resources/import/tosca/onap-types/vduCpd/vduCpd.yml b/catalog-be/src/main/resources/import/tosca/onap-types/vduCpd/vduCpd.yml index e1f6d068ce..e5d79fcacf 100644 --- a/catalog-be/src/main/resources/import/tosca/onap-types/vduCpd/vduCpd.yml +++ b/catalog-be/src/main/resources/import/tosca/onap-types/vduCpd/vduCpd.yml @@ -50,7 +50,7 @@ node_types: - 0 - UNBOUNDED - virtual_link: - capability: tosca.capabilities.nfv.VirtualBindable + capability: tosca.capabilities.nfv.VirtualLinkable occurrences: - 0 - UNBOUNDED
\ No newline at end of file diff --git a/catalog-be/src/main/resources/import/tosca/onap-types/vduCpd/vduCpd.zip b/catalog-be/src/main/resources/import/tosca/onap-types/vduCpd/vduCpd.zip Binary files differindex 6a9d4be124..e1b5be9f2f 100644 --- a/catalog-be/src/main/resources/import/tosca/onap-types/vduCpd/vduCpd.zip +++ b/catalog-be/src/main/resources/import/tosca/onap-types/vduCpd/vduCpd.zip diff --git a/catalog-be/src/main/resources/scripts/import/tosca/importHeatTypes.py b/catalog-be/src/main/resources/scripts/import/tosca/importHeatTypes.py index 78b257d6f3..c72c2c394f 100644 --- a/catalog-be/src/main/resources/scripts/import/tosca/importHeatTypes.py +++ b/catalog-be/src/main/resources/scripts/import/tosca/importHeatTypes.py @@ -53,7 +53,8 @@ def importHeatTypes(beHost, bePort, adminUser, fileDir, updateversion): "multiFlavorVFC", "vnfConfiguration", "underlayVpn", - "overlayTunnel" + "overlayTunnel", + "genericNeutronNet" ] responseCodes = [200, 201] diff --git a/catalog-be/src/main/resources/scripts/import/tosca/importOnapTypes.py b/catalog-be/src/main/resources/scripts/import/tosca/importOnapTypes.py index f91b64ed81..31c11c74bc 100644 --- a/catalog-be/src/main/resources/scripts/import/tosca/importOnapTypes.py +++ b/catalog-be/src/main/resources/scripts/import/tosca/importOnapTypes.py @@ -29,7 +29,8 @@ def importOnapTypes(beHost, bePort, adminUser, fileDir, updateversion): "vduCompute", "vduCpd", "vduVirtualStorage", - "vnfVirtualLinkDesc" + "vnfVirtualLinkDesc", + "NSD" ] responseCodes = [200, 201] diff --git a/catalog-be/src/main/resources/scripts/import/tosca/typesToUpgrade.json b/catalog-be/src/main/resources/scripts/import/tosca/typesToUpgrade.json index a6948f5da8..c518855860 100644 --- a/catalog-be/src/main/resources/scripts/import/tosca/typesToUpgrade.json +++ b/catalog-be/src/main/resources/scripts/import/tosca/typesToUpgrade.json @@ -1,13 +1,54 @@ { "heat": [ - "contrailPort", - "extCp", - "contrailV2VirtualMachineInterface", + "globalNetwork", + "globalPort", + "globalCompute", + "volume", + "cinderVolume", + "contrailVirtualNetwork", + "neutronNet", "neutronPort", + "novaServer", + "extVl", + "internalVl", + "extCp", + "vl", + "eline", + "abstractSubstitute", + "Generic_VFC", + "Generic_VF", "Generic_PNF", + "Generic_Service", + "contrailNetworkRules", + "contrailPort", + "contrailV2NetworkRules", + "contrailV2VirtualNetwork", + "securityRules", + "contrailAbstractSubstitute", + "contrailCompute", + "contrailV2VirtualMachineInterface", + "subInterface", + "contrailV2VLANSubInterface", "multiFlavorVFC", - "vnfConfiguration" + "vnfConfiguration", + "underlayVpn", + "overlayTunnel", + "genericNeutronNet" ], "normative": [ + "root", + "compute", + "softwareComponent", + "webServer", + "webApplication", + "DBMS", + "database", + "objectStorage", + "blockStorage", + "containerRuntime", + "containerApplication", + "loadBalancer", + "port", + "network" ] }
\ No newline at end of file diff --git a/catalog-be/src/test/resources/config/elasticsearch.yml.bak b/catalog-be/src/test/resources/config/elasticsearch.yml.bak deleted file mode 100644 index 98c6864bf2..0000000000 --- a/catalog-be/src/test/resources/config/elasticsearch.yml.bak +++ /dev/null @@ -1,387 +0,0 @@ - -cluster.name: elasticsearch_pavel - -discovery.zen.ping.multicast.enabled: false -discovery.zen.ping.unicast.enabled: true -discovery.zen.ping.unicast.hosts: elasticsearch_host - - - -##################### Elasticsearch Configuration Example ##################### - -# This file contains an overview of various configuration settings, -# targeted at operations staff. Application developers should -# consult the guide at <http://elasticsearch.org/guide>. -# -# The installation procedure is covered at -# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup.html>. -# -# Elasticsearch comes with reasonable defaults for most settings, -# so you can try it out without bothering with configuration. -# -# Most of the time, these defaults are just fine for running a production -# cluster. If you're fine-tuning your cluster, or wondering about the -# effect of certain configuration option, please _do ask_ on the -# mailing list or IRC channel [http://elasticsearch.org/community]. - -# Any element in the configuration can be replaced with environment variables -# by placing them in ${...} notation. For example: -# -# node.rack: ${RACK_ENV_VAR} - -# For information on supported formats and syntax for the config file, see -# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/setup-configuration.html> - - -################################### Cluster ################################### - -# Cluster name identifies your cluster for auto-discovery. If you're running -# multiple clusters on the same network, make sure you're using unique names. -# -# cluster.name: elasticsearch - - -#################################### Node ##################################### - -# Node names are generated dynamically on startup, so you're relieved -# from configuring them manually. You can tie this node to a specific name: -# -# node.name: "Franz Kafka" - -# Every node can be configured to allow or deny being eligible as the master, -# and to allow or deny to store the data. -# -# Allow this node to be eligible as a master node (enabled by default): -# -# node.master: true -# -# Allow this node to store data (enabled by default): -# -# node.data: true - -# You can exploit these settings to design advanced cluster topologies. -# -# 1. You want this node to never become a master node, only to hold data. -# This will be the "workhorse" of your cluster. -# -# node.master: false -# node.data: true -# -# 2. You want this node to only serve as a master: to not store any data and -# to have free resources. This will be the "coordinator" of your cluster. -# -# node.master: true -# node.data: false -# -# 3. You want this node to be neither master nor data node, but -# to act as a "search load balancer" (fetching data from nodes, -# aggregating results, etc.) -# -# node.master: false -# node.data: false - -# Use the Cluster Health API [http://localhost:9200/_cluster/health], the -# Node Info API [http://localhost:9200/_nodes] or GUI tools -# such as <http://www.elasticsearch.org/overview/marvel/>, -# <http://github.com/karmi/elasticsearch-paramedic>, -# <http://github.com/lukas-vlcek/bigdesk> and -# <http://mobz.github.com/elasticsearch-head> to inspect the cluster state. - -# A node can have generic attributes associated with it, which can later be used -# for customized shard allocation filtering, or allocation awareness. An attribute -# is a simple key value pair, similar to node.key: value, here is an example: -# -# node.rack: rack314 - -# By default, multiple nodes are allowed to start from the same installation location -# to disable it, set the following: -# node.max_local_storage_nodes: 1 - - -#################################### Index #################################### - -# You can set a number of options (such as shard/replica options, mapping -# or analyzer definitions, translog settings, ...) for indices globally, -# in this file. -# -# Note, that it makes more sense to configure index settings specifically for -# a certain index, either when creating it or by using the index templates API. -# -# See <http://elasticsearch.org/guide/en/elasticsearch/reference/current/index-modules.html> and -# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/indices-create-index.html> -# for more information. - -# Set the number of shards (splits) of an index (5 by default): -# -# index.number_of_shards: 5 - -# Set the number of replicas (additional copies) of an index (1 by default): -# -# index.number_of_replicas: 1 - -# Note, that for development on a local machine, with small indices, it usually -# makes sense to "disable" the distributed features: -# -index.number_of_shards: 1 -index.number_of_replicas: 0 - -# These settings directly affect the performance of index and search operations -# in your cluster. Assuming you have enough machines to hold shards and -# replicas, the rule of thumb is: -# -# 1. Having more *shards* enhances the _indexing_ performance and allows to -# _distribute_ a big index across machines. -# 2. Having more *replicas* enhances the _search_ performance and improves the -# cluster _availability_. -# -# The "number_of_shards" is a one-time setting for an index. -# -# The "number_of_replicas" can be increased or decreased anytime, -# by using the Index Update Settings API. -# -# Elasticsearch takes care about load balancing, relocating, gathering the -# results from nodes, etc. Experiment with different settings to fine-tune -# your setup. - -# Use the Index Status API (<http://localhost:9200/A/_status>) to inspect -# the index status. - - -#################################### Paths #################################### - -# Path to directory containing configuration (this file and logging.yml): -# -path.conf: /src/test/resources - -# Path to directory where to store index data allocated for this node. -# -path.data: target/esdata -# -# Can optionally include more than one location, causing data to be striped across -# the locations (a la RAID 0) on a file level, favouring locations with most free -# space on creation. For example: -# -# path.data: /path/to/data1,/path/to/data2 - -# Path to temporary files: -# -path.work: /target/eswork - -# Path to log files: -# -path.logs: /target/eslogs - -# Path to where plugins are installed: -# -# path.plugins: /path/to/plugins - - -#################################### Plugin ################################### - -# If a plugin listed here is not installed for current node, the node will not start. -# -# plugin.mandatory: mapper-attachments,lang-groovy - - -################################### Memory #################################### - -# Elasticsearch performs poorly when JVM starts swapping: you should ensure that -# it _never_ swaps. -# -# Set this property to true to lock the memory: -# -# bootstrap.mlockall: true - -# Make sure that the ES_MIN_MEM and ES_MAX_MEM environment variables are set -# to the same value, and that the machine has enough memory to allocate -# for Elasticsearch, leaving enough memory for the operating system itself. -# -# You should also make sure that the Elasticsearch process is allowed to lock -# the memory, eg. by using `ulimit -l unlimited`. - - -############################## Network And HTTP ############################### - -# Elasticsearch, by default, binds itself to the 0.0.0.0 address, and listens -# on port [9200-9300] for HTTP traffic and on port [9300-9400] for node-to-node -# communication. (the range means that if the port is busy, it will automatically -# try the next port). - -# Set the bind address specifically (IPv4 or IPv6): -# -# network.bind_host: 192.168.0.1 - -# Set the address other nodes will use to communicate with this node. If not -# set, it is automatically derived. It must point to an actual IP address. -# -# network.publish_host: 192.168.0.1 - -# Set both 'bind_host' and 'publish_host': -# -# network.host: 192.168.0.1 - -# Set a custom port for the node to node communication (9300 by default): -# -# transport.tcp.port: 9300 - -# Enable compression for all communication between nodes (disabled by default): -# -# transport.tcp.compress: true - -# Set a custom port to listen for HTTP traffic: -# -# http.port: 9200 - -# Set a custom allowed content length: -# -# http.max_content_length: 100mb - -# Disable HTTP completely: -# -# http.enabled: false - - -################################### Gateway ################################### - -# The gateway allows for persisting the cluster state between full cluster -# restarts. Every change to the state (such as adding an index) will be stored -# in the gateway, and when the cluster starts up for the first time, -# it will read its state from the gateway. - -# There are several types of gateway implementations. For more information, see -# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-gateway.html>. - -# The default gateway type is the "local" gateway (recommended): -# -# gateway.type: local - -# Settings below control how and when to start the initial recovery process on -# a full cluster restart (to reuse as much local data as possible when using shared -# gateway). - -# Allow recovery process after N nodes in a cluster are up: -# -gateway.recover_after_nodes: 1 - -# Set the timeout to initiate the recovery process, once the N nodes -# from previous setting are up (accepts time value): -# -# gateway.recover_after_time: 5m - -# Set how many nodes are expected in this cluster. Once these N nodes -# are up (and recover_after_nodes is met), begin recovery process immediately -# (without waiting for recover_after_time to expire): -# -gateway.expected_nodes: 1 - - -############################# Recovery Throttling ############################# - -# These settings allow to control the process of shards allocation between -# nodes during initial recovery, replica allocation, rebalancing, -# or when adding and removing nodes. - -# Set the number of concurrent recoveries happening on a node: -# -# 1. During the initial recovery -# -# cluster.routing.allocation.node_initial_primaries_recoveries: 4 -# -# 2. During adding/removing nodes, rebalancing, etc -# -# cluster.routing.allocation.node_concurrent_recoveries: 2 - -# Set to throttle throughput when recovering (eg. 100mb, by default 20mb): -# -# indices.recovery.max_bytes_per_sec: 20mb - -# Set to limit the number of open concurrent streams when -# recovering a shard from a peer: -# -# indices.recovery.concurrent_streams: 5 - - -################################## Discovery ################################## - -# Discovery infrastructure ensures nodes can be found within a cluster -# and master node is elected. Multicast discovery is the default. - -# Set to ensure a node sees N other master eligible nodes to be considered -# operational within the cluster. Its recommended to set it to a higher value -# than 1 when running more than 2 nodes in the cluster. -# -# discovery.zen.minimum_master_nodes: 1 - -# Set the time to wait for ping responses from other nodes when discovering. -# Set this option to a higher value on a slow or congested network -# to minimize discovery failures: -# -# discovery.zen.ping.timeout: 3s - -# For more information, see -# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-discovery-zen.html> - -# Unicast discovery allows to explicitly control which nodes will be used -# to discover the cluster. It can be used when multicast is not present, -# or to restrict the cluster communication-wise. -# -# 1. Disable multicast discovery (enabled by default): -# -# discovery.zen.ping.multicast.enabled: false -# -# 2. Configure an initial list of master nodes in the cluster -# to perform discovery when new nodes (master or data) are started: -# -# discovery.zen.ping.unicast.hosts: ["host1", "host2:port"] - -# EC2 discovery allows to use AWS EC2 API in order to perform discovery. -# -# You have to install the cloud-aws plugin for enabling the EC2 discovery. -# -# For more information, see -# <http://elasticsearch.org/guide/en/elasticsearch/reference/current/modules-discovery-ec2.html> -# -# See <http://elasticsearch.org/tutorials/elasticsearch-on-ec2/> -# for a step-by-step tutorial. - -# GCE discovery allows to use Google Compute Engine API in order to perform discovery. -# -# You have to install the cloud-gce plugin for enabling the GCE discovery. -# -# For more information, see <https://github.com/elasticsearch/elasticsearch-cloud-gce>. - -# Azure discovery allows to use Azure API in order to perform discovery. -# -# You have to install the cloud-azure plugin for enabling the Azure discovery. -# -# For more information, see <https://github.com/elasticsearch/elasticsearch-cloud-azure>. - -################################## Slow Log ################################## - -# Shard level query and fetch threshold logging. - -#index.search.slowlog.threshold.query.warn: 10s -#index.search.slowlog.threshold.query.info: 5s -#index.search.slowlog.threshold.query.debug: 2s -#index.search.slowlog.threshold.query.trace: 500ms - -#index.search.slowlog.threshold.fetch.warn: 1s -#index.search.slowlog.threshold.fetch.info: 800ms -#index.search.slowlog.threshold.fetch.debug: 500ms -#index.search.slowlog.threshold.fetch.trace: 200ms - -#index.indexing.slowlog.threshold.index.warn: 10s -#index.indexing.slowlog.threshold.index.info: 5s -#index.indexing.slowlog.threshold.index.debug: 2s -#index.indexing.slowlog.threshold.index.trace: 500ms - -################################## GC Logging ################################ - -#monitor.jvm.gc.young.warn: 1000ms -#monitor.jvm.gc.young.info: 700ms -#monitor.jvm.gc.young.debug: 400ms - -#monitor.jvm.gc.old.warn: 10s -#monitor.jvm.gc.old.info: 5s -#monitor.jvm.gc.old.debug: 2s - diff --git a/catalog-be/src/test/resources/config/mysql-type-empty-nodes.zip b/catalog-be/src/test/resources/config/mysql-type-empty-nodes.zip Binary files differdeleted file mode 100644 index d317bccd1e..0000000000 --- a/catalog-be/src/test/resources/config/mysql-type-empty-nodes.zip +++ /dev/null diff --git a/catalog-be/src/test/resources/config/mysql-type-no-nodes.zip b/catalog-be/src/test/resources/config/mysql-type-no-nodes.zip Binary files differdeleted file mode 100644 index 09999faed5..0000000000 --- a/catalog-be/src/test/resources/config/mysql-type-no-nodes.zip +++ /dev/null diff --git a/catalog-be/src/test/resources/config/mysql-type-no-version.zip b/catalog-be/src/test/resources/config/mysql-type-no-version.zip Binary files differdeleted file mode 100644 index fa1319f311..0000000000 --- a/catalog-be/src/test/resources/config/mysql-type-no-version.zip +++ /dev/null diff --git a/catalog-be/src/test/resources/config/mysql-type-only-yaml.zip b/catalog-be/src/test/resources/config/mysql-type-only-yaml.zip Binary files differdeleted file mode 100644 index b4b1946940..0000000000 --- a/catalog-be/src/test/resources/config/mysql-type-only-yaml.zip +++ /dev/null diff --git a/catalog-be/src/test/resources/config/mysql-type-with-scripts.zip b/catalog-be/src/test/resources/config/mysql-type-with-scripts.zip Binary files differdeleted file mode 100644 index d689b668a1..0000000000 --- a/catalog-be/src/test/resources/config/mysql-type-with-scripts.zip +++ /dev/null diff --git a/catalog-be/src/test/resources/config/mysql-type.yml b/catalog-be/src/test/resources/config/mysql-type.yml deleted file mode 100644 index f1985a0bdc..0000000000 --- a/catalog-be/src/test/resources/config/mysql-type.yml +++ /dev/null @@ -1,82 +0,0 @@ -tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03 -description: MySQL RDBMS installation on a specific mounted volume path. -template_name: mysql-type -template_version: 1.1.1-SNAPSHOT -template_author: FastConnect - -imports: - - "tosca-normative-types:1.0.0.wd03-SNAPSHOT" - -node_types: - alien.nodes.Mysql: - 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 - 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: - derived_from: tosca.capabilities.Container - -artifact_types: - tosca.artifacts.GroovyScript: - description: A groovy script (.groovy file) - file_ext: [groovy] diff --git a/catalog-be/src/test/resources/config/mysql-type.zip b/catalog-be/src/test/resources/config/mysql-type.zip Binary files differdeleted file mode 100644 index b4b1946940..0000000000 --- a/catalog-be/src/test/resources/config/mysql-type.zip +++ /dev/null diff --git a/catalog-be/src/test/resources/config/sample.yaml b/catalog-be/src/test/resources/config/sample.yaml deleted file mode 100644 index 12ab2c777f..0000000000 --- a/catalog-be/src/test/resources/config/sample.yaml +++ /dev/null @@ -1,17 +0,0 @@ -version: 1.0 -released: 2012-11-30 - -# Connection parameters -connection: - url: jdbc:mysql://localhost:3306/db - poolSize: 5 - -# Protocols -protocols: - - http - - https - -# Users -users: - tom: passwd - bob: passwd
\ No newline at end of file diff --git a/catalog-be/src/test/resources/config/sampleNoProtocol.yaml b/catalog-be/src/test/resources/config/sampleNoProtocol.yaml deleted file mode 100644 index 6197232aa4..0000000000 --- a/catalog-be/src/test/resources/config/sampleNoProtocol.yaml +++ /dev/null @@ -1,17 +0,0 @@ -version: 1.0 -released: 2012-11-30 - -# Connection parameters -connection: - url: jdbc:mysql://localhost:3306/db - poolSize: 5 - -# Protocols -#protocols: -# - http -# - https - -# Users -users: - tom: passwd - bob: passwd
\ No newline at end of file diff --git a/catalog-fe/pom.xml b/catalog-fe/pom.xml index 757e543dcb..d79d6aab47 100644 --- a/catalog-fe/pom.xml +++ b/catalog-fe/pom.xml @@ -323,42 +323,7 @@ </webResources> </configuration> </plugin> - - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-dependency-plugin</artifactId> - <executions> - <execution> - <id>copy-dependencies</id> - <phase>package</phase> - <goals> - <goal>copy-dependencies</goal> - </goals> - <configuration> - <includeScope>compile</includeScope> - </configuration> - </execution> - <execution> - <id>copy-installed</id> - <phase>install</phase> - <goals> - <goal>copy</goal> - </goals> - <configuration> - <artifactItems> - <artifactItem> - <groupId>${project.groupId}</groupId> - <artifactId>${project.artifactId}</artifactId> - <version>${project.version}</version> - <type>${project.packaging}</type> - </artifactItem> - </artifactItems> - <outputDirectory>${project.parent.basedir}/sdc-os-chef/sdc-frontend/</outputDirectory> - </configuration> - </execution> - </executions> - </plugin> - + <plugin> <groupId>org.eclipse.jetty</groupId> <artifactId>jetty-maven-plugin</artifactId> diff --git a/common-app-api/src/main/java/org/openecomp/sdc/common/api/ArtifactTypeEnum.java b/common-app-api/src/main/java/org/openecomp/sdc/common/api/ArtifactTypeEnum.java index f13984bc67..6beec9de54 100644 --- a/common-app-api/src/main/java/org/openecomp/sdc/common/api/ArtifactTypeEnum.java +++ b/common-app-api/src/main/java/org/openecomp/sdc/common/api/ArtifactTypeEnum.java @@ -37,8 +37,10 @@ public enum ArtifactTypeEnum { DCAE_INVENTORY_POLICY("DCAE_INVENTORY_POLICY"), DCAE_INVENTORY_DOC("DCAE_INVENTORY_DOC"), DCAE_INVENTORY_BLUEPRINT("DCAE_INVENTORY_BLUEPRINT"), DCAE_INVENTORY_EVENT("DCAE_INVENTORY_EVENT"), // AAI Artifacts AAI_SERVICE_MODEL("AAI_SERVICE_MODEL"), AAI_VF_MODEL("AAI_VF_MODEL"), AAI_VF_MODULE_MODEL("AAI_VF_MODULE_MODEL"), AAI_VF_INSTANCE_MODEL("AAI_VF_INSTANCE_MODEL"), - // MIB artifacts - SNMP_POLL ("SNMP_POLL"), SNMP_TRAP("SNMP_TRAP"), GUIDE("GUIDE"); + // MIB Artifacts + SNMP_POLL ("SNMP_POLL"), SNMP_TRAP("SNMP_TRAP"), GUIDE("GUIDE"), + // PLAN Artifacts + PLAN("PLAN"); ArtifactTypeEnum(String type) { this.type = type; diff --git a/common/openecomp-common-configuration-management/openecomp-configuration-management-api/pom.xml b/common/openecomp-common-configuration-management/openecomp-configuration-management-api/pom.xml index 22fdd2cdf4..0a06aa3f4e 100644 --- a/common/openecomp-common-configuration-management/openecomp-configuration-management-api/pom.xml +++ b/common/openecomp-common-configuration-management/openecomp-configuration-management-api/pom.xml @@ -2,7 +2,6 @@ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> - <groupId>org.openecomp.sdc.common</groupId> <name>openecomp-configuration-management-api</name> <artifactId>openecomp-configuration-management-api</artifactId> @@ -13,36 +12,4 @@ <relativePath>..</relativePath> </parent> - <dependencies> - </dependencies> - - <build> - <plugins> - <plugin> - <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-install-plugin</artifactId> - <version>${mvn.install.version}</version> - <executions> - <execution> - <id>install-mallet</id> - <phase>install</phase> - <goals> - <goal>install-file</goal> - </goals> - <configuration> - <file>${java.home}/../lib/tools.jar</file> - <groupId>tools</groupId> - <artifactId>tools</artifactId> - <version>1.8</version> - <packaging>jar</packaging> - <createChecksum>true</createChecksum> - <generatePom>true</generatePom> - </configuration> - </execution> - </executions> - </plugin> - </plugins> - </build> - - </project> diff --git a/common/openecomp-common-configuration-management/pom.xml b/common/openecomp-common-configuration-management/pom.xml index 0d28746e9a..001b719ef1 100644 --- a/common/openecomp-common-configuration-management/pom.xml +++ b/common/openecomp-common-configuration-management/pom.xml @@ -17,7 +17,6 @@ <modules> <module>openecomp-configuration-management-api</module> <module>openecomp-configuration-management-core</module> - <module>openecomp-configuration-management-cli</module> <module>openecomp-configuration-management-test</module> </modules> diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/Model.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/Model.java index 6668836518..c55abb36c2 100644 --- a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/Model.java +++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/Model.java @@ -80,9 +80,6 @@ public abstract class Model { case "org.openecomp.resource.vfc.nodes.heat.cinder": modelToBeReturned = new VolumeWidget(); break; - case "org.openecomp.resource.pnf": - modelToBeReturned = new PnfResource(); - break; default: modelToBeReturned = null; break; diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/PnfResource.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/PnfResource.java deleted file mode 100644 index 67e19392ba..0000000000 --- a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/PnfResource.java +++ /dev/null @@ -1,9 +0,0 @@ -package org.openecomp.sdc.generator.aai.model; - -import org.openecomp.sdc.generator.aai.types.Cardinality; - -@org.openecomp.sdc.generator.aai.types.Model(widget = Widget.Type.PNF, cardinality = Cardinality - .UNBOUNDED, - dataDeleteFlag = true) -public class PnfResource extends Resource { -} diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/PnfWidget.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/PnfWidget.java deleted file mode 100644 index 2aa03b38bd..0000000000 --- a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/PnfWidget.java +++ /dev/null @@ -1,11 +0,0 @@ -package org.openecomp.sdc.generator.aai.model; - -import org.openecomp.sdc.generator.aai.types.Cardinality; -import org.openecomp.sdc.generator.aai.types.ModelType; -import org.openecomp.sdc.generator.aai.types.ModelWidget; - -@org.openecomp.sdc.generator.aai.types.Model(widget = Widget.Type.PNF, cardinality - = Cardinality.UNBOUNDED, dataDeleteFlag = true) -@ModelWidget(type = ModelType.WIDGET, name = "pnf") -public class PnfWidget extends ResourceWidget { -} diff --git a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/Widget.java b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/Widget.java index ce1ef703d9..6220519a3f 100644 --- a/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/Widget.java +++ b/common/openecomp-sdc-artifact-generator-lib/openecomp-sdc-artifact-generator-api/src/main/java/org/openecomp/sdc/generator/aai/model/Widget.java @@ -78,8 +78,6 @@ public abstract class Widget extends Model { return new AllotedResourceWidget(); case TUNNEL_XCONNECT: return new TunnelXconnectWidget(); - case PNF: - return new PnfWidget(); default: return null; } @@ -193,6 +191,6 @@ public abstract class Widget extends Model { public enum Type { SERVICE, VF, VFC, VSERVER, VOLUME, FLAVOR, TENANT, VOLUME_GROUP, LINT, L3_NET, VFMODULE, IMAGE, - OAM_NETWORK,ALLOTTED_RESOURCE,TUNNEL_XCONNECT, PNF + OAM_NETWORK,ALLOTTED_RESOURCE,TUNNEL_XCONNECT } } diff --git a/docs/administration.rst b/docs/administration.rst new file mode 100644 index 0000000000..94a7407189 --- /dev/null +++ b/docs/administration.rst @@ -0,0 +1,24 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +Administration +============== + + +.. note:: + * This section is used to describe a software component from the perspective of on-going + operation including regular processes and actions that are taken to configure and manage + the component. + + * This section is typically: provided for platform-component or applications; and + referenced in user guides + + * This note must be removed after content has been added. + + +Processes +--------- + + +Actions +------- diff --git a/docs/architecture.rst b/docs/architecture.rst new file mode 100644 index 0000000000..8daa0d3bc5 --- /dev/null +++ b/docs/architecture.rst @@ -0,0 +1,27 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +Architecture +============ + +.. note:: + * This section is used to describe a software component from a high level + view of capability, common usage scenarios, and interactions with other + components required in the usage scenarios. + + * The architecture section is typically: provided in a platform-component + and sdk collections; and referenced from developer and user guides. + + * This note must be removed after content has been added. + + +Capabilities +------------ + + +Usage Scenarios +--------------- + + +Interactions +------------ diff --git a/docs/configuration.rst b/docs/configuration.rst new file mode 100644 index 0000000000..085f9c667d --- /dev/null +++ b/docs/configuration.rst @@ -0,0 +1,27 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +Configuration +============= + +.. note:: + * This section is used to describe the options a software component offers for configuration. + + * Configuration is typically: provided for platform-component and sdk projects; + and referenced in developer and user guides. + + * This note must be removed after content has been added. + + + +Example ... + +You can provide the following in ``basic.conf`` + +``host=ADDRESS`` + The address of the host + +``port=PORT`` + The port used for signaling + + Optional. Default: ``8080`` diff --git a/docs/consumedapis.rst b/docs/consumedapis.rst new file mode 100644 index 0000000000..c2af4c20e0 --- /dev/null +++ b/docs/consumedapis.rst @@ -0,0 +1,16 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +Consumed APIs +============= + +.. note:: + * This section is used to reference APIs that a software component depends on + and uses from other sources. + + * Consumed APIs should be a specific link to the offered APIs from another component + or external source. + + * This note must be removed after content has been added. + + diff --git a/docs/delivery.rst b/docs/delivery.rst new file mode 100644 index 0000000000..f3f083a732 --- /dev/null +++ b/docs/delivery.rst @@ -0,0 +1,44 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +Delivery +======== + +.. note:: + * This section is used to describe a software component packaging. + For a run-time component this might be executable images, containers, etc. + For an SDK this might be libraries. + + * This section is typically provided for a platform-component and sdk; + and referenced in developer and user guides + + * This note must be removed after content has been added. + +Example use of a block diagram. + +.. blockdiag:: + + + blockdiag layers { + orientation = portrait + a -> m; + b -> n; + c -> x; + m -> y; + m -> z; + group l1 { + color = blue; + x; y; z; + } + group l2 { + color = yellow; + m; n; + } + group l3 { + color = orange; + a; b; c; + } + + } + + diff --git a/docs/humaninterfaces.rst b/docs/humaninterfaces.rst new file mode 100644 index 0000000000..4292846085 --- /dev/null +++ b/docs/humaninterfaces.rst @@ -0,0 +1,17 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +Human Interfaces +================ + +.. note:: + * This section is used to describe a software component's command line and graphical + user interfaces. + + * This section is typically: provided for a platform-component and application; and + referenced from user guides. + + * This note must be removed after content has been added. + + + diff --git a/docs/index.rst b/docs/index.rst index 833e1aa969..7ba626a806 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,8 +1,18 @@ .. This work is licensed under a Creative Commons Attribution 4.0 International License. -TODO Add files to toctree and delete this header ------------------------------------------------- -.. toctree:: - :maxdepth: 1 - +SDC Documentation +================= +.. toctree:: + :maxdepth: 2 + + administration.rst + architecture.rst + configuration.rst + consumedapis.rst + delivery.rst + humaninterfaces.rst + installation.rst + logging.rst + offeredapis.rst + release-notes.rst diff --git a/docs/installation.rst b/docs/installation.rst new file mode 100644 index 0000000000..be64a63bb9 --- /dev/null +++ b/docs/installation.rst @@ -0,0 +1,20 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +Installation +============ + +.. note:: + * This section is used to describe how a software component is acquired and installed. + + * This section is typically: provided for a platform-component and application; and + referenced in user guides. + + * This note must be removed after content has been added. + +Environment +----------- + + +Steps +----- diff --git a/docs/logging.rst b/docs/logging.rst new file mode 100644 index 0000000000..b1ce120d99 --- /dev/null +++ b/docs/logging.rst @@ -0,0 +1,54 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +Logging +======= + +.. note:: + * This section is used to describe the informational or diagnostic messages emitted from + a software component and the methods or collecting them. + + * This section is typically: provided for a platform-component and sdk; and + referenced in developer and user guides + + * This note must be removed after content has been added. + ++--------+------------------------------------------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+ +| Server | Location | Type | Description | Rolling | ++--------+------------------------------------------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+ +| BE | /data/logs/BE/2017_03_10.stderrout.log | Jetty server log | The log describes info regarding Jetty startup and execution | the log rolls daily | ++ +------------------------------------------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+ +| | /data/logs/BE/SDC/SDC-BE/audit.log | application audit | An audit record is created for each operation in SDC | rolls at 20 mb | ++ +------------------------------------------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+ +| | /data/logs/BE/SDC/SDC-BE/debug.log | application logging | We can enable higher logging on demand by editing the logback.xml inside the server docker. | rolls at 20 mb | +| | | | The file is located under:,config/catalog-be/logback.xml. | | +| | | | This log holds the debug and trace level output of the application. | | ++ +------------------------------------------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+ +| | /data/logs/BE/SDC/SDC-BE/error.log | application logging | This log holds the info and error level output of the application. | rolls at 20 mb | ++ +------------------------------------------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+ +| | /data/logs/BE/SDC/SDC-BE/transaction.log | application logging | Not currently in use. will be used in future relases. | rolls at 20 mb | ++ +------------------------------------------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+ +| | /data/logs/BE/SDC/SDC-BE/all.log | application logging | On demand, we can enable log aggregation into one file for easier debugging. This is done by editing the logback.xml inside the server docker. | rolls at 20 mb | +| | | | The file is located under:,config/catalog-be/logback.xml. | | +| | | | To allow this logger, set the value for this property to true This log holds all logging output of the application. | | ++--------+------------------------------------------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+ +| FE | /data/logs/FE/2017_03_10.stderrout.log | Jetty server log | The log describes info regarding the Jetty startup and execution | the log rolls daily | ++ +------------------------------------------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+ +| | /data/logs/FE/SDC/SDC-FE/debug.log | application logging | We can enable higher logging on demand by editing the logback.xml inside the server docker. | rolls at 20 mb | +| | | | The file is located,under: config/catalog-fe/logback.xml. | | +| | | | This log holds the debug and trace level output of the application. | | ++ +------------------------------------------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+ +| | /data/logs/FE/SDC/SDC-FE/error.log | application logging | This log holds the Info and Error level output of the application. | rolls at 20 mb | ++ +------------------------------------------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+ +| | /data/logs/FE/SDC/SDC-FE/all.log | application logging | On demand we can enable log aggregation into one file for easier debuging, by editing the logback.xml inside the server docker.The file is located under: config/catalog-fe/logback.xml. | rolls | +| | | | To allow this logger set this property to true | | +| | | | This log holds all the logging output of the application. | | ++--------+------------------------------------------+---------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------------+ + + +Where to Access Information +--------------------------- + + +Error / Warning Messages +------------------------ diff --git a/docs/offeredapis.rst b/docs/offeredapis.rst new file mode 100644 index 0000000000..23504c1daa --- /dev/null +++ b/docs/offeredapis.rst @@ -0,0 +1,14 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +Offered APIs +============ + +.. note:: + * This section is used to describe the external interfaces offered by a software component + + * This section is typically: provided for a platform-component and sdk; and + referenced in developer guides and api reference manuals. + + * This note must be removed after content has been added. + diff --git a/docs/release-notes.rst b/docs/release-notes.rst new file mode 100644 index 0000000000..b568bee821 --- /dev/null +++ b/docs/release-notes.rst @@ -0,0 +1,48 @@ +.. This work is licensed under a Creative Commons Attribution 4.0 International License. + +Release Notes +============= + +.. note:: + * This Release Notes must be updated each time the team decides to Release new artifacts. + * The scope of this Release Notes is for this particular component. In other words, each ONAP component has its Release Notes. + * This Release Notes is cumulative, the most recently Released artifact is made visible in the top of this Release Notes. + * Except the date and the version number, all the other sections are optional but there must be at least one section describing the purpose of this new release. + * This note must be removed after content has been added. + + +Version: x.y.z +-------------- + + +:Release Date: yyyy-mm-dd + + + +**New Features** + +One or two sentences explaining the purpose of this Release. + +**Bug Fixes** + - `CIMAN-65 <https://jira.onap.org/browse/CIMAN-65>`_ and a sentence explaining what this defect is addressing. +**Known Issues** + - `CIMAN-65 <https://jira.onap.org/browse/CIMAN-65>`_ and two, three sentences. + One sentences explaining what is the issue. + + Another sentence explaining the impact of the issue. + + And an optional sentence providing a workaround. + +**Security Issues** + You may want to include a reference to CVE (Common Vulnerabilities and Exposures) `CVE <https://cve.mitre.org>`_ + + +**Upgrade Notes** + +**Deprecation Notes** + +**Other** + +=========== + +End of Release Notes diff --git a/onboarding/pom.xml b/onboarding/pom.xml index b3aa4d6493..5bd0f3a106 100644 --- a/onboarding/pom.xml +++ b/onboarding/pom.xml @@ -112,7 +112,7 @@ <executions> <execution> <id>jxr-generation</id> - <phase>validate</phase> + <phase>verify</phase> <goals> <goal>jxr</goal> <goal>test-jxr</goal> @@ -135,7 +135,7 @@ <executions> <execution> <id>pmd-check</id> - <phase>validate</phase> + <phase>verify</phase> <goals> <!-- violations fail build --> <goal>check</goal> diff --git a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java index 0a3428579d..1891cddfd5 100644 --- a/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-vendor-software-product-manager/src/main/java/org/openecomp/sdc/vendorsoftwareproduct/impl/VendorSoftwareProductManagerImpl.java @@ -329,7 +329,7 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa validateQuestionnaire(vspDetails.getId(), vspDetails.getVersion(), vspDetails .getOnboardingMethod())); - if (vspDetails.getOnboardingMethod().equals("Manual")) { + if ("Manual".equals(vspDetails.getOnboardingMethod())) { Collection<ErrorCode> deploymentFlavourValidationErrList = deploymentFlavorValidation(vspDetails.getId(), vspDetails.getVersion()); if (validationResponse.getVspErrors() != null) { @@ -527,7 +527,7 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa if (vspDetails.getSubCategory() == null) { errors.add(createMissingMandatoryFieldError("sub category")); } - if (vspDetails.getOnboardingMethod().equals("Manual")) { + if ("Manual".equals(vspDetails.getOnboardingMethod())) { //Manual Onboarding specific validations Collection<DeploymentFlavorEntity> deploymentFlavorEntities = vendorSoftwareProductDao .listDeploymentFlavors(vspDetails.getId(), vspDetails.getVersion()); @@ -729,7 +729,7 @@ public class VendorSoftwareProductManagerImpl implements VendorSoftwareProductMa mdcDataDebugMessage.debugEntryMessage("VSP id", vspDetails.getId()); VspDetails retrieved = vspInfoDao.get(vspDetails); - if (!retrieved.getOnboardingMethod().equals(vspDetails.getOnboardingMethod())) { + if (!Objects.equals(retrieved.getOnboardingMethod(), vspDetails.getOnboardingMethod())) { final ErrorCode onboardingMethodUpdateErrorCode = OnboardingMethodErrorBuilder .getOnboardingUpdateError(); diff --git a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterImpl.java b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterImpl.java index 69fa33aae7..348739e780 100644 --- a/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterImpl.java +++ b/openecomp-be/lib/openecomp-tosca-converter-lib/openecomp-tosca-converter-core/src/main/java/org/openecomp/core/impl/ToscaConverterImpl.java @@ -36,7 +36,7 @@ public class ToscaConverterImpl implements ToscaConverter { @Override public ToscaServiceModel convert(FileContentHandler fileContentHandler) - throws IOException { + throws IOException { Map<String, byte[]> csarFiles = new HashMap<>(fileContentHandler.getFiles()); ToscaServiceModel toscaServiceModel = new ToscaServiceModel(); Map<String, ServiceTemplate> serviceTemplates = new HashMap<>(); @@ -88,9 +88,9 @@ public class ToscaConverterImpl implements ToscaConverter { } } catch (YAMLException ye) { throw new CoreException(new ErrorCode.ErrorCodeBuilder() - .withMessage("Invalid YAML content in file " + key + ". reason - " - + ye.getMessage()) - .withCategory(ErrorCategory.APPLICATION).build()); + .withMessage("Invalid YAML content in file " + key + ". reason - " + + ye.getMessage()) + .withCategory(ErrorCategory.APPLICATION).build()); } } @@ -100,7 +100,7 @@ public class ToscaConverterImpl implements ToscaConverter { GlobalSubstitutionServiceTemplate globalSubstitutionServiceTemplate, Map<String, byte[]> csarFiles) { Collection<ServiceTemplate> globalServiceTemplates = - GlobalTypesGenerator.getGlobalTypesServiceTemplate().values(); + GlobalTypesGenerator.getGlobalTypesServiceTemplate().values(); addGlobalServiceTemplates(globalServiceTemplates, serviceTemplates); toscaServiceModel.setEntryDefinitionServiceTemplate(mainStName); toscaServiceModel.setServiceTemplates(serviceTemplates); @@ -125,10 +125,10 @@ public class ToscaConverterImpl implements ToscaConverter { String fileName, Map<String, byte[]> csarFiles, Map<String, ServiceTemplate> serviceTemplates) { Optional<ServiceTemplate> serviceTemplate = - getServiceTemplateFromCsar(fileName, csarFiles); + getServiceTemplateFromCsar(fileName, csarFiles); serviceTemplate.ifPresent( - serviceTemplate1 -> addServiceTemplate(serviceTemplateName, serviceTemplate1, - serviceTemplates)); + serviceTemplate1 -> addServiceTemplate(serviceTemplateName, serviceTemplate1, + serviceTemplates)); } private void addServiceTemplate(String serviceTemplateName, @@ -160,7 +160,7 @@ public class ToscaConverterImpl implements ToscaConverter { ServiceTemplate serviceTemplate = new ServiceTemplate(); try { ServiceTemplateReaderService readerService = - new ServiceTemplateReaderServiceImpl(fileContent); + new ServiceTemplateReaderServiceImpl(fileContent); convertMetadata(serviceTemplateName, serviceTemplate, readerService); convertToscaVersion(serviceTemplate, readerService); convertImports(serviceTemplate); @@ -169,9 +169,9 @@ public class ToscaConverterImpl implements ToscaConverter { } catch (YAMLException ye) { throw new CoreException(new ErrorCode.ErrorCodeBuilder() - .withMessage("Invalid YAML content in file" + serviceTemplateName + ". reason - " - + ye.getMessage()) - .withCategory(ErrorCategory.APPLICATION).build()); + .withMessage("Invalid YAML content in file" + serviceTemplateName + ". reason - " + + ye.getMessage()) + .withCategory(ErrorCategory.APPLICATION).build()); } @@ -187,7 +187,7 @@ public class ToscaConverterImpl implements ToscaConverter { private void convertImports(ServiceTemplate serviceTemplate) { serviceTemplate.setImports(new ArrayList<>()); serviceTemplate.getImports() - .add(createImportMap(openecompHeatIndex, "openecomp-heat/_index.yml")); + .add(createImportMap(openecompHeatIndex, "openecomp-heat/_index.yml")); serviceTemplate.getImports().add(createImportMap(globalSubstitution, globalStName)); } @@ -210,7 +210,7 @@ public class ToscaConverterImpl implements ToscaConverter { if (MapUtils.isNotEmpty(metadataToConvert)) { for (Map.Entry<String, Object> metadataEntry : metadataToConvert.entrySet()) { if (Objects.isNull(metadataEntry.getValue()) || - !(metadataEntry.getValue() instanceof String)) { + !(metadataEntry.getValue() instanceof String)) { continue; } finalMetadata.put(metadataEntry.getKey(), (String) metadataEntry.getValue()); @@ -229,9 +229,9 @@ public class ToscaConverterImpl implements ToscaConverter { for (Map.Entry<String, Object> nodeTypeEntry : nodeTypes.entrySet()) { DataModelUtil - .addNodeType(serviceTemplate, nodeTypeEntry.getKey(), - (NodeType) createObjectFromClass(nodeTypeEntry.getKey(), nodeTypeEntry.getValue(), - NodeType.class)); + .addNodeType(serviceTemplate, nodeTypeEntry.getKey(), + (NodeType) createObjectFromClass(nodeTypeEntry.getKey(), nodeTypeEntry.getValue(), + NodeType.class)); } } @@ -265,10 +265,10 @@ public class ToscaConverterImpl implements ToscaConverter { for (Map.Entry<String, Object> entry : mapToConvert.entrySet()) { ParameterDefinition parameterDefinition = - (ParameterDefinition) createObjectFromClass( - entry.getKey(), entry.getValue(), ParameterDefinition.class); + (ParameterDefinition) createObjectFromClass( + entry.getKey(), entry.getValue(), ParameterDefinition.class); addToServiceTemplateAccordingToSection( - serviceTemplate, inputsOrOutputs, entry.getKey(), parameterDefinition); + serviceTemplate, inputsOrOutputs, entry.getKey(), parameterDefinition); } } @@ -279,11 +279,11 @@ public class ToscaConverterImpl implements ToscaConverter { switch (inputsOrOutputs) { case inputs: DataModelUtil - .addInputParameterToTopologyTemplate(serviceTemplate, parameterId, parameterDefinition); + .addInputParameterToTopologyTemplate(serviceTemplate, parameterId, parameterDefinition); break; case outputs: DataModelUtil - .addOutputParameterToTopologyTemplate(serviceTemplate, parameterId, parameterDefinition); + .addOutputParameterToTopologyTemplate(serviceTemplate, parameterId, parameterDefinition); } } @@ -315,15 +315,15 @@ public class ToscaConverterImpl implements ToscaConverter { substitutionMapping.setNode_type((String) substitutionMappings.get(nodeType)); substitutionMapping.setCapabilities( - convertSubstitutionMappingsSections((Map<String, Object>) substitutionMappings.get(capabilities))); + convertSubstitutionMappingsSections((Map<String, Object>) substitutionMappings.get(capabilities))); substitutionMapping.setRequirements( - convertSubstitutionMappingsSections((Map<String, Object>) substitutionMappings.get(requirements))); + convertSubstitutionMappingsSections((Map<String, Object>) substitutionMappings.get(requirements))); return substitutionMapping; } private Map<String, List<String>> convertSubstitutionMappingsSections( - Map<String, Object> sectionToConvert) { + Map<String, Object> sectionToConvert) { Map<String, List<String>> convertedSection = new HashMap<>(); if (MapUtils.isEmpty(sectionToConvert)) { return null; @@ -345,7 +345,7 @@ public class ToscaConverterImpl implements ToscaConverter { return CsarFileTypes.globalServiceTemplate; } else if (isDefinitions(fileName)) { return CsarFileTypes.definitionsFile; - } else if (isMetadataFile(metadataFile)) { + } else if (isMetadataFile(fileName)) { return CsarFileTypes.toscaMetadata; } return CsarFileTypes.externalFile; @@ -373,14 +373,14 @@ public class ToscaConverterImpl implements ToscaConverter { nodeTemplate.setDescription((String) nodeTemplateAsMap.get("description")); nodeTemplate.setDirectives((List<String>) nodeTemplateAsMap.get("directives")); nodeTemplate.setInterfaces( - (Map<String, InterfaceDefinition>) nodeTemplateAsMap.get("interfaces")); + (Map<String, InterfaceDefinition>) nodeTemplateAsMap.get("interfaces")); nodeTemplate.setNode_filter((NodeFilter) nodeTemplateAsMap.get("node_filter")); nodeTemplate.setProperties((Map<String, Object>) nodeTemplateAsMap.get("properties")); nodeTemplate.setRequirements( - (List<Map<String, RequirementAssignment>>) nodeTemplateAsMap.get("requirements")); + (List<Map<String, RequirementAssignment>>) nodeTemplateAsMap.get("requirements")); nodeTemplate.setType((String) nodeTemplateAsMap.get("type")); nodeTemplate.setCapabilities( - convertCapabilities((Map<String, Object>) nodeTemplateAsMap.get("capabilities"))); + convertCapabilities((Map<String, Object>) nodeTemplateAsMap.get("capabilities"))); return nodeTemplate; } @@ -393,8 +393,8 @@ public class ToscaConverterImpl implements ToscaConverter { for (Map.Entry<String, Object> capabilityAssignmentEntry : capabilities.entrySet()) { Map<String, CapabilityAssignment> tempMap = new HashMap<>(); tempMap.put(capabilityAssignmentEntry.getKey(), - (CapabilityAssignment) createObjectFromClass - (capabilityAssignmentEntry.getKey(), capabilityAssignmentEntry.getValue(), CapabilityAssignment.class)); + (CapabilityAssignment) createObjectFromClass + (capabilityAssignmentEntry.getKey(), capabilityAssignmentEntry.getValue(), CapabilityAssignment.class)); convertedCapabilities.add(tempMap); } return convertedCapabilities; @@ -408,8 +408,9 @@ public class ToscaConverterImpl implements ToscaConverter { } catch (Exception e) { //todo - return error to user? throw new CoreException(new ErrorCode.ErrorCodeBuilder() - .withCategory(ErrorCategory.APPLICATION) - .withMessage("Can't create Node Type from " + nodeTypeId).build()); + .withCategory(ErrorCategory.APPLICATION) + .withMessage("Can't create " + classToCreate.getSimpleName() + " from " + + nodeTypeId).build()); } } diff --git a/openecomp-ui/resources/scss/onboarding.scss b/openecomp-ui/resources/scss/onboarding.scss index 94dc223be3..fc05f7493e 100644 --- a/openecomp-ui/resources/scss/onboarding.scss +++ b/openecomp-ui/resources/scss/onboarding.scss @@ -18,20 +18,27 @@ div[data-reactroot].customized-date-picker-calendar { .react-datepicker__triangle { margin-top: 0px; } - .react-datepicker__navigation--previous { - border: none; - width: 12px; - height: 12px; - margin-top: 2px; - content: url(../../node_modules/sdc-ui/assets/icons/angleLeft.svg); + .react-datepicker__navigation--previous::before, .react-datepicker__navigation--next::before { + width: 8px; + height: 8px; + display: inline-block; + position: absolute; + top: -4px; + } + .react-datepicker__navigation--previous::before { + left: 0; + content: url(../../node_modules/sdc-ui/assets/icons/angleLeft.svg); + } + .react-datepicker__navigation--next::before { + right: 0; + content: url(../../node_modules/sdc-ui/assets/icons/angleRight.svg); } - .react-datepicker__navigation--next { + + .react-datepicker__navigation--previous, .react-datepicker__navigation--next { border: none; - width: 12px; - height: 12px; - margin-top: 2px; - content: url(../../node_modules/sdc-ui/assets/icons/angleRight.svg); } + + .react-datepicker__month-container { .react-datepicker__header { background-color: $background-gray; @@ -123,7 +123,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> - <version>2.10.4</version> + <version>3.0.0-M1</version> <configuration> <failOnError>false</failOnError> <doclet>org.umlgraph.doclet.UmlGraphDoc</doclet> @@ -272,7 +272,6 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-site-plugin</artifactId> - <version>3.4</version> <dependencies> <dependency> <groupId>org.apache.maven.wagon</groupId> diff --git a/sdc-os-chef/pom.xml b/sdc-os-chef/pom.xml index 3ad8a4b811..a4c8036214 100644 --- a/sdc-os-chef/pom.xml +++ b/sdc-os-chef/pom.xml @@ -4,6 +4,8 @@ <modelVersion>4.0.0</modelVersion> <artifactId>sdc-os-chef</artifactId> + <packaging>pom</packaging> + <parent> <groupId>org.openecomp.sdc</groupId> @@ -32,24 +34,47 @@ <configuration> <filesets> <fileset> - <directory> - ${project.basedir}\sdc-cassandra\chef-repo\cookbooks\cassandra-actions\attributes\ - </directory> + <directory>${project.basedir}\sdc-cassandra\chef-repo\cookbooks\cassandra-actions\attributes\</directory> <followSymlinks>false</followSymlinks> <includes> <include>**/default.rb</include> </includes> </fileset> - <!-- static configuration files --> - <fileset> - <directory>${project.parent.basedir}/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/files/default</directory> - <includes> + <!-- static configuration files --> + <fileset> + <directory>${project.parent.basedir}/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/files/default</directory> + <followSymlinks>false</followSymlinks> + <includes> <include>Artifact-Generator.properties</include> <include>error-configuration.yaml</include> <include>ecomp-error-configuration.yaml</include> <include>logback.xml</include> </includes> </fileset> + <!-- BE WAR's --> + <fileset> + <directory>${project.parent.basedir}/sdc-os-chef/sdc-backend</directory> + <followSymlinks>false</followSymlinks> + <includes> + <include>*.war</include> + </includes> + </fileset> + <!-- FE WAR's --> + <fileset> + <directory>${project.parent.basedir}/sdc-os-chef/sdc-frontend/</directory> + <followSymlinks>false</followSymlinks> + <includes> + <include>*.war</include> + </includes> + </fileset> + <fileset> + <directory>${project.basedir}/sdc-backend/chef-repo/cookbooks/sdc-normatives/files/default</directory> + <followSymlinks>false</followSymlinks> + <includes> + <include>normatives.tar.gz</include> + </includes> + </fileset> + </filesets> </configuration> </execution> @@ -157,6 +182,12 @@ <configuration> <outputDirectory>${basedir}/sdc-backend</outputDirectory> <resources> + <resource> + <directory>${project.parent.basedir}/catalog-be/target</directory> + <includes> + <include>catalog-be-${project.version}.war</include> + </includes> + </resource> <resource> <directory> ${project.parent.basedir}/openecomp-be/api/openecomp-sdc-rest-webapp/onboarding-rest-war/target @@ -168,6 +199,7 @@ </resources> </configuration> </execution> + <execution> <id>copy-resources-fe</id> <phase>validate</phase> @@ -177,6 +209,12 @@ <configuration> <outputDirectory>${basedir}/sdc-frontend</outputDirectory> <resources> + <resource> + <directory>${project.parent.basedir}/catalog-fe/target</directory> + <includes> + <include>catalog-fe-${project.version}.war</include> + </includes> + </resource> <resource> <directory>${project.parent.basedir}/openecomp-ui/target</directory> <includes> @@ -186,6 +224,7 @@ </resources> </configuration> </execution> + <execution> <id>copy-tests-suites</id> <phase>validate</phase> @@ -222,6 +261,24 @@ </resources> </configuration> </execution> + <execution> + <id>copy-normatives</id> + <phase>validate</phase> + <goals> + <goal>copy-resources</goal> + </goals> + <configuration> + <outputDirectory>${project.parent.basedir}/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-normatives/files/default</outputDirectory> + <resources> + <resource> + <directory>${project.parent.basedir}/catalog-be/target</directory> + <includes> + <include>normatives.tar.gz</include> + </includes> + </resource> + </resources> + </configuration> + </execution> </executions> </plugin> diff --git a/sdc-os-chef/sdc-backend/Dockerfile b/sdc-os-chef/sdc-backend/Dockerfile index 9052e74b52..dd38726be3 100644 --- a/sdc-os-chef/sdc-backend/Dockerfile +++ b/sdc-os-chef/sdc-backend/Dockerfile @@ -4,8 +4,6 @@ COPY chef-solo /root/chef-solo/ COPY chef-repo/cookbooks/. /root/chef-solo/cookbooks/ -#RUN python /root/chef-solo/cookbooks/sdc-normatives/files/default/get-pip.py - ADD onboarding-be-*.war ${JETTY_BASE}/webapps/ ADD catalog-be-*.war ${JETTY_BASE}/webapps/ diff --git a/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb b/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb index df9e74ad51..a4be8b10d0 100644 --- a/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb +++ b/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-catalog-be/templates/default/BE-configuration.yaml.erb @@ -126,7 +126,7 @@ artifactTypes: - SNMP_POLL - SNMP_TRAP - GUIDE - + - PLAN licenseTypes: - User @@ -305,6 +305,11 @@ serviceDeploymentArtifacts: OTHER: acceptedTypes: +#PLAN + PLAN: + acceptedTypes: + - xml + resourceDeploymentArtifacts: HEAT: acceptedTypes: @@ -422,6 +427,14 @@ resourceDeploymentArtifacts: acceptedTypes: validForResourceTypes: *allResourceTypes +#PLAN + PLAN: + acceptedTypes: + - xml + validForResourceTypes: + - VF + - VFC + resourceInstanceDeploymentArtifacts: HEAT_ENV: acceptedTypes: @@ -459,6 +472,11 @@ resourceInstanceDeploymentArtifacts: acceptedTypes: validForResourceTypes: *allResourceTypes +#PLAN + PLAN: + acceptedTypes: + - xml + resourceInformationalArtifacts: CHEF: acceptedTypes: diff --git a/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-normatives/recipes/import_Normatives.rb b/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-normatives/recipes/import_Normatives.rb index 8dff57abe8..ba72dab34b 100644 --- a/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-normatives/recipes/import_Normatives.rb +++ b/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-normatives/recipes/import_Normatives.rb @@ -10,7 +10,8 @@ bash "import-normatives" do tar xvfz /tmp/normatives.tar.gz cd normatives/scripts/import/tosca/ /bin/chmod +x importNormativeAll.py - python importNormativeAll.py -i localhost --debug=true > /var/lib/jetty/logs/importNormativeAll.log +# add --debug=true to the importNormativeAll.py arguments to enable debug + python importNormativeAll.py -i localhost > /var/lib/jetty/logs/importNormativeAll.log EOH end diff --git a/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-normatives/recipes/upgrade_Normatives.rb b/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-normatives/recipes/upgrade_Normatives.rb index 3baf4732fa..52afe4d7b8 100644 --- a/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-normatives/recipes/upgrade_Normatives.rb +++ b/sdc-os-chef/sdc-backend/chef-repo/cookbooks/sdc-normatives/recipes/upgrade_Normatives.rb @@ -10,7 +10,8 @@ bash "upgrade-normatives" do tar xvfz /tmp/normatives.tar.gz cd normatives/scripts/import/tosca/ /bin/chmod +x upgradeNormative.py importGroupTypes.py - python upgradeNormative.py -i localhost --debug=true > /var/lib/jetty/logs/upgradeNormative.log +# add --debug=true to the importNormativeAll.py arguments to enable debug + python upgradeNormative.py -i localhost > /var/lib/jetty/logs/upgradeNormative.log EOH end diff --git a/sdc-os-chef/sdc-backend/startup.sh b/sdc-os-chef/sdc-backend/startup.sh index cfdab442d4..87f4ae674d 100644 --- a/sdc-os-chef/sdc-backend/startup.sh +++ b/sdc-os-chef/sdc-backend/startup.sh @@ -6,7 +6,7 @@ cd /root/chef-solo echo "normal['HOST_IP'] = \"${HOST_IP}\"" > /root/chef-solo/cookbooks/sdc-catalog-be/attributes/default.rb chef-solo -c solo.rb -E ${CHEFNAME} -sed -i '/^set -e/aJAVA_OPTIONS=\" -XX:MaxPermSize=256m -Xmx1500m -Dconfig.home=${JETTY_BASE}\/config -Dlog.home=${JETTY_BASE}\/logs -Dlogback.configurationFile=${JETTY_BASE}\/config\/catalog-be\/logback.xml -Dconfiguration.yaml=${JETTY_BASE}\/config\/catalog-be\/configuration.yaml -Dartifactgenerator.config=${JETTY_BASE}\/config\/catalog-be\/Artifact-Generator.properties\ -Donboarding_configuration.yaml=${JETTY_BASE}\/config\/onboarding-be\/onboarding_configuration.yaml" ' /docker-entrypoint.sh +sed -i '/^set -e/aJAVA_OPTIONS=\"-Xdebug -agentlib:jdwp=transport=dt_socket,address=4000,server=y,suspend=n -XX:MaxPermSize=256m -Xmx1500m -Dconfig.home=${JETTY_BASE}\/config -Dlog.home=${JETTY_BASE}\/logs -Dlogback.configurationFile=${JETTY_BASE}\/config\/catalog-be\/logback.xml -Dconfiguration.yaml=${JETTY_BASE}\/config\/catalog-be\/configuration.yaml -Dartifactgenerator.config=${JETTY_BASE}\/config\/catalog-be\/Artifact-Generator.properties\ -Donboarding_configuration.yaml=${JETTY_BASE}\/config\/onboarding-be\/onboarding_configuration.yaml" ' /docker-entrypoint.sh sed -i '/^set -e/aTMPDIR=${JETTY_BASE}\/temp' /docker-entrypoint.sh # executiong the jetty diff --git a/test-apis-ci/pom.xml b/test-apis-ci/pom.xml index 66cef3625c..875888facc 100644 --- a/test-apis-ci/pom.xml +++ b/test-apis-ci/pom.xml @@ -11,6 +11,10 @@ <version>1.2.0-SNAPSHOT</version> </parent> + <properties> + <sonar.skip>true</sonar.skip> + </properties> + <dependencies> <dependency> <groupId>com.google.guava</groupId> diff --git a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/images/mysql.png Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/images/mysql.png +++ /dev/null diff --git a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/mysql.yml deleted file mode 100644 index f512f8071e..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03 -description: MySQL RDBMS installation on a specific mounted volume path. -template_name: mysql-getResourceArtifactFileContentTest -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-getResourceArtifactFileContentTest: - 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 - 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: - derived_from: tosca.capabilities.Container - -artifact_types: - tosca.artifacts.GroovyScript: - description: A groovy script (.groovy file) - file_ext: [groovy] diff --git a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/scripts/install_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/scripts/install_mysql.sh deleted file mode 100644 index 400bcf40cb..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/scripts/install_mysql.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/scripts/start_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/scripts/start_mysql.sh deleted file mode 100644 index 648bd45756..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/scripts/start_mysql.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/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/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListNoContentTest/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListNoContentTest/mysql.yml deleted file mode 100644 index 180e247ea2..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListNoContentTest/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03 -description: MySQL RDBMS installation on a specific mounted volume path. -template_name: mysql-getResourceArtifactListNoContentTest -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-getResourceArtifactListNoContentTest: - 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 - 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: - derived_from: tosca.capabilities.Container - -artifact_types: - tosca.artifacts.GroovyScript: - description: A groovy script (.groovy file) - file_ext: [groovy] diff --git a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/images/mysql.png Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/images/mysql.png +++ /dev/null diff --git a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/mysql.yml deleted file mode 100644 index b8f9bbdc69..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03 -description: MySQL RDBMS installation on a specific mounted volume path. -template_name: mysql-GetResourceArtifactListTest -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-GetResourceArtifactListTest: - 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 - 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: - derived_from: tosca.capabilities.Container - -artifact_types: - tosca.artifacts.GroovyScript: - description: A groovy script (.groovy file) - file_ext: [groovy] diff --git a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/scripts/install_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/scripts/install_mysql.sh deleted file mode 100644 index 400bcf40cb..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/scripts/install_mysql.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/scripts/start_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/scripts/start_mysql.sh deleted file mode 100644 index 648bd45756..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/scripts/start_mysql.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/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/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataNoContentTest/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataNoContentTest/mysql.yml deleted file mode 100644 index 72ff4f37e0..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataNoContentTest/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03 -description: MySQL RDBMS installation on a specific mounted volume path. -template_name: mysql-getResourceArtifactMetadataNoContentTest -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-getResourceArtifactMetadataNoContentTest: - 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 - 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: - derived_from: tosca.capabilities.Container - -artifact_types: - tosca.artifacts.GroovyScript: - description: A groovy script (.groovy file) - file_ext: [groovy] diff --git a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/images/mysql.png Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/images/mysql.png +++ /dev/null diff --git a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/mysql.yml deleted file mode 100644 index 527e4a0081..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03 -description: MySQL RDBMS installation on a specific mounted volume path. -template_name: mysql-getResourceArtifactMetadataTest -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-getResourceArtifactMetadataTest: - 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 - 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: - derived_from: tosca.capabilities.Container - -artifact_types: - tosca.artifacts.GroovyScript: - description: A groovy script (.groovy file) - file_ext: [groovy] diff --git a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/scripts/install_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/scripts/install_mysql.sh deleted file mode 100644 index 400bcf40cb..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/scripts/install_mysql.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/scripts/start_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/scripts/start_mysql.sh deleted file mode 100644 index 648bd45756..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/scripts/start_mysql.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/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/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactPayloadNoContentTest/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactPayloadNoContentTest/mysql.yml deleted file mode 100644 index 7177a65387..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactPayloadNoContentTest/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03 -description: MySQL RDBMS installation on a specific mounted volume path. -template_name: mysql-getResourceArtifactPayloadNoContentTest -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-getResourceArtifactPayloadNoContentTest: - 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 - 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: - derived_from: tosca.capabilities.Container - -artifact_types: - tosca.artifacts.GroovyScript: - description: A groovy script (.groovy file) - file_ext: [groovy] diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/images/mysql.png Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/images/mysql.png +++ /dev/null diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/mysql.yml deleted file mode 100644 index e0a0c6458e..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -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/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/scripts/install_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/scripts/install_mysql.sh deleted file mode 100644 index 400bcf40cb..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/scripts/install_mysql.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/scripts/start_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/scripts/start_mysql.sh deleted file mode 100644 index 648bd45756..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/scripts/start_mysql.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/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/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/images/mysql.png Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/images/mysql.png +++ /dev/null diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/mysql.yml deleted file mode 100644 index dc5ff158c8..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -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/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/scripts/install_mysql2.sh b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/scripts/install_mysql2.sh deleted file mode 100644 index 400bcf40cb..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/scripts/install_mysql2.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/scripts/start_mysql2.sh b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/scripts/start_mysql2.sh deleted file mode 100644 index 648bd45756..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/scripts/start_mysql2.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/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/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/topology.txt b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/topology.txt deleted file mode 100644 index cb3c3e8546..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/topology.txt +++ /dev/null @@ -1 +0,0 @@ -{"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/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/topologyTemplate.txt b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/topologyTemplate.txt deleted file mode 100644 index f0d0849db8..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/topologyTemplate.txt +++ /dev/null @@ -1,2 +0,0 @@ -{"id":"9c063349-2259-40fe-97f1-7c40e659e1b0","name":"Andrey","description":null,"topologyId":"6a4b2f9d-7fe1-482d-af11-97f483dff5b7"} - diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource1/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource1/images/mysql.png Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource1/images/mysql.png +++ /dev/null diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource1/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource1/mysql.yml deleted file mode 100644 index 4ee2c8ca88..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource1/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -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/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource2/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource2/images/mysql.png Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource2/images/mysql.png +++ /dev/null diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource2/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource2/mysql.yml deleted file mode 100644 index b564dd0c4e..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource2/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -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/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/topology.txt b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/topology.txt deleted file mode 100644 index 279351879a..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/topology.txt +++ /dev/null @@ -1 +0,0 @@ -{"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/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/topologyTemplate.txt b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/topologyTemplate.txt deleted file mode 100644 index 3c342f6cd1..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/topologyTemplate.txt +++ /dev/null @@ -1,2 +0,0 @@ -{"id":"25845cce-05c8-4502-b5fe-abfd6bd6f28e","name":"ServiceArtListNoContent","description":null,"topologyId":"3293c9c8-a162-43fc-b8d1-431399f89cb7"} - diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/images/mysql.png Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/images/mysql.png +++ /dev/null diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/mysql.yml deleted file mode 100644 index e0a0c6458e..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -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/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/scripts/install_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/scripts/install_mysql.sh deleted file mode 100644 index 400bcf40cb..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/scripts/install_mysql.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/scripts/start_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/scripts/start_mysql.sh deleted file mode 100644 index 648bd45756..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/scripts/start_mysql.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/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/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/images/mysql.png Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/images/mysql.png +++ /dev/null diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/mysql.yml deleted file mode 100644 index dc5ff158c8..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -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/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/scripts/install_mysql2.sh b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/scripts/install_mysql2.sh deleted file mode 100644 index 400bcf40cb..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/scripts/install_mysql2.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/scripts/start_mysql2.sh b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/scripts/start_mysql2.sh deleted file mode 100644 index 648bd45756..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/scripts/start_mysql2.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/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/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/topology.txt b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/topology.txt deleted file mode 100644 index cb3c3e8546..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/topology.txt +++ /dev/null @@ -1 +0,0 @@ -{"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/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/topologyTemplate.txt b/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/topologyTemplate.txt deleted file mode 100644 index f0d0849db8..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/topologyTemplate.txt +++ /dev/null @@ -1,2 +0,0 @@ -{"id":"9c063349-2259-40fe-97f1-7c40e659e1b0","name":"Andrey","description":null,"topologyId":"6a4b2f9d-7fe1-482d-af11-97f483dff5b7"} - diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/images/mysql.png Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/images/mysql.png +++ /dev/null diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/mysql.yml deleted file mode 100644 index e0a0c6458e..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -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/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/install_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/install_mysql.sh deleted file mode 100644 index 400bcf40cb..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/install_mysql.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/start_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/start_mysql.sh deleted file mode 100644 index 648bd45756..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/start_mysql.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/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/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/images/mysql.png Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/images/mysql.png +++ /dev/null diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/mysql.yml deleted file mode 100644 index dc5ff158c8..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -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/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/install_mysql2.sh b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/install_mysql2.sh deleted file mode 100644 index 400bcf40cb..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/install_mysql2.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/start_mysql2.sh b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/start_mysql2.sh deleted file mode 100644 index 648bd45756..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/start_mysql2.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/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/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/topology.txt b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/topology.txt deleted file mode 100644 index cb3c3e8546..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/topology.txt +++ /dev/null @@ -1 +0,0 @@ -{"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/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/topologyTemplate.txt b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/topologyTemplate.txt deleted file mode 100644 index f0d0849db8..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/topologyTemplate.txt +++ /dev/null @@ -1,2 +0,0 @@ -{"id":"9c063349-2259-40fe-97f1-7c40e659e1b0","name":"Andrey","description":null,"topologyId":"6a4b2f9d-7fe1-482d-af11-97f483dff5b7"} - diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/images/mysql.png Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/images/mysql.png +++ /dev/null diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/mysql.yml deleted file mode 100644 index 4ee2c8ca88..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -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/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/images/mysql.png Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/images/mysql.png +++ /dev/null diff --git a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/mysql.yml deleted file mode 100644 index b564dd0c4e..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -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/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/topology.txt b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/topology.txt deleted file mode 100644 index 279351879a..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/topology.txt +++ /dev/null @@ -1 +0,0 @@ -{"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/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/topologyTemplate.txt b/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/topologyTemplate.txt deleted file mode 100644 index 3c342f6cd1..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/topologyTemplate.txt +++ /dev/null @@ -1,2 +0,0 @@ -{"id":"25845cce-05c8-4502-b5fe-abfd6bd6f28e","name":"ServiceArtListNoContent","description":null,"topologyId":"3293c9c8-a162-43fc-b8d1-431399f89cb7"} - diff --git a/test-apis-ci/src/test/resources/CI/tests/uploadComponent/images/mysql.png b/test-apis-ci/src/test/resources/CI/tests/uploadComponent/images/mysql.png Binary files differdeleted file mode 100644 index 8e02f49b7b..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/uploadComponent/images/mysql.png +++ /dev/null diff --git a/test-apis-ci/src/test/resources/CI/tests/uploadComponent/mysql.yml b/test-apis-ci/src/test/resources/CI/tests/uploadComponent/mysql.yml deleted file mode 100644 index a2eb4d423a..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/uploadComponent/mysql.yml +++ /dev/null @@ -1,85 +0,0 @@ -tosca_definitions_version: tosca_simple_yaml_1_0_0_wd03 -description: MySQL RDBMS installation on a specific mounted volume path. -template_name: mysql-uploadComponent -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-uploadComponent: - 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 - 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: - derived_from: tosca.capabilities.Container - -artifact_types: - tosca.artifacts.GroovyScript: - description: A groovy script (.groovy file) - file_ext: [groovy] diff --git a/test-apis-ci/src/test/resources/CI/tests/uploadComponent/scripts/install_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/uploadComponent/scripts/install_mysql.sh deleted file mode 100644 index 400bcf40cb..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/uploadComponent/scripts/install_mysql.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/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/test-apis-ci/src/test/resources/CI/tests/uploadComponent/scripts/start_mysql.sh b/test-apis-ci/src/test/resources/CI/tests/uploadComponent/scripts/start_mysql.sh deleted file mode 100644 index 648bd45756..0000000000 --- a/test-apis-ci/src/test/resources/CI/tests/uploadComponent/scripts/start_mysql.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/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/ui-ci/pom.xml b/ui-ci/pom.xml index d55a93fb73..20597acbde 100644 --- a/ui-ci/pom.xml +++ b/ui-ci/pom.xml @@ -11,6 +11,10 @@ <artifactId>sdc-main</artifactId> <version>1.2.0-SNAPSHOT</version> </parent> + + <properties> + <sonar.skip>true</sonar.skip> + </properties> <dependencies> <dependency> |