From patchwork Wed Jun 18 14:13:21 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gert Doering X-Patchwork-Id: 4286 Return-Path: Delivered-To: patchwork@openvpn.net Received: by 2002:a05:7001:602d:b0:668:42a9:9967 with SMTP id us45csp3145691mab; Wed, 18 Jun 2025 07:13:46 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXEDiRS7G2rwQsvuxYfvhitlPIABbpmTl9AhRwwM5WXho4COSryvqYSFNdd4cDWKskulH/pdvF21q4=@openvpn.net X-Google-Smtp-Source: AGHT+IFvAcoIIn58yHAiq7yCDakeWN/C669v32z+tre115aIZmnJ3G8IkBo0dzFOPIpAW6A94WL3 X-Received: by 2002:a05:6602:7501:b0:873:f23:ff5 with SMTP id ca18e2360f4ac-875dee11805mr2052125239f.12.1750256026331; Wed, 18 Jun 2025 07:13:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1750256026; cv=none; d=google.com; s=arc-20240605; b=W+PwWbEBus4h9xcP/fbFSC0gSKqObHCfhpA2j+54j4fj8Vt+EEMJ6z/CzC9OYzxWlu kC5epgnAOTLDVj7BZBvc8nedT67zHQmX4gcJYYf3BCoS3FOBwAXEV5zVhj1yGigZ5lY7 A9kNBtkVd34QL+TS4XfdMuQMNqDM5oUkQshCfW8e1BFrEnhsOPv7XyMsmoEkvfgW5/GN qCtsbJP47DCJm74QjviGoqe5ht2OQLPtmKP1vjYz9UZJNr8r2tPdTZ1ri+VoNIV4UGvZ uJS0uVBQAk9JL+9xhJXverKiKHQYMYiJyTiYZFo3CNCxz//BcFsxtMU9/HjgDTmYqkoF KWmw== 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:dkim-signature; bh=fQF1lZfONwbb0ztoSs+YG8Uf2pER0iKBr+O5YtQZqkg=; fh=4NbAC/LsuMLI0S0hprUlLSLCiHwg6SCAifhH718Jh0Q=; b=G057O79FpLecEUFmp3iRIC7MOktnC3zU2483FOYSnGtE65UWG4hKXzwmIrfvPuCHgL ethq8ncMFJl9Ew1mbT0r2vVl9r4OpT5AQZIy1T8dBrtcHCegyvBsKlqmRmsLeWRJnrD+ HntiKGE5bjLQaS0aRXSKL6k2Ty1UJoj16L+ElDp9rScETogbSdDpsiS2GSzrmkpfXZiS eTRAu12lhEX2ltW3D0dPubSpN87d8bQmqWfSnnkSymaCrJVhE3BTYeBGI1W5PNpeu+q6 WYDkMUM+s+aV1YSVyy6dtKa3pOOUAwgoY85FMSVz7eHhxPFiU7PkFNmBZCL9Z8HraamH +cKw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lists.sourceforge.net header.s=beta header.b=PG4cvo9c; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=fNmplxmG; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=PjCgEnfT; 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-50149ca2fedsi13445963173.136.2025.06.18.07.13.46 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 18 Jun 2025 07:13:46 -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=pass header.i=@lists.sourceforge.net header.s=beta header.b=PG4cvo9c; dkim=neutral (body hash did not verify) header.i=@sourceforge.net header.s=x header.b=fNmplxmG; dkim=neutral (body hash did not verify) header.i=@sf.net header.s=x header.b=PjCgEnfT; 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 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.sourceforge.net; s=beta; h=Content-Transfer-Encoding:Content-Type: List-Subscribe:List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: Subject:MIME-Version:References:In-Reply-To:Message-ID:Date:To:From:Sender: Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=fQF1lZfONwbb0ztoSs+YG8Uf2pER0iKBr+O5YtQZqkg=; b=PG4cvo9cj4rA2eQXxfi6tbYVlX 1zI8fvPdLWq3ue39j+IHKvQ5ZXLVySUb+i16CP+WCbxQDv6899FskL7XMw148d49Z32VR47gzmLx/ 5Aw7w7coHyRueZ+EctKzHT4tkkQ6Ruex1ojVXTXd8Jd1dstSp2oGadRKOBpsZBRhnz7w=; Received: from [127.0.0.1] (helo=sfs-ml-3.v29.lw.sourceforge.com) by sfs-ml-3.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1uRtXr-0004pj-Oa; Wed, 18 Jun 2025 14:13:43 +0000 Received: from [172.30.29.66] (helo=mx.sourceforge.net) by sfs-ml-3.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1uRtXp-0004pc-U1 for openvpn-devel@lists.sourceforge.net; Wed, 18 Jun 2025 14:13:41 +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=wW64Lzx9PQ6H3Xy7jMkbUNPIvBjV+bM+T1XlyrA5JXk=; b=fNmplxmGsctUYJ4qBTrUL44xoO O8munXTD+RPY1hgQuhUM4NPYGyJSCUPVrLd7WoZrJMsKa4GcNRtWuuv1EUtx/SG1BH95VaUws+kJD F0R7IMRktF8CKZ0LQovgYdu4BxdhcDeWwLbwnKL7CIwPBRjzMSuV3xwovdSXkwu3bgtU=; 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=wW64Lzx9PQ6H3Xy7jMkbUNPIvBjV+bM+T1XlyrA5JXk=; b=PjCgEnfT/K7UXcK81/aIxlT7bN /+MTSQRKCjdbA2dwsuUxgrSi7EIwKpF8qN7WrfwiI7ai4CDQK8QEWrkUKodmQ0fTW1tXLzB/2x6SE neidbAasbC45xBqoBuoigWPsKDJhZUPsFjFR7V6Y64cVLNYVMQoBHeH2uCxNQvTq5el0=; Received: from [193.149.48.143] (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 1uRtXp-00049u-3x for openvpn-devel@lists.sourceforge.net; Wed, 18 Jun 2025 14:13:41 +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 55IEDTku004630 for ; Wed, 18 Jun 2025 16:13:29 +0200 Received: (from gert@localhost) by blue.greenie.muc.de (8.17.1.9/8.17.1.9/Submit) id 55IEDTEw004628 for openvpn-devel@lists.sourceforge.net; Wed, 18 Jun 2025 16:13:29 +0200 From: Gert Doering To: openvpn-devel@lists.sourceforge.net Date: Wed, 18 Jun 2025 16:13:21 +0200 Message-ID: <20250618141328.4600-1-gert@greenie.muc.de> X-Mailer: git-send-email 2.49.0 In-Reply-To: References: MIME-Version: 1.0 X-Spam-Score: 1.3 (+) X-Spam-Report: =?unknown-8bit?q?Spam_detection_software=2C_running_on_the_sy?= =?unknown-8bit?q?stem_=22sfi-spamd-1=2Ehosts=2Ecolo=2Esdot=2Eme=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_Use_=22=26=22?= =?unknown-8bit?q?_to_background_so_that_the_exit_code_and_all_output_can_be_?= =?unknown-8bit?q?obtained_in_all?= =?unknown-8bit?q?_failure_cases=2E_Change-Id=3A_I39dc6b08952a06dae7901e468f9?= =?unknown-8bit?q?487c8541d83c3_Signed-off-by=3A?= =?unknown-8bit?q?_Samuli_Sepp=C3=A4nen_=3Csamuli=2Eseppanen=40gmail=2Ecom=3E?= =?unknown-8bit?q?_Acked-by=3A_Gert_Doering_=3Cgert=40greenie=2Emuc=2Ede=3E?= =?unknown-8bit?q?_---_?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_Content_analysis_details=3A___=281=2E3_points=2C_5=2E0_req?= =?unknown-8bit?q?uired=29?= =?unknown-8bit?q?_?= =?unknown-8bit?q?_pts_rule_name______________description?= =?unknown-8bit?q?_----_----------------------_------------------------------?= =?unknown-8bit?q?--------------------?= =?unknown-8bit?q?_1=2E3_RDNS=5FNONE______________Delivered_to_internal_netwo?= =?unknown-8bit?q?rk_by_a_host_with_no_rDNS?= X-Headers-End: 1uRtXp-00049u-3x Subject: [Openvpn-devel] [PATCH v3] t_server_null: print error when server startup fails 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?1835276463178502435?= X-GMAIL-MSGID: =?utf-8?q?1835276463178502435?= From: Samuli Seppänen Use "&" to background so that the exit code and all output can be obtained in all failure cases. Change-Id: I39dc6b08952a06dae7901e468f9487c8541d83c3 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/+/1024 This mail reflects revision 3 of this Change. Acked-by according to Gerrit (reflected above): Gert Doering diff --git a/tests/t_server_null_default.rc b/tests/t_server_null_default.rc index 5b74761..1f2fa2c 100755 --- a/tests/t_server_null_default.rc +++ b/tests/t_server_null_default.rc @@ -38,7 +38,7 @@ MAX_CLIENTS="10" CLIENT_MATCH="Test-Client" SERVER_EXEC="${top_builddir}/src/openvpn/openvpn" -SERVER_BASE_OPTS="--daemon --dev tun --topology subnet --max-clients $MAX_CLIENTS --persist-tun --verb 3 --duplicate-cn" +SERVER_BASE_OPTS="--dev tun --topology subnet --max-clients $MAX_CLIENTS --persist-tun --verb 3 --duplicate-cn" SERVER_BIND_OPTS="--local 127.0.0.1" SERVER_CIPHER_OPTS="" SERVER_CERT_OPTS="--ca ${CA} --dh ${DH} --cert ${SERVER_CERT} --key ${SERVER_KEY} --tls-auth ${TA} 0" diff --git a/tests/t_server_null_server.sh b/tests/t_server_null_server.sh index acf8479..65b7d56 100755 --- a/tests/t_server_null_server.sh +++ b/tests/t_server_null_server.sh @@ -11,20 +11,18 @@ # Allow reading this file even umask values are strict touch "$log" - if [ -z "${RUN_SUDO}" ]; then - "${server_exec}" \ - $server_conf \ - --status "${status}" 1 \ - --log "${log}" \ - --writepid "${pid}" \ - --explicit-exit-notify 3 - else - $RUN_SUDO "${server_exec}" \ - $server_conf \ - --status "${status}" 1 \ - --log "${log}" \ - --writepid "${pid}" \ - --explicit-exit-notify 3 + # Try to launch the server + $RUN_SUDO "${server_exec}" \ + $server_conf \ + --status "${status}" 1 \ + --writepid "${pid}" \ + --explicit-exit-notify 3 > "$log" 2>&1 & + + sleep 1 + + if ! [ -r "$pid" ] || [ -z "$pid" ]; then + echo "ERROR: failed to start server $server_name" + tail -n 20 "$log" fi }