Line 0
Link Here
|
|
|
1 |
# Copyright 1999-2015 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Id$ |
4 |
|
5 |
EAPI="5" |
6 |
MY_EXTRAS_VER="20150717-1707Z" |
7 |
HAS_TOOLS_PATCH="1" |
8 |
SUBSLOT="18" |
9 |
|
10 |
inherit toolchain-funcs mysql-multilib |
11 |
# only to make repoman happy. it is really set in the eclass |
12 |
IUSE="$IUSE tokudb tokudb-backup-plugin" |
13 |
|
14 |
# REMEMBER: also update eclass/mysql*.eclass before committing! |
15 |
KEYWORDS="~alpha ~amd64 ~arm ~ia64 ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd ~x86-linux" |
16 |
|
17 |
# When MY_EXTRAS is bumped, the index should be revised to exclude these. |
18 |
EPATCH_EXCLUDE='' |
19 |
|
20 |
DEPEND="|| ( >=sys-devel/gcc-3.4.6 >=sys-devel/gcc-apple-4.0 ) |
21 |
tokudb? ( app-arch/snappy ) |
22 |
tokudb-backup-plugin? ( dev-util/valgrind )" |
23 |
RDEPEND="${RDEPEND}" |
24 |
|
25 |
REQUIRED_USE="tokudb? ( jemalloc ) tokudb-backup-plugin? ( tokudb )" |
26 |
|
27 |
# Please do not add a naive src_unpack to this ebuild |
28 |
# If you want to add a single patch, copy the ebuild to an overlay |
29 |
# and create your own mysql-extras tarball, looking at 000_index.txt |
30 |
|
31 |
# Official test instructions: |
32 |
# USE='extraengine perl ssl static-libs community' \ |
33 |
# FEATURES='test userpriv -usersandbox' \ |
34 |
# ebuild percona-server-X.X.XX.ebuild \ |
35 |
# digest clean package |
36 |
multilib_src_test() { |
37 |
|
38 |
if ! multilib_is_native_abi ; then |
39 |
einfo "Server tests not available on non-native abi". |
40 |
return 0; |
41 |
fi |
42 |
|
43 |
local TESTDIR="${CMAKE_BUILD_DIR}/mysql-test" |
44 |
local retstatus_unit |
45 |
local retstatus_tests |
46 |
|
47 |
# Bug #213475 - MySQL _will_ object strenously if your machine is named |
48 |
# localhost. Also causes weird failures. |
49 |
[[ "${HOSTNAME}" == "localhost" ]] && die "Your machine must NOT be named localhost" |
50 |
|
51 |
if use server ; then |
52 |
|
53 |
if [[ $UID -eq 0 ]]; then |
54 |
die "Testing with FEATURES=-userpriv is no longer supported by upstream. Tests MUST be run as non-root." |
55 |
fi |
56 |
has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox" |
57 |
|
58 |
einfo ">>> Test phase [test]: ${CATEGORY}/${PF}" |
59 |
addpredict /this-dir-does-not-exist/t9.MYI |
60 |
|
61 |
# Run CTest (test-units) |
62 |
cmake-utils_src_test |
63 |
retstatus_unit=$? |
64 |
[[ $retstatus_unit -eq 0 ]] || eerror "test-unit failed" |
65 |
|
66 |
# Ensure that parallel runs don't die |
67 |
export MTR_BUILD_THREAD="$((${RANDOM} % 100))" |
68 |
# Enable parallel testing, auto will try to detect number of cores |
69 |
# You may set this by hand. |
70 |
# The default maximum is 8 unless MTR_MAX_PARALLEL is increased |
71 |
export MTR_PARALLEL="${MTR_PARALLEL:-auto}" |
72 |
|
73 |
# create directories because mysqladmin might right out of order |
74 |
mkdir -p "${T}"/var-tests{,/log} |
75 |
|
76 |
# Create a symlink to provided binaries so the tests can find them when client-libs is off |
77 |
if ! use client-libs ; then |
78 |
ln -srf /usr/bin/my_print_defaults "${BUILD_DIR}/client/my_print_defaults" || die |
79 |
ln -srf /usr/bin/perror "${BUILD_DIR}/client/perror" || die |
80 |
mysql-multilib_disable_test main.perror "String mismatch due to not building local perror" |
81 |
fi |
82 |
|
83 |
# These are failing in Percona 5.6 for now and are believed to be |
84 |
# false positives: |
85 |
# |
86 |
# main.information_schema, binlog.binlog_statement_insert_delayed, |
87 |
# main.mysqld--help-notwin, binlog.binlog_mysqlbinlog_filter |
88 |
# perfschema.binlog_edge_mix, perfschema.binlog_edge_stmt |
89 |
# funcs_1.is_columns_mysql funcs_1.is_tables_mysql funcs_1.is_triggers |
90 |
# engines/funcs.db_alter_character_set engines/funcs.db_alter_character_set_collate |
91 |
# engines/funcs.db_alter_collate_ascii engines/funcs.db_alter_collate_utf8 |
92 |
# engines/funcs.db_create_character_set engines/funcs.db_create_character_set_collate |
93 |
# fails due to USE=-latin1 / utf8 default |
94 |
# |
95 |
# main.mysql_client_test: |
96 |
# segfaults at random under Portage only, suspect resource limits. |
97 |
# |
98 |
# main.percona_bug1289599 |
99 |
# Looks to be a syntax error in the test file itself |
100 |
# |
101 |
# main.variables main.myisam main.merge_recover |
102 |
# fails due to ulimit not able to open enough files (needs 5000) |
103 |
# |
104 |
# main.mysqlhotcopy_archive main.mysqlhotcopy_myisam |
105 |
# Called with bad parameters should be reported upstream |
106 |
# |
107 |
# innodb_stress.innodb_stress |
108 |
# innodb_stress.innodb_stress_blob innodb_stress.innodb_stress_blob_nocompress |
109 |
# innodb_stress.innodb_stress_crash innodb_stress.innodb_stress_crash_blob |
110 |
# innodb_stress.innodb_stress_crash_blob_nocompress innodb_stress.innodb_stress_crash_nocompress |
111 |
# innodb_stress.innodb_stress_nocompress |
112 |
# Dependent on python2 being the system python |
113 |
|
114 |
for t in main.mysql_client_test \ |
115 |
binlog.binlog_statement_insert_delayed main.information_schema \ |
116 |
main.mysqld--help-notwin binlog.binlog_mysqlbinlog_filter \ |
117 |
perfschema.binlog_edge_mix perfschema.binlog_edge_stmt \ |
118 |
funcs_1.is_columns_mysql funcs_1.is_tables_mysql funcs_1.is_triggers \ |
119 |
main.variables main.myisam main.merge_recover \ |
120 |
engines/funcs.db_alter_character_set engines/funcs.db_alter_character_set_collate \ |
121 |
engines/funcs.db_alter_collate_ascii engines/funcs.db_alter_collate_utf8 \ |
122 |
engines/funcs.db_create_character_set engines/funcs.db_create_character_set_collate \ |
123 |
main.percona_bug1289599 main.mysqlhotcopy_archive main.mysqlhotcopy_myisam ; do |
124 |
mysql-multilib_disable_test "$t" "False positives in Gentoo" |
125 |
done |
126 |
|
127 |
for t in innodb_stress.innodb_stress \ |
128 |
innodb_stress.innodb_stress_blob innodb_stress.innodb_stress_blob_nocompress \ |
129 |
innodb_stress.innodb_stress_crash innodb_stress.innodb_stress_crash_blob \ |
130 |
innodb_stress.innodb_stress_crash_blob_nocompress innodb_stress.innodb_stress_crash_nocompress \ |
131 |
innodb_stress.innodb_stress_nocompress ; do |
132 |
mysql-multilib_disable_test "$t" "False positives due to python exception syntax" |
133 |
done |
134 |
|
135 |
# Run mysql tests |
136 |
pushd "${TESTDIR}" |
137 |
|
138 |
# Set file limits higher so tests run |
139 |
ulimit -n 3000 |
140 |
|
141 |
# run mysql-test tests |
142 |
perl mysql-test-run.pl --force --vardir="${T}/var-tests" \ |
143 |
--testcase-timeout=30 --reorder |
144 |
retstatus_tests=$? |
145 |
[[ $retstatus_tests -eq 0 ]] || eerror "tests failed" |
146 |
has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox" |
147 |
|
148 |
popd |
149 |
|
150 |
# Cleanup is important for these testcases. |
151 |
pkill -9 -f "${S}/ndb" 2>/dev/null |
152 |
pkill -9 -f "${S}/sql" 2>/dev/null |
153 |
|
154 |
failures="" |
155 |
[[ $retstatus_unit -eq 0 ]] || failures="${failures} test-unit" |
156 |
[[ $retstatus_tests -eq 0 ]] || failures="${failures} tests" |
157 |
has usersandbox $FEATURES && eerror "Some tests may fail with FEATURES=usersandbox" |
158 |
|
159 |
[[ -z "$failures" ]] || die "Test failures: $failures" |
160 |
einfo "Tests successfully completed" |
161 |
|
162 |
else |
163 |
|
164 |
einfo "Skipping server tests due to minimal build." |
165 |
fi |
166 |
} |