Compare commits
No commits in common. "c9-beta" and "c10s" have entirely different histories.
1
.fmf/version
Normal file
1
.fmf/version
Normal file
@ -0,0 +1 @@
|
||||
1
|
4
.gitignore
vendored
4
.gitignore
vendored
@ -1 +1,3 @@
|
||||
SOURCES/DBD-MariaDB-1.21.tar.gz
|
||||
/DBD-MariaDB-1.21.tar.gz
|
||||
/DBD-MariaDB-1.22.tar.gz
|
||||
/DBD-MariaDB-1.23.tar.gz
|
||||
|
@ -1 +0,0 @@
|
||||
fe2b6703d1340d82d219b056bf9a6feadf8904bd SOURCES/DBD-MariaDB-1.21.tar.gz
|
19
DBD-MariaDB-1.21-Run-test-setup-and-clean.patch
Normal file
19
DBD-MariaDB-1.21-Run-test-setup-and-clean.patch
Normal file
@ -0,0 +1,19 @@
|
||||
diff -up DBD-MariaDB-1.23/t/testrules.yml.orig DBD-MariaDB-1.23/t/testrules.yml
|
||||
--- DBD-MariaDB-1.23/t/testrules.yml.orig 2023-09-10 16:18:55.000000000 +0200
|
||||
+++ DBD-MariaDB-1.23/t/testrules.yml 2024-12-10 12:14:23.045521148 +0100
|
||||
@@ -1,10 +1,11 @@
|
||||
seq:
|
||||
+ - seq: t/test-setup.t
|
||||
- seq: t/00base.t
|
||||
- seq: t/05dbcreate.t
|
||||
- seq: t/10connect.t
|
||||
+ - seq: t/87async.t
|
||||
+ - seq: t/rt75353-innodb-lock-timeout.t
|
||||
+ - seq: t/rt85919-fetch-lost-connection.t
|
||||
- par:
|
||||
- - seq: t/60leaks.t
|
||||
- - seq: t/87async.t
|
||||
- - seq: t/rt75353-innodb-lock-timeout.t
|
||||
- - seq: t/rt85919-fetch-lost-connection.t
|
||||
- par: **
|
||||
+ - seq: t/test-clean.t
|
16
DBD-MariaDB-1.23-Note-about-mariadb-connector-c.patch
Normal file
16
DBD-MariaDB-1.23-Note-about-mariadb-connector-c.patch
Normal file
@ -0,0 +1,16 @@
|
||||
diff -up DBD-MariaDB-1.23/lib/DBD/MariaDB.pod.orig DBD-MariaDB-1.23/lib/DBD/MariaDB.pod
|
||||
--- DBD-MariaDB-1.23/lib/DBD/MariaDB.pod.orig 2025-02-04 09:17:49.438216175 +0100
|
||||
+++ DBD-MariaDB-1.23/lib/DBD/MariaDB.pod 2025-02-04 09:21:25.530382547 +0100
|
||||
@@ -281,6 +281,12 @@ L<I<mariadb_ssl_ca_path>|/mariadb_ssl_ca
|
||||
|
||||
This means that your communication with the server will be encrypted.
|
||||
|
||||
+NOTE: Due to the changes in mariadb-connector-c 3.4.0, SSL is always
|
||||
+enforced on MariaDB and this option does not have any effect (that does not
|
||||
+apply when connecting to MySQL though). You will need MariaDB with enabled
|
||||
+SSL support on server side, otherwise you'll get TLS/SSL error. That might
|
||||
+change in a future release.
|
||||
+
|
||||
=item mariadb_ssl_ca_file
|
||||
|
||||
The path to a file in PEM format that contains a list of trusted SSL certificate
|
3
README.md
Normal file
3
README.md
Normal file
@ -0,0 +1,3 @@
|
||||
# perl-DBD-MariaDB
|
||||
|
||||
DBD::MariaDB is the Perl5 Database Interface driver for MariaDB and MySQL databases. In other words: DBD::MariaDB is an interface between the Perl programming language and the MariaDB/MySQL programming API that comes with the MariaDB/MySQL relational database management system. Most functions provided by this programming API are supported. Some rarely used functions are missing, mainly because no-one ever requested them.
|
@ -1,14 +0,0 @@
|
||||
diff -up DBD-MariaDB-1.21/t/testrules.yml.orig DBD-MariaDB-1.21/t/testrules.yml
|
||||
--- DBD-MariaDB-1.21/t/testrules.yml.orig 2019-07-03 11:38:30.204870398 +0200
|
||||
+++ DBD-MariaDB-1.21/t/testrules.yml 2019-07-03 11:38:41.334062976 +0200
|
||||
@@ -1,4 +1,5 @@
|
||||
seq:
|
||||
+ - seq: t/test-setup.t
|
||||
- seq: t/00base.t
|
||||
- seq: t/05dbcreate.t
|
||||
- seq: t/10connect.t
|
||||
@@ -8,3 +9,4 @@ seq:
|
||||
- seq: t/rt75353-innodb-lock-timeout.t
|
||||
- seq: t/rt85919-fetch-lost-connection.t
|
||||
- par: **
|
||||
+ - seq: t/test-clean.t
|
@ -1,13 +0,0 @@
|
||||
diff -up DBD-MariaDB-1.21/t/45bind_no_backslash_escapes.t.orig DBD-MariaDB-1.21/t/45bind_no_backslash_escapes.t
|
||||
--- DBD-MariaDB-1.21/t/45bind_no_backslash_escapes.t.orig 2022-02-17 14:00:30.765461191 +0100
|
||||
+++ DBD-MariaDB-1.21/t/45bind_no_backslash_escapes.t 2022-02-17 14:01:54.388057993 +0100
|
||||
@@ -19,7 +19,8 @@ if ($dbh->{mariadb_serverversion} < 5000
|
||||
plan skip_all => "Servers < 5.0.1 do not support sql_mode NO_BACKSLASH_ESCAPES";
|
||||
}
|
||||
|
||||
-if ($dbh->{mariadb_clientversion} < 50001) {
|
||||
+# As from mariadb-connect-c 3.2.x version number for mariadb_clientversion is 3020x
|
||||
+if ($dbh->{mariadb_clientversion} < 50001 && $dbh->{mariadb_serverversion} < 50001) {
|
||||
$id2_quoted_no_backslash = q(X'737472696E675C737472696E6722737472696E6727737472696E67');
|
||||
}
|
||||
|
@ -1,16 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use File::Path;
|
||||
use Test::More tests => 2;
|
||||
|
||||
my $MYSQL_DIR = $ENV{'MYSQL_DIR'};
|
||||
my $MYSQL_UNIX_PORT = $ENV{'MYSQL_UNIX_PORT'};
|
||||
my $MYSQL_PIDFILE = $ENV{'MYSQL_PIDFILE'};
|
||||
|
||||
ok(system("/usr/bin/mysqladmin --user=root --socket=$MYSQL_UNIX_PORT shutdown 2>&1 || [ ! -s \"$MYSQL_PIDFILE\" ] || /bin/kill `cat \"$MYSQL_PIDFILE\"`") == 0);
|
||||
my $removed_count = rmtree($MYSQL_DIR, 1, 1);
|
||||
ok($removed_count > 0);
|
||||
|
@ -1,15 +0,0 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# MariaDB setup
|
||||
export MYSQL_DIR=$PWD/t/testdb
|
||||
export MYSQL_UNIX_PORT=$MYSQL_DIR/mysql.sock
|
||||
export MYSQL_PIDFILE=$MYSQL_DIR/mysql.pid
|
||||
export MYSQL_USER=`whoami`
|
||||
|
||||
# DBD::MariaDB test setup
|
||||
export DBD_MARIADB_TESTDB=testdb
|
||||
export DBD_MARIADB_TESTHOST=localhost
|
||||
export DBD_MARIADB_TESTSOCKET=$MYSQL_UNIX_PORT
|
||||
export DBD_MARIADB_TESTUSER=testuser
|
||||
export DBD_MARIADB_TESTPASSWORD=testpassword
|
||||
|
@ -1,55 +0,0 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More tests => 7;
|
||||
|
||||
# MySQL setup
|
||||
my $MYSQL_DIR = $ENV{'MYSQL_DIR'};
|
||||
my $MYSQL_UNIX_PORT = $ENV{'MYSQL_UNIX_PORT'};
|
||||
my $MYSQL_PIDFILE = $ENV{'MYSQL_PIDFILE'};
|
||||
my $MYSQL_USER = $ENV{'MYSQL_USER'};
|
||||
chomp($MYSQL_USER);
|
||||
|
||||
# DBD::MariaDB test setup
|
||||
my $DBD_MARIADB_TESTDB = $ENV{'DBD_MARIADB_TESTDB'};
|
||||
my $DBD_MARIADB_TESTHOST = $ENV{'DBD_MARIADB_TESTHOST'};
|
||||
my $DBD_MARIADB_TESTSOCKET = $ENV{'DBD_MARIADB_TESTSOCKET'};
|
||||
my $DBD_MARIADB_TESTUSER = $ENV{'DBD_MARIADB_TESTUSER'};
|
||||
my $DBD_MARIADB_TESTPASSWORD = $ENV{'DBD_MARIADB_TESTPASSWORD'};
|
||||
|
||||
my $MYSQLD = '';
|
||||
my $mysql_version = readpipe("mysql --version");
|
||||
if ($mysql_version =~ /MariaDB/) {
|
||||
system("mysql_install_db --no-defaults --datadir=$MYSQL_DIR --force --skip-name-resolve --explicit_defaults_for_timestamp >/dev/null 2>&1");
|
||||
is($?, 0);
|
||||
$MYSQLD = '/usr/libexec/mysqld';
|
||||
} else {
|
||||
$MYSQLD = '/usr/sbin/mysqld';
|
||||
system("$MYSQLD --no-defaults --initialize-insecure --datadir=$MYSQL_DIR --explicit_defaults_for_timestamp --user=$MYSQL_USER >/dev/null 2>&1");
|
||||
is($?, 0);
|
||||
}
|
||||
|
||||
my $cmd = "$MYSQLD --no-defaults --user=$MYSQL_USER --socket=$MYSQL_UNIX_PORT --datadir=$MYSQL_DIR --pid-file=$MYSQL_PIDFILE --explicit_defaults_for_timestamp --skip-networking >/dev/null 2>&1 &";
|
||||
system($cmd);
|
||||
is($?, 0);
|
||||
|
||||
my $attempts = 0;
|
||||
while (system("/usr/bin/mysqladmin --user=root --socket=$MYSQL_UNIX_PORT ping >/dev/null 2>&1") != 0) {
|
||||
sleep 3;
|
||||
$attempts++;
|
||||
if ($attempts > 10) {
|
||||
fail("skipping test, mariadb/mysql server could not be contacted after 30 seconds\n");
|
||||
}
|
||||
}
|
||||
ok(1);
|
||||
|
||||
system("mysql --socket=$MYSQL_UNIX_PORT --execute \"CREATE USER '$DBD_MARIADB_TESTUSER\@localhost';\" 2>&1");
|
||||
is($?, 0);
|
||||
system("mysql --socket=$MYSQL_UNIX_PORT --execute \"CREATE DATABASE IF NOT EXISTS $DBD_MARIADB_TESTDB CHARACTER SET='utf8mb4';\" 2>&1");
|
||||
is($?, 0);
|
||||
system("mysql --socket=$MYSQL_UNIX_PORT --execute \"GRANT ALL PRIVILEGES ON $DBD_MARIADB_TESTDB.* TO '$DBD_MARIADB_TESTUSER\@localhost' IDENTIFIED BY '$DBD_MARIADB_TESTPASSWORD';\" 2>&1");
|
||||
is($?, 0);
|
||||
system("/usr/bin/mysqladmin --user=$DBD_MARIADB_TESTUSER --password=$DBD_MARIADB_TESTPASSWORD --socket=$DBD_MARIADB_TESTSOCKET ping >/dev/null 2>&1");
|
||||
is($?, 0);
|
19
gating.yaml
Normal file
19
gating.yaml
Normal file
@ -0,0 +1,19 @@
|
||||
# Fedora
|
||||
--- !Policy
|
||||
id: fedora_policy
|
||||
product_versions:
|
||||
- fedora-*
|
||||
decision_contexts:
|
||||
- bodhi_update_push_testing
|
||||
- bodhi_update_push_stable
|
||||
subject_type: koji_build
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: fedora-ci.koji-build.tier0.functional}
|
||||
|
||||
# RHEL
|
||||
--- !Policy
|
||||
product_versions:
|
||||
- rhel-*
|
||||
decision_context: osci_compose_gate
|
||||
rules:
|
||||
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
@ -8,19 +8,18 @@
|
||||
%endif
|
||||
|
||||
Name: perl-DBD-MariaDB
|
||||
Version: 1.21
|
||||
Release: 16%{?dist}
|
||||
Version: 1.23
|
||||
Release: 9%{?dist}
|
||||
Summary: MariaDB and MySQL driver for the Perl5 Database Interface (DBI)
|
||||
License: GPL+ or Artistic
|
||||
License: GPL-1.0-or-later OR Artistic-1.0-Perl
|
||||
URL: https://metacpan.org/release/DBD-MariaDB/
|
||||
Source0: https://cpan.metacpan.org/authors/id/P/PA/PALI/DBD-MariaDB-%{version}.tar.gz
|
||||
Source1: test-setup.t
|
||||
Source2: test-clean.t
|
||||
Source3: test-env.sh
|
||||
Patch0: DBD-MariaDB-1.21-Run-test-setup-and-clean.patch
|
||||
# Fix test for changed value of mariadb_clientversion
|
||||
# mariadb-connector-c 3.2.x version number changed mariadb_clientversion to 3020x
|
||||
Patch1: DBD-MariaDB-fix-mariadb-connector-c-32x-test.patch
|
||||
# Note about changes in mariadb-connector-c which affected SSL connection
|
||||
Patch1: DBD-MariaDB-1.23-Note-about-mariadb-connector-c.patch
|
||||
BuildRequires: findutils
|
||||
BuildRequires: gcc
|
||||
BuildRequires: make
|
||||
@ -43,6 +42,7 @@ BuildRequires: perl(Getopt::Long)
|
||||
BuildRequires: perl(strict)
|
||||
BuildRequires: perl(utf8)
|
||||
BuildRequires: perl(warnings)
|
||||
BuildRequires: sscg
|
||||
# Tests
|
||||
BuildRequires: hostname
|
||||
BuildRequires: mariadb
|
||||
@ -71,7 +71,6 @@ BuildRequires: perl(Proc::ProcessTable)
|
||||
BuildRequires: perl(Storable)
|
||||
%endif
|
||||
|
||||
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
|
||||
|
||||
# Filter private modules for tests
|
||||
%global __requires_exclude %{?__requires_exclude:%__requires_exclude|}perl\\(lib.pl\\)
|
||||
@ -108,10 +107,15 @@ with "%{_libexecdir}/%{name}/test".
|
||||
|
||||
%prep
|
||||
%setup -q -n DBD-MariaDB-%{version}
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch -P0 -p1
|
||||
%patch -P1 -p1
|
||||
cp %{SOURCE1} %{SOURCE2} t/
|
||||
|
||||
# Create certificates for tests
|
||||
mkdir t/certs
|
||||
sscg --hostname=localhost --ca-mode=0644 --ca-key-mode=0640 --cert-key-mode=0640 --no-dhparams-file
|
||||
mv ca.crt service-key.pem service.pem t/certs
|
||||
|
||||
# Help file to recognise the Perl scripts and normalize shebangs
|
||||
for F in t/*.t t/*.pl; do
|
||||
perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' "$F"
|
||||
@ -140,22 +144,33 @@ perl Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS" NO_PACKLIST=1 NO_P
|
||||
|
||||
%install
|
||||
%{make_install}
|
||||
find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -delete
|
||||
find %{buildroot} -type f -name '*.bs' -size 0 -delete
|
||||
%{_fixperms} %{buildroot}/*
|
||||
|
||||
# Install tests
|
||||
mkdir -p %{buildroot}%{_libexecdir}/%{name}
|
||||
cp -a t %{buildroot}%{_libexecdir}/%{name}
|
||||
cp %{SOURCE3} %{buildroot}%{_libexecdir}/%{name}
|
||||
cat > %{buildroot}%{_libexecdir}/%{name}/test << EOF
|
||||
#!/bin/sh
|
||||
cat > %{buildroot}%{_libexecdir}/%{name}/test << 'EOF'
|
||||
#!/usr/bin/bash
|
||||
set -e
|
||||
unset RELEASE_TESTING
|
||||
. %{_libexecdir}/%{name}/$(basename %{SOURCE3})
|
||||
cd %{_libexecdir}/%{name} && exec prove -I .
|
||||
|
||||
# The tests write to temporary database which is placed in $DIR/t/testdb
|
||||
DIR=$(mktemp -d)
|
||||
pushd "$DIR"
|
||||
cp -a %{_libexecdir}/%{name}/* ./
|
||||
|
||||
# Load the variables
|
||||
. $DIR/$(basename %{SOURCE3})
|
||||
|
||||
# Run tests
|
||||
prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
|
||||
popd
|
||||
rm -rf "$DIR"
|
||||
EOF
|
||||
chmod +x %{buildroot}%{_libexecdir}/%{name}/test
|
||||
|
||||
%{_fixperms} $RPM_BUILD_ROOT/*
|
||||
|
||||
%check
|
||||
# Set MariaDB and DBD::MariaDB test environment
|
||||
. %{SOURCE3}
|
||||
@ -166,27 +181,73 @@ make test %{?with_perl_DBD_MariaDB_enables_leak_test:EXTENDED_TESTING=1}
|
||||
%files
|
||||
%license LICENSE
|
||||
%doc Changes Changes.historic
|
||||
%{perl_vendorarch}/auto/*
|
||||
%{perl_vendorarch}/auto/DBD*
|
||||
%{perl_vendorarch}/DBD*
|
||||
%{_mandir}/man3/*
|
||||
%{_mandir}/man3/DBD::MariaDB*
|
||||
|
||||
%files tests
|
||||
%{_libexecdir}/%{name}
|
||||
|
||||
%changelog
|
||||
* Tue Feb 04 2025 Jitka Plesnikova <jplesnik@redhat.com> - 1.23-9
|
||||
- Resolves: RHEL-66250
|
||||
- Updated notes related to the issue
|
||||
|
||||
* Tue Jan 28 2025 Jitka Plesnikova <jplesnik@redhat.com> - 1.23-8
|
||||
- Generate SSL needed for tests since mariadb-connector-c 3.4.x
|
||||
- Resolves: RHEL-66250
|
||||
|
||||
* Tue Oct 29 2024 Troy Dawson <tdawson@redhat.com> - 1.23-7
|
||||
- Bump release for October 2024 mass rebuild:
|
||||
Resolves: RHEL-64018
|
||||
|
||||
* Thu Aug 08 2024 Troy Dawson <tdawson@redhat.com> - 1.23-6
|
||||
- Bump release for Aug 2024 java mass rebuild
|
||||
|
||||
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1.23-5
|
||||
- Bump release for June 2024 mass rebuild
|
||||
|
||||
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.23-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.23-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||
|
||||
* Thu Oct 19 2023 Jitka Plesnikova <jplesnik@redhat.com> - 1.23-2
|
||||
- Replace using mysql by mariadb in setup script
|
||||
|
||||
* Mon Sep 11 2023 Jitka Plesnikova <jplesnik@redhat.com> - 1.23-1
|
||||
- 1.23 bump (rhbz#2238227)
|
||||
|
||||
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.22-6
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
||||
|
||||
* Tue Jul 11 2023 Jitka Plesnikova <jplesnik@redhat.com> - 1.22-5
|
||||
- Perl 5.38 rebuild
|
||||
|
||||
* Fri Jan 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.22-4
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||
|
||||
* Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.22-3
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||
|
||||
* Tue May 31 2022 Jitka Plesnikova <jplesnik@redhat.com> - 1.22-2
|
||||
- Perl 5.36 rebuild
|
||||
|
||||
* Tue Apr 26 2022 Jitka Plesnikova <jplesnik@redhat.com> - 1.22-1
|
||||
- 1.22 bump
|
||||
|
||||
* Thu Feb 17 2022 Jitka Plesnikova <jplesnik@redhat.com> - 1.21-16
|
||||
- Fix test for mariadb-connector-c 3.2.x
|
||||
|
||||
* Tue Aug 17 2021 Jitka Plesnikova <jplesnik@redhat.com> - 1.21-15
|
||||
- Related: rhbz#1960259 - Enable gating
|
||||
* Fri Jan 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.21-15
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
|
||||
|
||||
* Mon Aug 09 2021 Mohan Boddu <mboddu@redhat.com> - 1.21-14
|
||||
- Rebuilt for IMA sigs, glibc 2.34, aarch64 flags
|
||||
Related: rhbz#1991688
|
||||
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 1.21-14
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||||
|
||||
* Tue Jun 22 2021 Mohan Boddu <mboddu@redhat.com> - 1.21-13
|
||||
- Rebuilt for RHEL 9 BETA for openssl 3.0
|
||||
Related: rhbz#1971065
|
||||
* Fri May 21 2021 Jitka Plesnikova <jplesnik@redhat.com> - 1.21-13
|
||||
- Perl 5.34 rebuild
|
||||
|
||||
* Tue May 04 2021 Jitka Plesnikova <jplesnik@redhat.com> - 1.21-12
|
||||
- Update tests
|
12
plans/internal.fmf
Normal file
12
plans/internal.fmf
Normal file
@ -0,0 +1,12 @@
|
||||
summary: Private (RHEL) beakerlib tests
|
||||
enabled: false
|
||||
adjust:
|
||||
- when: distro == rhel
|
||||
enabled: true
|
||||
because: private tests are accesible only within rhel pipline
|
||||
discover:
|
||||
- name: rhel
|
||||
how: fmf
|
||||
url: https://pkgs.devel.redhat.com/git/tests/perl-DBD-MariaDB
|
||||
execute:
|
||||
how: tmt
|
5
plans/sanity.fmf
Normal file
5
plans/sanity.fmf
Normal file
@ -0,0 +1,5 @@
|
||||
summary: Sanity tests
|
||||
discover:
|
||||
how: fmf
|
||||
execute:
|
||||
how: tmt
|
1
sources
Normal file
1
sources
Normal file
@ -0,0 +1 @@
|
||||
SHA512 (DBD-MariaDB-1.23.tar.gz) = 2217f36606caab477b8fa931a69b53b7f706a25cf013e4b62aa1b0b48905aba24b724604b4b99e83dea08d967848119447f35ff8e6b5eb80c7fea4e8c084de16
|
16
test-clean.t
Executable file
16
test-clean.t
Executable file
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use File::Path;
|
||||
use Test::More tests => 2;
|
||||
|
||||
my $MARIADB_DIR = $ENV{'MARIADB_DIR'};
|
||||
my $MARIADB_UNIX_PORT = $ENV{'MARIADB_UNIX_PORT'};
|
||||
my $MARIADB_PIDFILE = $ENV{'MARIADB_PIDFILE'};
|
||||
|
||||
ok(system("mariadb-admin --user=root --socket=$MARIADB_UNIX_PORT shutdown 2>&1 || [ ! -s \"$MARIADB_PIDFILE\" ] || /bin/kill `cat \"$MARIADB_PIDFILE\"`") == 0);
|
||||
my $removed_count = rmtree($MARIADB_DIR, 1, 1);
|
||||
ok($removed_count > 0);
|
||||
|
16
test-env.sh
Executable file
16
test-env.sh
Executable file
@ -0,0 +1,16 @@
|
||||
#!/usr/bin/bash
|
||||
|
||||
# MariaDB setup
|
||||
export MARIADB_BASE=$PWD
|
||||
export MARIADB_DIR=$MARIADB_BASE/t/testdb
|
||||
export MARIADB_UNIX_PORT=$MARIADB_DIR/mysql.sock
|
||||
export MARIADB_PIDFILE=$MARIADB_DIR/mysql.pid
|
||||
export MARIADB_USER=`whoami`
|
||||
|
||||
# DBD::MariaDB test setup
|
||||
export DBD_MARIADB_TESTDB=testdb
|
||||
export DBD_MARIADB_TESTHOST=localhost
|
||||
export DBD_MARIADB_TESTSOCKET=$MARIADB_UNIX_PORT
|
||||
export DBD_MARIADB_TESTUSER=testuser
|
||||
export DBD_MARIADB_TESTPASSWORD=testpassword
|
||||
|
47
test-setup.t
Executable file
47
test-setup.t
Executable file
@ -0,0 +1,47 @@
|
||||
#!/usr/bin/perl
|
||||
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use Test::More tests => 7;
|
||||
|
||||
# MySQL setup
|
||||
my $MARIADB_BASE = $ENV{'MARIADB_BASE'};
|
||||
my $MARIADB_DIR = $ENV{'MARIADB_DIR'};
|
||||
my $MARIADB_UNIX_PORT = $ENV{'MARIADB_UNIX_PORT'};
|
||||
my $MARIADB_PIDFILE = $ENV{'MARIADB_PIDFILE'};
|
||||
my $MARIADB_USER = $ENV{'MARIADB_USER'};
|
||||
chomp($MARIADB_USER);
|
||||
|
||||
# DBD::MariaDB test setup
|
||||
my $DBD_MARIADB_TESTDB = $ENV{'DBD_MARIADB_TESTDB'};
|
||||
my $DBD_MARIADB_TESTHOST = $ENV{'DBD_MARIADB_TESTHOST'};
|
||||
my $DBD_MARIADB_TESTSOCKET = $ENV{'DBD_MARIADB_TESTSOCKET'};
|
||||
my $DBD_MARIADB_TESTUSER = $ENV{'DBD_MARIADB_TESTUSER'};
|
||||
my $DBD_MARIADB_TESTPASSWORD = $ENV{'DBD_MARIADB_TESTPASSWORD'};
|
||||
|
||||
system("mariadb-install-db --no-defaults --datadir=$MARIADB_DIR --force --skip-name-resolve --explicit_defaults_for_timestamp >/dev/null 2>&1");
|
||||
is($?, 0);
|
||||
|
||||
my $cmd = "mariadbd-safe --no-defaults --user=$MARIADB_USER --socket=$MARIADB_UNIX_PORT --datadir=$MARIADB_DIR --pid-file=$MARIADB_PIDFILE --ssl_cert=$MARIADB_BASE/t/certs/service.pem --ssl_key=$MARIADB_BASE/t/certs/service-key.pem --ssl_ca=$MARIADB_BASE/t/certs/ca.crt --skip-networking >/dev/null 2>&1 &";
|
||||
system($cmd);
|
||||
is($?, 0);
|
||||
|
||||
my $attempts = 0;
|
||||
while (system("mariadb-admin --user=root --socket=$MARIADB_UNIX_PORT ping >/dev/null 2>&1") != 0) {
|
||||
sleep 3;
|
||||
$attempts++;
|
||||
if ($attempts > 10) {
|
||||
fail("skipping test, mariadb/mysql server could not be contacted after 30 seconds\n");
|
||||
}
|
||||
}
|
||||
ok(1);
|
||||
|
||||
system("mariadb --socket=$MARIADB_UNIX_PORT --execute \"CREATE USER '$DBD_MARIADB_TESTUSER\@localhost';\" 2>&1");
|
||||
is($?, 0);
|
||||
system("mariadb --socket=$MARIADB_UNIX_PORT --execute \"CREATE DATABASE IF NOT EXISTS $DBD_MARIADB_TESTDB CHARACTER SET='utf8mb4';\" 2>&1");
|
||||
is($?, 0);
|
||||
system("mariadb --socket=$MARIADB_UNIX_PORT --execute \"GRANT ALL PRIVILEGES ON $DBD_MARIADB_TESTDB.* TO '$DBD_MARIADB_TESTUSER\@localhost' IDENTIFIED BY '$DBD_MARIADB_TESTPASSWORD';\" 2>&1");
|
||||
is($?, 0);
|
||||
system("mariadb-admin --user=$DBD_MARIADB_TESTUSER --password=$DBD_MARIADB_TESTPASSWORD --socket=$DBD_MARIADB_TESTSOCKET ping >/dev/null 2>&1");
|
||||
is($?, 0);
|
11
tests/upstream-tests.fmf
Normal file
11
tests/upstream-tests.fmf
Normal file
@ -0,0 +1,11 @@
|
||||
summary: Upstream tests
|
||||
component: perl-DBD-MariaDB
|
||||
require: perl-DBD-MariaDB-tests
|
||||
test: /usr/libexec/perl-DBD-MariaDB/test
|
||||
enabled: true
|
||||
tag:
|
||||
- rhel-buildroot
|
||||
adjust:
|
||||
- enabled: false
|
||||
when: distro < rhel-10 or distro < centos-stream-10
|
||||
continue: false
|
Loading…
Reference in New Issue
Block a user