From patchwork Wed Jun 22 23:02:17 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12891562 Received: from mail-pj1-f50.google.com (mail-pj1-f50.google.com [209.85.216.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AE9041C26 for ; Wed, 22 Jun 2022 23:04:30 +0000 (UTC) Received: by mail-pj1-f50.google.com with SMTP id h9-20020a17090a648900b001ecb8596e43so839998pjj.5 for ; Wed, 22 Jun 2022 16:04:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZlE+0kiYyBnWayQKTw22/X9Se/HRLW1FM2DdocyjSOw=; b=lsIhwb+pskhYMFzIf592dBRgd3TYmzDbqF3u/pf3HgEFeoknaM93Wztrqq8wRqZPgH TYKA4NR3kwfWwrYHbvhCghjYC+0eiVd2m5L+O1zTul5Gauf1EIsPWyB0IWU3VmkV0+BV C5BwY0NGm1R5vybfpwqp8WMRYnevM5ls0B8wtsQ0oRBrhGgrTulzaf+JFb8fRvX2y90s 9v5Gqjtce5r7i/D6HNoDHKmV7sHTWScugzu1OIinno7/B+BpmZ4o5OAgZ5+vGyy4P9AQ uNbdJAobwRhk5QRWY5GA3m46XOjEs91OSGgb7ZPglEXQCwEyNaQ1XtmXT8CBGpDeluK6 LDwA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=ZlE+0kiYyBnWayQKTw22/X9Se/HRLW1FM2DdocyjSOw=; b=xlQht18+1In7Z0kmhwrMXIKr/vS6snQblvwoH81aui1Kmjipcm3PYRgCKUw7ixoRNW FPhmAOZTat6TZLVhMe2r1i+PsPHdmCMWU5GrPdlSXuCSE39qQge+GIXO6U7ZCMn5K9Ru fT8VmzvybMdrtW6Vp3qEkizJpMotZ/yw4Nr+5Exhg3IHZpNxEvexGWXzzTwN35Vfe4Or TAOuI+rSxOqhe8Jkek8otesh8ZCKf40XAzFSXgxqcUKuebmeOTiHlP0IYiNuol22Eevn igNRrxa6TgKwZ8iNZRWGEKSm2iWhJwcbH4aNH/sV8Ize8A+e6C91LENZ8u5W4cQmqT8T /Ivg== X-Gm-Message-State: AJIora+JgUaLBmSS+r5kkWFHpFP4/cs4TwURq/E3zkZKREwqSf1dwwVt tIPCQCaAf+eFuzet8BSGFsHVpuue24w= X-Google-Smtp-Source: AGRyM1vwyjVmRUOMEqsYEkoHh5VkRZs+s8u99/MAKd5L4H/U8bWzE0X19Dq+Qf59Xp7RDV8S7XiAVQ== X-Received: by 2002:a17:902:cec4:b0:16a:1fc3:b6e6 with SMTP id d4-20020a170902cec400b0016a1fc3b6e6mr19067723plg.129.1655939069957; Wed, 22 Jun 2022 16:04:29 -0700 (PDT) Received: from localhost.localdomain ([50.45.187.22]) by smtp.gmail.com with ESMTPSA id jb6-20020a170903258600b0016a12571537sm9107052plb.299.2022.06.22.16.04.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jun 2022 16:04:29 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 1/3] test-runner: exclude 'iwd-rtnl' from being enabled with --log Date: Wed, 22 Jun 2022 16:02:17 -0700 Message-Id: <20220622230219.1557695-1-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Enabling this ends up dumping so much logging and, at least with namespaces, seems to break the logger module and cause really weird behavior, worst of which is that all processes start dumping to stdout. This can still be enabled explicitly with --verbose iwd-rtnl, but is turned off by default when --log is used. --- tools/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tools/utils.py b/tools/utils.py index fd51b6e8..e424231f 100644 --- a/tools/utils.py +++ b/tools/utils.py @@ -142,13 +142,14 @@ class Process(subprocess.Popen): @staticmethod def is_verbose(process, log=True): + exclude = ['iwd-rtnl'] process = os.path.basename(process) if Process.testargs is None: return False # every process is verbose when logging is enabled - if log and Process.testargs.log: + if log and Process.testargs.log and process not in exclude: return True if process in Process.testargs.verbose: From patchwork Wed Jun 22 23:02:18 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12891563 Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 645A71C27 for ; Wed, 22 Jun 2022 23:04:31 +0000 (UTC) Received: by mail-pg1-f182.google.com with SMTP id z14so17467797pgh.0 for ; Wed, 22 Jun 2022 16:04:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=mNeLgntYaA2ssQXSnyc+kF9/TZ40oOtB16wIkzybGBQ=; b=bskzExuLoZPcXtfviFBFx1dSb4q2bq8AfkADw6m89eKA9q3jN0127lRWilpaUW7WbC UWxmV7iaD6rsQ1g6rl8ZQt1nWaceWhgOtyXL4gse7Rc3Bf4uxCLkAZiqsPuK58iObWRW z2D9UB/EzdkNxT+dddJlgib1r+GJ7yt6j3aMFDx6/vfdi3psXR1gtaqAvWlR+wc24Y// sidtThsaFmfq8tp2FAGrACM4KUmipuEqOTXXhPOhr6EtRBG+3bvH67u3awzGpC7+PT7N guG2z9rCXRv6FjjMGbEyrVpjC2Q5uaKJ8ubyWzLkvTepLANUb7G5RoSq9ni1rknh5VI7 t80A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=mNeLgntYaA2ssQXSnyc+kF9/TZ40oOtB16wIkzybGBQ=; b=ea6GnWPOBzIVsEpJf5+ka0Ff7BYMxBPsIDJ4u9kFf88R7cQmgGfcfiLpvnlPfsyGbW Lj2s7QvfMTy6kzIaRZ8HPDrBTPJ1BBIXRRQnhvqwS5Xp9kvGcnsS/CKGvpz6IXAVwSy5 pP/f2vMSrH7xgJ0uDZ/hh/PoxncEhS3G1BEYB+uTwKDKh1TJQd8/2EUXzbiK7toVyAYN lMFjItaFKbOrHRiT/7yM4DJf0GqO7cxLKlgFZHPbZfpdvRLPTxhh9sJCw/itI7EiMaaU Tjr4nLXR+UPa84O9UsLvwP+1UdZtDCPEVgjjxg1llYCrc6qARLzNDolASX2lglxSMfDJ I6bg== X-Gm-Message-State: AJIora95ovDzPz1E1u3MpExjHaSdyGdAvxr4Xlz/5PbbVX5xEgzPg6GB Jinf6wIvUJxqdTjtX+VZla5LQOQ3GY4= X-Google-Smtp-Source: AGRyM1sks/y+dMOndU61WTtAJ0m+HMBACz1yDTl8Ih4cNlKkFej6ka6VKOJUTXyEsyaTP3rcKkP09w== X-Received: by 2002:a05:6a00:1acd:b0:51c:795b:860c with SMTP id f13-20020a056a001acd00b0051c795b860cmr38281437pfv.16.1655939070627; Wed, 22 Jun 2022 16:04:30 -0700 (PDT) Received: from localhost.localdomain ([50.45.187.22]) by smtp.gmail.com with ESMTPSA id jb6-20020a170903258600b0016a12571537sm9107052plb.299.2022.06.22.16.04.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jun 2022 16:04:30 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 2/3] auto-t: rename testHiddenNetwork's test class Date: Wed, 22 Jun 2022 16:02:18 -0700 Message-Id: <20220622230219.1557695-2-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220622230219.1557695-1-prestwoj@gmail.com> References: <20220622230219.1557695-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This was copy pasted from the autoconnect test, and depending on how the python module cache is ordered can incorrectly use the wrong test class. This should nothappen because we insert the paths to the head of the list but for consistency the class should be named something that reflects what the test is doing. --- autotests/testHiddenNetworks/exceptions_test.py | 4 ++-- autotests/testHiddenNetworks/open_network_test.py | 4 ++-- autotests/testHiddenNetworks/validation.py | 2 +- autotests/testHiddenNetworks/wpa_network_test.py | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/autotests/testHiddenNetworks/exceptions_test.py b/autotests/testHiddenNetworks/exceptions_test.py index 0c151fcb..1c4722a6 100644 --- a/autotests/testHiddenNetworks/exceptions_test.py +++ b/autotests/testHiddenNetworks/exceptions_test.py @@ -6,7 +6,7 @@ import sys sys.path.append('../util') import iwd import validation -from validation import TestConnectAutoConnect +from validation import TestHiddenNetworks from iwd import IWD class TestWpaNetwork(unittest.TestCase): @@ -23,7 +23,7 @@ class TestWpaNetwork(unittest.TestCase): ''' def test_wpa(self): - tca = TestConnectAutoConnect() + tca = TestHiddenNetworks() tca.validate('UnExistingNetwork', False, iwd.NotFoundEx) tca.validate('ssidOverlap', False, iwd.ServiceSetOverlapEx) diff --git a/autotests/testHiddenNetworks/open_network_test.py b/autotests/testHiddenNetworks/open_network_test.py index 2cc0f75b..8645fdad 100644 --- a/autotests/testHiddenNetworks/open_network_test.py +++ b/autotests/testHiddenNetworks/open_network_test.py @@ -6,7 +6,7 @@ import sys sys.path.append('../util') import iwd import validation -from validation import TestConnectAutoConnect +from validation import TestHiddenNetworks from iwd import IWD class TestOpenNetwork(unittest.TestCase): @@ -20,7 +20,7 @@ class TestOpenNetwork(unittest.TestCase): True True Connection succeeds ''' def test_open(self): - tca = TestConnectAutoConnect() + tca = TestHiddenNetworks() tca.validate('ssidHiddenOpen', False) tca.validate('ssidHiddenOpen', True) diff --git a/autotests/testHiddenNetworks/validation.py b/autotests/testHiddenNetworks/validation.py index 793b459f..2c005331 100644 --- a/autotests/testHiddenNetworks/validation.py +++ b/autotests/testHiddenNetworks/validation.py @@ -9,7 +9,7 @@ from iwd import IWD from iwd import PSKAgent from iwd import NetworkType -class TestConnectAutoConnect(unittest.TestCase): +class TestHiddenNetworks(unittest.TestCase): def check_connect_hidden_network(self, wd, device, ssid, throws): if not throws is None: diff --git a/autotests/testHiddenNetworks/wpa_network_test.py b/autotests/testHiddenNetworks/wpa_network_test.py index d8166b1b..a65fe1af 100644 --- a/autotests/testHiddenNetworks/wpa_network_test.py +++ b/autotests/testHiddenNetworks/wpa_network_test.py @@ -6,7 +6,7 @@ import sys sys.path.append('../util') import iwd import validation -from validation import TestConnectAutoConnect +from validation import TestHiddenNetworks from iwd import IWD class TestWpaNetwork(unittest.TestCase): @@ -21,7 +21,7 @@ class TestWpaNetwork(unittest.TestCase): ''' def test_wpa(self): - tca = TestConnectAutoConnect() + tca = TestHiddenNetworks() tca.validate('ssidHiddenWPA', False, None, True) tca.validate('ssidHiddenWPA', True, None, True) From patchwork Wed Jun 22 23:02:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12891564 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 60A551C26 for ; Wed, 22 Jun 2022 23:04:32 +0000 (UTC) Received: by mail-pl1-f179.google.com with SMTP id d5so16612639plo.12 for ; Wed, 22 Jun 2022 16:04:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PhyFgYJMib1r+sn6iBZbjKCM1irtidU6HBjh0Q4XXVM=; b=iEx1k5p7/UQN1bba4GcyqSoNnzk6v+7FGDJrElawZOfntM7A5rWPB0NLh2Ktfjg2fi XeZsa4i0EczgksyVrdqovjlv4TohUFUdeU7CQA6fYqMFCF+CMBHm8JxgVFLGsIOzoNca T6kymCh2yIktoVjVgr4lK0YPx+xT5zWVSz8jKkvNorpoMKZTqGk7rvmioTXVvvj9WI4v BZ7fd8lU3j7UrHD7r06tJ4tGq/n3k6X78pi1k3cecss+G9svyHpbD2TOk0qs4WSQms+L yqrdSn8/kj8VR+aSjpLKIFkcIJlqiEezHpqtehyRKNNGTid/sFM4NnS6tjXVlOB2VnUc FHiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=PhyFgYJMib1r+sn6iBZbjKCM1irtidU6HBjh0Q4XXVM=; b=E6Syz9OXqX9deVexvPcG8iCzXWgPyZys9KOPZhE1iM25+DyQ9SbRKOY9oC0e0VXQFY V/dRkl85ojGXFQJO1zvZeVGZBMeyUEQrlT/Xf12LN9uVAoOzmlvupAUgsGOxX3uOMmC6 4i3nAROVqJ800P6c3V5IBMXt8HtUNYQHgYL2cDguSTKjsebmtA4/KqgQ8frW15XJhg5y gO6eTtFOJz0Qdo6EAh2CAEA8jW83KIeST+zEN/1gDc2jd1iPG3RW2d414bcCKHEs0FGp NxYtnhW1KrZvQpfTIKkF7pMYPCnpKvTaVMRbZ3zGCJf2vSYrbD0d1jTi4eKhRYW9D7tI 0d/g== X-Gm-Message-State: AJIora9bA20JeoxUazhS6OfXX2jE2tg30nYsp5dex3XtGD/oRx5A3kjo VO3NXW8yr1p5J+Kl643YiSrhTOUXAkM= X-Google-Smtp-Source: AGRyM1s6QmfIDH8S6WvpApP3bONVFm4v3xzR9n2WSC8SLa836Dz8VDjewEfDbhcbiEk04gf7Bjvwfw== X-Received: by 2002:a17:90b:4b02:b0:1e2:ff51:272a with SMTP id lx2-20020a17090b4b0200b001e2ff51272amr763475pjb.56.1655939071497; Wed, 22 Jun 2022 16:04:31 -0700 (PDT) Received: from localhost.localdomain ([50.45.187.22]) by smtp.gmail.com with ESMTPSA id jb6-20020a170903258600b0016a12571537sm9107052plb.299.2022.06.22.16.04.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 Jun 2022 16:04:31 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 3/3] auto-t: fix hardcoded 'wlan1' in testNetconfig Date: Wed, 22 Jun 2022 16:02:19 -0700 Message-Id: <20220622230219.1557695-3-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220622230219.1557695-1-prestwoj@gmail.com> References: <20220622230219.1557695-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This works, if testNetconfig is the only test. Otherwise it will always fail since the interface naming increments for each test. --- autotests/testNetconfig/connection_test.py | 2 +- autotests/testNetconfig/static_test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/autotests/testNetconfig/connection_test.py b/autotests/testNetconfig/connection_test.py index 4b05c745..e73ab335 100644 --- a/autotests/testNetconfig/connection_test.py +++ b/autotests/testNetconfig/connection_test.py @@ -80,7 +80,7 @@ class Test(unittest.TestCase): rclog = open('/tmp/resolvconf.log', 'r') entries = rclog.readlines() rclog.close() - expected_rclog = ['-a wlan1.dns\n', 'nameserver 192.168.1.2\n', 'nameserver 3ffe:501:ffff:100::2\n'] + expected_rclog = ['-a %s.dns\n' % ifname, 'nameserver 192.168.1.2\n', 'nameserver 3ffe:501:ffff:100::2\n'] # Every real resolvconf -a run overwrites the previous settings. Check the last three lines # of our log since we care about the end result here. self.assertEqual(expected_rclog, entries[-3:]) diff --git a/autotests/testNetconfig/static_test.py b/autotests/testNetconfig/static_test.py index ac525b28..d9f0b9cb 100644 --- a/autotests/testNetconfig/static_test.py +++ b/autotests/testNetconfig/static_test.py @@ -75,7 +75,7 @@ class Test(unittest.TestCase): rclog = open('/tmp/resolvconf.log', 'r') entries = rclog.readlines() rclog.close() - expected_rclog = ['-a wlan1.dns\n', 'nameserver 192.168.1.4\n', 'nameserver 3ffe:501:ffff:200::4\n'] + expected_rclog = ['-a %s.dns\n' % ifname, 'nameserver 192.168.1.4\n', 'nameserver 3ffe:501:ffff:200::4\n'] # Every resolvconf -a run overwrites the previous settings. Check the last three lines # of the log since we care about the end result here. self.assertEqual(expected_rclog, entries[-3:])