#!/bin/sh -e
#
# Test the SUSE mysql(-Max) package using the MySQL testsuite

cd /usr/share/mysql-test
if test -n "`/bin/ls var`"; then
	echo "removing temporary files from previous test run"
	rm -rf var/*
fi

if test "`whoami`" = "root"; then
	echo "running as root makes rpl_rotate_logs fail, switchig to user mysql"
	exec su mysql -c "$0 $*"
fi

set -x
./mysql-test-run --master-binary=/usr/sbin/%{mysql_binary} --slave-binary=/usr/sbin/%{mysql_binary} --big-test "$@"
