From patchwork Mon Aug 22 15:58:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12950888 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) (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 28776256C for ; Mon, 22 Aug 2022 15:58:07 +0000 (UTC) Received: by mail-pl1-f177.google.com with SMTP id m2so10329463pls.4 for ; Mon, 22 Aug 2022 08:58:07 -0700 (PDT) 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:cc :to:from:from:to:cc; bh=ecd4WSKnsxwRkeaxJFCq86kDCaceKAaImv7wkDcSUKY=; b=LizSFMGJIbrVMh8vs5Y5t/ub1TV+fTZbhI/Ob+NxYlABDcDiDY1Jl8T/f4QD/ZrL+F ZfjZf3lSybneOZ4KOkDlJYZjyqGkBZKR0iEJOVMDemWu8B+t09YGPS75fZy7eaV7+WEI t9+zY6QfVfNk99CvXLqPf5wYx6j0CmDt3oWl+ro8RBTbj820LplwGCjolwicSCmPqK7V qw/9kAS4dhNBKdywfyYGWVGJSy+2gVtnOXJtwsFb/lec/oCwbl023FxB4BqykyLjsrU9 LUnCyIdvagVXuYttHTzr1YQRI2SxaX41YxmR0KZk1yv6hiM/HLYuL3zE3rgfzCK8Uofy ltlA== 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:cc :to:from:x-gm-message-state:from:to:cc; bh=ecd4WSKnsxwRkeaxJFCq86kDCaceKAaImv7wkDcSUKY=; b=Au5ik4mLq7z/xgpNS2dp0qt7ikyO/AcIU/4uT2Ge02/gupljHeulT27+Sl+QeM7enJ 6j5i0yHDeeo/UlvWhIBucGftyIoVqh8LCzaBEdDpipxbioaKwYRWK1O/hwuMIVOt1kWy EHLy2PwRQOpKX7ctokNoNZX7SnD4HtFVTNp5xFEzsmR1XbYgnHpOm2swpAHcATE/SX2o Yh4HsTVWAe3WyHX47wup4ripRT1f5vfB8Bvmo/t9kOAAc74r2Sgq9iEY7k1cAQMjeWRu q00a4tNF9Nl+Oz3nVIV42fu8Gm9dXVbmpMoESXDr3lOZmcAUn0EGPoL1Bzchb26NeflT Trtg== X-Gm-Message-State: ACgBeo0t0S63hTa45al/RyZcqItZgPZCW99VhuyXHcsSK8XAYqz5mkyP kBdNWqC/n1euYU72DFF3DVIjr60dK2k= X-Google-Smtp-Source: AA6agR5DNro9VDC/KQYGi5S9GpJtf84GY//XK4PgyiFKiyPj2R7vHCUuShuXdseSZACzbnZktxQ1AA== X-Received: by 2002:a17:903:1209:b0:16b:81f6:e952 with SMTP id l9-20020a170903120900b0016b81f6e952mr21368195plh.48.1661183886320; Mon, 22 Aug 2022 08:58:06 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id x64-20020a628643000000b005368192372fsm3216440pfd.200.2022.08.22.08.58.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Aug 2022 08:58:05 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v3 1/5] test-runner: double RAM for --valgrind Date: Mon, 22 Aug 2022 08:58:00 -0700 Message-Id: <20220822155804.2006566-1-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 It seems 256MB was right on the edge if valgrind was being used and sometimes the test would fail with OOM exceptions. --- tools/runner.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tools/runner.py b/tools/runner.py index a96627de..004bf46d 100644 --- a/tools/runner.py +++ b/tools/runner.py @@ -370,6 +370,7 @@ class QemuRunner(RunnerAbstract): usb_adapters = None pci_adapters = None + ram = 256 super().__init__(args) @@ -400,11 +401,14 @@ class QemuRunner(RunnerAbstract): kern_log = "ignore_loglevel" if "kernel" in args.verbose else "quiet" + if args.valgrind: + ram *= 2 + qemu_cmdline = [ 'qemu-system-x86_64', '-machine', 'type=q35,accel=kvm:tcg', '-nodefaults', '-no-user-config', '-monitor', 'none', - '-display', 'none', '-m', '256M', '-nographic', '-vga', + '-display', 'none', '-m', '%dM' % ram, '-nographic', '-vga', 'none', '-no-acpi', '-no-hpet', '-no-reboot', '-fsdev', 'local,id=fsdev-root,path=/,readonly=on,security_model=none,multidevs=remap', From patchwork Mon Aug 22 15:58:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12950889 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (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 C55E02594 for ; Mon, 22 Aug 2022 15:58:07 +0000 (UTC) Received: by mail-pf1-f178.google.com with SMTP id w29so5191277pfj.3 for ; Mon, 22 Aug 2022 08:58:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=cLqZNAZ2bC8+7FrYtP6Gp/ZSnMJLta9rTFEInz1Nvo8=; b=Q83fb57H1Dod5vgwgyaDeSezmlP7IW8CElvfBH8b9NJKCucPeeP2X58fw4ezKt3ZMk h/muhEqpc2l4jLJNLsCFaaWUR8AGje/jYP2XjuCEQs57MnWmhz0G0DiaBpCgqHXnshvC iGldHagdJ7IxeGlztMB76Egxn+CmNysXVe9ASJ3XqeyfO5KzowG2T8UzcIrjA27WTff/ T05/STYt4fQSbDN4/qdyNNeaxT33oBF0LJLAxZoYuxc8hKqz5t+B8YeegJsJYC0Joo81 o1eBVciRaF+ZPM0NBMtuiD72iJJ7W6zjYfAuQdW781LPL4uxTRIx3eUjSZLfFzG4NBf7 273w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=cLqZNAZ2bC8+7FrYtP6Gp/ZSnMJLta9rTFEInz1Nvo8=; b=d/jA/beQ5D8zpoD4GX7084Al3Q1L8db7kEvlwI7y9jxaqKTDMw8r3WXf2MJEIAnmCi 4GEfL1yYWouIb9X3w/fZ6aDRcPW/ayQI5d2liFawgcR5z96uMnsCBP+forovdVKPWlEz bB+lFwatdLPL277aUdryJ8VLJUfuwTKEL36Z+/KwtRKO6qbk/gvS6KMTj6oRKcw6iMVm UXcJkynJAEYjvl5lm8Kodl0/JRvMsozg3xrHNzyrSGhZvx9J6Y310eeq6YJRJVrbdr1I EL1stsO+pKifEMKbaZl4otQWZmXOWD4X5UF8Zar8Ro0A6u6u4ehPmmPkFQwN3rbGyJb6 mJPA== X-Gm-Message-State: ACgBeo25epa+RLHy3MjaK8wOv9CEd+ocsMyAixd5v6Z46LWNl/u6neG5 z3QbzKroYH+NQzKfnXfsHKdxfIxNNis= X-Google-Smtp-Source: AA6agR56UtVL58QfBOHRdLJ2KUygCPNx7VKMtRJTsv5cqcwOiApaX4oSvGb+BwwJPPmhUDOfnh5j3A== X-Received: by 2002:a63:174c:0:b0:42a:81ff:6913 with SMTP id 12-20020a63174c000000b0042a81ff6913mr8156439pgx.625.1661183887054; Mon, 22 Aug 2022 08:58:07 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id x64-20020a628643000000b005368192372fsm3216440pfd.200.2022.08.22.08.58.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Aug 2022 08:58:06 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v3 2/5] auto-t: hostapd: add set_address/group_neighbors Date: Mon, 22 Aug 2022 08:58:01 -0700 Message-Id: <20220822155804.2006566-2-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220822155804.2006566-1-prestwoj@gmail.com> References: <20220822155804.2006566-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This adds a few utilities for setting up an FT environment. All the roaming tests basically copy/paste the same code for setting up the hostapd instances and this can cause problems if not done correctly. set_address() sets the MAC address on the device, and restarts hostapd group_neighbors() takes a list of HostapdCLI objects and makes each a neighbor to the others. The neighbor report element requires the operating class which isn't advertised by hostapd. For this we assume operating class 81 but this can be set explicitly if it differs. Currently no roaming tests use 5/6GHz frequencies, and just in case an exception will be thrown if the channel is greater than 14 and the op_class didn't change. --- autotests/util/hostapd.py | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/autotests/util/hostapd.py b/autotests/util/hostapd.py index 3ae8ff89..d6c13e2b 100644 --- a/autotests/util/hostapd.py +++ b/autotests/util/hostapd.py @@ -281,3 +281,34 @@ class HostapdCLI(object): @property def enabled(self): return self._get_status()['state'] == 'ENABLED' + + def set_address(self, mac): + os.system('ip link set dev %s down' % self.ifname) + os.system('ip link set dev %s addr %s up' % (self.ifname, mac)) + + self.reload() + self.wait_for_event("AP-ENABLED") + + def _add_neighbors(self, *args, op_class=81): + for hapd in args: + status = hapd._get_status() + + ssid = status['ssid[0]'] + bssid = status['bssid[0]'] + channel = int(status['channel']) + + if (channel > 14 and op_class == 81): + raise Exception("default add_neighbors assumes opclass 0x51!") + + channel = '{:02x}'.format(channel) + oper_class = '{:02x}'.format(op_class) + + self.set_neighbor(bssid, ssid, '%s8f000000%s%s060603000000' % + (bssid.replace(':', ''), oper_class, channel)) + + @classmethod + def group_neighbors(cls, *args): + for hapd in args: + others = [h for h in args if h != hapd] + + hapd._add_neighbors(*others) From patchwork Mon Aug 22 15:58:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12950890 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.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 7E8CD256C for ; Mon, 22 Aug 2022 15:58:08 +0000 (UTC) Received: by mail-pl1-f182.google.com with SMTP id x19so10316667plc.5 for ; Mon, 22 Aug 2022 08:58:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=eRDXDl+0PTLTxWnkHg8F/Hb7F5d8j/iQnXzGsc+KWd4=; b=ePcRSLj+T1ailCwOUUg/WmKdpMv5xnmli1HUQhWuDjT1NCYaHsUtu2wZDJMDaGcfAb SnA0HX9hxpTG1kmVHOZpC26wRrchgESBaQDIRK75IeLoFel03Qv7ro779rOCHFKUWqUY MN5+zAEc/tIucQLIKGXlKfzId5XxaE3wbF8jRIjcOIJ3axVbYTPBFVMcxoSzTpxIgeEn V6pFTgnNAkqHUs6GARItzGpEN14bPUjsPc2XgVh3skrjUTd+u3GRtyCxekViiElyrulT 4iuBPvGie2iWOUItrJ6shMhEP/DWk3C1nEL/ZkwYe7RalkDx2aFwf7518weYSFSgbSbM i5oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=eRDXDl+0PTLTxWnkHg8F/Hb7F5d8j/iQnXzGsc+KWd4=; b=WrVMaJrkshnl6pLkH5Z+RGueDEwFsvjl9ePFh2p24Y2IuNUrYSbEWn3HekDHDx97j6 bHQc+ANMDfsF3/6kuOC660FXmkffRgn7yQaPWkajslWcw9sXgcClbEbIm4aHLZqK7pPF vjqCVMcY0lQxu7oZpKkaZWVWqaQaQuROXm5Cm1928J4n0hcnqwkmx2t//UYYCICW+Ae6 uLhfiHOw49Vn1TdWikiAOCkeOmNaWeumrw6Fe6R5Z4eLFHLscC23xQ7ZsqTIsY58tbLb eB0fZTvh3rvvfANG41Ghmej/7CdKnSMUegKpdT7QHEOCuPxdGRVcuSZwIm7xmqC4eyeA qKsQ== X-Gm-Message-State: ACgBeo3Qsrs+f031pxeR+hv20cPWCco+cOCLTJ71TNKr10pPsaSsCO55 B7ekzc6kwXdff4DapRQNZoa/1BSSS20= X-Google-Smtp-Source: AA6agR5xqAk7OL9NCwOwll+u/CwqIA4dwG60LYDU6SM2vbJG4NaMvCZ86vtmssxP9lXJ6pDtP51jJQ== X-Received: by 2002:a17:902:ed92:b0:172:a334:acbb with SMTP id e18-20020a170902ed9200b00172a334acbbmr20913666plj.58.1661183887677; Mon, 22 Aug 2022 08:58:07 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id x64-20020a628643000000b005368192372fsm3216440pfd.200.2022.08.22.08.58.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Aug 2022 08:58:07 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v3 3/5] auto-t: update tests to use set_address/group_neighbors Date: Mon, 22 Aug 2022 08:58:02 -0700 Message-Id: <20220822155804.2006566-3-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220822155804.2006566-1-prestwoj@gmail.com> References: <20220822155804.2006566-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This reduces the big blocks of copied code with a few function calls. --- .../testFT-8021x-roam/connection_test.py | 26 ++---------- autotests/testFT-FILS/connection_test.py | 24 ++--------- autotests/testPSK-roam/connection_test.py | 24 ++--------- .../testPSK-roam/roam_ap_disconnect_test.py | 12 ++---- autotests/testPreauth-roam/connection_test.py | 13 +----- autotests/testRoamRetry/fast_retry_test.py | 15 +------ autotests/testRoamRetry/stop_retry_test.py | 15 +------ autotests/testSAE-roam/connection_test.py | 42 +++---------------- 8 files changed, 23 insertions(+), 148 deletions(-) v3: * Fixed packet loss failure from error in removing the wait for DeviceState.roaming. diff --git a/autotests/testFT-8021x-roam/connection_test.py b/autotests/testFT-8021x-roam/connection_test.py index 6853bdb0..d3f8e2c6 100644 --- a/autotests/testFT-8021x-roam/connection_test.py +++ b/autotests/testFT-8021x-roam/connection_test.py @@ -66,28 +66,10 @@ class Test(unittest.TestCase): cls.bss_hostapd = [ HostapdCLI(config='ft-eap-ccmp-1.conf'), HostapdCLI(config='ft-eap-ccmp-2.conf') ] - # Set interface addresses to those expected by hostapd config files - os.system('ip link set dev "' + cls.bss_hostapd[0].ifname + '" down') - os.system('ip link set dev "' + cls.bss_hostapd[0].ifname + \ - '" address 12:00:00:00:00:01 up') - os.system('ip link set dev "' + cls.bss_hostapd[1].ifname + '" down') - os.system('ip link set dev "' + cls.bss_hostapd[1].ifname + \ - '" address 12:00:00:00:00:02 up') - - cls.bss_hostapd[0].reload() - cls.bss_hostapd[0].wait_for_event("AP-ENABLED") - cls.bss_hostapd[1].reload() - cls.bss_hostapd[1].wait_for_event("AP-ENABLED") - - # Fill in the neighbor AP tables in both BSSes. By default each - # instance knows only about current BSS, even inside one hostapd - # process. - # FT still works without the neighbor AP table but neighbor reports - # have to be disabled in the .conf files - cls.bss_hostapd[0].set_neighbor('12:00:00:00:00:02', 'TestFT', - '1200000000028f0000005102060603000000') - cls.bss_hostapd[1].set_neighbor('12:00:00:00:00:01', 'TestFT', - '1200000000018f0000005101060603000000') + cls.bss_hostapd[0].set_address('12:00:00:00:00:01') + cls.bss_hostapd[1].set_address('12:00:00:00:00:02') + + HostapdCLI.group_neighbors(*cls.bss_hostapd) @classmethod def tearDownClass(cls): diff --git a/autotests/testFT-FILS/connection_test.py b/autotests/testFT-FILS/connection_test.py index c1deb77c..b1ec42e0 100644 --- a/autotests/testFT-FILS/connection_test.py +++ b/autotests/testFT-FILS/connection_test.py @@ -128,26 +128,10 @@ class Test(unittest.TestCase): cls.bss_hostapd = [ HostapdCLI(config='ft-eap-ccmp-1.conf'), HostapdCLI(config='ft-eap-ccmp-2.conf') ] - # Set interface addresses to those expected by hostapd config files - os.system('ip link set dev "' + cls.bss_hostapd[0].ifname + '" down') - os.system('ip link set dev "' + cls.bss_hostapd[0].ifname + '" addr 12:00:00:00:00:01 up') - os.system('ip link set dev "' + cls.bss_hostapd[1].ifname + '" down') - os.system('ip link set dev "' + cls.bss_hostapd[1].ifname + '" addr 12:00:00:00:00:02 up') - - cls.bss_hostapd[0].reload() - cls.bss_hostapd[0].wait_for_event("AP-ENABLED") - cls.bss_hostapd[1].reload() - cls.bss_hostapd[1].wait_for_event("AP-ENABLED") - - # Fill in the neighbor AP tables in both BSSes. By default each - # instance knows only about current BSS, even inside one hostapd - # process. - # FT still works without the neighbor AP table but neighbor reports - # have to be disabled in the .conf files - cls.bss_hostapd[0].set_neighbor('12:00:00:00:00:02', 'TestFT', - '1200000000028f0000005102060603000000') - cls.bss_hostapd[1].set_neighbor('12:00:00:00:00:01', 'TestFT', - '1200000000018f0000005101060603000000') + cls.bss_hostapd[0].set_address('12:00:00:00:00:01') + cls.bss_hostapd[1].set_address('12:00:00:00:00:02') + + HostapdCLI.group_neighbors(*cls.bss_hostapd) @classmethod def tearDownClass(cls): diff --git a/autotests/testPSK-roam/connection_test.py b/autotests/testPSK-roam/connection_test.py index c926e255..1b80d65b 100644 --- a/autotests/testPSK-roam/connection_test.py +++ b/autotests/testPSK-roam/connection_test.py @@ -199,26 +199,10 @@ class Test(unittest.TestCase): cls.rule2.source = rad0.addresses[0] cls.rule2.signal = -4000 - # Set interface addresses to those expected by hostapd config files - os.system('ip link set dev "' + cls.bss_hostapd[0].ifname + '" down') - os.system('ip link set dev "' + cls.bss_hostapd[0].ifname + '" addr 12:00:00:00:00:01 up') - os.system('ip link set dev "' + cls.bss_hostapd[1].ifname + '" down') - os.system('ip link set dev "' + cls.bss_hostapd[1].ifname + '" addr 12:00:00:00:00:02 up') - - cls.bss_hostapd[0].reload() - cls.bss_hostapd[0].wait_for_event("AP-ENABLED") - cls.bss_hostapd[1].reload() - cls.bss_hostapd[1].wait_for_event("AP-ENABLED") - - # Fill in the neighbor AP tables in both BSSes. By default each - # instance knows only about current BSS, even inside one hostapd - # process. - # FT still works without the neighbor AP table but neighbor reports - # have to be disabled in the .conf files - cls.bss_hostapd[0].set_neighbor('12:00:00:00:00:02', 'TestFT', - '1200000000028f0000005102060603000000') - cls.bss_hostapd[1].set_neighbor('12:00:00:00:00:01', 'TestFT', - '1200000000018f0000005101060603000000') + cls.bss_hostapd[0].set_address('12:00:00:00:00:01') + cls.bss_hostapd[1].set_address('12:00:00:00:00:02') + + HostapdCLI.group_neighbors(*cls.bss_hostapd) @classmethod def tearDownClass(cls): diff --git a/autotests/testPSK-roam/roam_ap_disconnect_test.py b/autotests/testPSK-roam/roam_ap_disconnect_test.py index 760c25fa..416541ce 100644 --- a/autotests/testPSK-roam/roam_ap_disconnect_test.py +++ b/autotests/testPSK-roam/roam_ap_disconnect_test.py @@ -46,10 +46,7 @@ class Test(unittest.TestCase): self.validate() def test_ap_disconnect_neighbors(self): - self.bss_hostapd[0].set_neighbor('12:00:00:00:00:02', 'TestFT', - '1200000000028f0000005102060603000000') - self.bss_hostapd[1].set_neighbor('12:00:00:00:00:01', 'TestFT', - '1200000000018f0000005101060603000000') + HostapdCLI.group_neighbors(*self.bss_hostapd) self.validate() @@ -85,11 +82,8 @@ class Test(unittest.TestCase): cls.rule0.signal = -8000 cls.rule0.enabled = True - # Set interface addresses to those expected by hostapd config files - os.system('ip link set dev "' + cls.bss_hostapd[0].ifname + '" down') - os.system('ip link set dev "' + cls.bss_hostapd[0].ifname + '" addr 12:00:00:00:00:01 up') - os.system('ip link set dev "' + cls.bss_hostapd[1].ifname + '" down') - os.system('ip link set dev "' + cls.bss_hostapd[1].ifname + '" addr 12:00:00:00:00:02 up') + cls.bss_hostapd[0].set_address('12:00:00:00:00:01') + cls.bss_hostapd[1].set_address('12:00:00:00:00:02') @classmethod def tearDownClass(cls): diff --git a/autotests/testPreauth-roam/connection_test.py b/autotests/testPreauth-roam/connection_test.py index 26475698..3c8fa0bb 100644 --- a/autotests/testPreauth-roam/connection_test.py +++ b/autotests/testPreauth-roam/connection_test.py @@ -17,18 +17,7 @@ class Test(unittest.TestCase): bss0_addr = bss_hostapd[0].bssid bss1_addr = bss_hostapd[1].bssid - # Fill in the neighbor AP tables in both BSSes. By default each - # instance knows only about current BSS, even inside one hostapd - # process. - # Roaming still works without the neighbor AP table but neighbor - # reports have to be disabled in the .conf files - bss0_nr = ''.join(bss0_addr.split(':')) + \ - '8f0000005101060603000000' - bss1_nr = ''.join(bss1_addr.split(':')) + \ - '8f0000005102060603000000' - - bss_hostapd[0].set_neighbor(bss1_addr, 'TestPreauth', bss1_nr) - bss_hostapd[1].set_neighbor(bss0_addr, 'TestPreauth', bss0_nr) + HostapdCLI.group_neighbors(*bss_hostapd) wd = IWD(True) diff --git a/autotests/testRoamRetry/fast_retry_test.py b/autotests/testRoamRetry/fast_retry_test.py index b45daada..373f3d45 100644 --- a/autotests/testRoamRetry/fast_retry_test.py +++ b/autotests/testRoamRetry/fast_retry_test.py @@ -36,20 +36,7 @@ class Test(unittest.TestCase): rule1.bidirectional = True rule1.enabled = True - # Fill in the neighbor AP tables in both BSSes. By default each - # instance knows only about current BSS, even inside one hostapd - # process. - # Roaming still works without the neighbor AP table but neighbor - # reports have to be disabled in the .conf files - bss0_nr = ''.join(bss_radio[0].addresses[0].split(':')) + \ - '8f0000005101060603000000' - bss1_nr = ''.join(bss_radio[1].addresses[0].split(':')) + \ - '8f0000005102060603000000' - - bss_hostapd[0].set_neighbor(bss_radio[1].addresses[0], 'TestRoamRetry', - bss1_nr) - bss_hostapd[1].set_neighbor(bss_radio[0].addresses[0], 'TestRoamRetry', - bss0_nr) + HostapdCLI.group_neighbors(*bss_hostapd) # Start in the vicinity of BSS 0, check that iwd connects to BSS 0 rule0.signal = -2000 diff --git a/autotests/testRoamRetry/stop_retry_test.py b/autotests/testRoamRetry/stop_retry_test.py index 3957d12d..b5eb6f77 100644 --- a/autotests/testRoamRetry/stop_retry_test.py +++ b/autotests/testRoamRetry/stop_retry_test.py @@ -35,20 +35,7 @@ class Test(unittest.TestCase): rule1.bidirectional = True rule1.enabled = True - # Fill in the neighbor AP tables in both BSSes. By default each - # instance knows only about current BSS, even inside one hostapd - # process. - # Roaming still works without the neighbor AP table but neighbor - # reports have to be disabled in the .conf files - bss0_nr = ''.join(bss_radio[0].addresses[0].split(':')) + \ - '8f0000005101060603000000' - bss1_nr = ''.join(bss_radio[1].addresses[0].split(':')) + \ - '8f0000005102060603000000' - - bss_hostapd[0].set_neighbor(bss_radio[1].addresses[0], 'TestRoamRetry', - bss1_nr) - bss_hostapd[1].set_neighbor(bss_radio[0].addresses[0], 'TestRoamRetry', - bss0_nr) + HostapdCLI.group_neighbors(*bss_hostapd) # Start in the vicinity of BSS 0, check that iwd connects to BSS 0 rule0.signal = -2000 diff --git a/autotests/testSAE-roam/connection_test.py b/autotests/testSAE-roam/connection_test.py index 2c8cd799..ac44b4b2 100644 --- a/autotests/testSAE-roam/connection_test.py +++ b/autotests/testSAE-roam/connection_test.py @@ -120,43 +120,11 @@ class Test(unittest.TestCase): HostapdCLI(config='ft-sae-2.conf'), HostapdCLI(config='ft-psk-3.conf') ] - ctx.start_process(['ip', 'link', 'set', 'dev', cls.bss_hostapd[0].ifname, 'down']).wait() - ctx.start_process(['ip', 'link', 'set', 'dev', cls.bss_hostapd[0].ifname, \ - 'addr', '12:00:00:00:00:01', 'up']).wait() - ctx.start_process(['ip', 'link', 'set', 'dev', cls.bss_hostapd[1].ifname, 'down']).wait() - ctx.start_process(['ip', 'link', 'set', 'dev', cls.bss_hostapd[1].ifname, \ - 'addr', '12:00:00:00:00:02', 'up']).wait() - ctx.start_process(['ip', 'link', 'set', 'dev', cls.bss_hostapd[2].ifname, 'down']).wait() - ctx.start_process(['ip', 'link', 'set', 'dev', cls.bss_hostapd[2].ifname, \ - 'addr', '12:00:00:00:00:03', 'up']).wait() - - # Set interface addresses to those expected by hostapd config files - cls.bss_hostapd[0].reload() - cls.bss_hostapd[0].wait_for_event("AP-ENABLED") - cls.bss_hostapd[1].reload() - cls.bss_hostapd[1].wait_for_event("AP-ENABLED") - cls.bss_hostapd[2].reload() - cls.bss_hostapd[2].wait_for_event("AP-ENABLED") - - # Fill in the neighbor AP tables in both BSSes. By default each - # instance knows only about current BSS, even inside one hostapd - # process. - # FT still works without the neighbor AP table but neighbor reports - # have to be disabled in the .conf files - cls.bss_hostapd[0].set_neighbor('12:00:00:00:00:02', 'TestFT', - '1200000000028f0000005102060603000000') - cls.bss_hostapd[0].set_neighbor('12:00:00:00:00:03', 'TestFT', - '1200000000038f0000005102060603000000') - - cls.bss_hostapd[1].set_neighbor('12:00:00:00:00:01', 'TestFT', - '1200000000018f0000005101060603000000') - cls.bss_hostapd[1].set_neighbor('12:00:00:00:00:03', 'TestFT', - '1200000000038f0000005101060603000000') - - cls.bss_hostapd[2].set_neighbor('12:00:00:00:00:01', 'TestFT', - '1200000000018f0000005101060603000000') - cls.bss_hostapd[2].set_neighbor('12:00:00:00:00:02', 'TestFT', - '1200000000028f0000005101060603000000') + cls.bss_hostapd[0].set_address('12:00:00:00:00:01') + cls.bss_hostapd[1].set_address('12:00:00:00:00:02') + cls.bss_hostapd[2].set_address('12:00:00:00:00:03') + + HostapdCLI.group_neighbors(*cls.bss_hostapd) IWD.copy_to_storage('TestFT.psk') From patchwork Mon Aug 22 15:58:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12950891 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (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 EAB9A2597 for ; Mon, 22 Aug 2022 15:58:08 +0000 (UTC) Received: by mail-pf1-f180.google.com with SMTP id y15so6766668pfr.9 for ; Mon, 22 Aug 2022 08:58:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=oaytClLNVcMoG5g/aV/h9Xp5KhfN+snUxmprD+oOSJ4=; b=N4ZbToQMj+pNwqelTENzDISWX6yCScl6CI78s0Vs9EAoVJEDs9zulAd79FhV17eD6c cqIp51wd4fN9k13ncHJAJVd8bxGtuuiWALgTLoGT2Sku7c77qENrH7fhhLhWv60kuVVx 1XTvRyR0RaKsVIq8OsvSKHSDm1B/thq0JLVwqnP1HOL0itPf41/7rkuOIehnRAP8fneB SnSZ+0mSUf+bIk1JrA3PyEiImH1R+2DxsK1WrxaGpLXhVVQlScVJkWzPDURyj9C2b7LT 4anNn98kHBI2TJtGocInaiZXpfWFt/I9ruXXGXOQ+DSajsXGw8qH2BG2Y8+LYnLhDBBi ho4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=oaytClLNVcMoG5g/aV/h9Xp5KhfN+snUxmprD+oOSJ4=; b=a58Yth3UjO88jxouKwiTa4FNnu9LkOWhRe+bOIqkRJOMqNcRxDD61Br5l9eqOz9BMN jx8FJv0wedcd+3+1fwOAC54RcDtVilZ1su1vfl8uovmj/WCw/dqHXDEi1Vhy4wuLC7y0 m6oCKGvHjtMgXb1yp99fv+eYM3qMg/0+ivq7bn7SjN+W29b87P6tQdVPQHcExue+hOd6 2pAk+wF9NufyS4PXzre0cLfTkq6se9I6j98LqzLX5By7IZVxo9mKkyLTlehci+1+GErY NomKHnFo3KoNFPaJqi0sOSdnas1T0JVEzkKUYtWRPJcufljIq/wxUZLX16WuoSgMymmZ OYVw== X-Gm-Message-State: ACgBeo19fxOROalmpp783xgg3BrqYguIhYwN4XH23ih4bN48F5cUN0nN Ewn3A4adrUmIiXKEQjnETv0IjP7NnlQ= X-Google-Smtp-Source: AA6agR7p93LXAv2jmhSEYGnfKYGaci2++2utKp124ZhYYeVpVfsTGsmQj293aGnt+XIwGOtwaRzoSg== X-Received: by 2002:a05:6a00:4393:b0:52f:3603:e62f with SMTP id bt19-20020a056a00439300b0052f3603e62fmr21309583pfb.23.1661183888232; Mon, 22 Aug 2022 08:58:08 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id x64-20020a628643000000b005368192372fsm3216440pfd.200.2022.08.22.08.58.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Aug 2022 08:58:07 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v3 4/5] auto-t: remove bringing up lo interface Date: Mon, 22 Aug 2022 08:58:03 -0700 Message-Id: <20220822155804.2006566-4-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220822155804.2006566-1-prestwoj@gmail.com> References: <20220822155804.2006566-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Several tests were setting lo up which is already done by test-runner. --- autotests/testFILS/fils_256_test.py | 2 -- autotests/testFILS/fils_384_test.py | 2 -- autotests/testFT-FILS/connection_test.py | 1 - autotests/testPreauth-roam/connection_test.py | 2 -- tools/run-tests | 3 --- 5 files changed, 10 deletions(-) diff --git a/autotests/testFILS/fils_256_test.py b/autotests/testFILS/fils_256_test.py index 5fa371e1..7018f0f2 100644 --- a/autotests/testFILS/fils_256_test.py +++ b/autotests/testFILS/fils_256_test.py @@ -62,8 +62,6 @@ class Test(unittest.TestCase): @classmethod def setUpClass(cls): IWD.copy_to_storage('ssidFILS-256.8021x') - os.system('ip link set lo up') - pass @classmethod def tearDownClass(cls): diff --git a/autotests/testFILS/fils_384_test.py b/autotests/testFILS/fils_384_test.py index b7174418..ce8904df 100644 --- a/autotests/testFILS/fils_384_test.py +++ b/autotests/testFILS/fils_384_test.py @@ -62,8 +62,6 @@ class Test(unittest.TestCase): @classmethod def setUpClass(cls): IWD.copy_to_storage('ssidFILS-384.8021x') - os.system('ip link set lo up') - pass @classmethod def tearDownClass(cls): diff --git a/autotests/testFT-FILS/connection_test.py b/autotests/testFT-FILS/connection_test.py index b1ec42e0..5d60bf4d 100644 --- a/autotests/testFT-FILS/connection_test.py +++ b/autotests/testFT-FILS/connection_test.py @@ -122,7 +122,6 @@ class Test(unittest.TestCase): @classmethod def setUpClass(cls): - os.system('ip link set lo up') IWD.copy_to_storage('TestFT.8021x') cls.bss_hostapd = [ HostapdCLI(config='ft-eap-ccmp-1.conf'), diff --git a/autotests/testPreauth-roam/connection_test.py b/autotests/testPreauth-roam/connection_test.py index 3c8fa0bb..02d03361 100644 --- a/autotests/testPreauth-roam/connection_test.py +++ b/autotests/testPreauth-roam/connection_test.py @@ -75,8 +75,6 @@ class Test(unittest.TestCase): def setUpClass(cls): IWD.copy_to_storage('TestPreauth.8021x') - os.system('ip link set lo up') - @classmethod def tearDownClass(cls): IWD.clear_storage() diff --git a/tools/run-tests b/tools/run-tests index e45ffe46..9620ed1f 100755 --- a/tools/run-tests +++ b/tools/run-tests @@ -487,8 +487,6 @@ class TestContext(Namespace): print("Ofono or Phonesim not found, skipping test") return - Process(['ip', 'link', 'set', 'lo', 'up']).wait() - os.environ['OFONO_PHONESIM_CONFIG'] = '/tmp/phonesim.conf' phonesim_args = ['phonesim', '-p', '12345', '/usr/share/phonesim/default.xml'] @@ -889,7 +887,6 @@ def post_test(ctx, to_copy): elif os.path.exists('/tmp/' + f): os.remove('/tmp/' + f) - Process(['ip', 'link', 'set', 'lo', 'down']).wait() except Exception as e: print("Exception thrown in post_test") finally: From patchwork Mon Aug 22 15:58:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12950892 Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) (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 A85FD2594 for ; Mon, 22 Aug 2022 15:58:09 +0000 (UTC) Received: by mail-pg1-f170.google.com with SMTP id q9so705890pgq.6 for ; Mon, 22 Aug 2022 08:58:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=PyaCBV50H/xF9xv3Fm+FcwZnifyGExGBQ/U5FJwtPqg=; b=p4lyerG0RjyyQbjFzdVdb84pCYpdo2Y1BU0VTuUZ2f55A9LHCYQvo59MAVrCjQ4oM3 U4XIAs6AVjICMJtOSSL+EYkXzNBeds0o2RxF+hIsR9hUA6460r8P1C2HhmOTCtUHGfbZ iMIWr+jvj1Zhra71dDjgkBkmqDyr8PpOTsGsYHCX97AM3lhwe8Xk+6+r1AoGVz7VbMiz TAD18qiCq9yWOi9p/mY0uRnv/DAt540UvPfXTmG/zj/UVhKtWrXhk+K7jXA/FznP0+rK QdnH44tZMaRoKxvmRq9AieMqMDOhNj9Qy+RTGAVqv6baLhrxnD9SrfmwPKufpANAoMmw urMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=PyaCBV50H/xF9xv3Fm+FcwZnifyGExGBQ/U5FJwtPqg=; b=zFmoFiAsOQGJIjaMO7OHpF5gy6Rb6oXWKyDGQqlkgKjJSyqKZW16fYv6cx8Rj2pcWN /6zq0RWW1LcY/auffzlgVvFfeDXYFtIcMvLNTX/UhfJhYSK4ZBVOgPBDMI6FQGslZgrR 4+MZnbG2k1/JjrTH3KM5PDn7cf74ixuzo0HtwglMAPHP5IdUNbcYGO3kow0+re5jWfyk Q2pDDb9J4hR0Ze1cYSoaKXmR35CRcsesVrNkfBGe137TYOgRl2HTJ595vQZ4WP6WRiNI CI7jI+AnZ/n2ETvP+MXjKf1nvJyGl7woASBL9DQuPiO6BsAfVH7zIF9dsKPOl4EPzKBB X72A== X-Gm-Message-State: ACgBeo0DxsVMx7Q/epE7/emrVD/dsxM9wqrXzJf2O9HdLRh8Nr1j10/u N5GaNvm2zJdXa89yJpUTCkmqujoM9nw= X-Google-Smtp-Source: AA6agR7s0PJd0JffaR08EBFcysuXckPQuRJwK+mD3E/1a3wJ7KMUm9EJtV5mhhovD6BCAA7NC8cgSg== X-Received: by 2002:a63:4d4f:0:b0:412:a02e:2896 with SMTP id n15-20020a634d4f000000b00412a02e2896mr17648868pgl.337.1661183888946; Mon, 22 Aug 2022 08:58:08 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id x64-20020a628643000000b005368192372fsm3216440pfd.200.2022.08.22.08.58.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Aug 2022 08:58:08 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v3 5/5] auto-t: fix testNetconfig static test Date: Mon, 22 Aug 2022 08:58:04 -0700 Message-Id: <20220822155804.2006566-5-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220822155804.2006566-1-prestwoj@gmail.com> References: <20220822155804.2006566-1-prestwoj@gmail.com> Precedence: bulk X-Mailing-List: iwd@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 This test was updated to add namespaces which actually 'fixed' dhcpd's address conflict detection since it uses ICMP echo requests. Part of this test assumed the DHCP server would not detect a conflict which isn't true for dhcpd (and any decent DHCP server I would guess). This check now fails since dhcpd detects a conflict (the static address) and hands out the next available address. Testing conflict detection like this is really only testing dhcpd behavior, and however IWD behaves here isn't important since the network is doomed from the start. --- autotests/testNetconfig/static_test.py | 28 -------------------------- 1 file changed, 28 deletions(-) diff --git a/autotests/testNetconfig/static_test.py b/autotests/testNetconfig/static_test.py index 01d694ca..aac2adcc 100644 --- a/autotests/testNetconfig/static_test.py +++ b/autotests/testNetconfig/static_test.py @@ -20,17 +20,10 @@ class Test(unittest.TestCase): # Use a non-default storage_dir for one of the instances, the default for the other one wd = IWD(True, iwd_storage_dir='/tmp/storage') - ns0 = ctx.get_namespace('ns0') - - wd_ns0 = IWD(True, namespace=ns0) - psk_agent = PSKAgent("secret123") - psk_agent_ns0 = PSKAgent("secret123", namespace=ns0) wd.register_psk_agent(psk_agent) - wd_ns0.register_psk_agent(psk_agent_ns0) dev1 = wd.list_devices(1)[0] - dev2 = wd_ns0.list_devices(1)[0] ordered_network = dev1.get_ordered_network('ap-main') @@ -80,28 +73,7 @@ class Test(unittest.TestCase): # of the log since we care about the end result here. self.assertEqual(expected_rclog, entries[-3:]) - ordered_network = dev2.get_ordered_network('ap-main') - - condition = 'not obj.connected' - wd_ns0.wait_for_object_condition(ordered_network.network_object, condition) - - # Connect to the same network from a dynamically configured client. The - # DHCP server doesn't know (even though dev1 announced itself) that - # 192.168.1.10 is already in use and if it assigns dev2 the lowest - # available address, that's going to be 192.168.1.10. dev1's ACD - # implementation should then stop using this address. - ordered_network.network_object.connect() - - condition = 'obj.state == DeviceState.connected' - wd_ns0.wait_for_object_condition(dev2, condition) - - wd.wait(1) - # Check dev1 is now disconnected or without its IPv4 address - if dev1.state == iwd.DeviceState.connected: - testutil.test_ip_address_match(dev1.name, None) - dev1.disconnect() - dev2.disconnect() condition = 'not obj.connected' wd.wait_for_object_condition(ordered_network.network_object, condition)