From 3bf08cbb388a89014252bdfe5143324bdaa4dc46 Mon Sep 17 00:00:00 2001 From: "Dmitry V. Levin" Date: Mon, 28 Oct 2024 08:00:00 +0000 Subject: [PATCH 185/185] tests: add another test of restart_syscall decoding * tests/restart_syscall-p.test: New test. * tests/restart_syscall-p.expected: New file. * tests/Makefile.am (DECODER_TESTS): Add restart_syscall-p.test. (check_DATA): Add restart_syscall-p.expected. --- tests/Makefile.am | 2 ++ tests/restart_syscall-p.expected | 2 ++ tests/restart_syscall-p.test | 20 ++++++++++++++++++++ 3 files changed, 24 insertions(+) create mode 100644 tests/restart_syscall-p.expected create mode 100755 tests/restart_syscall-p.test Index: strace-6.7/tests/Makefile.am =================================================================== --- strace-6.7.orig/tests/Makefile.am 2024-10-29 13:05:29.486223478 +0100 +++ strace-6.7/tests/Makefile.am 2024-10-29 13:58:46.485209167 +0100 @@ -565,6 +565,7 @@ prctl-seccomp-strict.test \ qual_fault-exit_group.test \ readv.test \ + restart_syscall-p.test \ rt_sigaction.test \ scm_rights-fd.test \ seccomp-strict.test \ @@ -736,6 +737,7 @@ qual_inject-signal.expected \ qualify_personality_empty.in \ regex.in \ + restart_syscall-p.expected \ rt_sigaction.awk \ sched.in \ sigaltstack.expected \ Index: strace-6.7/tests/restart_syscall-p.expected =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ strace-6.7/tests/restart_syscall-p.expected 2024-10-29 13:58:46.485209167 +0100 @@ -0,0 +1,2 @@ +restart_syscall(<... resuming interrupted nanosleep ...>) = 0 +exit_group(0) = ? Index: strace-6.7/tests/restart_syscall-p.test =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ strace-6.7/tests/restart_syscall-p.test 2024-10-29 13:58:46.485209167 +0100 @@ -0,0 +1,20 @@ +#!/bin/sh +# +# Check restart_syscall decoding. +# +# Copyright (c) 2015-2024 The strace developers. +# All rights reserved. +# +# SPDX-License-Identifier: GPL-2.0-or-later + +. "${srcdir=.}/init.sh" + +run_prog ../sleep 0 + +../set_ptracer_any ../sleep 2 > /dev/null & +tracee_pid=$! + +../sleep 1 + +run_strace -qq -a14 -p $tracee_pid +match_diff Index: strace-6.7/tests-m32/Makefile.in =================================================================== --- strace-6.7.orig/tests-m32/Makefile.in 2024-01-29 13:43:44.000000000 +0100 +++ strace-6.7/tests-m32/Makefile.in 2024-10-29 13:59:34.146652355 +0100 @@ -10531,6 +10531,7 @@ prctl-seccomp-strict.test \ qual_fault-exit_group.test \ readv.test \ + restart_syscall-p.test \ rt_sigaction.test \ scm_rights-fd.test \ seccomp-strict.test \ @@ -10697,6 +10698,7 @@ qual_inject-signal.expected \ qualify_personality_empty.in \ regex.in \ + restart_syscall-p.expected \ rt_sigaction.awk \ sched.in \ sigaltstack.expected \ Index: strace-6.7/tests-mx32/Makefile.in =================================================================== --- strace-6.7.orig/tests-mx32/Makefile.in 2024-01-29 13:43:45.000000000 +0100 +++ strace-6.7/tests-mx32/Makefile.in 2024-10-29 13:59:43.762540016 +0100 @@ -10531,6 +10531,7 @@ prctl-seccomp-strict.test \ qual_fault-exit_group.test \ readv.test \ + restart_syscall-p.test \ rt_sigaction.test \ scm_rights-fd.test \ seccomp-strict.test \ @@ -10697,6 +10698,7 @@ qual_inject-signal.expected \ qualify_personality_empty.in \ regex.in \ + restart_syscall-p.expected \ rt_sigaction.awk \ sched.in \ sigaltstack.expected \ Index: strace-6.7/tests/Makefile.in =================================================================== --- strace-6.7.orig/tests/Makefile.in 2024-01-29 13:43:45.000000000 +0100 +++ strace-6.7/tests/Makefile.in 2024-10-29 13:59:15.712867710 +0100 @@ -10530,6 +10530,7 @@ prctl-seccomp-strict.test \ qual_fault-exit_group.test \ readv.test \ + restart_syscall-p.test \ rt_sigaction.test \ scm_rights-fd.test \ seccomp-strict.test \ @@ -10696,6 +10697,7 @@ qual_inject-signal.expected \ qualify_personality_empty.in \ regex.in \ + restart_syscall-p.expected \ rt_sigaction.awk \ sched.in \ sigaltstack.expected \