Commit 89d490d3 authored by Xavier Bachelot's avatar Xavier Bachelot

Add upstream patches to fix test failure on F30

parent 5abb193c
Pipeline #4136 failed with stages
in 9 minutes and 40 seconds
From 5752254af89729562f6459e45a6060a1ca4a6a9d Mon Sep 17 00:00:00 2001
From: Christophe Maudoux <chrmdx@gmail.com>
Date: Fri, 18 Jan 2019 19:48:46 +0100
Subject: [PATCH 1/7] WIP - Fix unit test
---
lemonldap-ng-common/t/02-Common-Conf-File.t | 1 +
1 file changed, 1 insertion(+)
diff --git a/lemonldap-ng-common/t/02-Common-Conf-File.t b/lemonldap-ng-common/t/02-Common-Conf-File.t
index afa281ec7..dba925df0 100644
--- a/lemonldap-ng-common/t/02-Common-Conf-File.t
+++ b/lemonldap-ng-common/t/02-Common-Conf-File.t
@@ -7,6 +7,7 @@
use strict;
use Test::More;
+use v5.26.1;
BEGIN { use_ok('Lemonldap::NG::Common::Conf') }
#########################
--
2.20.1
From baa2868d3f7444120460f0949c4e20d0429f4b4d Mon Sep 17 00:00:00 2001
From: Christophe Maudoux <chrmdx@gmail.com>
Date: Fri, 18 Jan 2019 20:09:42 +0100
Subject: [PATCH 2/7] WIP - Fix unit test
---
lemonldap-ng-common/t/02-Common-Conf-File.t | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lemonldap-ng-common/t/02-Common-Conf-File.t b/lemonldap-ng-common/t/02-Common-Conf-File.t
index dba925df0..8c052c42c 100644
--- a/lemonldap-ng-common/t/02-Common-Conf-File.t
+++ b/lemonldap-ng-common/t/02-Common-Conf-File.t
@@ -7,7 +7,7 @@
use strict;
use Test::More;
-use v5.26.1;
+use v5.20;
BEGIN { use_ok('Lemonldap::NG::Common::Conf') }
#########################
--
2.20.1
From adbe2adb3e2a8a7aada8cfffcea3a5f1fa20fea3 Mon Sep 17 00:00:00 2001
From: Christophe Maudoux <chrmdx@gmail.com>
Date: Fri, 18 Jan 2019 21:16:55 +0100
Subject: [PATCH 3/7] WIP - Fix unit test
---
lemonldap-ng-common/t/02-Common-Conf-File.t | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/lemonldap-ng-common/t/02-Common-Conf-File.t b/lemonldap-ng-common/t/02-Common-Conf-File.t
index 8c052c42c..8dcdf048f 100644
--- a/lemonldap-ng-common/t/02-Common-Conf-File.t
+++ b/lemonldap-ng-common/t/02-Common-Conf-File.t
@@ -49,8 +49,8 @@ for ( my $i = 0 ; $i < @test ; $i++ ) {
open F, 'file t/lmConf-1.json |';
$_ = join( '', <F> );
close F;
- ok( /(ascii|utf-?8)/si, "File is $1 encoded" )
- or print STDERR "Result: $_\n";
+ ok( /(ascii|utf-?8)/si, "File is $1 encoded" );
+ print STDERR "Result: $_\n";
$count++;
};
}
--
2.20.1
From e1565191bf66f8bcd3dedc307a2972482e1fd402 Mon Sep 17 00:00:00 2001
From: Christophe Maudoux <chrmdx@gmail.com>
Date: Fri, 18 Jan 2019 21:38:24 +0100
Subject: [PATCH 4/7] WIP - Fix unit test
---
lemonldap-ng-common/t/02-Common-Conf-File.t | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lemonldap-ng-common/t/02-Common-Conf-File.t b/lemonldap-ng-common/t/02-Common-Conf-File.t
index 8dcdf048f..2a09730cc 100644
--- a/lemonldap-ng-common/t/02-Common-Conf-File.t
+++ b/lemonldap-ng-common/t/02-Common-Conf-File.t
@@ -49,7 +49,7 @@ for ( my $i = 0 ; $i < @test ; $i++ ) {
open F, 'file t/lmConf-1.json |';
$_ = join( '', <F> );
close F;
- ok( /(ascii|utf-?8)/si, "File is $1 encoded" );
+ ok( /(ascii|utf-?8|json\s?data)/si, "File is $1 encoded" );
print STDERR "Result: $_\n";
$count++;
};
--
2.20.1
From 559b410849613731fff08fd58dae2f7aa40bbbe4 Mon Sep 17 00:00:00 2001
From: Christophe Maudoux <chrmdx@gmail.com>
Date: Fri, 18 Jan 2019 21:46:23 +0100
Subject: [PATCH 5/7] Fix unit test for Debian Buster
---
lemonldap-ng-common/t/02-Common-Conf-File.t | 20 ++++++++++----------
1 file changed, 10 insertions(+), 10 deletions(-)
diff --git a/lemonldap-ng-common/t/02-Common-Conf-File.t b/lemonldap-ng-common/t/02-Common-Conf-File.t
index 2a09730cc..85d384198 100644
--- a/lemonldap-ng-common/t/02-Common-Conf-File.t
+++ b/lemonldap-ng-common/t/02-Common-Conf-File.t
@@ -17,10 +17,8 @@ BEGIN { use_ok('Lemonldap::NG::Common::Conf') }
my $h;
-ok(
- $h = new Lemonldap::NG::Common::Conf(
- {
- type => 'File',
+ok( $h = new Lemonldap::NG::Common::Conf(
+ { type => 'File',
dirName => "t/",
}
),
@@ -40,25 +38,27 @@ my @test = (
{ cfgNum => 1, test => 'éà' }
);
-for ( my $i = 0 ; $i < @test ; $i++ ) {
+for ( my $i = 0; $i < @test; $i++ ) {
ok( $h->store( $test[$i] ) == 1, "Test $i is stored" )
- or print STDERR "$Lemonldap::NG::Common::Conf::msg $!";
+ or print STDERR "$Lemonldap::NG::Common::Conf::msg $!";
$count++;
if ( -x '/usr/bin/file' ) {
eval {
open F, 'file t/lmConf-1.json |';
$_ = join( '', <F> );
close F;
- ok( /(ascii|utf-?8|json\s?data)/si, "File is $1 encoded" );
- print STDERR "Result: $_\n";
+
+ ## Debian Buster 'file' command returns JSON DATA
+ ok( /(ascii|utf-?8|json\sdata)/si, "File is $1 encoded" )
+ or print STDERR "Result: $_\n";
$count++;
};
}
my $cfg;
ok( $cfg = $h->load(1), "Test $i can be read" )
- or print STDERR $Lemonldap::NG::Common::Conf::msg;
+ or print STDERR $Lemonldap::NG::Common::Conf::msg;
ok( $cfg->{test} eq $test[$i]->{test}, "Test $i is restored" )
- or print STDERR "Expect $cfg->{test} eq $test[$i]->{test}\n";
+ or print STDERR "Expect $cfg->{test} eq $test[$i]->{test}\n";
$count += 2;
}
--
2.20.1
From 6dee2f2dba53e3261ceed76bc0bd7999096e3e76 Mon Sep 17 00:00:00 2001
From: Christophe Maudoux <chrmdx@gmail.com>
Date: Fri, 18 Jan 2019 21:47:40 +0100
Subject: [PATCH 6/7] Fix unit test for Debian Buster
---
lemonldap-ng-common/t/02-Common-Conf-File.t | 1 -
1 file changed, 1 deletion(-)
diff --git a/lemonldap-ng-common/t/02-Common-Conf-File.t b/lemonldap-ng-common/t/02-Common-Conf-File.t
index 85d384198..63cadffcf 100644
--- a/lemonldap-ng-common/t/02-Common-Conf-File.t
+++ b/lemonldap-ng-common/t/02-Common-Conf-File.t
@@ -7,7 +7,6 @@
use strict;
use Test::More;
-use v5.20;
BEGIN { use_ok('Lemonldap::NG::Common::Conf') }
#########################
--
2.20.1
From 774137e5fd85d3c1cdeca842e28e4687f14dc670 Mon Sep 17 00:00:00 2001
From: Xavier Guimard <yadd@debian.org>
Date: Sat, 19 Jan 2019 09:46:55 +0100
Subject: [PATCH 7/7] Remove useless test (fixes test failure on Debian
unstable)
---
lemonldap-ng-common/t/02-Common-Conf-File.t | 12 ------------
1 file changed, 12 deletions(-)
diff --git a/lemonldap-ng-common/t/02-Common-Conf-File.t b/lemonldap-ng-common/t/02-Common-Conf-File.t
index 63cadffcf..ebd5f5b38 100644
--- a/lemonldap-ng-common/t/02-Common-Conf-File.t
+++ b/lemonldap-ng-common/t/02-Common-Conf-File.t
@@ -41,18 +41,6 @@ for ( my $i = 0; $i < @test; $i++ ) {
ok( $h->store( $test[$i] ) == 1, "Test $i is stored" )
or print STDERR "$Lemonldap::NG::Common::Conf::msg $!";
$count++;
- if ( -x '/usr/bin/file' ) {
- eval {
- open F, 'file t/lmConf-1.json |';
- $_ = join( '', <F> );
- close F;
-
- ## Debian Buster 'file' command returns JSON DATA
- ok( /(ascii|utf-?8|json\sdata)/si, "File is $1 encoded" )
- or print STDERR "Result: $_\n";
- $count++;
- };
- }
my $cfg;
ok( $cfg = $h->load(1), "Test $i can be read" )
or print STDERR $Lemonldap::NG::Common::Conf::msg;
--
2.20.1
......@@ -57,6 +57,8 @@ URL: http://lemonldap-ng.org
Source0: https://release.ow2.org/lemonldap/%{name}-%{version}%{?pre_release:~%{pre_release}}.tar.gz
BuildArch: noarch
Patch0: lemonldap-ng-2.0.1-Remove_useless_test.patch
BuildRequires: perl-generators
BuildRequires: perl-interpreter
BuildRequires: perl(Apache2::Connection)
......@@ -360,6 +362,7 @@ This package installs the authentication portal.
#==============================================================================
%prep
%setup -q -n %{name}-%{version}%{?pre_release:~%{pre_release}}
%patch0 -p1 -b fix_test_failure
#==============================================================================
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment