From bb77698412d88a95c0b34eccb920e7de10f08be5 Mon Sep 17 00:00:00 2001 From: Yuli Shlosberg Date: Wed, 11 Oct 2017 10:13:14 +0300 Subject: remove mysql png from sdc code Change-Id: Iafa81a8b8496eb60ade3f6c840776c65f69ee2e0 Issue-Id: SDC-450 Signed-off-by: Yuli Shlosberg --- .../images/mysql.png | Bin 63119 -> 0 bytes .../getResourceArtifactFileContentTest/mysql.yml | 85 ----- .../scripts/install_mysql.sh | 28 -- .../scripts/start_mysql.sh | 105 ------ .../getResourceArtifactListNoContentTest/mysql.yml | 85 ----- .../getResourceArtifactListTest/images/mysql.png | Bin 63119 -> 0 bytes .../CI/tests/getResourceArtifactListTest/mysql.yml | 85 ----- .../scripts/install_mysql.sh | 28 -- .../scripts/start_mysql.sh | 105 ------ .../mysql.yml | 85 ----- .../images/mysql.png | Bin 63119 -> 0 bytes .../getResourceArtifactMetadataTest/mysql.yml | 85 ----- .../scripts/install_mysql.sh | 28 -- .../scripts/start_mysql.sh | 105 ------ .../mysql.yml | 85 ----- .../resource1/images/mysql.png | Bin 63119 -> 0 bytes .../resource1/mysql.yml | 85 ----- .../resource1/scripts/install_mysql.sh | 28 -- .../resource1/scripts/start_mysql.sh | 105 ------ .../resource2/images/mysql.png | Bin 63119 -> 0 bytes .../resource2/mysql.yml | 85 ----- .../resource2/scripts/install_mysql2.sh | 28 -- .../resource2/scripts/start_mysql2.sh | 105 ------ .../topology.txt | 1 - .../topologyTemplate.txt | 2 - .../resource1/images/mysql.png | Bin 63119 -> 0 bytes .../resource1/mysql.yml | 85 ----- .../resource2/images/mysql.png | Bin 63119 -> 0 bytes .../resource2/mysql.yml | 85 ----- .../topology.txt | 1 - .../topologyTemplate.txt | 2 - .../resource1/images/mysql.png | Bin 63119 -> 0 bytes .../getServiceArtifactListTest/resource1/mysql.yml | 85 ----- .../resource1/scripts/install_mysql.sh | 28 -- .../resource1/scripts/start_mysql.sh | 105 ------ .../resource2/images/mysql.png | Bin 63119 -> 0 bytes .../getServiceArtifactListTest/resource2/mysql.yml | 85 ----- .../resource2/scripts/install_mysql2.sh | 28 -- .../resource2/scripts/start_mysql2.sh | 105 ------ .../tests/getServiceArtifactListTest/topology.txt | 1 - .../topologyTemplate.txt | 2 - .../Service1/resource1/images/mysql.png | Bin 63119 -> 0 bytes .../Service1/resource1/mysql.yml | 85 ----- .../Service1/resource1/scripts/install_mysql.sh | 28 -- .../Service1/resource1/scripts/start_mysql.sh | 105 ------ .../Service1/resource2/images/mysql.png | Bin 63119 -> 0 bytes .../Service1/resource2/mysql.yml | 85 ----- .../Service1/resource2/scripts/install_mysql2.sh | 28 -- .../Service1/resource2/scripts/start_mysql2.sh | 105 ------ .../tests/getServiceListTest/Service1/topology.txt | 1 - .../Service1/topologyTemplate.txt | 2 - .../Service2/resource1/images/mysql.png | Bin 63119 -> 0 bytes .../Service2/resource1/mysql.yml | 85 ----- .../Service2/resource2/images/mysql.png | Bin 63119 -> 0 bytes .../Service2/resource2/mysql.yml | 85 ----- .../tests/getServiceListTest/Service2/topology.txt | 1 - .../Service2/topologyTemplate.txt | 2 - .../CI/tests/uploadComponent/images/mysql.png | Bin 63119 -> 0 bytes .../resources/CI/tests/uploadComponent/mysql.yml | 85 ----- .../tests/uploadComponent/scripts/install_mysql.sh | 28 -- .../tests/uploadComponent/scripts/start_mysql.sh | 105 ------ .../test/resources/config/elasticsearch.yml.bak | 387 --------------------- .../resources/config/mysql-type-empty-nodes.zip | Bin 1894 -> 0 bytes .../test/resources/config/mysql-type-no-nodes.zip | Bin 448 -> 0 bytes .../resources/config/mysql-type-no-version.zip | Bin 1142 -> 0 bytes .../test/resources/config/mysql-type-only-yaml.zip | Bin 1129 -> 0 bytes .../resources/config/mysql-type-with-scripts.zip | Bin 66267 -> 0 bytes .../src/test/resources/config/mysql-type.yml | 82 ----- .../src/test/resources/config/mysql-type.zip | Bin 1129 -> 0 bytes catalog-be/src/test/resources/config/sample.yaml | 17 - .../test/resources/config/sampleNoProtocol.yaml | 17 - .../images/mysql.png | Bin 63119 -> 0 bytes .../getResourceArtifactFileContentTest/mysql.yml | 85 ----- .../scripts/install_mysql.sh | 28 -- .../scripts/start_mysql.sh | 105 ------ .../getResourceArtifactListNoContentTest/mysql.yml | 85 ----- .../getResourceArtifactListTest/images/mysql.png | Bin 63119 -> 0 bytes .../CI/tests/getResourceArtifactListTest/mysql.yml | 85 ----- .../scripts/install_mysql.sh | 28 -- .../scripts/start_mysql.sh | 105 ------ .../mysql.yml | 85 ----- .../images/mysql.png | Bin 63119 -> 0 bytes .../getResourceArtifactMetadataTest/mysql.yml | 85 ----- .../scripts/install_mysql.sh | 28 -- .../scripts/start_mysql.sh | 105 ------ .../mysql.yml | 85 ----- .../resource1/images/mysql.png | Bin 63119 -> 0 bytes .../resource1/mysql.yml | 85 ----- .../resource1/scripts/install_mysql.sh | 28 -- .../resource1/scripts/start_mysql.sh | 105 ------ .../resource2/images/mysql.png | Bin 63119 -> 0 bytes .../resource2/mysql.yml | 85 ----- .../resource2/scripts/install_mysql2.sh | 28 -- .../resource2/scripts/start_mysql2.sh | 105 ------ .../topology.txt | 1 - .../topologyTemplate.txt | 2 - .../resource1/images/mysql.png | Bin 63119 -> 0 bytes .../resource1/mysql.yml | 85 ----- .../resource2/images/mysql.png | Bin 63119 -> 0 bytes .../resource2/mysql.yml | 85 ----- .../topology.txt | 1 - .../topologyTemplate.txt | 2 - .../resource1/images/mysql.png | Bin 63119 -> 0 bytes .../getServiceArtifactListTest/resource1/mysql.yml | 85 ----- .../resource1/scripts/install_mysql.sh | 28 -- .../resource1/scripts/start_mysql.sh | 105 ------ .../resource2/images/mysql.png | Bin 63119 -> 0 bytes .../getServiceArtifactListTest/resource2/mysql.yml | 85 ----- .../resource2/scripts/install_mysql2.sh | 28 -- .../resource2/scripts/start_mysql2.sh | 105 ------ .../tests/getServiceArtifactListTest/topology.txt | 1 - .../topologyTemplate.txt | 2 - .../Service1/resource1/images/mysql.png | Bin 63119 -> 0 bytes .../Service1/resource1/mysql.yml | 85 ----- .../Service1/resource1/scripts/install_mysql.sh | 28 -- .../Service1/resource1/scripts/start_mysql.sh | 105 ------ .../Service1/resource2/images/mysql.png | Bin 63119 -> 0 bytes .../Service1/resource2/mysql.yml | 85 ----- .../Service1/resource2/scripts/install_mysql2.sh | 28 -- .../Service1/resource2/scripts/start_mysql2.sh | 105 ------ .../tests/getServiceListTest/Service1/topology.txt | 1 - .../Service1/topologyTemplate.txt | 2 - .../Service2/resource1/images/mysql.png | Bin 63119 -> 0 bytes .../Service2/resource1/mysql.yml | 85 ----- .../Service2/resource2/images/mysql.png | Bin 63119 -> 0 bytes .../Service2/resource2/mysql.yml | 85 ----- .../tests/getServiceListTest/Service2/topology.txt | 1 - .../Service2/topologyTemplate.txt | 2 - .../CI/tests/uploadComponent/images/mysql.png | Bin 63119 -> 0 bytes .../resources/CI/tests/uploadComponent/mysql.yml | 85 ----- .../tests/uploadComponent/scripts/install_mysql.sh | 28 -- .../tests/uploadComponent/scripts/start_mysql.sh | 105 ------ 132 files changed, 6083 deletions(-) delete mode 100644 asdc-tests/src/test/resources/CI/tests/getResourceArtifactFileContentTest/images/mysql.png delete mode 100644 asdc-tests/src/test/resources/CI/tests/getResourceArtifactFileContentTest/mysql.yml delete mode 100644 asdc-tests/src/test/resources/CI/tests/getResourceArtifactFileContentTest/scripts/install_mysql.sh delete mode 100644 asdc-tests/src/test/resources/CI/tests/getResourceArtifactFileContentTest/scripts/start_mysql.sh delete mode 100644 asdc-tests/src/test/resources/CI/tests/getResourceArtifactListNoContentTest/mysql.yml delete mode 100644 asdc-tests/src/test/resources/CI/tests/getResourceArtifactListTest/images/mysql.png delete mode 100644 asdc-tests/src/test/resources/CI/tests/getResourceArtifactListTest/mysql.yml delete mode 100644 asdc-tests/src/test/resources/CI/tests/getResourceArtifactListTest/scripts/install_mysql.sh delete mode 100644 asdc-tests/src/test/resources/CI/tests/getResourceArtifactListTest/scripts/start_mysql.sh delete mode 100644 asdc-tests/src/test/resources/CI/tests/getResourceArtifactMetadataNoContentTest/mysql.yml delete mode 100644 asdc-tests/src/test/resources/CI/tests/getResourceArtifactMetadataTest/images/mysql.png delete mode 100644 asdc-tests/src/test/resources/CI/tests/getResourceArtifactMetadataTest/mysql.yml delete mode 100644 asdc-tests/src/test/resources/CI/tests/getResourceArtifactMetadataTest/scripts/install_mysql.sh delete mode 100644 asdc-tests/src/test/resources/CI/tests/getResourceArtifactMetadataTest/scripts/start_mysql.sh delete mode 100644 asdc-tests/src/test/resources/CI/tests/getResourceArtifactPayloadNoContentTest/mysql.yml delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/images/mysql.png delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/mysql.yml delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/scripts/install_mysql.sh delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/scripts/start_mysql.sh delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/images/mysql.png delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/mysql.yml delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/scripts/install_mysql2.sh delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/scripts/start_mysql2.sh delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/topology.txt delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/topologyTemplate.txt delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource1/images/mysql.png delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource1/mysql.yml delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource2/images/mysql.png delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource2/mysql.yml delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/topology.txt delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/topologyTemplate.txt delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/images/mysql.png delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/mysql.yml delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/scripts/install_mysql.sh delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/scripts/start_mysql.sh delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/images/mysql.png delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/mysql.yml delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/scripts/install_mysql2.sh delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/scripts/start_mysql2.sh delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/topology.txt delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/topologyTemplate.txt delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/images/mysql.png delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/mysql.yml delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/install_mysql.sh delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/start_mysql.sh delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/images/mysql.png delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/mysql.yml delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/install_mysql2.sh delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/start_mysql2.sh delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/topology.txt delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/topologyTemplate.txt delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/images/mysql.png delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/mysql.yml delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/images/mysql.png delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/mysql.yml delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/topology.txt delete mode 100644 asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/topologyTemplate.txt delete mode 100644 asdc-tests/src/test/resources/CI/tests/uploadComponent/images/mysql.png delete mode 100644 asdc-tests/src/test/resources/CI/tests/uploadComponent/mysql.yml delete mode 100644 asdc-tests/src/test/resources/CI/tests/uploadComponent/scripts/install_mysql.sh delete mode 100644 asdc-tests/src/test/resources/CI/tests/uploadComponent/scripts/start_mysql.sh delete mode 100644 catalog-be/src/test/resources/config/elasticsearch.yml.bak delete mode 100644 catalog-be/src/test/resources/config/mysql-type-empty-nodes.zip delete mode 100644 catalog-be/src/test/resources/config/mysql-type-no-nodes.zip delete mode 100644 catalog-be/src/test/resources/config/mysql-type-no-version.zip delete mode 100644 catalog-be/src/test/resources/config/mysql-type-only-yaml.zip delete mode 100644 catalog-be/src/test/resources/config/mysql-type-with-scripts.zip delete mode 100644 catalog-be/src/test/resources/config/mysql-type.yml delete mode 100644 catalog-be/src/test/resources/config/mysql-type.zip delete mode 100644 catalog-be/src/test/resources/config/sample.yaml delete mode 100644 catalog-be/src/test/resources/config/sampleNoProtocol.yaml delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/images/mysql.png delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/mysql.yml delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/scripts/install_mysql.sh delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/scripts/start_mysql.sh delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListNoContentTest/mysql.yml delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/images/mysql.png delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/mysql.yml delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/scripts/install_mysql.sh delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/scripts/start_mysql.sh delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataNoContentTest/mysql.yml delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/images/mysql.png delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/mysql.yml delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/scripts/install_mysql.sh delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/scripts/start_mysql.sh delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getResourceArtifactPayloadNoContentTest/mysql.yml delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/images/mysql.png delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/mysql.yml delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/scripts/install_mysql.sh delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/scripts/start_mysql.sh delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/images/mysql.png delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/mysql.yml delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/scripts/install_mysql2.sh delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/scripts/start_mysql2.sh delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/topology.txt delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/topologyTemplate.txt delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource1/images/mysql.png delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource1/mysql.yml delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource2/images/mysql.png delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource2/mysql.yml delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/topology.txt delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/topologyTemplate.txt delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/images/mysql.png delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/mysql.yml delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/scripts/install_mysql.sh delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/scripts/start_mysql.sh delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/images/mysql.png delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/mysql.yml delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/scripts/install_mysql2.sh delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/scripts/start_mysql2.sh delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/topology.txt delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/topologyTemplate.txt delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/images/mysql.png delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/mysql.yml delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/install_mysql.sh delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/scripts/start_mysql.sh delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/images/mysql.png delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/mysql.yml delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/install_mysql2.sh delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/scripts/start_mysql2.sh delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/topology.txt delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/topologyTemplate.txt delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/images/mysql.png delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/mysql.yml delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/images/mysql.png delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/mysql.yml delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/topology.txt delete mode 100644 test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/topologyTemplate.txt delete mode 100644 test-apis-ci/src/test/resources/CI/tests/uploadComponent/images/mysql.png delete mode 100644 test-apis-ci/src/test/resources/CI/tests/uploadComponent/mysql.yml delete mode 100644 test-apis-ci/src/test/resources/CI/tests/uploadComponent/scripts/install_mysql.sh delete mode 100644 test-apis-ci/src/test/resources/CI/tests/uploadComponent/scripts/start_mysql.sh 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactFileContentTest/images/mysql.png and /dev/null differ 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactListTest/images/mysql.png and /dev/null differ 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/asdc-tests/src/test/resources/CI/tests/getResourceArtifactMetadataTest/images/mysql.png and /dev/null differ 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/images/mysql.png and /dev/null differ 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/images/mysql.png and /dev/null differ 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource1/images/mysql.png and /dev/null differ 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource2/images/mysql.png and /dev/null differ 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/images/mysql.png and /dev/null differ 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/asdc-tests/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/images/mysql.png and /dev/null differ 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/images/mysql.png and /dev/null differ diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/mysql.yml b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/mysql.yml 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/images/mysql.png and /dev/null differ diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/mysql.yml b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/mysql.yml 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/images/mysql.png and /dev/null differ diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/mysql.yml b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/mysql.yml 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/images/mysql.png and /dev/null differ diff --git a/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/mysql.yml b/asdc-tests/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/mysql.yml 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/asdc-tests/src/test/resources/CI/tests/uploadComponent/images/mysql.png and /dev/null differ 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/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 . -# -# The installation procedure is covered at -# . -# -# 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 -# - - -################################### 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 , -# , -# and -# 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 and -# -# 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 () 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 -# . - -# 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 -# - -# 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 -# -# -# See -# 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 . - -# 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 . - -################################## 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 deleted file mode 100644 index d317bccd1e..0000000000 Binary files a/catalog-be/src/test/resources/config/mysql-type-empty-nodes.zip and /dev/null differ 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 deleted file mode 100644 index 09999faed5..0000000000 Binary files a/catalog-be/src/test/resources/config/mysql-type-no-nodes.zip and /dev/null differ 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 deleted file mode 100644 index fa1319f311..0000000000 Binary files a/catalog-be/src/test/resources/config/mysql-type-no-version.zip and /dev/null differ 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 deleted file mode 100644 index b4b1946940..0000000000 Binary files a/catalog-be/src/test/resources/config/mysql-type-only-yaml.zip and /dev/null differ 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 deleted file mode 100644 index d689b668a1..0000000000 Binary files a/catalog-be/src/test/resources/config/mysql-type-with-scripts.zip and /dev/null differ 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 deleted file mode 100644 index b4b1946940..0000000000 Binary files a/catalog-be/src/test/resources/config/mysql-type.zip and /dev/null differ 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/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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactFileContentTest/images/mysql.png and /dev/null differ 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactListTest/images/mysql.png and /dev/null differ 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/test-apis-ci/src/test/resources/CI/tests/getResourceArtifactMetadataTest/images/mysql.png and /dev/null differ 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource1/images/mysql.png and /dev/null differ 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListInvalidVersionNotFoundTest/resource2/images/mysql.png and /dev/null differ 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource1/images/mysql.png and /dev/null differ 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListNoContentTest/resource2/images/mysql.png and /dev/null differ 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource1/images/mysql.png and /dev/null differ 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/test-apis-ci/src/test/resources/CI/tests/getServiceArtifactListTest/resource2/images/mysql.png and /dev/null differ 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource1/images/mysql.png and /dev/null differ 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service1/resource2/images/mysql.png and /dev/null differ 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource1/images/mysql.png and /dev/null differ 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/test-apis-ci/src/test/resources/CI/tests/getServiceListTest/Service2/resource2/images/mysql.png and /dev/null differ 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 deleted file mode 100644 index 8e02f49b7b..0000000000 Binary files a/test-apis-ci/src/test/resources/CI/tests/uploadComponent/images/mysql.png and /dev/null differ 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 -- cgit 1.2.3-korg