From patchwork Sat Oct 26 09:25:14 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 3915 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7000:589a:b0:5b9:581e:f939 with SMTP id h26csp379891max; Sat, 26 Oct 2024 02:25:39 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCU9cz/YikP0xWavAj56jokh+30btgPeoiLEWedBLvwWC8aN26qGSeSIEC4GHqNOZyLNEr5nc7c5aiU=@openvpn.net X-Google-Smtp-Source: AGHT+IEJOh9LcacXnudiTgiCHauOWQYem7oxQ7g4cvQjK0EaxuGZzrbZpkeWVd95e5RyvQK+dYKd X-Received: by 2002:a05:6e02:1d14:b0:3a0:9f36:6bf1 with SMTP id e9e14a558f8ab-3a4de75ad55mr60105215ab.9.1729934739703; Sat, 26 Oct 2024 02:25:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1729934739; cv=none; d=google.com; s=arc-20240605; b=jruY/KKWVjInt3fHiQclmf7ipZoX1PFt43X/qf34GTIwQuAVAfvTO8jhI8uNYfCBL6 8amtfk3ncj34K9yBCOxedMo5/2RU79E0VT61q7JIrVpXkTjfYOrxVxdCUWSHCil5g2Pv qnNeNg9zI6JBEJTl/eyj92XPchlVOtWR3USadBWpks2xwJiHHFg1JOCR/wizdnfI2JJV 60UhgNIQbxg1ukjTNmwY5C/J325rruN6rElSspzqG6qhjrMMyz383Dc1T+z9eoGNZd+P lxxx0Q5PnsB6txexTXXVq3Tv511s25dNotlseeh88Xmu/3TLPiOp8wjQn5s8EpmPYyKn 3S4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=errors-to:content-transfer-encoding:list-subscribe:list-help :list-post:list-archive:list-unsubscribe:list-id:precedence:subject :mime-version:references:in-reply-to:message-id:date:to:from :dkim-signature:dkim-signature; bh=aB1SuZ88M6NiSET6taX190FST2bDTFeKl6p6mz7rDEA=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=PD2Bftm25QPVIELbUyz/bGU6KBB0b1o66r5Ru9jEVfN9Akkh9Mny74ZVfGtGVrN76i M5eM8bpuDc2rC/qNRGap5WBFC+n2h5GQ86X08yyfbGZjAhYKOT6MmRXCdqxudJtJV5j1 iLPHdYqeiQqqqhX8DvC3Jy2xg1vCJ5q+Q07Kmm0gMBXfYxKbQBpBfyq+tjXeQtO8kY6h Wyd7BxUd3yc0BHc0nFCT8aNNvj3BJP9WqioRSaCP+dskMBEHFLAQaxRhbIodXfWs2rT3 KY7GxqDdgGNVddIkU8owUgVXtpJHoYbjCamcAeHR+V8ozznRVdHqOhfMbtuHhhx/7mnb APVw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=LIVIDk0K; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=AZAXhTC3; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from lists.sourceforge.net (lists.sourceforge.net. [216.105.38.7]) by mx.google.com with ESMTPS id 8926c6da1cb9f-4dc72612ba1si1352739173.61.2024.10.26.02.25.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sat, 26 Oct 2024 02:25:39 -0700 (PDT) Received-SPF: pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) client-ip=216.105.38.7; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=LIVIDk0K; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=AZAXhTC3; spf=pass (google.com: domain of openvpn-devel-bounces@lists.sourceforge.net designates 216.105.38.7 as permitted sender) smtp.mailfrom=openvpn-devel-bounces@lists.sourceforge.net; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=muc.de Received: from [127.0.0.1] (helo=sfs-ml-2.v29.lw.sourceforge.com) by sfs-ml-2.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1t4d35-0006Jh-RG; Sat, 26 Oct 2024 09:25:31 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-2.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1t4d33-0006JP-V5 for openvpn-devel@lists.sourceforge.net; Sat, 26 Oct 2024 09:25:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:Content-Type:MIME-Version :References:In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=FH+QtjKvY5/9IrIejxyitgm7w7RUEUh6H4W3rPuirZs=; b=LIVIDk0KwfLlnaBFcKMDGLOEEE Rpfds4wdqgiG+rzd61n+PZMWBiGuVMjzNnVn2LgYAf4NUWJ8VAB0OW4pmIyqFO3y2AGydPIdo50YZ 4e1CL90IlCSJ6jg5L4nVFmNss+t1dcNZ9mqbDHDLiGTwzqFyXCzp0Rzrxnubvn/+uGI8=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References: In-Reply-To:Message-ID:Date:Subject:To:From:Sender:Reply-To:Cc:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=FH+QtjKvY5/9IrIejxyitgm7w7RUEUh6H4W3rPuirZs=; b=AZAXhTC3eHqROSyBnAgSPBl+eq JT2N8J/bEP0qhuyau/GZGd2dMUaq1uWZ452zHpV66eWqP4JbjeRt5q+YM2jp6u4B1XLOSoUGC2Erg 9XXoLZeMiqSf5aasb0Q6AA/KrihXBpKhv4GYVsZUcbFeCdL0FgrFVC1hYbKBYGXa4wLs=; Received: from dhcp-174.greenie.muc.de ([193.149.48.174] helo=blue.greenie.muc.de) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.95) id 1t4d32-00077W-67 for openvpn-devel@lists.sourceforge.net; Sat, 26 Oct 2024 09:25:29 +0000 Received: from blue.greenie.muc.de (localhost [127.0.0.1]) by blue.greenie.muc.de (8.17.1.9/8.17.1.9) with ESMTP id 49Q9PGwE030623 for ; Sat, 26 Oct 2024 11:25:16 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 49Q9PGXg030622 for openvpn-devel@lists.sourceforge.net; Sat, 26 Oct 2024 11:25:16 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Sat, 26 Oct 2024 11:25:14 +0200 Message-ID: <20241026092515.30559-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: -0.0 (/) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22util-spamd-2=2Ev13=2Elw=2Esourceforge=2Ecom=22=2C?= =?unknown-8bit?q?_has_NOT_identified_this_incoming_email_as_spam=2E__The_ori?= =?unknown-8bit?q?ginal?= =?unknown-8bit?q?_message_has_been_attached_to_this_so_you_can_view_it_or_la?= =?unknown-8bit?q?bel?= =?unknown-8bit?q?_similar_future_email=2E__If_you_have_any_questions=2C_see?= =?unknown-8bit?q?_the_administrator_of_that_system_for_details=2E?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_preview=3A__From=3A_Samuli_Sepp=C3=A4nen_=3Csamuli?= =?unknown-8bit?q?=2Eseppanen=40gmail=2Ecom=3E_By_using?= =?unknown-8bit?q?_wait_in_a_more_inventive_way_we_can_avoid_using_a_marker_f?= =?unknown-8bit?q?ile_to_detect_the?= =?unknown-8bit?q?_=22server_could_not_be_killed_gracefully=22_situation=2E_C?= =?unknown-8bit?q?hange-Id=3A_Ib385080e1dd1c3046c54e6267db8aa7d5c09e2fb?= =?unknown-8bit?q?_Signed-off-by=3A_Samuli_Sepp=C3=A4nen_=3Csamuli=2Eseppanen?= =?unknown-8bit?q?=40gmail=2Ecom=3E_Acked-by=3A_Gert?= =?unknown-8bit?q?_Doering_=3Cgert=40greenie=2Emuc=2Ede=3E_---_?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=28-0=2E0_points=2C_6=2E0_re?= =?unknown-8bit?q?quired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_-0=2E0_SPF=5FHELO=5FPASS__________SPF=3A_HELO_matches_SPF_?= =?unknown-8bit?q?record?= =?unknown-8bit?q?_-0=2E0_SPF=5FPASS_______________SPF=3A_sender_matches_SPF_?= =?unknown-8bit?q?record?= X-Headers-End: 1t4d32-00077W-67 Subject: [Openvpn-devel] [PATCH v1] t_server_null: use wait instead of marker files X-BeenThere: openvpn-devel@lists.sourceforge.net X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openvpn-devel-bounces@lists.sourceforge.net X-getmail-retrieved-from-mailbox: Inbox X-GMAIL-THRID: =?utf-8?q?1813968049456715588?= X-GMAIL-MSGID: =?utf-8?q?1813968049456715588?= From: Samuli Seppänen By using wait in a more inventive way we can avoid using a marker file to detect the "server could not be killed gracefully" situation. Change-Id: Ib385080e1dd1c3046c54e6267db8aa7d5c09e2fb Signed-off-by: Samuli Seppänen Acked-by: Gert Doering --- This change was reviewed on Gerrit and approved by at least one developer. I request to merge it to master. Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/786 This mail reflects revision 1 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/tests/t_server_null.sh b/tests/t_server_null.sh index 3c0fc4b..74ffd52 100755 --- a/tests/t_server_null.sh +++ b/tests/t_server_null.sh @@ -62,6 +62,8 @@ mkdir $t_server_null_logdir "${srcdir}/t_server_null_server.sh" & +T_SERVER_NULL_SERVER_PID=$! + "${srcdir}/t_server_null_client.sh" retval=$? @@ -69,11 +71,9 @@ # that this script does not exit before all --dev null servers are dead and # their network interfaces are gone. Otherwise t_client.sh will fail because # pre and post ifconfig output does not match. -wait +wait $T_SERVER_NULL_SERVER_PID -. ./t_server_null_default.rc - -if [ -e $SERVER_KILL_FAIL_FILE ]; then +if [ $? -ne 0 ]; then exit 1 else exit $retval diff --git a/tests/t_server_null_server.sh b/tests/t_server_null_server.sh index ab01dd2..acf8479 100755 --- a/tests/t_server_null_server.sh +++ b/tests/t_server_null_server.sh @@ -37,8 +37,9 @@ # Load local configuration, if any test -r ./t_server_null.rc && . ./t_server_null.rc -# Remove server kill failure marker file, if any -rm -f $SERVER_KILL_FAIL_FILE +# We can't exit immediately on the first failure as that could leave processes +# lying around. +retval=0 # Launch test servers for SUF in $TEST_SERVER_LIST @@ -81,7 +82,6 @@ # Make sure that the server processes are truly dead before exiting. If a # server process does not exit in 15 seconds assume it never will, move on and # hope for the best. - echo "Waiting for servers to exit" for PID_FILE in $server_pid_files do @@ -111,6 +111,8 @@ echo "ERROR: had to send SIGKILL to server ${SERVER_NAME} with pid ${SERVER_PID}!" echo "Tail of server log:" tail -n 20 "${t_server_null_logdir}/${SERVER_NAME}.log" - touch $SERVER_KILL_FAIL_FILE + retval=1 fi done + +exit $retval