diff options
| author | Till Kamppeter <till.kamppeter@gmail.com> | 2019-07-23 11:54:28 +0200 |
|---|---|---|
| committer | Till Kamppeter <till.kamppeter@gmail.com> | 2019-07-23 11:54:28 +0200 |
| commit | ffd0897626bd9ac48d29221b4f647bd7c0b15792 (patch) | |
| tree | 83ed1f4bc0b258416b33561f82aea5d4769514ae | |
| parent | a76f039b26099081a07a2b3a76e96c49c3599bc4 (diff) | |
nm.py autopkgtest: Improved check_connected_device_config()
- Replaced hard sleep() by longer timeout on check for config data available
- While config data still not available get_ip{4|6}_config() not None but
empty, checking appropriately now
| -rwxr-xr-x | debian/tests/nm.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/debian/tests/nm.py b/debian/tests/nm.py index d9b58b70..c79dcb82 100755 --- a/debian/tests/nm.py +++ b/debian/tests/nm.py @@ -346,10 +346,10 @@ class NetworkManagerTest(network_test_base.NetworkTestBase): def check_connected_device_config(self, ipv6_mode, nmdev): '''Check NMDevice configuration state after being connected''' - time.sleep(10) if ipv6_mode is not None: - # FIXME: why do we need to wait here, if state is already ACTIVATED? - self.assertEventually(lambda: nmdev.get_ip6_config() is not None, timeout=50) + # Wait for a valid, non-empty config entry (Why wait here, + # connection is already ACTIVATED?) + self.assertEventually(lambda: ((nmdev.get_ip6_config() is not None) and (len(nmdev.get_ip6_config().get_addresses()) > 0)), timeout=600) #self.assertEqual(nmdev.get_ip4_config(), None) conf = nmdev.get_ip6_config() self.assertNotEqual(conf, None) @@ -360,8 +360,9 @@ class NetworkManagerTest(network_test_base.NetworkTestBase): # note, we cannot call IP6Address.get_address(), as that returns a # raw gpointer; check address with low-level tools only else: - # FIXME: why do we need to wait here, if state is already ACTIVATED? - self.assertEventually(lambda: nmdev.get_ip4_config() is not None, timeout=50) + # Wait for a valid, non-empty config entry (Why wait here, + # connection is already ACTIVATED?) + self.assertEventually(lambda: ((nmdev.get_ip4_config() is not None) and (len(nmdev.get_ip4_config().get_addresses()) > 0)), timeout=600) conf = nmdev.get_ip4_config() self.assertNotEqual(conf, None) self.assertEqual(len(conf.get_addresses()), 1) |