2 suite: test configmap behavior
6 - it: "should render with default value"
12 value: RELEASE-NAME-mariadb-init
14 path: metadata.namespace
17 path: metadata.labels.app
24 # Copyright © 2019 Orange
26 # Licensed under the Apache License, Version 2.0 (the "License");
27 # you may not use this file except in compliance with the License.
28 # You may obtain a copy of the License at
30 # http://www.apache.org/licenses/LICENSE-2.0
32 # Unless required by applicable law or agreed to in writing, software
33 # distributed under the License is distributed on an "AS IS" BASIS,
34 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
35 # See the License for the specific language governing permissions and
36 # limitations under the License.
38 echo "Creating database ynsaUCru6mUNwGal and user u5WZ1GMSIS1wHZF..."
40 mysql -h ${DB_HOST} -P ${DB_PORT} -uroot -p$MYSQL_ROOT_PASSWORD << 'EOF' || exit 1
41 CREATE OR REPLACE USER 'u5WZ1GMSIS1wHZF'@'localhost' IDENTIFIED BY '${MYSQL_PASSWORD}';
42 CREATE OR REPLACE USER 'u5WZ1GMSIS1wHZF'@'%' IDENTIFIED BY '${MYSQL_PASSWORD}';
43 CREATE DATABASE IF NOT EXISTS ynsaUCru6mUNwGal;
44 GRANT ALL PRIVILEGES ON ynsaUCru6mUNwGal.* TO 'u5WZ1GMSIS1wHZF'@'%';
45 GRANT ALL PRIVILEGES ON ynsaUCru6mUNwGal.* TO 'u5WZ1GMSIS1wHZF'@'localhost';
48 echo "Created database ynsaUCru6mUNwGal and user u5WZ1GMSIS1wHZF."
49 - it: "shoud render with other databases"
54 mysqlAdditionalDatabases:
67 # Copyright © 2019 Orange
69 # Licensed under the Apache License, Version 2.0 (the "License");
70 # you may not use this file except in compliance with the License.
71 # You may obtain a copy of the License at
73 # http://www.apache.org/licenses/LICENSE-2.0
75 # Unless required by applicable law or agreed to in writing, software
76 # distributed under the License is distributed on an "AS IS" BASIS,
77 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
78 # See the License for the specific language governing permissions and
79 # limitations under the License.
81 echo "Creating database testDB and user testUser..."
83 mysql -h ${DB_HOST} -P ${DB_PORT} -uroot -p$MYSQL_ROOT_PASSWORD << 'EOF' || exit 1
84 CREATE OR REPLACE USER 'testUser'@'localhost' IDENTIFIED BY '${MYSQL_PASSWORD}';
85 CREATE OR REPLACE USER 'testUser'@'%' IDENTIFIED BY '${MYSQL_PASSWORD}';
86 CREATE DATABASE IF NOT EXISTS testDB;
87 GRANT ALL PRIVILEGES ON testDB.* TO 'testUser'@'%';
88 GRANT ALL PRIVILEGES ON testDB.* TO 'testUser'@'localhost';
91 echo "Created database testDB and user testUser."
93 echo "Creating database dbOne and user one..."
95 mysql -h ${DB_HOST} -P ${DB_PORT} -uroot -p$MYSQL_ROOT_PASSWORD << 'EOF' || exit 1
96 CREATE OR REPLACE USER 'one'@'localhost' IDENTIFIED BY '${MYSQL_PASSWORD_DBONE}';
97 CREATE OR REPLACE USER 'one'@'%' IDENTIFIED BY '${MYSQL_PASSWORD_DBONE}';
98 CREATE DATABASE IF NOT EXISTS dbOne;
99 GRANT ALL PRIVILEGES ON dbOne.* TO 'one'@'%';
100 GRANT ALL PRIVILEGES ON dbOne.* TO 'one'@'localhost';
103 echo "Created database dbOne and user one."
104 echo "Creating database dbTwo and user two..."
106 mysql -h ${DB_HOST} -P ${DB_PORT} -uroot -p$MYSQL_ROOT_PASSWORD << 'EOF' || exit 1
107 CREATE OR REPLACE USER 'two'@'localhost' IDENTIFIED BY '${MYSQL_PASSWORD_DBTWO}';
108 CREATE OR REPLACE USER 'two'@'%' IDENTIFIED BY '${MYSQL_PASSWORD_DBTWO}';
109 CREATE DATABASE IF NOT EXISTS dbTwo;
110 GRANT ALL PRIVILEGES ON dbTwo.* TO 'two'@'%';
111 GRANT ALL PRIVILEGES ON dbTwo.* TO 'two'@'localhost';
114 echo "Created database dbTwo and user two."