shill: allow forced starting of wake-to-scan timer via DBus
Allow the toggling of a boolean, |force_wake_to_scan_timer_| via DBus
(i.e. the Device DBus property ForceWakeToScanTimer) that forces shill to
start the wake-to-scan timer every time shill goes into suspend disconnected
with wake on WiFi enabled. This will be used for autotests and manual tests
that want to trigger wake-to-scan timer wakes.
BUG=chromium:463301
CQ-DEPEND=CL:255551
TEST=Compile shill and run unit tests.
Manual testing as follows:
1) Boot into a samus test image.
2) Run 'dbus-send --system --print-reply --dest=org.chromium.flimflam
/device/wlan0 org.chromium.flimflam.Device.GetProperties'.
3) Verify that ForceWakeToScanTimer is present and set to 'false'.
4) Run 'dbus-send --system --print-reply --dest=org.chromium.flimflam
/device/wlan0 org.chromium.flimflam.Device.SetProperty
string:ForceWakeToScanTimer variant:boolean:true' and verify that no error
response is printed.
5) Run 'dbus-send --system --print-reply --dest=org.chromium.flimflam
/device/wlan0 org.chromium.flimflam.Device.SetProperty
string:WakeOnWiFiFeaturesEnabled variant:string:ssid'.
6) Run 'dbus-send --system --print-reply --dest=org.chromium.flimflam
/device/wlan0 org.chromium.flimflam.Device.SetProperty
string:WakeToScanPeriodSeconds variant:uint32:20'.
7) Run 'echo 0 > /var/lib/power_manager/disable_dark_resume; restart powerd'
8) Run 'grep "OnDarkResume" /var/log/net.log | wc -l' and ensure that the
output is 0.
9) Ensure that the samus is not connected to a WiFi network, and run
'powerd_dbus_suspend'.
10) Wait 40 seconds, then resume the samus by pressing any key.
11) Run 'grep "OnDarkResume" /var/log/net.log | wc -l' and verify that the
output is 1.
Change-Id: I03035e38ac8044c1ca9164ce16ca319d4106fbc0
Reviewed-on: https://chromium-review.googlesource.com/255561
Reviewed-by: Samuel Tan <samueltan@chromium.org>
Commit-Queue: Samuel Tan <samueltan@chromium.org>
Tested-by: Samuel Tan <samueltan@chromium.org>
3 files changed