[debian-mysql] Bug#809022: autopkgtest patch for MariaDB
Paul Gevers
elbrus at debian.org
Sat Jul 9 13:06:14 UTC 2016
Control: tags -1 patch
Hi Otto,
Please find attached a patch and the individual files, whatever you find
more convenient) for adding autopkgtest to MariaDB (tested with 10.0)
Paul
-------------- next part --------------
Tests: smoke
Depends: mariadb-server-10.0
Restrictions: allow-stderr needs-root
Tests: upstream
Depends: mariadb-test
Restrictions: allow-stderr breaks-testbed
-------------- next part --------------
#!/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
-------------- next part --------------
#!/bin/sh
# autopkgtest check: Build and run the upstream test suite.
# (C) 2012 Canonical Ltd.
# Author: Daniel Kessel <d.kessel at 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"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: mariadb_autopkgtest.diff
Type: text/x-patch
Size: 3028 bytes
Desc: not available
URL: <http://lists.alioth.debian.org/pipermail/pkg-mysql-maint/attachments/20160709/dabf22a9/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: OpenPGP digital signature
URL: <http://lists.alioth.debian.org/pipermail/pkg-mysql-maint/attachments/20160709/dabf22a9/attachment.sig>
More information about the pkg-mysql-maint
mailing list