From patchwork Mon Aug 22 17:01:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12950953 Received: from mail-pg1-f177.google.com (mail-pg1-f177.google.com [209.85.215.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 4DC872F56 for ; Mon, 22 Aug 2022 17:01:53 +0000 (UTC) Received: by mail-pg1-f177.google.com with SMTP id d71so9896556pgc.13 for ; Mon, 22 Aug 2022 10:01:53 -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=RWhcffeOl0sLwh5sHM/qrGVC2x09eQpm+E1rqtcVqjw=; b=JOTx1RZQRsjNcN00sV8Mr8ZrEe8+XDbGVvSd/p6YCMYfegsG1Jj9wdDGhq8WiWLvAl vSQPeSbKKYmEyIVKQsz/i6h2VEOSC5jDW483057EmkJV3lqYvro5YKRvIFWq8xcRFREX fpyZ6Mkq9XZiGIX0k8zLDKUF9qz1Vy9xPC4bRASL9gS//6jcNRmnBJCeHeoKUFCL9BB1 KgZuepyKeQQBytlYiswAvg8+7aHwJ6fNRQqk1UbD1shBOT/8nNpIMdH9T070ECj2b4Ja Mm5mEh9PSHQTv+l/hBvO2xgw01PxGj1vFtxnu+HBsIB4z37dn+g/m7iVYZ+oULu4z46A xp3g== 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=RWhcffeOl0sLwh5sHM/qrGVC2x09eQpm+E1rqtcVqjw=; b=uE5/oVmfnNl8Jl1GVhpJ1ERVxpJj9A/aM86V+HkQoGwbBvvef08UH9WS8gMsHdYFec adSCixe7JTyU18OsWZLTLGcuoW7Uoa9mI/i9xyBj5RWxT46SM/0D9nvTSBwyuZm6QUV8 QupLB1p3NGH0PF7LJwgIPgn9u0LlfyJpkEHilCWNXoe3TpaW9kDBZBiUE5RZG6KihQC8 X4UWlYaTUqXNoqyFnM47XWdwGUIaifjwYZB+U3QyAFv425ukCshQppzvt8R5uaauwS9j SerElfmVWUcXwDFp3tXtpnAPIaa7veDf+HWOq4qVBp7OMfyg/q74UOgovHOtoIPo8gVW Wnig== X-Gm-Message-State: ACgBeo2ZceqKntwuXmEYOc7TiFTsqZ1jNEVxm46Wjf4R79K7M0Va/iK+ RAPDi6UGU3vEsK74tXxJEAXT/EKrVBI= X-Google-Smtp-Source: AA6agR63yunTTrdtOVEEW2x81H2/Nyhuk3maKhdzjgmKQ9yX3SPmCwMl5cOz7/NdoklaIK8Ijs4CeQ== X-Received: by 2002:a63:4916:0:b0:427:d463:55e with SMTP id w22-20020a634916000000b00427d463055emr18165030pga.374.1661187712552; Mon, 22 Aug 2022 10:01:52 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id d1-20020a170903230100b0016ef87334aesm8691002plh.162.2022.08.22.10.01.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Aug 2022 10:01:52 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v4 1/6] auto-t: fix unreliable behavior in testPSK-roam Date: Mon, 22 Aug 2022 10:01:45 -0700 Message-Id: <20220822170150.2049490-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 The packet loss test had a few problems. First being that the RSSI for the original BSS was not low enough to change the rank. This meant any roam was just lucky that the intended BSS was first in the results. The second problem is timing related, and only happens on UML. Disabling the rules after the roaming condition sometimes allows IWD to fully roam and connect before the next state change checks. --- autotests/testPSK-roam/connection_test.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/autotests/testPSK-roam/connection_test.py b/autotests/testPSK-roam/connection_test.py index c926e255..364f75c2 100644 --- a/autotests/testPSK-roam/connection_test.py +++ b/autotests/testPSK-roam/connection_test.py @@ -55,16 +55,16 @@ class Test(unittest.TestCase): condition = 'obj.state == DeviceState.roaming' wd.wait_for_object_condition(device, condition) - if pkt_loss: - self.rule1.enabled = False - self.rule2.enabled = False - # Check that iwd is on BSS 1 once out of roaming state and doesn't # go through 'disconnected', 'autoconnect', 'connecting' in between from_condition = 'obj.state == DeviceState.roaming' to_condition = 'obj.state == DeviceState.connected' wd.wait_for_object_change(device, from_condition, to_condition) + if pkt_loss: + self.rule1.enabled = False + self.rule2.enabled = False + self.bss_hostapd[1].wait_for_event('AP-STA-CONNECTED %s' % device.address) testutil.test_iface_operstate(device.name) @@ -197,7 +197,7 @@ class Test(unittest.TestCase): cls.rule2 = hwsim.rules.create() cls.rule2.source = rad0.addresses[0] - cls.rule2.signal = -4000 + cls.rule2.signal = -7000 # Set interface addresses to those expected by hostapd config files os.system('ip link set dev "' + cls.bss_hostapd[0].ifname + '" down') From patchwork Mon Aug 22 17:01:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12950958 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (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 37BEF3206 for ; Mon, 22 Aug 2022 17:01:54 +0000 (UTC) Received: by mail-pf1-f169.google.com with SMTP id y141so10921121pfb.7 for ; Mon, 22 Aug 2022 10:01:54 -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=ecd4WSKnsxwRkeaxJFCq86kDCaceKAaImv7wkDcSUKY=; b=WlJwklgN2OHTGHZvkSY10v+KOdWdxkiCxgMEIqoOc9u2THnF8d9ARY0WoFeXjL0fM+ jD6c5yKBILXjkNIPFxooihoX/t4/kkUBlHqXyKUjavujkwTw7X9Q/YNXL2VJG2/X2ryZ dAyTLQzr5quEMBxnzUeP5MHZN5zWcCYozyMa14rImGH2uVJEwnYuCIltSmneoQG1S7dY 3kO21BlqSMx9cfS8sMh64RXusJCPNuh6rRS+1BetS9/EKwXG0Bb2SxkzbqMHpRRFlbC3 Gb77sqxX9VYRbfCE3eUBTpPSVYlzN3tEjA86XkjuehK1YrUQeq6K19V5uD2KY8qYg7NR j3tg== 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=ecd4WSKnsxwRkeaxJFCq86kDCaceKAaImv7wkDcSUKY=; b=XAAY6sJf8/p07oEBijW0kkmXJEZzAPRz36wjIqmmqmXx86n5/OyE1pMbq0EHyFrkQN x64TmLYcBzqdae0hswZspuYy11cI2bSziBWV8Yo0gxregMv+3X5H31MfKr26jLAkN2ik YuhtKC9XJJxGIyweaKsTEcCC2qJmLHdkbVhXvf0xTHaoLl89uDR8fRTS5MxceDfpgle7 DX3Cwaw440McGQtX7zxOYt5aeh09vB1aT8C6zyhzvAyA+Fb9rrNbCvq7y+EFiH4vzCPp zqcCWioMAst/w2sF3OOOWQYgBIovu/Z//D3DmPudd7xcfFaf47ccVvSAFeqEwhiQ48DE MonQ== X-Gm-Message-State: ACgBeo22ORkJ7a4cixZ7flnOsYlHzvHH+ZrL83t0UbDbzH0dtsm5jUiE LSbdXk7YUSddRr/+dMQWxUFdqOZgg40= X-Google-Smtp-Source: AA6agR7OC6gtnxuHzazkFTaSzE83t7clsce+HJlvh+7EK1aRCli/HYENy+10ELYHvmEjI106YLzAfg== X-Received: by 2002:a05:6a00:21c5:b0:52b:fc9c:295b with SMTP id t5-20020a056a0021c500b0052bfc9c295bmr22074863pfj.56.1661187713407; Mon, 22 Aug 2022 10:01:53 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id d1-20020a170903230100b0016ef87334aesm8691002plh.162.2022.08.22.10.01.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Aug 2022 10:01:52 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v4 2/6] test-runner: double RAM for --valgrind Date: Mon, 22 Aug 2022 10:01:46 -0700 Message-Id: <20220822170150.2049490-2-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220822170150.2049490-1-prestwoj@gmail.com> References: <20220822170150.2049490-1-prestwoj@gmail.com> 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 17:01:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12950954 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 D4D8946AB for ; Mon, 22 Aug 2022 17:01:54 +0000 (UTC) Received: by mail-pj1-f54.google.com with SMTP id pm13so2670238pjb.5 for ; Mon, 22 Aug 2022 10:01:54 -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=F+5zSIq5EUWCPNwuT2nAmr7DPYxXlKj7FsAszUjtLom/SD79UX9dbB0YDnW8nZfA/t AqX5v/SBLVB5taHPDZbWja2pz/jRyObo5o+wikGQG4Nw9jvpbAilwmlf/83vW3PcVr0m Appci41e+8zx/L3NsCjEDOetasFTB/LwmmYhqZaAJwjX8RcopttxQ5nicCPzKD7RrfHv jkWvnZEQzq/XbDEBtLkIq1p4embSR9nmWpTRp0QPI8ew2JJaldCUYgcjs/dawRMfw2c+ zJRhtWeDuAyfEgg8nyViqz78XZl5VortJNeRgmoT277oHDD5kviamMiRyb6vch6wWcgA JqAQ== 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=HeZwJ41dKcfEZLBbefNcwYIKbP4CjOh3ErEOSB1B5ULeH8gQUh2WZekxvVD4L4559/ s6t3ekkEMgCP3jWCg3s6AFanSAewz+x9o1XcvKMFM5SdQR0KNdH/BK4wF7oeDnazkZ6Y rb+pMzZhuAKofPxH66ASig02RjwQ7xdQzUjmpe+LcQek1HP+AIQAn76lqfcqujMGgYcY YdTLvZbLcqZcAKxrc3wVM992TdSKFrppKydwBYkDya2+ggOXrBFemnnlw3EQEI9PMpyi jThmFzNwFUyunyRkZh7jxNGLO3bLh7+833DDd3iTdBefaa6R5fyF7sRjtksZxqudoDmT wAtg== X-Gm-Message-State: ACgBeo0ftt5OeN2R7XrVQB2wbqJNL4S8+ALMjuxzull+9mb7igUnPgLp vgY3Ux3DjjvK4/wifqycKMqwPC3cy5E= X-Google-Smtp-Source: AA6agR5pAjAjn0eATHH4pupy57alYFGWYzv2A5uABahFYTvsMozMSVVuf9RY035bi5FDMWdABETKYg== X-Received: by 2002:a17:90a:4887:b0:1f7:7676:e46e with SMTP id b7-20020a17090a488700b001f77676e46emr29407311pjh.107.1661187714123; Mon, 22 Aug 2022 10:01:54 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id d1-20020a170903230100b0016ef87334aesm8691002plh.162.2022.08.22.10.01.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Aug 2022 10:01:53 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v4 3/6] auto-t: hostapd: add set_address/group_neighbors Date: Mon, 22 Aug 2022 10:01:47 -0700 Message-Id: <20220822170150.2049490-3-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220822170150.2049490-1-prestwoj@gmail.com> References: <20220822170150.2049490-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 17:01:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12950956 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.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 A2F5C46AC for ; Mon, 22 Aug 2022 17:01:55 +0000 (UTC) Received: by mail-pf1-f171.google.com with SMTP id 83so5213276pfw.6 for ; Mon, 22 Aug 2022 10:01:55 -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=Te6a3F5PsQ8Moyr2UMG0VTHxxZL6Jj/WY6EIkBJtPo4=; b=oyLyGgBjSEKmSxyC+nI2mnm/dwjKdl78G9vxkWh3hZfvTxrughQFVPj+X907+xtj+W eJQlbdvTe1YcEgBcZOTsGbiuMG+I1YyFwC1HpSBP/l69Sk602wwQpa4NOGlYZ7lQVfJS YmQrw2IePESbAjHXkInLOz/rRUdVZQHewWr5qVu9w70tPt6ua/De90ucZ8NdHCBK8HQU 3CdrZB+wcckYXfLlHoK+babNYOFE6lUsRWGzob0caWwqy3tafwdD/y6Qkhvl1NzS6ji6 pRXYD7jVj0BxIYMT9/v6iWmVPCcbVQZ/3QxvsZoSqa1SLOCS9yf8KNpvD7gOycvRpm95 Q4fA== 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=Te6a3F5PsQ8Moyr2UMG0VTHxxZL6Jj/WY6EIkBJtPo4=; b=P5Akd7RfuRV8jYrajgT70MwWfYfd9FfgvFbIpzQgu+Ap+RBkSWOfVRjAJH4WeQpDuf tEaU+H2NoyzZiukdcEWmtwBtXjVXbqo7F7Q/5HBIHp2XscLzcyy+93yh3dyqwm8vrKuc psq4MVEs+UypULLdQLkRLX0abWSBYmlLffMnfVT+3q2qg2Ze3Ey4blm9ZCB0KPzhOEkF 6xz8GczVlaftqKKWseo9qp7+3mlZ7ROGWFq2f4Dznd4ed+pity1ds1hFWcTlsuMtRzuT 8fttMsf2Dr+ixbiCJ9iRr5qVM0q1OHXTWL03N7yntQ6x0C0KuvExGAU+PTs75JPX4FOj YHCw== X-Gm-Message-State: ACgBeo0ePzNo4Uz2KYI+GppX1gNoidAGXOqOUbXvalq5mlrs2OZA2r7f l51KyAtRcEtnrJRfjKvpf2XwNdASad4= X-Google-Smtp-Source: AA6agR683+FaazdSkizL8MK5lYFAhs0gt7nTeiOJcNMeGzSG/yszLi63dcsp8CBKA7mcKBkVXDfJ5g== X-Received: by 2002:a05:6a00:148c:b0:52e:a630:afc7 with SMTP id v12-20020a056a00148c00b0052ea630afc7mr22021721pfu.0.1661187714834; Mon, 22 Aug 2022 10:01:54 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id d1-20020a170903230100b0016ef87334aesm8691002plh.162.2022.08.22.10.01.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Aug 2022 10:01:54 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v4 4/6] auto-t: update tests to use set_address/group_neighbors Date: Mon, 22 Aug 2022 10:01:48 -0700 Message-Id: <20220822170150.2049490-4-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220822170150.2049490-1-prestwoj@gmail.com> References: <20220822170150.2049490-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 364f75c2..2206f120 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 = -7000 - # 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 17:01:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12950955 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 30F3E2F56 for ; Mon, 22 Aug 2022 17:01:56 +0000 (UTC) Received: by mail-pj1-f54.google.com with SMTP id ds12-20020a17090b08cc00b001fae6343d9fso6197240pjb.0 for ; Mon, 22 Aug 2022 10:01:56 -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=Tr0eKbQKNlEr4Kmt0ZWh6sfUgpcoHB5doqY+an+5cDEmj1hueBhJ8FrnoJxAv1uNkB 99j+HWkQmxWzsDr6+2Uk1hSu60y9yDI82AX2ZdbOJgp2REZYfxV7S0/ApfHV6PxvG3d1 2tV9GyOl27MUaNI/E/kzN6e8kg+JTFmd3UK+5gkIg+Uv3ZH3WLjwWfMCSoWZT4VI/Zza Pt6bawe/Y4vKZZPOAcvEbFK0vyslLOYr3AJLLJsvG3aPT9Idm+sJU64bI3tUtsHa9EEH iFJ9qq0gznGTYhOkLgJ/JeXxb7RXTj5KWjCX3heHAC+7k9nwH4F+cTiRTyfJwDEbg2O3 V8tw== 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=51eaB2QAcKBDpjJE2XrkXXj0CusZtlkZh+7XWouDkD7hxsJM5xNAGTjIirSoC3qJUQ stWHyTDHhIEobEGCWDfzRnG3S2opp8KEaGQADLkhaOYA6BufL21VbRECFY5b6xEipkp6 CMZKH1Quw2BjCqLdgubOTEDss5aMvh5Yijqg2qYRipbeJhfPAR+tdEEC3L9sMJNXa+By 0TRC205f4kwrIVc6Svk3XN/K1ks1PoId+sMmQsiXqoMO5pWoq9uZlWu0Pv9PbcTRCryc 31V7EXIYabibIBYydkk8//KqdzUUe08QpeDDQkp4ah528OrjrMuNXexq4fdb/9vhwHKI ebjQ== X-Gm-Message-State: ACgBeo2qCmZOqZAD+4qEx/XGDVnK6EA8csUPZJoOXJWTH4TkzXMiuVea 4Ijk/snUR5ReIW0lMuV5x20H8Gset4w= X-Google-Smtp-Source: AA6agR7sW4VoBL0vzbhXcfrE6umQ7/EJxW3G3nnjr1xhJ6IrfdkywF/ikr/019g4vjL42z2XHfN0Yw== X-Received: by 2002:a17:902:7d86:b0:170:a752:cbd1 with SMTP id a6-20020a1709027d8600b00170a752cbd1mr21028938plm.17.1661187715559; Mon, 22 Aug 2022 10:01:55 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id d1-20020a170903230100b0016ef87334aesm8691002plh.162.2022.08.22.10.01.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Aug 2022 10:01:55 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v4 5/6] auto-t: remove bringing up lo interface Date: Mon, 22 Aug 2022 10:01:49 -0700 Message-Id: <20220822170150.2049490-5-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220822170150.2049490-1-prestwoj@gmail.com> References: <20220822170150.2049490-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 17:01:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Prestwood X-Patchwork-Id: 12950957 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (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 E5C0733EC for ; Mon, 22 Aug 2022 17:01:56 +0000 (UTC) Received: by mail-pf1-f181.google.com with SMTP id z187so10899682pfb.12 for ; Mon, 22 Aug 2022 10:01:56 -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=fEKC4mBN4reCa+l/9p21pTRTMcqtgqzIKSGpjTr32030ouF7QaukckHL3W36CAccHQ Kr58FvSO1HSUBox73bdsWU3jYm+noWXk4exGsAGtxPOvePuvD0I04Gy1NOLS1VuV4cIs jldthDN40rMMQnPoi68XNYkQoUXk64YbXAsNZWXsgvUSDdAomPx7M6FRXXzktk+KQU34 LcSFc1kHXDahhyE+eRjVyHpg9ZqSdYHoByy/uQ74MFQm8gDdp5/lgW6U+anG4oNTmdGZ 0TgQTpILz0xaLd/Q7EsZzYDF12+1lIlw9cz6zZlDsR+T+ZJAIe2bth6BAZImSC6K0+7t 7Oig== 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=I5SwuNqFXBNHgojrmIYPJPCBTqBBdpuBG8yLsJ10AKRySEFrXSzV/d85ShoHaqvLaJ 9XRzCio6BOU4T4lYWHnrKwiCCqfVkZsagBxs1G0eO7c4QM/Ijq1MJy1UwF4uoQT08CGo 19xs2SY/z95dqPHM77rkvvHw0zjChZGIZQXJRLI1iMWrREZnhB4eRTwzh1TGYn2yW1KD gufxH2TbSv5vTHWiuKZUFEImS6DfzYR8f6/0YQI/JL4EU4KpMaEb+4zbSQWUSfOSMloO foke+YR9AlVqOl7Y6MCno0WlkflPXZnXXp8+PZ5AHbOSj4PWqLugYI16/L3VfRhcBEig O9dw== X-Gm-Message-State: ACgBeo0izpbjNEG5V6axhXLI8TgcSEn1UGcIWuDzF6LZ8wjASj0YO8Hj sA5r4FlmZLTK+q9gqI6j19DI+DKBlrM= X-Google-Smtp-Source: AA6agR4tud7pmYBhnjNLxrpDsnEW2kcYF02Ew0q9zmdErB8nx4ReeKLvNv9esMnQPOZkvQ6rkNeq1A== X-Received: by 2002:a05:6a00:acc:b0:530:e79e:fc27 with SMTP id c12-20020a056a000acc00b00530e79efc27mr21872709pfl.61.1661187716164; Mon, 22 Aug 2022 10:01:56 -0700 (PDT) Received: from jprestwo-xps.none ([50.39.168.145]) by smtp.gmail.com with ESMTPSA id d1-20020a170903230100b0016ef87334aesm8691002plh.162.2022.08.22.10.01.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 22 Aug 2022 10:01:55 -0700 (PDT) From: James Prestwood To: iwd@lists.linux.dev Cc: James Prestwood Subject: [PATCH v4 6/6] auto-t: fix testNetconfig static test Date: Mon, 22 Aug 2022 10:01:50 -0700 Message-Id: <20220822170150.2049490-6-prestwoj@gmail.com> X-Mailer: git-send-email 2.34.3 In-Reply-To: <20220822170150.2049490-1-prestwoj@gmail.com> References: <20220822170150.2049490-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)