From patchwork Fri Aug 19 19:24:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12949139 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (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 599704A09 for ; Fri, 19 Aug 2022 19:24:37 +0000 (UTC) Received: by mail-pj1-f53.google.com with SMTP id r15-20020a17090a1bcf00b001fabf42a11cso5729709pjr.3 for ; Fri, 19 Aug 2022 12:24:37 -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=ZSCVb0yHhSu5VoWJs9dGYM8YUdiganBGKcc7HI97oqmfc8VSXssWDnyL/9l2HCJY2F 3N5zqI5Pg63+D4EC4agmtvlW/93GVdU2jZUc6vggTOG04GKbDYJS8CD9FxLJZPDXOlTr Y/HY/cWAZylXQonkDXKrqWwg7Z46IzXv/ojyBbMJdbVgaOhakMbUp0FDTA6CXY4MZr3u JjDQ/zkuICNwbxOVPg/ripvi+ATZgxxL24hOHR/nmNgNuCfly+pnDUWXLCsELexWgyUl TRI9ZoVbzGJE0uaaRGyJa9G134xSEaiISkujHd3XxxSu3uMBxCQZXOUTffLEbq6PNGyT yM0g== 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=rb0i1vAUr4mWEzKMU5P8upqMBxH/l6N9cCu3zadRUPeWUer8eHo9dpp5gVlcdR8J6X EsUX2lrXIj27rttkyQjBNpoAd7DCfHUrPjLGIBlUQ27SGSqhX1XnzK3SD95/GaUX4wTy KepMG/IWMHfWhn7l1IgHJUd9mTe1W9Pl6ulILFlWVbDOjl1qxBcCFztePPXpmdor+abu imAacACKxqS/OuuwZxm50m5NriUtEr6bPorFJrDJffQxk5I6Rrm1fVwz0bVqpc61Vjwo zxAkefFHWdBOh8UUPfyW972rS8aY/DB5fCCQ7DcP4XvqgxqfYzQ0JmWZZoBnS5+QqElp Bxkw== X-Gm-Message-State: ACgBeo1Gn0+bW2qQk5a2Yg+2g5s+7YODcI5lW/j7krhgvrVk3V1xkdh3 FIZibhIdxEm/8kvxMdSpUP2ecZBFeyw= X-Google-Smtp-Source: AA6agR7UfD79XdvDgjQ4PaaK4I1xKq+ConT9G+7FgV8OMQl9eWYemuWTiWGIrutIuuq93RkO+P/jYQ== X-Received: by 2002:a17:902:ba96:b0:170:9f15:b997 with SMTP id k22-20020a170902ba9600b001709f15b997mr8447153pls.34.1660937076521; Fri, 19 Aug 2022 12:24:36 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id t2-20020a170902d14200b0016dbe37cebdsm3472982plt.246.2022.08.19.12.24.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Aug 2022 12:24:36 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 1/5] test-runner: double RAM for --valgrind Date: Fri, 19 Aug 2022 12:24:27 -0700 Message-Id: <20220819192431.1605386-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 Fri Aug 19 19:24:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12949140 Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) (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 390914A14 for ; Fri, 19 Aug 2022 19:24:38 +0000 (UTC) Received: by mail-pj1-f48.google.com with SMTP id g18so5545621pju.0 for ; Fri, 19 Aug 2022 12:24:38 -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=B+KeXq1qhL/tJlopwaEdqPJEoRdGIotNJFuasGAMrssn8AhsB74ed0nKqT2aplfCDF e7qP+fuzWALH8l/29xPp6E3bJvJmw976E1/VL1oHBGevPYCmchcboP7i2g9XnPz7zixb BJ1/wy3c/9Y72v9exqL7obG96OeqYzuG29hB4mKQLFa/50CVO9WVCKh+ru6cfNFJZmx0 giZ5n+ckWeGBjHkYh4U/YYfzmdVxsU9fEWhXdXRsw3IYj9+LnUlAyA9EEegMbFLaVVCh ExSIyri8wruEsI4VwjfwBCu2AMQ+zgRwuvtXQfP0fVGeCBfzoGxpnNgcA+Ws2jPW5GQD Q8ag== 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=LfZ8OZz5AiJBj8amW2fG83LM1z5bbtg3fAPug/1+t6uW0Y2OdxYp6LmgzuJpbzvKw2 jKC/0f2nKcv8SGgZYZA4OY63EW1zfDxq5I/1xGvVQKkammbdq1//LCK1/D6BZSnUNtj3 0WwPZepG4wm4Wgbh7OyVhyaS/37SM06dXztKmaWno+sMSmWB5VVRrK+mh31exjqGyVKR M93Z1TOXtcM8Y33P/H2kKEgoJI7qFPbiC1AOlwy7n6aL7OUVbapc9+mHWwYewmlCEeuQ YR10ukZxzdbDSy8RClGZ2mu0PD9VBYQa/W/rC9+aVUz2UDxGiMjuS8nSpyVwTt5nddcp 5Ayw== X-Gm-Message-State: ACgBeo0BQZi5knC5PUaNebuNETMCkCvx6nAuFV3yMkOANtcUsaeaLbhR oXxPeRDkSPrRvAuUXN7ZkIb4TYcaQoc= X-Google-Smtp-Source: AA6agR5P9A336aWH6UpULYjrBFtREuPNemhMiUTorOJUpeNym8xFb7z7+kNvtWvglNXnkYE67fwyDA== X-Received: by 2002:a17:902:7007:b0:170:8d35:bafd with SMTP id y7-20020a170902700700b001708d35bafdmr8528351plk.51.1660937077509; Fri, 19 Aug 2022 12:24:37 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id t2-20020a170902d14200b0016dbe37cebdsm3472982plt.246.2022.08.19.12.24.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Aug 2022 12:24:36 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 2/5] auto-t: hostapd: add set_address/group_neighbors Date: Fri, 19 Aug 2022 12:24:28 -0700 Message-Id: <20220819192431.1605386-2-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220819192431.1605386-1-prestwoj@gmail.com> References: <20220819192431.1605386-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 Fri Aug 19 19:24:29 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12949141 Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.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 F1B4F4A09 for ; Fri, 19 Aug 2022 19:24:38 +0000 (UTC) Received: by mail-pl1-f180.google.com with SMTP id w14so4910000plp.9 for ; Fri, 19 Aug 2022 12:24:38 -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=dDfCzPG4JAf9oqCLEnolWU0pco7BOOESt9Y340KUK2c=; b=HZCxOgMKNyDZxmu240VRSkxhVotBZq2Sv/A4Pw7STRGn5YyAOJeczgDRY5FWbp+Qoh VQcmJNnzcasP2VESlctV2g65hqMT2HGC+Gnp74KCMR1sZP/1LSboeNmH80P7rIScYe7u d1FxHfbn9NrthwPZOVXG295Jm7dbaTYWTrXtWJtvT7yIfHESp3LaKM0W8bENt8Yx1QCO qu2ioVez8QpFmjpMTf7GzuPsIvEHZQgXo2L4q0H5OpMiA/IzceIz7KsHvTN123cNY7NG mXw0vlG3xMEkmLS4rYCFnamMt2xv6g6qgKYFkpq/BuDe86//yC85oA94dhxHaT/mwMdo vM+g== 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=dDfCzPG4JAf9oqCLEnolWU0pco7BOOESt9Y340KUK2c=; b=XhalIiqZcnZb6q2ntoUbYsQolx6AQ+VLXPjJMgjBjycHTW/oE/83UL/gVBwdkLKiXQ RyPnInwcHT+GbZ41cMkp4Q4jcVfvIxH/FsrOxFifTmmoJdtR7bOBQ3KA9cBhui30w2sz x2JB3Mv9xOPfFG/32QD6JR/FlpvS9ARDRzSnH+gyE15NvLrMeWQliJFMPvKStcOZpIQV UimO/1GyqMSG9Jppnf6M5ZhZVvCBAD9hFZLwVpIyQuneI4LqVyxjmQ8V9emXo6UXfryg nEWwpIi+zYWhQXSbuyVO8+VmXYThYFJlH/3sT35SJ3VYCl93FRvPjHuJiAKK0anCaPDE 34Pg== X-Gm-Message-State: ACgBeo3fdt/tsIdlQ19Chgr80P9tAl2XpMNs0VoLHHgE4xggtGJP5cNc B6hIsM09RXS7R/KuWq1SUw1bnNMmP+w= X-Google-Smtp-Source: AA6agR5gFvPl/0TcwBgEaAZHbyaGlVKb7FyDcowQM8jFXo91x520jix54fbOUw9nmhe5Fnyh8gJIQg== X-Received: by 2002:a17:902:f711:b0:170:9e3c:1540 with SMTP id h17-20020a170902f71100b001709e3c1540mr8456550plo.22.1660937078143; Fri, 19 Aug 2022 12:24:38 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id t2-20020a170902d14200b0016dbe37cebdsm3472982plt.246.2022.08.19.12.24.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Aug 2022 12:24:37 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 3/5] auto-t: update tests to use set_address/group_neighbors Date: Fri, 19 Aug 2022 12:24:29 -0700 Message-Id: <20220819192431.1605386-3-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220819192431.1605386-1-prestwoj@gmail.com> References: <20220819192431.1605386-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(-) 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 f1b43130..d735551b 100644 --- a/autotests/testPSK-roam/connection_test.py +++ b/autotests/testPSK-roam/connection_test.py @@ -157,26 +157,10 @@ class Test(unittest.TestCase): cls.rule0.prefix = 'b0' cls.rule0.drop = 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].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 Fri Aug 19 19:24:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12949142 Received: from mail-pl1-f176.google.com (mail-pl1-f176.google.com [209.85.214.176]) (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 5667B747D for ; Fri, 19 Aug 2022 19:24:39 +0000 (UTC) Received: by mail-pl1-f176.google.com with SMTP id c2so4932270plo.3 for ; Fri, 19 Aug 2022 12:24:39 -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=psBxpOzP0Bb0cj01TH18yvRzUnfqVOpGIIv59XQFSccyrztaAH5hCxvv2GK/XMFJjx m24g/FTt8jPSCIG5HdL96T0z9ih5vf3XgSvI13fu0ckvUnO6XPVIqhfdYioHCSkRBIuP bZhjcWB5W82yAYkvtdvfdLcAI60dfJFiB5sFdnTZnKkA2CgN77Ia0pzb53oDnbYYPCyc ajp95D9Pebst1tI+OzOWQMVGXeLmpfpqF4SCBgA8WcsBssYgNMNEurcdMcL9rlaYzCZF DddHrI7IrFn5/4eHSsbI4t9zJC6lJ8LWrO6w79HVDDmfol6+ewrBomZQZQkDbFx08bek WGuQ== 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=4Wy2qgDdrgn1umBNo13ZhuEPeU93wBKVGVqYCgL+wG796zef6QVc/TnrPedr/MJCbm K92DCAghnfMR21MHnEI/1+SEvqSHmWYqyRezw8a7gC/FNqXhJmTN/MmLhbaesdTMppVC +xEKHvFMDe7W05eIQjVgLwghqrj8to4V1eWzCOOvPifrb6bVPCfP5eOoQLp8gsIFj2Ig jrrOdegbADBkPn0cNHy8yqwhqsdd7CwQL36Wmdiv5y9Ev4RkL9zruJMrMqzl0W9rP9rV uZ6Izqa0LvhOLo+MrzCt6RvfK8SL/xn3XOK6SzUL3AdlhJDOlQ87lzELphxw2sh1YdHY 4Q5w== X-Gm-Message-State: ACgBeo3yNppfEPBrHm1xY/bdVYwC5r3sLTaLOdvnGt/+SrbjQdDca2X0 4sIq2L0cyC56ldXdKs/Vj4LeLbrjogg= X-Google-Smtp-Source: AA6agR7IQUpZ02b9Z6BQ1eUFmTge/cR3kpFogExr41yG7Gu1yNg3h+WtbbcwDI6b07G11aQ6w2IKHA== X-Received: by 2002:a17:90b:4b0d:b0:1fa:e712:dd53 with SMTP id lx13-20020a17090b4b0d00b001fae712dd53mr4366541pjb.10.1660937078673; Fri, 19 Aug 2022 12:24:38 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id t2-20020a170902d14200b0016dbe37cebdsm3472982plt.246.2022.08.19.12.24.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Aug 2022 12:24:38 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 4/5] auto-t: remove bringing up lo interface Date: Fri, 19 Aug 2022 12:24:30 -0700 Message-Id: <20220819192431.1605386-4-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220819192431.1605386-1-prestwoj@gmail.com> References: <20220819192431.1605386-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 Fri Aug 19 19:24:31 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12949143 Received: from mail-pj1-f54.google.com (mail-pj1-f54.google.com [209.85.216.54]) (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 125C74A14 for ; Fri, 19 Aug 2022 19:24:39 +0000 (UTC) Received: by mail-pj1-f54.google.com with SMTP id s4-20020a17090a5d0400b001fabc6bb0baso5188116pji.1 for ; Fri, 19 Aug 2022 12:24:39 -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=NIY4GN7r/vazkw8qon7caoEfP5LqKXe1esHMTe0k8/Ca84fl0m4i13KeJ5ndLT7YIP N/JIR2LXc+lW9Wxwuqm7vHS7b6TsdKddDTOKum6k2KXWAr7OvIO2l/fD2RM7tWGNEiNW Ryb/9J7XC+jwpogGvUwOu/kyzghXPej+yqVSfMW9xZT58ENKZCzlAlfXgTaKVKdj4Miv zHd4c/yOPDVbNeuC+GWllhvCAfesMVARuhvmULt984VD8l3QKRdDLQ5IrJiOnCBKL3Zy HF/Zo/CXtGv7sUziwl7pnk+hZ14oEl8uudIp2nXc2F7EB/eR0XYM4h7Cq6pF5A9BZjyb 9LMQ== 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=4OIk7NBbKVOinmdhOTsfuYerOtuGTrNEH/wMU0S1M+3CrsNDy9hBERlcRBfdkJufEN DyYEduLeMs/FJ3SfP21w3YWSyPLS5mBYmBvPKnCvd7eayAUbQd+CcxwwRfB1ipvHCoQ0 x9k+aYCgN64EETLxN64YxJP+6sUr2GHzaKHrwnn9DNxUGHjxdZ6g9wEYL0mIdoG7Wc7i z8VagbwImtNtKVGt8DB+CnrDpTSddMfOeuh8GhE/dkRaIpHsd0qyV+Xh1TXAXGe3QmDV 3xGPZ3T2VsipZXvSp2OmttjkysOlMnDYN5LWIHU35L3WUP54hCoYE1/Sn9ggGhQ5rjgG dADg== X-Gm-Message-State: ACgBeo2rXXJ9vd2Tz8C0vWdfQ3hSaLsqlAsOu9CCX7YgdfvidHqe4DEF f0U0gAWw05KYzdjeLyFMmCkaCHw0+tY= X-Google-Smtp-Source: AA6agR7r7KeKalAX6CfDvAX/355zX0uyXQeKZCBrw4UO1Ekalw9+9psWukru+GTVIvyvBnmtn0Ct9g== X-Received: by 2002:a17:903:2602:b0:172:ba94:1590 with SMTP id jd2-20020a170903260200b00172ba941590mr6843629plb.146.1660937079288; Fri, 19 Aug 2022 12:24:39 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id t2-20020a170902d14200b0016dbe37cebdsm3472982plt.246.2022.08.19.12.24.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Aug 2022 12:24:38 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH 5/5] auto-t: fix testNetconfig static test Date: Fri, 19 Aug 2022 12:24:31 -0700 Message-Id: <20220819192431.1605386-5-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220819192431.1605386-1-prestwoj@gmail.com> References: <20220819192431.1605386-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)