mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-10 21:19:59 +00:00
46 lines
1.1 KiB
Perl
46 lines
1.1 KiB
Perl
#!/usr/bin/perl
|
|
|
|
BEGIN {
|
|
die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n"
|
|
unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH};
|
|
unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib";
|
|
};
|
|
|
|
use strict;
|
|
use warnings FATAL => 'all';
|
|
use English qw(-no_match_vars);
|
|
use Test::More tests => 3;
|
|
|
|
use VersionParser;
|
|
use PerconaTest;
|
|
|
|
my $vp = new VersionParser;
|
|
|
|
is(
|
|
$vp->parse('5.0.38-Ubuntu_0ubuntu1.1-log'),
|
|
'005000038',
|
|
'Parser works on ordinary version',
|
|
);
|
|
|
|
# Open a connection to MySQL, or skip the rest of the tests.
|
|
use DSNParser;
|
|
use Sandbox;
|
|
my $dp = new DSNParser(opts=>$dsn_opts);
|
|
my $sb = new Sandbox(basedir => '/tmp', DSNParser => $dp);
|
|
my $dbh = $sb->get_dbh_for('master');
|
|
SKIP: {
|
|
skip 'Cannot connect to MySQL', 2 unless $dbh;
|
|
ok($vp->version_ge($dbh, '3.23.00'), 'Version is > 3.23');
|
|
|
|
unlike(
|
|
$vp->innodb_version($dbh),
|
|
qr/DISABLED/,
|
|
"InnoDB version"
|
|
);
|
|
}
|
|
|
|
# #############################################################################
|
|
# Done.
|
|
# #############################################################################
|
|
exit;
|