From patchwork Thu Dec 1 07:50:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frans Klaver X-Patchwork-Id: 2880 X-Patchwork-Delegate: davids@openvpn.net Return-Path: Delivered-To: patchwork@openvpn.net Delivered-To: patchwork@openvpn.net Received: from director13.mail.ord1d.rsapps.net ([172.30.191.6]) by backend30.mail.ord1d.rsapps.net with LMTP id al6hKQhdiGPGdQAAIUCqbw (envelope-from ) for ; Thu, 01 Dec 2022 02:51:36 -0500 Received: from proxy5.mail.ord1d.rsapps.net ([172.30.191.6]) by director13.mail.ord1d.rsapps.net with LMTP id GPqwKAhdiGNLQgAA91zNiA (envelope-from ) for ; Thu, 01 Dec 2022 02:51:36 -0500 Received: from smtp1.gate.ord1d ([172.30.191.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) by proxy5.mail.ord1d.rsapps.net with LMTPS id 0ERoKAhdiGPwQwAA8Zzt7w (envelope-from ) for ; Thu, 01 Dec 2022 02:51:36 -0500 X-Spam-Threshold: 95 X-Spam-Score: 0 X-Spam-Flag: NO X-Virus-Scanned: OK X-Orig-To: openvpnslackdevel@openvpn.net X-Originating-Ip: [216.105.38.7] Authentication-Results: smtp1.gate.ord1d.rsapps.net; iprev=pass policy.iprev="216.105.38.7"; spf=pass smtp.mailfrom="openvpn-devel-bounces@lists.sourceforge.net" smtp.helo="lists.sourceforge.net"; dkim=fail (signature verification failed) header.d=sourceforge.net; dkim=fail (signature verification failed) header.d=sf.net; dkim=fail (signature verification failed) header.d=gmail.com; dmarc=fail (p=none; dis=none) header.from=gmail.com X-Suspicious-Flag: YES X-Classification-ID: fad977b6-714c-11ed-b42a-5254002d775b-1-1 Received: from [216.105.38.7] ([216.105.38.7:57678] helo=lists.sourceforge.net) by smtp1.gate.ord1d.rsapps.net (envelope-from ) (ecelerity 4.2.38.62370 r(:)) with ESMTPS (cipher=DHE-RSA-AES256-GCM-SHA384) id C8/1E-20079-80D58836; Thu, 01 Dec 2022 02:51:36 -0500 Received: from [127.0.0.1] (helo=sfs-ml-4.v29.lw.sourceforge.com) by sfs-ml-4.v29.lw.sourceforge.com with esmtp (Exim 4.95) (envelope-from ) id 1p0eLB-00085X-AT; Thu, 01 Dec 2022 07:50:41 +0000 Received: from [172.30.20.202] (helo=mx.sourceforge.net) by sfs-ml-4.v29.lw.sourceforge.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1p0eL9-00085R-Fe for openvpn-devel@lists.sourceforge.net; Thu, 01 Dec 2022 07:50:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sourceforge.net; s=x; h=Content-Transfer-Encoding:MIME-Version:Message-Id: Date:Subject:To:From:Sender:Reply-To:Cc:Content-Type:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:In-Reply-To:References:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=rmxhGSiEc4UAWdKowhAAoiVopBxFXV+NoODMKh/CQKc=; b=ZbE/suI/a7JKIkVPJ7ufm4ucln 7SBtJU9mTKMouoGbT2F60HDKU0BGJqVYQkMaqP9MgRAlWlLhRYctFRHBAjl0o//lOS8X6x1zsHIYi +VgQBLmahxZ2nX3SG/cafC1BF6y4e8MQJYqs8L8q1rCWEvhi0V52IpgsmSmtOenFrs0I=; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=sf.net; s=x ; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject:To:From: Sender:Reply-To:Cc:Content-Type:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Id:List-Help:List-Unsubscribe:List-Subscribe:List-Post: List-Owner:List-Archive; bh=rmxhGSiEc4UAWdKowhAAoiVopBxFXV+NoODMKh/CQKc=; b=h W1oDytZOQ9UnaZIfmtlYO3qTRZkrTzUBuLLSlG2dTfd6v/6mrExs9Bl+h+hQVcIPgG+TxlId0REBk xGChTPyrXKigRl72rKJ1/n7ZfB5fXM5an8V0ikN5COd4YUynH/HHXM976hpggKBNBLMp87RaGCRtQ KDEaiHGASwrxK638=; Received: from mail-ej1-f44.google.com ([209.85.218.44]) by sfi-mx-2.v28.lw.sourceforge.com with esmtps (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.95) id 1p0eL8-000059-1u for openvpn-devel@lists.sourceforge.net; Thu, 01 Dec 2022 07:50:39 +0000 Received: by mail-ej1-f44.google.com with SMTP id vv4so2248064ejc.2 for ; Wed, 30 Nov 2022 23:50:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=rmxhGSiEc4UAWdKowhAAoiVopBxFXV+NoODMKh/CQKc=; b=S569AY6iVIOsGfDGp9+OKWgNXP5tNsuOKDJzBvP2GQ96vqu+6cGlY6qLcnokD0CVnk D/5L+NllUcQBwxyOPRZ25cUTzY2znDFoiXCS3Fu7wgrshNtqNGT3dYnfdvl4wFFKHJRZ tyIqBNZjuULZEg2TttXPprkEhKfRV44+4Uay+4DCOxnnBYR1nChuk5c7KlHALMt4mbGS /GxNv3oWSVyXEjzt9/Zsvw6t8lCnRtZXni3UUbcxq8r5zncyiAAiVzVJfZPDFwhnVIuX SoZSy3VmDQHuffiYMVsDDeK+o/p1miWLxvJj/78iRHYJGWx12PlsWQn7KlCChfjdMr3g 0/eQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=rmxhGSiEc4UAWdKowhAAoiVopBxFXV+NoODMKh/CQKc=; b=Ii5orrGVwHvGaSWktDkHR+qe3PqIgBHIGBnPJL7u+fqF1ZtefrjAqUOtSQt70CY4F7 Sd2LUqARdCn/t2qvRc+hahMkMIKGzIDvzFI8RhOw4E5t0HCI/vbJMNkrrObY8dKIhsQK qk9KvNoVB3oHqH/aqy2ZzXTZIBJFNw+RCWLyj0L3XGvKs5lFCFK8v5nI397LFA5llqlA vMRYQWAroikKNgY6gYE1+WqNC/q7rKho8KzqlThdlzddZRfHMYEWzkW1/iKoggBZJORM ZQ6Xmpo8KwtG2H2YPwAbhdoJIK712x0bhM9PBTpNaNkacRXeTBeKEwxz60sZyRygPASu xx0w== X-Gm-Message-State: ANoB5plgb48zbUGl53/yd+M8fNZogRPp9SRNSREUWzysqc2CqkG3I2WZ Jh8zcNKFBWDnmb1hWAIKdA5uK2WzBHQ= X-Google-Smtp-Source: AA0mqf6bOoo9hdOqa/dzaXjGPIrXkxlLJdBWSevgak3zra71I4eVb56XZxLbnzfE+V8UfZBa3jVGOQ== X-Received: by 2002:a17:906:7c59:b0:7c0:4030:ae21 with SMTP id g25-20020a1709067c5900b007c04030ae21mr14716389ejp.346.1669881031491; Wed, 30 Nov 2022 23:50:31 -0800 (PST) Received: from localhost.localdomain (2a02-a466-aae1-1-52eb-71ff-fe56-bb66.fixed6.kpn.net. [2a02:a466:aae1:1:52eb:71ff:fe56:bb66]) by smtp.gmail.com with ESMTPSA id 24-20020a170906309800b0078c1e174e11sm1470801ejv.136.2022.11.30.23.50.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Nov 2022 23:50:29 -0800 (PST) From: Frans Klaver To: fransklaver@gmail.com, openvpn-devel@lists.sourceforge.net Date: Thu, 1 Dec 2022 08:50:13 +0100 Message-Id: <20221201075013.30946-1-fransklaver@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 X-Spam-Report: Spam detection software, running on the system "util-spamd-2.v13.lw.sourceforge.com", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: The dbus test is dependent on the org.freedesktop.hostname1 service being present. If that isn't there, we really can't determine whether or not the PlatformInfo code does what it's supposed to do. So try to determine whether or not it makes sense to execute this test in the first place. Content analysis details: (-0.2 points, 6.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [fransklaver[at]gmail.com] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 RCVD_IN_MSPIKE_H2 RBL: Average reputation (+2) [209.85.218.44 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [209.85.218.44 listed in list.dnswl.org] X-Headers-End: 1p0eL8-000059-1u Subject: [Openvpn-devel] [PATCH openvpn3-linux] tests: platforminfo: skip DBus test if hostname service isn't available 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 The dbus test is dependent on the org.freedesktop.hostname1 service being present. If that isn't there, we really can't determine whether or not the PlatformInfo code does what it's supposed to do. So try to determine whether or not it makes sense to execute this test in the first place. Signed-off-by: Frans Klaver Acked-by: David Sommerseth --- src/tests/unit/platforminfo.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/tests/unit/platforminfo.cpp b/src/tests/unit/platforminfo.cpp index 453de63..1460367 100644 --- a/src/tests/unit/platforminfo.cpp +++ b/src/tests/unit/platforminfo.cpp @@ -45,6 +45,20 @@ TEST(PlatformInfo, DBus) } PlatformInfo plinfo(dbc.GetConnection()); + + try + { + plinfo.GetStringProperty("OperatingSystemCPEName"); + } + catch (const DBusException& e) + { + const std::string what{e.what()}; + if (what.find("was not provided by any") != std::string::npos) + { + GTEST_SKIP() << "A required service isn't available ## " + what; + } + } + std::string s{plinfo.str()}; ASSERT_TRUE(s.find("generic:") == std::string::npos) << "PlatformInfo D-Bus call failed";