From 06f954902d76754a65ae4f928505ffa7be21de74 Mon Sep 17 00:00:00 2001 From: xun Date: Thu, 28 Dec 2023 18:55:50 +0800 Subject: [PATCH] addpatch: imapsync - Using other test scripts, ref: https://github.com/imapsync/imapsync/issues/431 - Comment out some tests because IPv6 needs to be used - Upstreamed to archlinux: https://gitlab.archlinux.org/archlinux/packaging/packages/imapsync/-/merge_requests/1 --- imapsync/fix-test.patch | 47 +++++++++++++++++++++++++++++++++++++++++ imapsync/riscv64.patch | 29 +++++++++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 imapsync/fix-test.patch create mode 100644 imapsync/riscv64.patch diff --git a/imapsync/fix-test.patch b/imapsync/fix-test.patch new file mode 100644 index 000000000..604cb466c --- /dev/null +++ b/imapsync/fix-test.patch @@ -0,0 +1,47 @@ +diff --git a/imapsync b/imapsync +index e842961..8ad50b9 100644 +--- a/imapsync ++++ b/imapsync +@@ -7776,7 +7776,7 @@ sub tests_mailimapclient_connect + # ipv6 + ssl + + ok( $imap = Mail::IMAPClient->new( ), 'mailimapclient_connect ipv6 + ssl: new' ) ; +- is( 'petiteipv6.lamiral.info', $imap->Server( 'petiteipv6.lamiral.info' ), 'mailimapclient_connect ipv6 + ssl: setting Server petiteipv6.lamiral.info' ) ; ++ is( 'test1ipv6.lamiral.info', $imap->Server( 'test1ipv6.lamiral.info' ), 'tests_mailimapclient_connect: ipv6 + ssl: setting Server test1ipv6.lamiral.info' ) ; + is( 10, $imap->Timeout( 10 ), 'mailimapclient_connect ipv6: setting Timeout( 10 )' ) ; + ok( $imap->Ssl( [ SSL_verify_mode => SSL_VERIFY_NONE, SSL_cipher_list => 'DEFAULT:!DH' ] ), 'mailimapclient_connect ipv6 + ssl: setting Ssl( SSL_VERIFY_NONE )' ) ; + is( 993, $imap->Port( 993 ), 'mailimapclient_connect ipv6 + ssl: setting Port( 993 )' ) ; +@@ -7797,11 +7797,11 @@ sub tests_mailimapclient_connect + is( 1, $imap->Debug( 1 ), 'mailimapclient_connect ipv4 + ssl: setting Debug( 1 )' ) ; + + # It sounds stupid but it avoids failures on the next test about $imap->connect +- is( '2a01:e34:ecde:70d0:223:54ff:fec2:36d7', resolv( 'petiteipv6.lamiral.info' ), 'resolv: petiteipv6.lamiral.info => 2a01:e34:ecde:70d0:223:54ff:fec2:36d7' ) ; ++ # is( '2a01:e34:ecde:70d0:223:54ff:fec2:36d7', resolv( 'petiteipv6.lamiral.info' ), 'resolv: petiteipv6.lamiral.info => 2a01:e34:ecde:70d0:223:54ff:fec2:36d7' ) ; + +- like( ref( $imap->connect( ) ), qr/IO::Socket::SSL/, 'mailimapclient_connect ipv6 + ssl: connect to petiteipv6.lamiral.info' ) ; ++ # like( ref( $imap->connect( ) ), qr/IO::Socket::SSL/, 'mailimapclient_connect ipv6 + ssl: connect to petiteipv6.lamiral.info' ) ; + # This one is ok on petite, not on ks2, do not know why, so commented. +- like( ref( $imap->logout( ) ), qr/Mail::IMAPClient/, 'mailimapclient_connect ipv6 + ssl: logout in ssl is ok on petiteipv6.lamiral.info' ) ; ++ # like( ref( $imap->logout( ) ), qr/Mail::IMAPClient/, 'mailimapclient_connect ipv6 + ssl: logout in ssl is ok on petiteipv6.lamiral.info' ) ; + } + + is( undef, undef $imap, 'mailimapclient_connect ipv6 + ssl: free variable' ) ; +@@ -8204,6 +8204,9 @@ sub tests_login_imap + # Verify return code: 9 (certificate is not yet valid) + # Fix: /etc/init.d/openntpd restart + # 2021_09_04 done ++ ++ Readonly $SSL_VERIFY_POLICY => IO::Socket::SSL::SSL_VERIFY_NONE( ) ; ++ + ok( + $myimap = login_imap( 'test1.lamiral.info', 993, 'test1', 'secret1', + 1, undef, +@@ -21953,7 +21956,7 @@ sub tests + + #tests_always_fail( ) ; + +- done_testing( 1992 ) ; ++ done_testing( 1989 ) ; + note( 'Leaving tests()' ) ; + } + return ; diff --git a/imapsync/riscv64.patch b/imapsync/riscv64.patch new file mode 100644 index 000000000..887448f67 --- /dev/null +++ b/imapsync/riscv64.patch @@ -0,0 +1,29 @@ +--- PKGBUILD ++++ PKGBUILD +@@ -16,15 +16,23 @@ makedepends=(cpanminus perl-par-packer) + checkdepends=(inetutils lsb-release time procps-ng + perl-{test-deep,test-fatal,test-mock-guard,test-mockobject,test-pod,test-requires,test-warn} + ) +-source=("https://github.com/imapsync/imapsync/archive/refs/tags/${pkgname}-${pkgver}.tar.gz") +-b2sums=('1fbb52e014e18ed8970e56031b64aa3429d6383bc71b0d47e08528b300dfda4591ba279e6c752bdf3a609ae6873bddb61cdcc8ead53750112fc1969e101e1a99') ++source=("https://github.com/imapsync/imapsync/archive/refs/tags/${pkgname}-${pkgver}.tar.gz" ++ "fix-test.patch") ++b2sums=('1fbb52e014e18ed8970e56031b64aa3429d6383bc71b0d47e08528b300dfda4591ba279e6c752bdf3a609ae6873bddb61cdcc8ead53750112fc1969e101e1a99' ++ '4609ab497be43161f2e441f21ab31da2da057446087c45f17c91f7a0b1bc7b4606ef3b77220eb8be1c1032f3c787911fbb9c3ba14eedfa16545668f5ee71e0bc') ++ ++prepare() { ++ cd ${pkgname}-${pkgname}-${pkgver} ++ patch -Np1 -i ../fix-test.patch ++} + + build() { + make -C ${pkgname}-${pkgname}-${pkgver} + } + + check() { +- make -C ${pkgname}-${pkgname}-${pkgver} test ++ cd ${pkgname}-${pkgname}-${pkgver} ++ perl imapsync --tests + } + + package() {