- Reverted upstream commit that makes some tests to fail when

compiling with openssl-1.1.0
  * Upstream commit 68cc39dd64688829be2632d9cd24f7efa3da79bb
  * Added patch tcpdump-reverted-test-scripts-fix.patch
  * Removed patch tcpdump-ikev2pI2-test-fails-ppc.patch

OBS-URL: https://build.opensuse.org/package/show/network:utilities/tcpdump?expand=0&rev=42
This commit is contained in:
Pedro Monreal Gonzalez 2017-08-23 14:24:22 +00:00 committed by Git OBS Bridge
parent 20338ac898
commit 8e39dc6910
4 changed files with 140 additions and 19 deletions

View File

@ -1,13 +0,0 @@
Index: tcpdump-4.9.1/tests/crypto.sh
===================================================================
--- tcpdump-4.9.1.orig/tests/crypto.sh
+++ tcpdump-4.9.1/tests/crypto.sh
@@ -28,8 +28,6 @@ then
[ $? -eq 0 ] || exitcode=1
./TESTonce espudp1 espudp1.pcap espudp1.out '-nnnn -E "file esp-secrets.txt"'
[ $? -eq 0 ] || exitcode=1
- ./TESTonce ikev2pI2 ikev2pI2.pcap ikev2pI2.out '-E "file ikev2pI2-secrets.txt" -v -v -v -v'
- [ $? -eq 0 ] || exitcode=1
./TESTonce isakmp4 isakmp4500.pcap isakmp4.out '-E "file esp-secrets.txt"'
[ $? -eq 0 ] || exitcode=1
fi

View File

@ -0,0 +1,131 @@
From 68cc39dd64688829be2632d9cd24f7efa3da79bb Mon Sep 17 00:00:00 2001
From: Denis Ovsienko <denis@ovsienko.info>
Date: Thu, 13 Jul 2017 21:07:13 +0100
Subject: [PATCH] Fix a bug in test scripts (exposed in GH #613).
crypto.sh ran its tests as expected but only indicated a failure
upstream when the last test failed. Add necessary checks and modify
the other "complex" tests in a similar manner to make sure the same
bug does not creep into these scripts later. Fix some indentation
while at it.
---
tests/crypto.sh | 12 ++++++++++++
tests/isis-seg-fault-1-v.sh | 6 +++++-
tests/lmp-v.sh | 7 ++++++-
tests/nflog-e.sh | 7 ++++++-
4 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/tests/crypto.sh b/tests/crypto.sh
index 3aa29caa..5e295957 100755
--- a/tests/crypto.sh
+++ b/tests/crypto.sh
@@ -1,12 +1,17 @@
#!/bin/sh
+exitcode=0
+
# Only attempt OpenSSL-specific tests when compiled with the library.
if grep '^#define HAVE_LIBCRYPTO 1$' ../config.h >/dev/null
then
./TESTonce esp1 02-sunrise-sunset-esp.pcap esp1.out '-E "0x12345678@192.1.2.45 3des-cbc-hmac96:0x4043434545464649494a4a4c4c4f4f515152525454575758"'
+ [ $? -eq 0 ] || exitcode=1
./TESTonce esp2 08-sunrise-sunset-esp2.pcap esp2.out '-E "0x12345678@192.1.2.45 3des-cbc-hmac96:0x43434545464649494a4a4c4c4f4f51515252545457575840,0xabcdabcd@192.0.1.1 3des-cbc-hmac96:0x434545464649494a4a4c4c4f4f5151525254545757584043"'
+ [ $? -eq 0 ] || exitcode=1
./TESTonce esp3 02-sunrise-sunset-esp.pcap esp1.out '-E "3des-cbc-hmac96:0x4043434545464649494a4a4c4c4f4f515152525454575758"'
+ [ $? -eq 0 ] || exitcode=1
# Reading the secret(s) from a file does not work with Capsicum.
if grep '^#define HAVE_CAPSICUM 1$' ../config.h >/dev/null
then
@@ -18,10 +23,15 @@ then
printf "$FORMAT" isakmp4
else
./TESTonce esp4 08-sunrise-sunset-esp2.pcap esp2.out '-E "file esp-secrets.txt"'
+ [ $? -eq 0 ] || exitcode=1
./TESTonce esp5 08-sunrise-sunset-aes.pcap esp5.out '-E "file esp-secrets.txt"'
+ [ $? -eq 0 ] || exitcode=1
./TESTonce espudp1 espudp1.pcap espudp1.out '-nnnn -E "file esp-secrets.txt"'
+ [ $? -eq 0 ] || exitcode=1
./TESTonce ikev2pI2 ikev2pI2.pcap ikev2pI2.out '-E "file ikev2pI2-secrets.txt" -v -v -v -v'
+ [ $? -eq 0 ] || exitcode=1
./TESTonce isakmp4 isakmp4500.pcap isakmp4.out '-E "file esp-secrets.txt"'
+ [ $? -eq 0 ] || exitcode=1
fi
else
FORMAT=' %-35s: TEST SKIPPED (compiled w/o OpenSSL)\n'
@@ -34,3 +44,5 @@ else
printf "$FORMAT" ikev2pI2
printf "$FORMAT" isakmp4
fi
+
+exit $exitcode
diff --git a/tests/isis-seg-fault-1-v.sh b/tests/isis-seg-fault-1-v.sh
index fc7bddd4..57965e8e 100755
--- a/tests/isis-seg-fault-1-v.sh
+++ b/tests/isis-seg-fault-1-v.sh
@@ -4,6 +4,7 @@
# may produce a slightly different result if the compiler is not GCC.
# Test only with GCC (similar to GitHub issue #333).
+exitcode=0
test_name=isis-seg-fault-1-v
if [ ! -f ../Makefile ]
@@ -11,7 +12,10 @@ then
printf ' %-35s: TEST SKIPPED (no Makefile)\n' $test_name
elif grep '^CC = .*gcc' ../Makefile >/dev/null
then
- ./TESTonce $test_name isis-seg-fault-1.pcap isis-seg-fault-1-v.out '-v'
+ ./TESTonce $test_name isis-seg-fault-1.pcap isis-seg-fault-1-v.out '-v'
+ [ $? -eq 0 ] || exitcode=1
else
printf ' %-35s: TEST SKIPPED (compiler is not GCC)\n' $test_name
fi
+
+exit $exitcode
diff --git a/tests/lmp-v.sh b/tests/lmp-v.sh
index d26760d0..2d018864 100755
--- a/tests/lmp-v.sh
+++ b/tests/lmp-v.sh
@@ -6,6 +6,8 @@
# GCC build and must reproduce correctly on any other GCC build regardless of
# the architecture.
+exitcode=0
+
# A Windows build may have no file named Makefile and also a version of grep
# that won't return an error when the file does not exist. Work around.
if [ ! -f ../Makefile ]
@@ -13,7 +15,10 @@ then
printf ' %-35s: TEST SKIPPED (no Makefile)\n' 'lmp-v'
elif grep '^CC = .*gcc' ../Makefile >/dev/null
then
- ./TESTonce lmp-v lmp.pcap lmp-v.out '-T lmp -v'
+ ./TESTonce lmp-v lmp.pcap lmp-v.out '-T lmp -v'
+ [ $? -eq 0 ] || exitcode=1
else
printf ' %-35s: TEST SKIPPED (compiler is not GCC)\n' 'lmp-v'
fi
+
+exit $exitcode
diff --git a/tests/nflog-e.sh b/tests/nflog-e.sh
index a8a67f00..5b002bf1 100755
--- a/tests/nflog-e.sh
+++ b/tests/nflog-e.sh
@@ -1,10 +1,15 @@
#!/bin/sh
+exitcode=0
+
# NFLOG support depends on both DLT_NFLOG and working <pcap/nflog.h>
if grep '^#define HAVE_PCAP_NFLOG_H 1$' ../config.h >/dev/null
then
- ./TESTonce nflog-e nflog.pcap nflog-e.out '-e'
+ ./TESTonce nflog-e nflog.pcap nflog-e.out '-e'
+ [ $? -eq 0 ] || exitcode=1
else
printf ' %-35s: TEST SKIPPED (compiled w/o NFLOG)\n' 'nflog-e'
fi
+
+exit $exitcode

View File

@ -1,8 +1,11 @@
-------------------------------------------------------------------
Tue Aug 22 09:22:35 UTC 2017 - pmonrealgonzalez@suse.com
Wed Aug 23 13:51:30 UTC 2017 - pmonrealgonzalez@suse.com
- Disabled ikev2pI2 test on all architectures
* Refreshed patch tcpdump-ikev2pI2-test-fails-ppc.patch
- Reverted upstream commit that makes some tests to fail when
compiling with openssl-1.1.0
* Upstream commit 68cc39dd64688829be2632d9cd24f7efa3da79bb
* Added patch tcpdump-reverted-test-scripts-fix.patch
* Removed patch tcpdump-ikev2pI2-test-fails-ppc.patch
-------------------------------------------------------------------
Wed Jul 26 12:33:53 UTC 2017 - pmonrealgonzalez@suse.com

View File

@ -28,8 +28,8 @@ Source: http://www.tcpdump.org/release/%{name}-%{version}.tar.gz
Source1: tcpdump-qeth
Source2: http://www.tcpdump.org/release/%{name}-%{version}.tar.gz.sig
Source3: http://www.tcpdump.org/tcpdump-workers.asc#/%{name}.keyring
# PATCH-FIX-OPENSUSE tcpdump-ikev2pI2-test-fails-ppc.patch -- Disable ikev2pI2 test
Patch0: tcpdump-ikev2pI2-test-fails-ppc.patch
# PATCH-FIX-UPSTREAM tcpdump-reverted-test-scripts-fix.patch
Patch0: tcpdump-reverted-test-scripts-fix.patch
BuildRequires: libpcap-devel >= %{min_libpcap_version}
BuildRequires: libsmi-devel
BuildRequires: openssl-devel
@ -42,7 +42,7 @@ ethernet. It can be used to debug specific network problems.
%prep
%setup -q
%patch0 -p1
%patch0 -p1 -R
%build
export CFLAGS="%{optflags} -Wall -DGUESS_TSO -fstack-protector -fno-strict-aliasing"