Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:dirkmueller:acdc:as_python3_module
mariadb104
macros.mariadb-test
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File macros.mariadb-test of Package mariadb104
%__mysql_test_run_dir /tmp/mysql %__mysql_test_user dbuser %__mysql_test_pass dbuserpass %__mysql_test_cconf abuild-myclient.cnf %__mysql_test_port 63306 # # macro: mysql_testserver_start -- start a test mysqld instance # # usage: %mysql_test_start -u <dbuser> -p <dbpassword> -t <port> # %mysql_testserver_start(u:p:t:) \ TEST_RUN_DIR=%{__mysql_test_run_dir} \ TEST_USER="%{-u:%{-u*}}" \ if [ -z "$TEST_USER" ]; then \ TEST_USER='%{__mysql_test_user}' \ fi \ TEST_PASS="%{-p:%{-p*}}" \ if [ -z "$TEST_PASS" ]; then \ TEST_PASS='%{__mysql_test_pass}' \ fi \ TEST_PORT="%{-t:%{-t*}}" \ if [ -z "$TEST_PORT" ]; then \ TEST_PORT='%{__mysql_test_port}' \ fi \ \ [ -d $TEST_RUN_DIR ] && rm -r $TEST_RUN_DIR \ mkdir -p $TEST_RUN_DIR/datadir{,-private} \ \ cat << EOF > $TEST_RUN_DIR/my.cnf \ [client] \ socket = $TEST_RUN_DIR/mysql.sock \ port = $TEST_PORT \ [mysqld] \ user = abuild \ log-error = $TEST_RUN_DIR/mysqld.log \ secure_file_priv = $TEST_RUN_DIR/datadir-private \ datadir = $TEST_RUN_DIR/datadir \ server-id = 1 \ socket = $TEST_RUN_DIR/mysql.sock \ port = $TEST_PORT \ sql_mode = '' \ EOF\ \ echo '>>> Initializing databases' \ mysql_install_db --defaults-file=$TEST_RUN_DIR/my.cnf \ \ echo '>>> Invoking mysqld' \ /usr/sbin/mysqld --defaults-file=$TEST_RUN_DIR/my.cnf& \ sleep 2 \ \ echo '>>> Creating authentication database (credentials: $TEST_USER, $TEST_PASS)' \ mysqladmin --defaults-file=$TEST_RUN_DIR/my.cnf --user=abuild password abuildpw \ mysqladmin --defaults-file=$TEST_RUN_DIR/my.cnf --user=abuild --password=abuildpw create testhat \ cat << EOF > $TEST_RUN_DIR/create_auth.sql \ CREATE USER '$TEST_USER'@'localhost' IDENTIFIED BY '$TEST_PASS'; \ GRANT ALL PRIVILEGES ON * . * TO '$TEST_USER'@'localhost'; \ FLUSH PRIVILEGES; \ EOF\ mysql --defaults-file=$TEST_RUN_DIR/my.cnf --user=abuild --password=abuildpw < $TEST_RUN_DIR/create_auth.sql \ %nil # # macro mysql_testserver_cconf -- generate client access conf # %mysql_testserver_cconf(n:t:) \ TEST_RUN_DIR=%{__mysql_test_run_dir} \ TEST_CCONF="%{-n:%{-n*}}" \ if [ -z "$TEST_CCONF" ]; then \ TEST_CCONF='%{__mysql_test_cconf}' \ fi \ TEST_PORT="%{-t:%{-t*}}" \ if [ -z "$TEST_PORT" ]; then \ TEST_PORT='%{__mysql_test_port}' \ fi \ cat << EOF > $TEST_CCONF \ [client] \ user = abuild \ password = abuildpw \ database = test \ socket = $TEST_RUN_DIR/mysql.sock \ port = $TEST_PORT \ EOF\ %nil # # macro: mysql_testserver_stop -- start a test mysqld instance # # usage: %mysql_test_stop # %mysql_testserver_stop() \ TEST_RUN_DIR=%{__mysql_test_run_dir} \ echo '>>> Shutting the mysql server down' \ cat << EOF > $TEST_RUN_DIR/shutdown.sql \ SHUTDOWN; \ EOF\ mysql --defaults-file=$TEST_RUN_DIR/my.cnf --user=abuild --password=abuildpw < $TEST_RUN_DIR/shutdown.sql \ %nil
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor