Apply "tests: workaround net-yy-inet* for new kernels"

Fixes net-yy-inet and net-yy-inet6 test failures.

* 0001-tests-workaround-net-yy-inet-for-new-kernels.patch: New file.
* strace.spec (Release): Bump to 3.
(Patch0001): New patch.
(%prep): Apply it.
(%changelog): Add a record.

Resolves: RHEL-45361
Signed-off-by: Eugene Syromiatnikov <esyr@redhat.com>
This commit is contained in:
Eugene Syromiatnikov 2024-08-01 15:43:24 +02:00
parent 84754a8d77
commit 7a243f6cd2
2 changed files with 62 additions and 1 deletions

View File

@ -0,0 +1,52 @@
From e9d784ecd3ef0c5af9f8c74a830e797d773d71cb Mon Sep 17 00:00:00 2001
From: "Dmitry V. Levin" <ldv@strace.io>
Date: Sun, 21 Apr 2024 08:00:00 +0000
Subject: [PATCH] tests: workaround net-yy-inet* for new kernels
Starting with Linux kernel commit v6.8-rc1~131^2~223, NETLINK_INET_DIAG
works also for bound-only sockets. As there is no easy way to tell
whether the running kernel contains that commit, the test cannot easily
predict the kernel behavior in case of sockets in bound-only state.
Workaround this by skipping the corresponding part of the test.
* tests/net-yy-inet.test: Filter out listen() calls.
* tests/net-yy-inet.c (main): Do not print expected output for listen()
syscall.
Resolves: https://github.com/strace/strace/issues/299
---
tests/net-yy-inet.c | 2 --
tests/net-yy-inet.test | 6 +++++-
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/tests/net-yy-inet.c b/tests/net-yy-inet.c
index 1a83548bf..7f8e05783 100644
--- a/tests/net-yy-inet.c
+++ b/tests/net-yy-inet.c
@@ -63,8 +63,6 @@ main(void)
if (listen(listen_fd, 1))
perror_msg_and_skip("listen");
- printf("listen(%d<" TCP_STR ":[%lu]>, 1) = 0\n",
- listen_fd, listen_inode);
memset(listen_sa, 0, sizeof(addr));
*len = sizeof(addr);
diff --git a/tests/net-yy-inet.test b/tests/net-yy-inet.test
index 9a3f851bf..d45414bcb 100755
--- a/tests/net-yy-inet.test
+++ b/tests/net-yy-inet.test
@@ -17,5 +17,9 @@ run_prog > /dev/null
run_strace -a22 -yy -eclose,network $args > "$EXP"
# Filter out close() calls made by ld.so and libc.
-sed -n '/socket/,$p' < "$LOG" > "$OUT"
+#
+# Filter out listen() call as we cannot easily predict the kernel
+# behaviour because there is no easy way to tell whether the Linux kernel
+# contains commit v6.8-rc1~131^2~223.
+sed -n '/^listen/d;/^socket/,$p' < "$LOG" > "$OUT"
match_diff "$OUT" "$EXP"
--
2.28.0

View File

@ -1,7 +1,7 @@
Summary: Tracks and displays system calls associated with a running process
Name: strace
Version: 6.7
Release: 2%{?dist}
Release: 3%{?dist}
# The test suite is GPLv2+, the bundled headers are GPLv2 with Linux syscall
# exception, all the rest is LGPLv2.1+.
%if 0%{?fedora} >= 35 || 0%{?centos} >= 9 || 0%{?rhel} >= 9
@ -104,6 +104,10 @@ Group: Development%{?suse_version:/Tools}/Debuggers
URL: https://strace.io
%if 0%{?fedora} >= 12 || 0%{?centos} >= 6 || 0%{?rhel} >= 6 || 0%{?suse_version} >= 1200
Source: https://strace.io/files/%{version}/strace-%{version}.tar.xz
# v6.9~27 "tests: workaround net-yy-inet* for new kernels"
Patch0001: 0001-tests-workaround-net-yy-inet-for-new-kernels.patch
BuildRequires: xz
%else
Source: strace-%{version}.tar.gz
@ -155,6 +159,8 @@ echo -n 2024 > .year
echo -n 2023-11-21 > doc/.strace.1.in.date
echo -n 2022-01-01 > doc/.strace-log-merge.1.in.date
%patch0001 -p1
%build
echo 'BEGIN OF BUILD ENVIRONMENT INFORMATION'
uname -a |head -1
@ -205,6 +211,9 @@ fi
%{_mandir}/man1/*
%changelog
* Thu Aug 01 2024 Eugene Syromiatnikov <esyr@redhat.com> - 6.7-3
- Apply "tests: workaround net-yy-inet* for new kernels" (RHEL-45361)
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 6.7-2
- Bump release for June 2024 mass rebuild