summaryrefslogtreecommitdiffstats
path: root/tosca2heat/tosca-parser/toscaparser/tests/artifacts/mysql
diff options
context:
space:
mode:
authorjulien zhang <zhang.jun3g@zte.com.cn>2016-04-22 08:43:26 +0000
committerGerrit Code Review <gerrit@172.30.200.206>2016-04-22 08:43:26 +0000
commit2fa4785aa218cf655f3405d832d2200d64fd033e (patch)
tree0061edccecca9a99aa9a50c6c0e2783c07370112 /tosca2heat/tosca-parser/toscaparser/tests/artifacts/mysql
parent56c2a5d3ba6193c9a98870a264bc5e3aca19a086 (diff)
parentc8201c119ec686e79797721156767685fe848aca (diff)
Merge "Update tosca lib to version 0.5"
Diffstat (limited to 'tosca2heat/tosca-parser/toscaparser/tests/artifacts/mysql')
-rw-r--r--tosca2heat/tosca-parser/toscaparser/tests/artifacts/mysql/mysql_database_configure.sh8
-rw-r--r--tosca2heat/tosca-parser/toscaparser/tests/artifacts/mysql/mysql_dbms_configure.sh5
-rw-r--r--tosca2heat/tosca-parser/toscaparser/tests/artifacts/mysql/mysql_dbms_install.sh9
-rw-r--r--tosca2heat/tosca-parser/toscaparser/tests/artifacts/mysql/mysql_dbms_start.sh2
4 files changed, 24 insertions, 0 deletions
diff --git a/tosca2heat/tosca-parser/toscaparser/tests/artifacts/mysql/mysql_database_configure.sh b/tosca2heat/tosca-parser/toscaparser/tests/artifacts/mysql/mysql_database_configure.sh
new file mode 100644
index 0000000..092136a
--- /dev/null
+++ b/tosca2heat/tosca-parser/toscaparser/tests/artifacts/mysql/mysql_database_configure.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+cat << EOF | mysql -u root --password=$db_root_password
+CREATE DATABASE $db_name;
+GRANT ALL PRIVILEGES ON $db_name.* TO "$db_user"@"localhost"
+IDENTIFIED BY "$db_password";
+FLUSH PRIVILEGES;
+EXIT
+EOF \ No newline at end of file
diff --git a/tosca2heat/tosca-parser/toscaparser/tests/artifacts/mysql/mysql_dbms_configure.sh b/tosca2heat/tosca-parser/toscaparser/tests/artifacts/mysql/mysql_dbms_configure.sh
new file mode 100644
index 0000000..d4ef6b4
--- /dev/null
+++ b/tosca2heat/tosca-parser/toscaparser/tests/artifacts/mysql/mysql_dbms_configure.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+sed --regexp-extended "s/(port\s*=\s*)[0-9]*/\1$db_port/g" </etc/mysql/my.cnf >/tmp/my.cnf
+mv -f /tmp/my.cnf /etc/mysql/my.cnf
+/etc/init.d/mysql stop
+/etc/init.d/mysql start \ No newline at end of file
diff --git a/tosca2heat/tosca-parser/toscaparser/tests/artifacts/mysql/mysql_dbms_install.sh b/tosca2heat/tosca-parser/toscaparser/tests/artifacts/mysql/mysql_dbms_install.sh
new file mode 100644
index 0000000..38628b9
--- /dev/null
+++ b/tosca2heat/tosca-parser/toscaparser/tests/artifacts/mysql/mysql_dbms_install.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+#This script installs mysql server
+
+apt-get update
+
+debconf-set-selections <<< "mysql-server mysql-server/root_password password $db_root_password"
+debconf-set-selections <<< "mysql-server mysql-server/root_password_again password $db_root_password"
+
+apt-get -y install --fix-missing mysql-server \ No newline at end of file
diff --git a/tosca2heat/tosca-parser/toscaparser/tests/artifacts/mysql/mysql_dbms_start.sh b/tosca2heat/tosca-parser/toscaparser/tests/artifacts/mysql/mysql_dbms_start.sh
new file mode 100644
index 0000000..3378670
--- /dev/null
+++ b/tosca2heat/tosca-parser/toscaparser/tests/artifacts/mysql/mysql_dbms_start.sh
@@ -0,0 +1,2 @@
+#!/bin/sh
+/etc/init.d/mysql start \ No newline at end of file