From patchwork Fri Aug 19 20:26:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12949177 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 B68F14A14 for ; Fri, 19 Aug 2022 20:26:26 +0000 (UTC) Received: by mail-pj1-f53.google.com with SMTP id s36-20020a17090a69a700b001faad0a7a34so8532775pjj.4 for ; Fri, 19 Aug 2022 13:26:26 -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=ONAxMwihEDEdQ/KNx7RRB0l/6dW62gm/5KoPGkJM+0ICVAxKfcGIccp06oOh9l+pEV 3QDeTHH4LRsHYVwyftF5i2qkotWEeJ3EaoH7nYfz27Y0+ySkednMF7iCfw1TPooCs3HB mFjV4G8DHL5hXO/BiwtErzeraPvhNt53bgP0Xk6F/sjZ6e3a1/ngxmTtXQOtEnBegnIj /O/vlMzDyLbj1ScA+Et+btLnhbrNS6bZJlD4fkPX2+GwwcX6wHKRDcvSX30FP04aW8Ev KrGJzR4Tv9uEyj4WBX2KMErdpM8vpc/F6iRTzHLrYYb/TXwxww+ZJKv0qecPQJ24pMET OODA== 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=4K5V1VTXS0bDevXBASgQUB/bkDuoE01SDXKbo4ZxvesStTviKWvBoz1uM24mYK4+Uj UcuRQy74NyrLJsyngaijVQKiMHO45AJgWCKRZl7M80yfTE2xWrOinyVeGyYHIPgQtVd2 OyR2QD5LiW9yjVIqhJQrzUN7rdoNQd9806Wu3F0HgijZXmLDIlzY30CmYzd3uhyl7+hX 6paNtSRq3qdHc/nRbfDamHWR+LkPUzhVnx1wYpVcAvPQNFPGHbbEOx9h+j8+wmChoG0u tBawKRARbNoCe93J61lukRk33udqqEhyxbs6xoHfqMZCzbnHJDG/IKfbrBKeuVKn6SSZ ticA== X-Gm-Message-State: ACgBeo3tVWU2auANB+/yyVxxQyZhFNVBarLThSEZL9CTuOl7sc392e5L Ojrn9FsGMQpCyWCX8/KXDONEvANYbZU= X-Google-Smtp-Source: AA6agR6u16yLV778QTBOB+J0a3Q9EHg4nTfggLBYc834vqBfDfgU4E5NRXF5OsfVoqAkyVZnck0HxA== X-Received: by 2002:a17:90a:55:b0:1f7:4513:8cac with SMTP id 21-20020a17090a005500b001f745138cacmr9954547pjb.93.1660940785973; Fri, 19 Aug 2022 13:26:25 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id t15-20020a17090340cf00b0016dbce87aecsm22206pld.182.2022.08.19.13.26.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Aug 2022 13:26:25 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 1/5] test-runner: double RAM for --valgrind Date: Fri, 19 Aug 2022 13:26:20 -0700 Message-Id: <20220819202624.1681246-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 20:26:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12949178 Received: from mail-pg1-f171.google.com (mail-pg1-f171.google.com [209.85.215.171]) (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 290F5748F for ; Fri, 19 Aug 2022 20:26:27 +0000 (UTC) Received: by mail-pg1-f171.google.com with SMTP id r22so4527582pgm.5 for ; Fri, 19 Aug 2022 13:26:27 -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=aJAxW0gWJNNk5368rOt1KMwDICQXDUBsYyoN+gVSMGgjMAStnIDx6mwYT1TdI353vK 1gkjKcN4T2L0sKW2aeGYbdHNIaPmscZZ92bf5Xjf2qTqK4QrZAvOQKrDWZRy9/fQ6fKZ YyATNZDHhpYWfDP+34XSEzLvJK4LEWImvxYyfElRxv7RdlmQxbM4OSPWFPANFCNYbz2I qtTMuklAvuspvvStYTnC220NCwTbVAsywBRBGSzk6nzIq34HH3ON3un6QyPxzShadfyO OFPDfd0dJe5IUPGdP31yrWySbL9qhzZX6ctyjuDYS1pbTpdVjwXmdIxqOzgojNaMo5x2 TGwQ== 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=KS/atvEMYrIIjH/rxw8vmifMjOcRqVXVg8fkJ6W0IdDQzXmR2fSsB4BLw+P5s8I9KX oM0/GI2s9ERtNF3EbFx7xxUxmA5fnSsW97MW4CG5kCWdrtADqbdqo/tfi926P3wd2VBX yB4A24gLU1x8oGeww44LE+gssdUrumQZj8xt+6CejaNbuXJf+zBb902boIRLtnEEDPU/ R8Wd5+Ceg1J1g1O3UuV9yd2OvKNYh4RX4eBPIAsW6Ho0YBs3Ja0MuTiyFyQe5Ij5XiSx 8p1IrDzVr2cZGg/46dBpZ2r6PxuvklJlUGSGI4jPb5KTXmHaiIcJeE2FBmplogykNRQQ 46Cg== X-Gm-Message-State: ACgBeo1SokXLsPntcdW1RrL8ULSLSJRW+dnzIjeUyrwASdUOLZjyybXh ng2engl3ybNKoDmiWXJQAkBnl1LIyfY= X-Google-Smtp-Source: AA6agR50gNylvO307g8NNy4zU+06tVaoXbs0Hib6jphcc9FqJyPSqzU2A9Q5HajH5V+i6G0dzoJeEw== X-Received: by 2002:a63:4f4f:0:b0:429:f656:69a6 with SMTP id p15-20020a634f4f000000b00429f65669a6mr7545515pgl.287.1660940786406; Fri, 19 Aug 2022 13:26:26 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id t15-20020a17090340cf00b0016dbce87aecsm22206pld.182.2022.08.19.13.26.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Aug 2022 13:26:26 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 2/5] auto-t: hostapd: add set_address/group_neighbors Date: Fri, 19 Aug 2022 13:26:21 -0700 Message-Id: <20220819202624.1681246-2-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220819202624.1681246-1-prestwoj@gmail.com> References: <20220819202624.1681246-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 20:26:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12949180 Received: from mail-pf1-f174.google.com (mail-pf1-f174.google.com [209.85.210.174]) (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 F17C87490 for ; Fri, 19 Aug 2022 20:26:27 +0000 (UTC) Received: by mail-pf1-f174.google.com with SMTP id p9so4169671pfq.13 for ; Fri, 19 Aug 2022 13:26:27 -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=SH1p/Jy6irmmdOftxiYsMTxal98HxDHfz5eD8xlfrZQ=; b=IDOdEzdDvFaRmO1BKl1A67ERVBvTP8MsEUO6PeXEl9R+rziyhMVcb64do00ONS0fPZ K7jzbFAsazWcnPjNwhgWeNyyRN+IVmGkMMv638Y9ZC1TThpihKiaJdATuEFkGuTq8rMw fQmJDNA5WZ45xNlLju+NESX6YitTJnR73ozPIWiTqWlujRfzKDm3aVhGRGmjqnHGs8e+ 3e0rd68n640R/q3RkMLKlEDs6ZpJZyAeAWUPMILzejN6TTpTnp0CzdiwESPB2Un/Pb4v OeKRrBujmtGPalW1sXADBURWobReIqEOJAJIcsLOgrBvtV9FoMDTXvPVSLPRsKobk3Kd tgcg== 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=SH1p/Jy6irmmdOftxiYsMTxal98HxDHfz5eD8xlfrZQ=; b=Avnnh2PfOjsgMLizK031kKYbZw0trkBM2wR3GjBoBSkjIcb8zpTyqpH3NA0jO8/7/s woelaK4PAUivnLbGbR0hDaY6d4v5s4kSN7fY4jDNVi/v74YblMFEgkKzUBosd+vByBa/ Cuewhd89ogo0k4sROTozRn32gGGkNodq1WxrUfk69AF/MA705c+GP/Q93WJmNiL9BEjg y+aPhBDG+RnQ4GbtZcfUxpigzD1riSvApLgzr0pNj0rT6HFydFanXTuoKdKjHuxujDXq ccDAlD+RQ39JBOdmFau2O3XgjEBNWcubP56UPUL63HM20a8oZWgyffyBpE8P6EeuPAPr 2gxg== X-Gm-Message-State: ACgBeo2ysLUruq+4IDWI6zfL0UpK/yhYrxnknK3TY5rbShXDFb5hqQ2T I6GF5A68Stt9BqAlF0epaAiwXHJEuV4= X-Google-Smtp-Source: AA6agR6mvGzRu0BT1eqPce90lXG1q09wfFWIWHEanT9HQmFyO5BhufmxNQi+6EaYbqN/+FGPDao5Sw== X-Received: by 2002:a63:1203:0:b0:429:c80d:1d17 with SMTP id h3-20020a631203000000b00429c80d1d17mr7426346pgl.24.1660940787101; Fri, 19 Aug 2022 13:26:27 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id t15-20020a17090340cf00b0016dbce87aecsm22206pld.182.2022.08.19.13.26.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Aug 2022 13:26:26 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 3/5] auto-t: update tests to use set_address/group_neighbors Date: Fri, 19 Aug 2022 13:26:22 -0700 Message-Id: <20220819202624.1681246-3-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220819202624.1681246-1-prestwoj@gmail.com> References: <20220819202624.1681246-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(-) v2: * Rebased to upstream 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 Fri Aug 19 20:26:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12949179 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 5547E4A14 for ; Fri, 19 Aug 2022 20:26:28 +0000 (UTC) Received: by mail-pl1-f180.google.com with SMTP id y4so5042154plb.2 for ; Fri, 19 Aug 2022 13:26:28 -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=cPjUj5ODfsyQSttbh+qHInke3K+a7IpHZyHseo+Yu9VCIAjet3gDpM0HXzlw6PLM4L UjLTx6w3wj/ECPaCMxHJdppR6KC8+7uw7T4nBcaY0LyBnZ3RUOR5Va8/xszugo70Hy/0 ur6EqNO5iBcbyVxyR3DoqO+eQZRPQJ/Ixza2wmTqxHiERcVuUhoNTjWcpVxjyzwq4LTX uJc5k0qpKnJklaDRNe9qzub7KoNoH5iMu6aGIY1H1RQKDm7TOI34z+YjQ6N6ScdXMYr4 divZMhwlp0InxK152mwZDejV4VK15UGLKVqe/VtbkwUvPhxi3OVZMeYuTyekDvoypv5n VoAg== 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=NKiyGt0z9wvNwIwJnnike+qYoXKvU3BEsUR+iJb0bn60B/9WAb2/QXil2/8aWuaYvh pSYB1fGo0L0WI2fu2TKeBzpsQTpyKDlA7JBMFa6q6AfsfdZDoAXjID0/mw0OlpNTA0K4 A78Aorpg5So30lC7it2CncG5t0asPpcGqXVUQGQdHFZS3aud7pDw6HR0WGhzbPKzT6Qa ACVf8A+LHOSlJ8tOKCdg8muHNU9tEECOMrfMzkHJHQjeSWQrK8Ef0UQeGkUL2t2Wj3cG vCH7H37yTvgqB5JGaKtBzeAai2HvVAN79XKZbqLM2FgMI1nkDgG2V06kT9VcfwRStDUy AEng== X-Gm-Message-State: ACgBeo0tHdo0TyCSFVq+LTijSY64xLxNqK3pcwf3H5D7qYB7SeBTyP2f YbuvT5/CdlyWtYTlVyvAZ3cTmXustFM= X-Google-Smtp-Source: AA6agR4mhXjUfhFS6A3A3BGeXFnZdNOzZ4uQrRnQmD+CjXE9e6XmEKOHzpgKGauthKDw+Bo4Ym7cvQ== X-Received: by 2002:a17:90b:3ec9:b0:1f5:7e38:1fd1 with SMTP id rm9-20020a17090b3ec900b001f57e381fd1mr15620671pjb.101.1660940787641; Fri, 19 Aug 2022 13:26:27 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id t15-20020a17090340cf00b0016dbce87aecsm22206pld.182.2022.08.19.13.26.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Aug 2022 13:26:27 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 4/5] auto-t: remove bringing up lo interface Date: Fri, 19 Aug 2022 13:26:23 -0700 Message-Id: <20220819202624.1681246-4-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220819202624.1681246-1-prestwoj@gmail.com> References: <20220819202624.1681246-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 20:26:24 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12949181 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (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 DE4E4748F for ; Fri, 19 Aug 2022 20:26:28 +0000 (UTC) Received: by mail-pf1-f172.google.com with SMTP id x19so2472241pfq.1 for ; Fri, 19 Aug 2022 13:26:28 -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=k7MTyyMy783UyJCVM3FfauS3szDKU/ZZpM5RgjTEjZ3UFwLtTDUNKP1PLK60bEb9gR kUhonxrLijYm/K9MzPcoXf5oKUjqJTyyDyu63Sqib5iWR2AQDwHG6KNODMIPqjAK1t2B rvlEqjP6AFBVY2K7nVlClGQl6dn0gYiWVoSah0oGsDRu2ylV97zEJYZydJIwxDHwXPxT WcH0k2DRPWkZTcz2H+8V0CgELepHefeiHYPu3/7Xcjnr/Br/APX9S6JB+zifAlWArERP Vj2yy12JKCcfE5WkRHGqV3+wXX7pIYZ1XrmCFQpn9YmWfC6we5nLubxFz/7mG46irVHz GGAA== 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=sluvmbEc+KsLB94SgnKvg8InTPWlTdCuQKW36rDkjcK3WO0T3x8dFGYqOV8wJhcZr9 wTSclHXgOSJTOMYqTjeHCr8AHvh99alqb5AcLmESj/ra2soLdDr79Pm8OQNFOHbakuDy KfRiBypLCdRPtGCizXd35zvTnvLzyEqjE2IIc2cOuEu1qkf6PCKJDCiZV12BjGPxNFVG hZBQgprNUIBQ11VIjunRRlDdJ5C/l62PWWoJlL9jtkSLnTEQ+ureUo3PV+6J3YG8GSGL mSd9FUwBZWeuUzIjOQU2z4rIMH/w7YEpcP+/oyYKW4Jy6fE3m+KiHiqjzi5c0ywCBoFs IBSA== X-Gm-Message-State: ACgBeo1hs6klyJ/KeKDYyw0y6a/WZQSxmVx2e0MikPzwy13RIBz/Lz53 hg+UjXf9RLdFOPpTcTWK0e0m/IVvqZQ= X-Google-Smtp-Source: AA6agR4izcvtIOvlgA4eKVkwZ+nHFfwMK5sowxx23dVru2U0sA+aHmfp+O40OFfVqpUa7c+lMIleeQ== X-Received: by 2002:a65:68d0:0:b0:422:ebd2:302 with SMTP id k16-20020a6568d0000000b00422ebd20302mr7404775pgt.340.1660940788230; Fri, 19 Aug 2022 13:26:28 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id t15-20020a17090340cf00b0016dbce87aecsm22206pld.182.2022.08.19.13.26.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Aug 2022 13:26:27 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v2 5/5] auto-t: fix testNetconfig static test Date: Fri, 19 Aug 2022 13:26:24 -0700 Message-Id: <20220819202624.1681246-5-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220819202624.1681246-1-prestwoj@gmail.com> References: <20220819202624.1681246-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)