Source: mysql-5.6
Version: 5.6.25-3
Severity: wishlist
Tags: patch

The attached patch adds a dep8 test that runs sysbench against the server
for 60s. This reproduces a data corruption issue on arm64 and ppc64el
on certain systems.
diff -urpN mysql-5.6-5.6.25.orig/debian/tests/control mysql-5.6-5.6.25/debian/tests/control
--- mysql-5.6-5.6.25.orig/debian/tests/control	2015-07-22 10:51:55.000000000 -0600
+++ mysql-5.6-5.6.25/debian/tests/control	2015-07-24 11:54:12.973732556 -0600
@@ -2,6 +2,10 @@ Tests: smoke
 Depends: mysql-server-5.6
 Restrictions: allow-stderr needs-root breaks-testbed
 
+Tests: sysbench
+Depends: mysql-server-5.6, sysbench
+Restrictions: allow-stderr needs-root breaks-testbed
+
 Tests: upstream
 Depends: mysql-testsuite-5.6
 Restrictions: allow-stderr breaks-testbed
diff -urpN mysql-5.6-5.6.25.orig/debian/tests/sysbench mysql-5.6-5.6.25/debian/tests/sysbench
--- mysql-5.6-5.6.25.orig/debian/tests/sysbench	1969-12-31 17:00:00.000000000 -0700
+++ mysql-5.6-5.6.25/debian/tests/sysbench	2015-07-24 11:55:22.526624572 -0600
@@ -0,0 +1,57 @@
+#!/bin/sh
+set -ex
+
+# dep8 sysbench test for mysql-server
+# Author: dann frazier <da...@debian.org>
+#
+# This test should be declared in debian/tests/control with the
+# following restrictions:
+#
+# needs-root (needed to reset the root mysql password)
+# breaks-testbed (because it resets the root mysql password)
+# allow-stderr
+#
+# This test runs sysbench against a test database. The goal is to see if the
+# server is stable enough to deal with multiple threads of concurrent activity.
+# It serves as a regression test for LP: #1427406 (arm64/ppc64-specific).
+#
+
+debconf-set-selections <<EOT
+mysql-server-5.6 mysql-server/root_password password rootpassword
+mysql-server-5.6 mysql-server/root_password_again password rootpassword
+EOT
+
+DEBIAN_FRONTEND=noninteractive dpkg-reconfigure mysql-server-5.6
+
+cleanup() {
+    local ret=0
+    local mysqlclient="mysql --user=root --password=rootpassword"
+
+    echo "DROP DATABASE sbtest;" | $mysqlclient || ret=1
+    echo "DROP USER 'testuser'@'localhost';" | $mysqlclient || ret=1
+
+    return $ret
+}
+
+do_sysbench() {
+    sysbench \
+	--test=oltp \
+	--num-threads=128 \
+	--max-time=60 \
+	--mysql-user=testuser \
+	--mysql-password=testpassword \
+	$1
+}
+
+cleanup || /bin/true # in case a previous run failed
+
+mysql --user=root --password=rootpassword <<EOT
+CREATE DATABASE sbtest;
+CREATE USER 'testuser'@'localhost' identified by 'testpassword';
+GRANT ALL ON sbtest.* TO 'testuser'@'localhost';
+EOT
+
+do_sysbench prepare
+do_sysbench run
+
+cleanup

Reply via email to