All of lore.kernel.org
 help / color / mirror / Atom feed
From: James Prestwood <prestwoj@gmail.com>
To: iwd@lists.linux.dev
Cc: James Prestwood <prestwoj@gmail.com>
Subject: [PATCH] auto-t: fix timing issue in testEncryptedProfiles
Date: Wed, 15 Jun 2022 15:50:12 -0700	[thread overview]
Message-ID: <20220615225012.932391-1-prestwoj@gmail.com> (raw)

test_decryption_failure is quite simple and only verifies that a known
network exists after starting. This causes the test to end before IWD can
fully start up leaving the DBus utilities in limbo having not fully
initialized.

Then, on the next test, stale InterfaceAdded signals arrive (for Station
and P2P) which throw exceptions when trying to get the bus (since IWD is
long gone). In addition the next IWD instance has started so any paths
included in the InterfaceAdded signals are bogus and cause additional
exceptions.

At the end of this test we can call list_devices() which will wait for
the InterfaceAdded signal, and cleanly exit afterwards.
---
 autotests/testEncryptedProfiles/connection_test.py | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/autotests/testEncryptedProfiles/connection_test.py b/autotests/testEncryptedProfiles/connection_test.py
index dd4892ca..2b846596 100644
--- a/autotests/testEncryptedProfiles/connection_test.py
+++ b/autotests/testEncryptedProfiles/connection_test.py
@@ -115,6 +115,12 @@ EncryptedSecurity=aabbccddeeff00112233445566778899
 
         self.assertEqual(wd.list_known_networks(), [])
 
+        # This test starts and stops IWD so quickly the DBus utilities don't
+        # even have a chance to set up the Device interface object which causes
+        # exceptions on the next test as the InterfaceAdded signals arrive. This
+        # allows the device interface to get set up before ending the test.
+        wd.list_devices(1)
+
     def test_runtime_profile(self):
         wd = IWD(True)
 
-- 
2.34.1


                 reply	other threads:[~2022-06-15 22:52 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220615225012.932391-1-prestwoj@gmail.com \
    --to=prestwoj@gmail.com \
    --cc=iwd@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.