From patchwork Sun Oct 7 14:59:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lubomir Rintel X-Patchwork-Id: 980184 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=v3.sk Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="HZPR8npt"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42Smsc4YLFz9sj6 for ; Mon, 8 Oct 2018 02:01:24 +1100 (AEDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=lMH4P70mZJjApQLj2RRgHMOgr5Tp5fTef3BZfN+gt90=; b=HZPR8nptv2/S6h aC2P2GKMD+3+iGEJ+s3Cn7IE/en3DjDL+7yViFNmGMqTzulMPK5uM7o0rOB0KCBnU7BvcX9QCVnBE OcIdHE4VKNGXRqTZOIsg21WB6Nk38qaAPKIvvW4niCBVzCn75s8GjoE75rdk3NXKnq99H37/KtcdE yVbvHcpCDcI2xXTeCHPFp2PJ0bi5DaXIqHsM0XwBRX7EpvPgLDYMxj23OTqZvQAzngs2xZipqdkMK Wr0ZSOEydsxqBc1MmxeVNE1KVbOJR/7zmE7+ZoDHBf+OA0BuYfsZ00dY/qdpuLZhlAlRzp9hwtsMU e0sXP4i0qsvv7dWUZFSQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1g9AYL-000304-SH; Sun, 07 Oct 2018 15:01:05 +0000 Received: from shell.v3.sk ([90.176.6.54]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g9AXG-0001S7-5n for hostap@lists.infradead.org; Sun, 07 Oct 2018 15:01:02 +0000 Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id 2B6FFBCA8E; Sun, 7 Oct 2018 16:59:56 +0200 (CEST) Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id LNG30ybEB88y; Sun, 7 Oct 2018 16:59:53 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra.v3.sk (Postfix) with ESMTP id D8391BCA8C; Sun, 7 Oct 2018 16:59:52 +0200 (CEST) X-Virus-Scanned: amavisd-new at zimbra.v3.sk Received: from shell.v3.sk ([127.0.0.1]) by localhost (zimbra.v3.sk [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id wofHfJKYI_dv; Sun, 7 Oct 2018 16:59:52 +0200 (CEST) Received: from belphegor.lan (ip-89-102-31-34.net.upcbroadband.cz [89.102.31.34]) by zimbra.v3.sk (Postfix) with ESMTPSA id 33DA0BCA8E; Sun, 7 Oct 2018 16:59:52 +0200 (CEST) From: Lubomir Rintel To: hostap@lists.infradead.org Subject: [RESEND PATCH 3/3] tests: D-Bus Get/Set Pmf Date: Sun, 7 Oct 2018 16:59:40 +0200 Message-Id: <20181007145940.55836-3-lkundrak@v3.sk> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181007145940.55836-1-lkundrak@v3.sk> References: <20181007145940.55836-1-lkundrak@v3.sk> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181007_075958_408026_D7F977CE X-CRM114-Status: UNSURE ( 6.35 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.0 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.0 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 SPF_PASS SPF: sender matches SPF record X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jouni Malinen , Lubomir Rintel Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org Based on Jouni Malinen's [76055b4c6 "tests: D-Bus Get/Set Pmf"], modified to use the correct "s" signature for the "Pmf" property. Removed the negative test cases, because the synthesized property doens't seem to do error checking upon being set. Signed-off-by: Jouni Malinen Signed-off-by: Lubomir Rintel --- tests/hwsim/test_dbus.py | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/tests/hwsim/test_dbus.py b/tests/hwsim/test_dbus.py index b79e24ae9..82057365d 100644 --- a/tests/hwsim/test_dbus.py +++ b/tests/hwsim/test_dbus.py @@ -2367,6 +2367,33 @@ def _test_dbus_apscan(dev, apdev): if_obj.Set(WPAS_DBUS_IFACE, "ApScan", dbus.UInt32(1), dbus_interface=dbus.PROPERTIES_IFACE) +def test_dbus_pmf(dev, apdev): + """D-Bus Get/Set Pmf""" + try: + _test_dbus_pmf(dev, apdev) + finally: + dev[0].request("SET pmf 0") + +def _test_dbus_pmf(dev, apdev): + (bus,wpas_obj,path,if_obj) = prepare_dbus(dev[0]) + + dev[0].set("pmf", "0") + res = if_obj.Get(WPAS_DBUS_IFACE, "Pmf", + dbus_interface=dbus.PROPERTIES_IFACE) + if res != "0": + raise Exception("Unexpected initial Pmf value: %s" % res) + + for i in range(3): + if_obj.Set(WPAS_DBUS_IFACE, "Pmf", str(i), + dbus_interface=dbus.PROPERTIES_IFACE) + res = if_obj.Get(WPAS_DBUS_IFACE, "Pmf", + dbus_interface=dbus.PROPERTIES_IFACE) + if res != str(i): + raise Exception("Unexpected Pmf value %s (expected %d)" % (res, i)) + + if_obj.Set(WPAS_DBUS_IFACE, "Pmf", "1", + dbus_interface=dbus.PROPERTIES_IFACE) + def test_dbus_fastreauth(dev, apdev): """D-Bus Get/Set FastReauth""" (bus,wpas_obj,path,if_obj) = prepare_dbus(dev[0])