Commit b9d1c103 authored by Paul Gevers's avatar Paul Gevers Committed by Otto Kekäläinen
Browse files

Add autopkg tests for MariaDB 10.0 (Closes: #809022)

Tests based on the ones in MySQL 5.6.
parent 866de63d
......@@ -29,6 +29,7 @@ Standards-Version: 3.9.8
Homepage: http://mariadb.org/
Vcs-Git: git://anonscm.debian.org/pkg-mysql/mariadb-10.0.git
Vcs-Browser: https://anonscm.debian.org/cgit/pkg-mysql/mariadb-10.0.git/
Testsuite: autopkgtest
Package: libmariadbd18
Architecture: any
......
Tests: smoke
Depends: mariadb-server-10.0
Restrictions: allow-stderr needs-root
Tests: upstream
Depends: mariadb-test
Restrictions: allow-stderr breaks-testbed
#!/bin/sh
set -ex
# dep8 smoke test for mysql-server
# Author: Robie Basak <robie.basak at canonical.com>
#
# This test should be declared in debian/tests/control with a dependency
# on the package that provides a configured MariaDB server (eg.
# mariadb-server-10.0).
#
# This test should be declared in debian/tests/control with the
# following restrictions:
#
# needs-root (to be able to log into the database)
# allow-stderr
#
# This test:
#
# 1) Creates a test database and test user as the root user.
#
# 2) Creates a test table and checks it appears to operate normally
# using the test user and test database.
mysql <<EOT
CREATE DATABASE testdatabase;
CREATE USER 'testuser'@'localhost' identified by 'testpassword';
GRANT ALL ON testdatabase.* TO 'testuser'@'localhost';
EOT
mysql testdatabase <<EOT
CREATE TABLE foo (bar INTEGER);
INSERT INTO foo (bar) VALUES (41);
EOT
result=`echo 'SELECT bar+1 FROM foo;'|mysql --batch --skip-column-names --user=testuser --password=testpassword testdatabase`
if [ "$result" != "42" ]; then
echo "Unexpected result" >&2
exit 1
fi
mysql --user=testuser --password=testpassword testdatabase <<EOT
DROP TABLE foo;
EOT
mysql <<EOT
DROP DATABASE testdatabase;
DROP USER 'testuser'@'localhost';
EOT
#!/bin/sh
# autopkgtest check: Build and run the upstream test suite.
# (C) 2012 Canonical Ltd.
# Author: Daniel Kessel <d.kessel@gmx.de>
# running the mysql testsuite as described in:
# https://bugs.launchpad.net/ubuntu/+source/mysql-5.5/+bug/959683
echo "running test 'testsuite'"
set -e
SKIP_TEST_LST="/tmp/skip-test.lst"
WORKDIR=$(mktemp -d)
trap "rm -rf $WORKDIRi $SKIP_TEST_LST" 0 INT QUIT ABRT PIPE TERM
cd $WORKDIR
mkdir var
mkdir tmp
echo "using vardir: $WORKDIR/var"
echo "using tmpdir: $WORKDIR/tmp"
echo "Setting up skip-tests-list"
cat > $SKIP_TEST_LST << EOF
binlog.binlog_server_start_options : Requires writable /usr
main.ctype_uca : Requires writable /usr
rpl.rpl_gtid_mode : Requires starting server as root ref http://bugs.mysql.com/bug.php?id=70517
EOF
cd /usr/share/mysql/mysql-test
echo "starting mysql-test-tun.pl..."
./mysql-test-run.pl --suite=main --vardir=$WORKDIR/var --tmpdir=$WORKDIR/tmp \
--skip-ndbcluster --parallel=auto --skip-rpl \
--force --skip-test-list=$SKIP_TEST_LST $@ 2>&1
echo "run: OK"
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment