History log of /system/connectivity/shill/wifi/wifi_provider_unittest.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
3a62e235646ec19bee71e8dbee5208282dcd13b5 20-Jan-2016 Alex Vakulenko <avakulenko@google.com> shill: Update libchrome APIs to r369476

The new libchrome has been ported from Chromium and some APIs have
changed. Make necessary changes at call sites.

Change-Id: Ib4c4b5438a2e249777c9c1b6509f085ad5d00049
/system/connectivity/shill/wifi/wifi_provider_unittest.cc
fa1eb722d0742d89c26b9c5c81d02ef2a138cbf2 21-Dec-2015 Alex Vakulenko <avakulenko@google.com> shill: Disable RTTI

There is no longer a reliance on RTTI in libbrillo, so disable RTTI
in the rest of Brillo codebase.

Shill also used dynamic_cast<> in many places but it looks like there
is no reason for that. Using static_cast<> in those places seems to
work just as well and doesn't require RTTI.

Bug: 26292405, chromium:220387
TEST: Compiles, all unit tests pass on Dragonboard
Was able to bootstrap a device from scratch and networking
seems to work fine.

Change-Id: Id0c47168e634e354b4279f613246e6667df6fb5f
/system/connectivity/shill/wifi/wifi_provider_unittest.cc
289a5a5e18bb1a676b3dfce111af4c2c00c7776e 21-Sep-2015 Samuel Tan <samueltan@google.com> shill: use different service_constants.h path for Android builds

Use the service_constants.h file from the external/cros/system_api/dbus
instead of chromeos/dbus/service_constants.h, since this header file
is installed into different directories when building shill for Android
and Chrome OS.

BUG: 22956441
Change-Id: I7e6ea46b4893588d2862792cf43aa83fdf7c30b4
TEST: shill still compiles using emerge.
/system/connectivity/shill/wifi/wifi_provider_unittest.cc
bad1c10ffd2d4ac14f7bd9f4ef6a8982e711f566 19-Sep-2015 mukesh agrawal <quiche@google.com> shill: remove references to GLib

There are a number of references to GLib (the object),
even though no one uses GLib in a substantive way.
Remove these obsolete references.

Bug: 23386647
TEST=unit tests

Change-Id: I8d574980bc8e853c8b87ef64b581d64a71491201
/system/connectivity/shill/wifi/wifi_provider_unittest.cc
c0beca55d290fe0b1c96d78cbbcf94b05c23f5a5 03-Sep-2015 Peter Qiu <zqiu@google.com> License shill to Apache2

This patch automatically replaced the license on all text files from
Chromium OS (BSD style) to AOSP (Apache2), keeping the original year as
a reference.

The license header was added to .gyp and .gypi, the NOTICE was added with a copy
of the Apache2 license and MODULE_LICENSE_* file was added.

BUG=23587594
TEST=grep 'Chromium OS Authors' doesn't find anything.

Change-Id: If41ede586c2465f5831fb7fee270ff41dbfdb596
/system/connectivity/shill/wifi/wifi_provider_unittest.cc
d31fb5812df751f0bfac41e2c0489e1a8a18cfd7 15-Jul-2015 Peter Qiu <zqiu@chromium.org> shill: refactor KeyValueStore internal data structures

Use a single chromeos::VariantDictionary to store all key value
pairs instead of having one map per data type.

Also overload the == and != operators for equality comparison
when KeyValueStore is wrapped inside a chromeos::Any object, which
is needed for nested KeyValueStore.

BUG=chromium:510238
TEST=USE="asan clang" FEATURES=test emerge-$BOARD shill

Change-Id: I8b014d602b9d67538a86d0f5e0fdd1fb07556533
Reviewed-on: https://chromium-review.googlesource.com/285930
Reviewed-by: Zeping Qiu <zqiu@chromium.org>
Tested-by: Zeping Qiu <zqiu@chromium.org>
Commit-Queue: Zeping Qiu <zqiu@chromium.org>
/system/connectivity/shill/wifi/wifi_provider_unittest.cc
2b363903f38a515001c5edc7202403fcddb15a01 16-Jun-2015 Paul Stewart <pstew@chromium.org> shill: wifi: Switch pointer/ref spacing

Switch to Chrome style spacing.

BUG=chromium:501026
TEST=Unit tests

Change-Id: Ieff88b00706ed7c57049531a21427d9ea84b0a71
Reviewed-on: https://chromium-review.googlesource.com/278081
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/wifi/wifi_provider_unittest.cc
18213652e2ce4c6e4354951e5b665097b7a7aa6b 22-Apr-2015 Peter Qiu <zqiu@chromium.org> shill: remove dependency for ProfileDBusPropertyExporter

Currently, Profile.GetEntry uses ProfileDBusPropertyExporter to
retrieve entry settings for a service entry that's not registered to the
manager or loaded from a different profile. ProfileDBusPropertyExporter
duplicates logics from Service and its subclasses for loading settings
from the profile.

Instead, create a temporary service for profile to load entry settings
into for such service entry, and then retrieve the service settings
(properties) directly. When creating a temporary service, the profile entry
will be validated for fields required by the corresponding service type.

Also added couple test scripts for testing purpose.

BUG=chromium:208736
TEST=USE="asan clang wimax" FEATURES=test emerge-$BOARD shill
Manual Test:
1. Bootup a DUT (wolf) without logging in, connect to a wifi network
WiFi-A.
2. Logged in with an user account, connect to a different managed wifi
network WiFi-B.
3. Invoke command "/usr/local/lib/flimflam/test/list-profiles", verify
there is an entry in both default profile "/profile/default" and
user profile "/profile/chronos/shill".
3. Use the get-profile-entry command to retrieve entry from both default
and user profile, verify entries are retrieved successfully.
"/usr/local/lib/flimflam/test/get-profile-entry default <entry_name>"
"/usr/local/lib/flimflam/test/get-profile-entry shill <entry_name>"

Change-Id: If6c22fbca0e4e47dd42761b047d57fff14c2e658
Reviewed-on: https://chromium-review.googlesource.com/266751
Tested-by: Zeping Qiu <zqiu@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Zeping Qiu <zqiu@chromium.org>
/system/connectivity/shill/wifi/wifi_provider_unittest.cc
6d61faf84ef5eb2545bc6eee8a4d74109dfdd6d1 06-Feb-2015 Samuel Tan <samueltan@chromium.org> shill: use wake reasons for dark resume logic

Use the wake reasons reported by the kernel to choose what actions shill
performs in dark resume. If the wake reason is not reported or unsupported,
shill defaults to the previous logic (choosing actions based on current
connection status). The exit-path out of dark resume into re-suspend (i.e.
WakeOnWiFi::BeforeSuspendActions) remains unchanged.

Also:
- Added cases where the system suspends in dark resume because no
autoconnectable services were found to previous dark resume unit tests.
- Prefixed WakeOnWiFiTrigger enums with "WakeTrigger" for added clarity.
- Add expectations for Metrics::NotifyDarkResumeInitiateScan in dark resume
unit tests.

BUG=chrome-os-partner:32269, chrome-os-partner:36471
TEST=Compile shill and run unit tests using:

P2_TEST_FILTER="shill::*" FEATURES="test" \
USE="wake_on_wifi clang asan" emerge-samus shill

P2_TEST_FILTER="shill::*" FEATURES="test" \
USE="-wake_on_wifi clang asan" emerge-samus shill

Manual testing as follows:
1) Flash a samus with test image and boot into it.
2) Run
ff_debug +wifi; ff_debug --level -3
3) Run
echo 0 > /var/lib/power_manager/disable_dark_resume; restart \
powerd
4) Run
echo disabled > /sys/bus/i2c/devices/i2c-ATML0000\:01/power/wakeup
5) Enable the wake on WiFi SSID feature with the following command:
dbus-send --system --print-reply --dest=org.chromium.flimflam \
/device/wlan0 org.chromium.flimflam.Device.SetProperty \
string:WakeOnWiFiFeaturesEnabled \
variant:string:packet_and_ssid
6) Set the net detect scan period to 60 seconds with the
following command:
dbus-send --system --print-reply --dest=org.chromium.flimflam \
/device/wlan0 org.chromium.flimflam.Device.SetProperty \
string:NetDetectScanPeriodSeconds variant:uint32:60
7) Connect samus to an AP (make sure AP is one that you can run ping from).
8) Enable waking on packets from the AP with the following command:
dbus-send --system --print-reply --dest=org.chromium.flimflam \
/device/wlan0 org.chromium.flimflam.Device.AddWakeOnPacketConnection \
string:"1.1.1.1"
where 1.1.1.1 is the IP address of the AP.
9) Run 'powerd_dbus_suspend' to suspend the system.
10) Wait 15 seconds, then ping the samus from the AP.
11) Verify that within 5 seconds of sending the ping, the AP gets a pong from
the samus.
12) Wake the samus by pressing any key.
13) Run 'powerd_dbus_suspend' to suspend the system.
14) Wait 10 seconds, then disable the AP.
15) Wait 15 seconds, then re-enable the AP.
16) Wait, 80 seconds, then wake the samus by pressing any key.
17) Immediately upon waking the system, verify that the WiFi status icon is
in the connected state.
18) Run
grep 'BeforeSuspendActions.*connected' /var/log/net.log | tail -1
and verify that the line printed says "BeforeSuspendActions: connected".

Change-Id: I499b702e242b35a0e23cb917e66e5e757f476e6e
Reviewed-on: https://chromium-review.googlesource.com/246365
Reviewed-by: Samuel Tan <samueltan@chromium.org>
Tested-by: Samuel Tan <samueltan@chromium.org>
Commit-Queue: Samuel Tan <samueltan@chromium.org>
/system/connectivity/shill/wifi/wifi_provider_unittest.cc
d70ecdf36c94516b71cca8212caeb71da8c63d02 12-Jan-2015 Samuel Tan <samueltan@chromium.org> shill: configure NIC to wake on SSID

Enable shill to program the NIC to wake the system
from suspend on the appearance of whitelisted SSIDs.

BUG=chrome-os-partner:32269
TEST=Compile shill and run unit tests using:

P2_TEST_FILTER="shill::*" FEATURES="test" \
USE="wake_on_wifi clang asan" emerge-samus shill

P2_TEST_FILTER="shill::*" FEATURES="test" \
USE="-wake_on_wifi clang asan" emerge-samus shill

Manual testing as follows:
1) Flash a samus with test image and boot into it.
2) Run
ff_debug +wifi; ff_debug --level -3
3) Run
echo 0 > /var/lib/power_manager/disable_dark_resume; restart \
powerd
4) Run
echo disabled > /sys/bus/i2c/devices/i2c-ATML0000\:01/power/wakeup
5) Enable the wake on WiFi SSID feature with the following command:
dbus-send --system --print-reply --dest=org.chromium.flimflam \
/device/wlan0 org.chromium.flimflam.Device.SetProperty \
string:WakeOnWiFiFeaturesEnabled \
variant:string:ssid
6) Set the net detect scan period to 60 seconds with the
following command:
dbus-send --system --print-reply --dest=org.chromium.flimflam \
/device/wlan0 org.chromium.flimflam.Device.SetProperty \
string:NetDetectScanPeriodSeconds variant:uint32:60
7) Connect samus to an AP.
8) Disable the AP. Verify that the samus is fully disconnected by the
WiFi icon state (a cross over empty WiFi bars).
9) Run 'powerd_dbus_suspend' to suspend the system.
10) 10 seconds after step 9, re-enable the AP.
11) Wait 120 seconds (start counting right after performing step 9).
12) Wake the samus by pressing any key.
13) Verify that the samus is connected to WiFi immediately after waking
by ensuring that it wakes up with the WiFi icon in the connected
state.

Change-Id: Ibfe5fa810770c0faa292c1f9fe423e3ee61668cf
Reviewed-on: https://chromium-review.googlesource.com/240579
Reviewed-by: Samuel Tan <samueltan@chromium.org>
Tested-by: Samuel Tan <samueltan@chromium.org>
Commit-Queue: Samuel Tan <samueltan@chromium.org>
/system/connectivity/shill/wifi/wifi_provider_unittest.cc
402bf2959e8b2c68627a7b66203ec84760bf2e03 23-Dec-2014 Samuel Tan <samueltan@chromium.org> shill: report done early in dark resume after scan

Report done early in dark resume after scanning for networks if
we do not find any networks that are available for auto-connect.

Also:
- rename the |have_service_configured_for_autoconnect| to
|has_service_configured_for_autoconnect| to match the
naming of the corresponding function in WiFiProvider.

BUG=chromium:444652
TEST=Compile shill and run unit tests using the following commands:

P2_TEST_FILTER="shill::*" FEATURES="test" USE="wake_on_wifi \
clang asan" emerge-samus shill

P2_TEST_FILTER="shill::*" FEATURES="test" USE="-wake_on_wifi \
clang asan" emerge-samus shill

Manual testing as follows:
1) Boot into a samus test image.
2) Run 'ff_debug +wifi; ff_debug --level -3'
3) Run 'echo 0 > /var/lib/power_manager/disable_dark_resume; restart \
powerd'
4) Enable all wake on WiFi features with the following command:
dbus-send --system --print-reply --dest=org.chromium.flimflam \
/device/wlan0 org.chromium.flimflam.Device.SetProperty \
string:WakeOnWiFiFeaturesEnabled \
variant:string:"packet_and_ssid"
5) Set the wake-to-scan frequency to 60 seconds with the
following command:
dbus-send --system --print-reply --dest=org.chromium.flimflam \
/device/wlan0 org.chromium.flimflam.Device.SetProperty \
string:WakeToScanFrequency variant:uint32:60
6) To work around a trackpad wakeup bug, disable trackpad wakeup using
the following command:
echo disabled > /sys/bus/i2c/devices/i2c-ATML0000\:01/power/wakeup
7) Connect samus to an AP.
8) Disable the AP. Verify that the samus is fully disconnected by the WiFi
icon state (a cross over empty WiFi bars).
9) Run 'powerd_dbus_suspend' to suspend the system.
10) Wait ~60 seconds and verify that the samus wakes on dark resume
by observing that light bar turns on while the screen is off.
11) Verify that the samus exits dark resume and suspends again after ~5 seconds
by observing that the lightbar turns off ~5 seconds after turning on.
12) Repeat steps 10-11 one more time.
13) Re-enable the AP immediately after the last dark resume cycle finishes
(i.e. right after light bar turns off).
14) Wait ~60 seconds for the next dark resume cycle to begin.
15) Verify that this dark resume cycle lasts for at least 2-3 more seconds than
the previous dark resume cycles observed in steps 10-12.
16) Wake the samus by pressing any key.
17) Verify that the samus is connected by verifying that the WiFi icon in the
bottom right corner is solid and filled (i.e. not crossed out or animating).

Note: these instructions assume that the AP can be fully re-enabled in
60 seconds, and that the DUT can scan and connect to this AP within 8.5 seconds.
The D-Link DGL-5500 is an example of such an AP that is appropriate for
this test.

Change-Id: I8a3c00e49dacf9e8580e24f9a0d84efb9e28b99c
Reviewed-on: https://chromium-review.googlesource.com/237494
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Samuel Tan <samueltan@chromium.org>
Commit-Queue: Samuel Tan <samueltan@chromium.org>
/system/connectivity/shill/wifi/wifi_provider_unittest.cc
7116093da00d83a9b2a2200e5501fe138cbdd11e 12-Dec-2014 mukesh agrawal <quiche@chromium.org> shill: allow configuring wifi services with kSecurityClassProperty

We want Chrome to use kSecurityClassProperty, instead of
kSecurityProperty. To do so cleanly, Chrome needs to be able to
configure WiFi networks using the kSecurityClassProperty. So update
shill to support that.

While there: fix a buglet in WiFiService::SetPassphrase. (It was
logging the pointer to the error, rather than the error's message.)

BUG=chromium:441904
TEST=unit tests

Change-Id: I26957dbb7610381372044e3178a37b7b074764af
Reviewed-on: https://chromium-review.googlesource.com/235451
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/wifi/wifi_provider_unittest.cc
0951ccbfca977a9cf218b2e4308aa26fb4d06ef9 10-Dec-2014 Alex Vakulenko <avakulenko@chromium.org> Update libchrome to r307740 and fix build errors

Updated libchrome, libchrome_crypto, metrics, feedback to the
latest revisions from Chrome (r307740).

Fixed build breaks due to the changes in upstream code:

- scope_ptr no longer needs explicit PassAs<T>() calls.
- scope_ptr<T> no longer has implicit conversion to T*.
Must use scope_ptr<T>::get() instead.
- base/file_util.h moved to base/files/file_util.h
- ARRAYSIZE_UNSAFE() removed in favor of arraysize()
- base::AppendToFile() and base::WriteFileDescriptor() now
return bool instead of the number of bytes written.
- dbus::Bus::AddFilterFunction() now returns void.
- C++11 features are enabled in libchromeos, so all targets
linking with it now have to support C++11
- OVERRIDE macro is removed in favor of native C++11
'override' keyword.

BUG=chromium:416628, chromium:411508
TEST=Build the world on x86, x64, ARM. The following builders
were tried:
x86-generic-full amd64-generic-full arm-generic-full
amd64-generic-asan daisy-full nyan-full pre-cq-group
daisy-release-group sandybridge-release-group
pineview-release-group
CQ-DEPEND=CL:234450,CL:234980

Change-Id: I374bebe2211d533c4431c82efb8be1cdcb1f405d
Reviewed-on: https://chromium-review.googlesource.com/234440
Reviewed-by: Bertrand Simonnet <bsimonnet@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
/system/connectivity/shill/wifi/wifi_provider_unittest.cc
da69ecfa906572120eb4f6c405e7d4be38dc9701 19-Nov-2014 Ben Chan <benchan@chromium.org> shill: supplicant: Move supplicant code to its own sub-directory.

This CL is part of a series of CLs, which aim to reorganzie shill's flat
source code structure into a more modular form by moving technology
specific code into their own sub-directories.

BUG=chromium:433419
TEST=`FEATURES=test emerge-$BOARD shill`
TEST=`USE='clang asan' FEATURES=test emerge-$BOARD shill`

Change-Id: I119663a90062f7faf3038a2455d53d4ae8c5e297
Reviewed-on: https://chromium-review.googlesource.com/230750
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/wifi/wifi_provider_unittest.cc
d6a8b519e3057f52313e502f502a4819a942e089 18-Nov-2014 Ben Chan <benchan@chromium.org> shill: wifi: Move wifi code to its own sub-directory.

This CL is part of a series of CLs, which aim to reorganzie shill's flat
source code structure into a more modular form by moving technology
specific code into their own sub-directories.

BUG=chromium:433419
TEST=`FEATURES=test emerge-$BOARD shill`
TEST=`USE='clang asan' FEATURES=test emerge-$BOARD shill`

Change-Id: Ic6bf64e7fe263fd0b2277877d78cf776f179e7d7
Reviewed-on: https://chromium-review.googlesource.com/230460
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/wifi/wifi_provider_unittest.cc