tests: simulate old LastScan wifi value in test-networkmanager-service.py
In this way clients will randomly find that the AP list is older than 30 seconds and they will issue a new scan.
This commit is contained in:
@@ -916,16 +916,8 @@ class WifiDevice(Device):
|
|||||||
self.aps = []
|
self.aps = []
|
||||||
self.scan_cb_id = None
|
self.scan_cb_id = None
|
||||||
|
|
||||||
# Note: we would like to simulate how nmcli calls RequestScan() and we could
|
# Use a randomly older timestamp to trigger RequestScan() from the client
|
||||||
# do so by using an older timestamp. However, that makes the client tests
|
ts = max(0, NM.utils_get_timestamp_msec() - Util.random_int(self.path, 20000, 40000))
|
||||||
# racy, because if a bunch of nmcli instances run in parallel against this
|
|
||||||
# service, earlier instances will issue a RequestScan(), while later instances
|
|
||||||
# won't do that (because the LastScan timestamp is already updated). That means,
|
|
||||||
# the later instances will print the scan result immediately, and in another sort
|
|
||||||
# order. That should be fixed, by nmcli not starting to print anything, before
|
|
||||||
# all RequestScan() requests complete, and thus, always print a consistent list
|
|
||||||
# of results.
|
|
||||||
ts = NM.utils_get_timestamp_msec()
|
|
||||||
|
|
||||||
props = {
|
props = {
|
||||||
PRP_WIFI_HW_ADDRESS: mac,
|
PRP_WIFI_HW_ADDRESS: mac,
|
||||||
|
Reference in New Issue
Block a user