From a6ad0e6148ea36e0a488195dc6ede4f89290edcf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com> Date: Wed, 9 Nov 2016 13:29:38 +0100 Subject: Fix tests for big endian
--- Socket-Netlink-0.04-Fix-tests-for-big-endian.patch | 55 ++++++++++++++++++++++ perl-Socket-Netlink.spec | 4 ++ 2 files changed, 59 insertions(+) create mode 100644 Socket-Netlink-0.04-Fix-tests-for-big-endian.patch diff --git a/Socket-Netlink-0.04-Fix-tests-for-big-endian.patch b/Socket-Netlink-0.04-Fix-tests-for-big-endian.patch new file mode 100644 index 0000000..4304bf9 --- /dev/null +++ b/Socket-Netlink-0.04-Fix-tests-for-big-endian.patch @@ -0,0 +1,55 @@ +From ab1700d55b1b802e2eae4657b53b6017ae68047b Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Petr=20P=C3=ADsa=C5=99?= <ppi...@redhat.com> +Date: Wed, 9 Nov 2016 13:17:40 +0100 +Subject: [PATCH] Fix tests for big endian +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Tests in t/13netlink-message-attrs.t and +t/20io-socket-netlink-generic.t failed on 64-bit big-endian PowerPC +machines. + +This patch fixes erroneous bswap() calls in the tests by splitting +nlmsg_type and nlmsg_flags fields in t/20io-socket-netlink-generic.t +and handling zero-terminted byte-string literaly in +t/13netlink-message-attrs.t. It also fixes incorrect length +specification of a zero-terminated byte-string. + +CPAN RT#71112 + +Signed-off-by: Petr Písař <ppi...@redhat.com> +--- + t/13netlink-message-attrs.t | 2 +- + t/20io-socket-netlink-generic.t | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/t/13netlink-message-attrs.t b/t/13netlink-message-attrs.t +index 133d18e..132587f 100644 +--- a/t/13netlink-message-attrs.t ++++ b/t/13netlink-message-attrs.t +@@ -87,7 +87,7 @@ $message = $sock->unpack_message( + bswap("\5\0").bswap("\1\0").bswap("\7")."\0\0\0". + bswap("\6\0").bswap("\2\0").bswap("\x59\0")."\0\0". + bswap("\x08\0").bswap("\3\0").bswap("\xf3\3\0\0"). +- bswap("\7\0").bswap("\4\0").bswap("FGH\0"). ++ bswap("\x08\0").bswap("\4\0")."FGH\0". + bswap("\x0a\0").bswap("\5\0")."X\0Y\0Z\0\0\0". + bswap("\x0c\0").bswap("\6\0"). + bswap("\5\0").bswap("\1\0").bswap("\x15")."\0\0\0", +diff --git a/t/20io-socket-netlink-generic.t b/t/20io-socket-netlink-generic.t +index 16fb29e..c5cadde 100644 +--- a/t/20io-socket-netlink-generic.t ++++ b/t/20io-socket-netlink-generic.t +@@ -53,7 +53,7 @@ isa_ok( $message, 'IO::Socket::Netlink::Generic::_Message', '$message' ); + ok( $message->can( "cmd" ), '$message has ->cmd accessor' ); + + is_hexstr( $message->pack, +- bswap("\x14\0\0\0").bswap("\x1e\0\0\0")."\0\0\0\0\0\0\0\0". ++ bswap("\x14\0\0\0").bswap("\x1e\0").bswap("\0\0")."\0\0\0\0\0\0\0\0". + "\1\2\0\0", + '$message->pack' ); + +-- +2.7.4 + diff --git a/perl-Socket-Netlink.spec b/perl-Socket-Netlink.spec index 9e51502..0a9aa8f 100644 --- a/perl-Socket-Netlink.spec +++ b/perl-Socket-Netlink.spec @@ -8,6 +8,8 @@ URL: http://search.cpan.org/dist/Socket-Netlink/ Source0: http://www.cpan.org/authors/id/P/PE/PEVANS/Socket-Netlink-%{version}.tar.gz # Fix nlmsgerr length check, CPAN RT#118688 Patch0: Socket-Netlink-0.04-Fix-nlmsgerr-length-check.patch +# Fix tests for big endian, CPAN RT#71112 +Patch1: Socket-Netlink-0.04-Fix-tests-for-big-endian.patch BuildRequires: perl-devel BuildRequires: perl-generators @@ -46,6 +48,7 @@ IO::Socket::Netlink. %prep %setup -q -n Socket-Netlink-%{version} %patch0 -p1 +%patch1 -p1 %build @@ -74,6 +77,7 @@ IO::Socket::Netlink. %changelog * Wed Nov 09 2016 Petr Pisar <ppi...@redhat.com> - 0.04-16 - Fix nlmsgerr length check (CPAN RT#118688) +- Fix tests for big endian (CPAN RT#71112) * Tue Feb 02 2016 Emmanuel Seyman <emman...@seyman.fr> - 0.04-15 - Modernize spec -- cgit v0.12 http://pkgs.fedoraproject.org/cgit/perl-Socket-Netlink.git/commit/?h=f23&id=a6ad0e6148ea36e0a488195dc6ede4f89290edcf _______________________________________________ perl-devel mailing list -- perl-devel@lists.fedoraproject.org To unsubscribe send an email to perl-devel-le...@lists.fedoraproject.org