History log of /system/connectivity/shill/link_monitor_unittest.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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/link_monitor_unittest.cc
3b30ca58d13cf66b75ba0729b222ddc42ae68b33 16-Jun-2015 Paul Stewart <pstew@chromium.org> shill: Top-level unit tests: Switch pointer/ref spacing

Switch to Chrome style spacing.

BUG=chromium:501026
TEST=Unit tests

Change-Id: I86c072b89281e0de18928b47860b99d779af061a
Reviewed-on: https://chromium-review.googlesource.com/278037
Reviewed-by: Rebecca Silberstein <silberst@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/link_monitor_unittest.cc
ffa56374b5cfca653f458d072630bb02dbc7bcd7 22-Jan-2015 Peter Qiu <zqiu@chromium.org> shill: reduce ARP traffic from LinkMonitor

This is achieved by monitoring the link passively (monitor on ARP requests)
after the link is determined as up via active link monitor (sending
ARP requests and probing for ARP replies). Only switch to active link
monitor when the passive link monitor completes after a preset number
of successful cycles or after a single failed cycle.

ARP traffic will be reduced since the device will not be generating
any ARP requests during passive link monitoring period. This will potentially
delay the detection of link failure up to one passive monitoring cycle
(25 seconds) when the link goes down during passive monitoring.

BUG=chromium:422159
TEST=USE="asan clang" FEATURES=test emerge-$BOARD shill
Connect DUT to a wireless network, and verify link monitor mode switching
via debug logs

Change-Id: I4c72a048da18cee7dc5be2cf2b51082cb9ae6716
Reviewed-on: https://chromium-review.googlesource.com/242684
Tested-by: Zeping Qiu <zqiu@chromium.org>
Reviewed-by: Zeping Qiu <zqiu@chromium.org>
Commit-Queue: Zeping Qiu <zqiu@chromium.org>
/system/connectivity/shill/link_monitor_unittest.cc
c9c31d8497c3f053c2160408cc386010fc125fad 22-Oct-2014 Rebecca Silberstein <silberst@chromium.org> shill: add object id to scoped log messages

Add object identifier (DBus::Path) string to scoped logging messages. If
the logging message is called from a static method, SLOG will be called
with nullptr and the log will use (anon) for the object id. Objects
without identifying information will use the (class_name) as their logged
identifier.

BUG=chromium:403996
TEST=ran unit tests and manually inspected net.log

Change-Id: Idf23911a303f5edc4b82917bf1e2cea3f8e44e60
Reviewed-on: https://chromium-review.googlesource.com/224812
Tested-by: Rebecca Silberstein <silberst@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Rebecca Silberstein <silberst@chromium.org>
/system/connectivity/shill/link_monitor_unittest.cc
8d6b59704591ba9fad57751858835dc332dbdd37 28-Oct-2014 Peter Qiu <zqiu@chromium.org> shill: export a shared library for RTNL interface.

Export a shared library "libshill-net-<(libbase-ver)" from shill, which
currently includes the RTNL interface and other codes that it depends on
(mainly ByteString, IPAddress, IOHandler, TimeStamp, and Sockets). All the
library codes are moved to under "shill/net/".

Upcoming changes:
- Remove dependency for "shill/error.h" which depends on dbus-c++.
- Add Netlink interface to the shared library.

BUG=chromium:427982
TEST=unittests
CQ-DEPEND=CL:226103

Change-Id: I7f5c183b8a347c02e80ffed5e3497f691dde517c
Reviewed-on: https://chromium-review.googlesource.com/226110
Reviewed-by: Peter Qiu <zqiu@chromium.org>
Tested-by: Peter Qiu <zqiu@chromium.org>
Commit-Queue: Peter Qiu <zqiu@chromium.org>
/system/connectivity/shill/link_monitor_unittest.cc
417e5f079a1ccbc068c67f9cbf34f13c40330abc 09-Oct-2014 Paul Stewart <pstew@chromium.org> shill: ArpClient: Support Request Reception

Refactor the code (specifically the part that sets up BPF filters)
to be able to receive and parse ARP requests. In doing so, we
will now be able to start an ARP client to monitor the amount of
ambient broadcast ARP traffic on the network. We can use this to
back down the rate of LinkMonitor requests to reduce loads on
networks with large numbers of Chromebooks.

BUG=chromium:422159
TEST=Unit tests + manual: ff_debug +link; ff_debug --level -4
Make sure ARP responses continue to be received correctly

Change-Id: I4c29919a09537b8be39f414647dd3a4fccc3800b
Reviewed-on: https://chromium-review.googlesource.com/222704
Reviewed-by: Peter Qiu <zqiu@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/link_monitor_unittest.cc
cc225ef3b77b5e098cc12c661a947e1737480777 30-Sep-2014 Ben Chan <benchan@chromium.org> shill: Replace NULL with nullptr.

BUG=None
TEST=`USE=wimax FEATURES=test emerge-$BOARD shill`

Change-Id: I30ab47ff32dcadad09ae7a2baf4d4123a6ef0d8e
Reviewed-on: https://chromium-review.googlesource.com/220657
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/link_monitor_unittest.cc
7fab89734d88724a288e96a9996b15548c5294c7 11-Aug-2014 Ben Chan <benchan@chromium.org> shill: Use integer types from stdint.h

This CL replaces the deprecated int* and uint* types from
'base/basictypes.h' with the int*_t and uint*_t types from 'stdint.h'.

BUG=chromium:401356
TEST=`USE='cellular gdmwimax wimax' FEATURES=test emerge-$BOARD platform2`

Change-Id: I3d4c195881203dd2a47dbb5af150b6c90b9c206e
Reviewed-on: https://chromium-review.googlesource.com/211770
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/link_monitor_unittest.cc
a41ab517725d036b63420f8445550246f8f50b99 23-Jul-2014 Alex Vakulenko <avakulenko@chromium.org> shill: Sort headers alphabetically (build/include_alpha)

We are going to enable build/include_alpha linter warning soon,
so in preparation for this, fixed the warnings in shill.

BUG=None
TEST=cpplint.py --filter=-build/include_order,+build/include_alpha shill/*

Change-Id: I113ed7f9dd3f465a3f660599320cdb434e7cc214
Reviewed-on: https://chromium-review.googlesource.com/209636
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
/system/connectivity/shill/link_monitor_unittest.cc
8a5322984f2d81bcbfd8d44c59747a11bd9b904b 17-Jun-2014 Alex Vakulenko <avakulenko@chromium.org> shill: Fix most of warnings from cpplint

Fix most cpplinter's warnings. On a few occasisions, the warnings
produced were false-positives, so added explicit // NOLINT comment
overrides.

There were a few instances of disallowed non-const reference usage
(reported as runtime/reference error by cpplint) for
"DBus::Error &error" which should potentially be changed
to pointers to comply with C++ coding style but I will let Shill
owners do that since there is quite a few of those and the
change isn't brain-dead simple...

BUG=None
TEST=platform2 still compiles and all unit tests pass.

Change-Id: Ic2e31896aa13d20eeb1a85dee74f3db8cccfde2e
Reviewed-on: https://chromium-review.googlesource.com/204164
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
/system/connectivity/shill/link_monitor_unittest.cc
b5d124f4e789e7dd6afef6cc798b517650da5aff 14-Apr-2014 Peter Qiu <zqiu@chromium.org> Added GatewayChange callback to LinkMonitor.

Added a callback handler to LinkMonitor to be notified when
gateway's MAC address is found or changed.

BUG=chromium:359302
TEST=unittest

Change-Id: Iba7857a189b6121a5aac8244dc4c061cc02b8e60
Reviewed-on: https://chromium-review.googlesource.com/194803
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Peter Qiu <zqiu@chromium.org>
Tested-by: Peter Qiu <zqiu@chromium.org>
/system/connectivity/shill/link_monitor_unittest.cc
6937b6aa246cd82d06994ca885c69ddf92ac29bb 03-Dec-2013 Yunlian Jiang <yunlian@google.com> shill: remove unused const variables

BUG=chromium:324986
TEST=emerge-x86-generic platform2
the warnings are disappeared.

Change-Id: Ib6b7fb69a87f8315e3fac0eef726dc9d67e8bad7
Reviewed-on: https://chromium-review.googlesource.com/178544
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Yunlian Jiang <yunlian@chromium.org>
Tested-by: Yunlian Jiang <yunlian@chromium.org>
/system/connectivity/shill/link_monitor_unittest.cc
b434ce5653edd701b5a6f3b40d4ad0111f0549a7 23-Sep-2013 Paul Stewart <pstew@chromium.org> shill: LinkMonitor: Test reliability of unicast responses

Some gateways do not support replying to unicast ARP. As such,
it is on tenuous grounds that we use the unicast test to trigger
a link monitor failure. This change delays counting of unicast
failures until it is clear that unicast replies are the norm
with the currently connected gateway.

BUG=chromium:237290,chromium:295844
TEST=Unit tests

Change-Id: I3f60c09069a31ad93aa4c71fe8d5b3e0224bda34
Reviewed-on: https://chromium-review.googlesource.com/170473
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/link_monitor_unittest.cc
bb2231c2d6e39267a3f9e55e74efd9a1ea8e4c98 18-Jul-2013 mukesh agrawal <quiche@chromium.org> shill: accelerate link monitoring after a suspend/resume event

When going into suspend, devices using the ath9k chipset do not disassociate
from the AP. Consequently, on networks like GoogleGuest, we are often able
to re-use the prior-to-suspend association following resume.

For some APs, however, this leads to the AP ending up in a confused state.
In particular, the Airport Extreme 802.11ac (A1521) sends DEAUTH frames
while we're sleeping, but it acknowledges our Nullfunc frames when we resume.
In fact, the AP even answers our ADDBA request with a Successful ADDBA respone.
When in this state, however, the AP does not deliver our frames to the IP
stack. E.g. ARPs fail.

Improve our post-suspend-resume behavior on these APs by running LinkMonitor
immediately on resume, and with a lower timeout. We use a per-probe timeout
of 200ms, which is at the 98.48%-ile of ARP response time observed in the
field last week. The total timeout is 1 second, and I believe we accept
late replies, so if the first ARP probe is replied too slowly, we'll still
accept it. A one-second ARP reply is at the 99.24%-ile.

Note that after LinkMonitor fails, it still takes ~10 seconds to establish
connectivity to this AP. That's because the Reassociate attempt times out.

While there:
- clarify a log message in Device::StopPortalDetection
- fix bad indent in LinkMonitor::StartInternal
- add some diagnostic infomation in cases where the IsArpRequest
matcher fails to match expected values

BUG=chromium:244920
TEST=unit tests, manual (see below)

Manual testing
--------------
1. grab a device which has an atheros wifi chip (e.g. lumpy, link)
2. connect to "cros airport extreme wpa2", with password "chromeos"
3. suspend device (e.g. close lid)
4. wait >5 minutes.
5. resume device (e.g. open lid)
6. verify that the device detects a link failure in < 5 seconds
"Link monitor has reached the failure threshold" should occur
less than 5 seconds after "OnAfterResume" in /var/log/net.log
7. wait 15-20 seconds
8. verify that the device reconnects to the AP
9. wait 45 seconds
10. verify that the device does not detect another link failure
11. switch to GoogleGuest.
12. suspend device
13. wait >5 minutes
14. resume device
15. check that device does not detect a link failure

Change-Id: I900ba45714875f5785bba3d47c73f37b863553fb
Reviewed-on: https://gerrit.chromium.org/gerrit/63126
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/link_monitor_unittest.cc
fddc09ac26ba77cabb59810f01b705fca2efd10b 04-Jul-2013 Alex Deymo <deymo@chromium.org> Export the Physical Technology of a VPN service.

Exposes the Type of the lowest service used for a VPN service
through the "PhysicalTechnology" property of a VPN service.

TEST=cros_workon_make shill --test and tested manually.
BUG=chromium:213086

Manual Test procedure.
1. Connect to a wifi network.
2. Connect to a VPN service on that wifi network.
3. Run /usr/local/lib/flimflam/test/list-services on a terminal
and verify the first service on its output contains a service with
a Type "vpn" and a PhysicalTechnology "wifi":

[ /service/6 ]
...
Type = vpn
...
PhysicalTechnology = wifi

Change-Id: Ic843429de3f4d5a4208e271bb779c3e3160f036b
Reviewed-on: https://gerrit.chromium.org/gerrit/61510
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Alex Deymo <deymo@chromium.org>
Reviewed-by: Alex Deymo <deymo@chromium.org>
Tested-by: Alex Deymo <deymo@chromium.org>
/system/connectivity/shill/link_monitor_unittest.cc
6c1e3bbca64d642cb30ed9952203626942bc1451 07-Feb-2013 Thieu Le <thieule@chromium.org> shill: cellular: Add Network.Shill.Cellular.DropsPerHour.

BUG=chromium-os:38557
TEST=Unit tests, manually lose LTE signal and check chrome://histograms

Change-Id: I82aa1edabd21c5dfde4834cd36a34a12b629ba8f
Reviewed-on: https://gerrit.chromium.org/gerrit/42813
Reviewed-by: Arman Uguray <armansito@chromium.org>
Commit-Queue: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
/system/connectivity/shill/link_monitor_unittest.cc
f1961f836f8f6fc8afaa5b97872b45d31cd081f6 12-Sep-2012 Paul Stewart <pstew@chromium.org> shill: LinkMonitor: Apply readability-review comments

Modify LinkMonitor and those affected by it to add
changes suggested during readability review.

BUG=chromium-os:32600
TEST=Unit tests

Change-Id: Ie48ac6d6ea1727207042fe5bf1519875b0673501
Reviewed-on: https://gerrit.chromium.org/gerrit/33047
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/link_monitor_unittest.cc
fc34925d45add6f1c81a42a7632621e69bfdc43e 30-Aug-2012 Han Shen <shenhan@google.com> Fix shill unittest build problem for gcc 4.7.

gcc 4.7 is more strict about type conversion in initilization list,
for example -

const char apple[] = {0xff, 0xfe};

The above compiles ok prior to gcc 4.7, but fails on gcc 4.7 with
-Wall -Werror. The reason is that 0xff is out of bound for (signed)
char type.

TEST=Built/tested using gcc 4.7
BUG=None

Change-Id: I597cac783954b856726494b757d69ddbc6c4436b
Reviewed-on: https://gerrit.chromium.org/gerrit/31908
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Han Shen <shenhan@chromium.org>
Tested-by: Han Shen <shenhan@chromium.org>
/system/connectivity/shill/link_monitor_unittest.cc
9f7823e84e876329befadbf0551353d5845ccafa 09-Aug-2012 Paul Stewart <pstew@chromium.org> shill: LinkMonitor: Fixup local/remote order

ARP responses will have the "local" fields of the ARP
header populated with the "remote" addresses, from the
perspective of the recipient. Fix this misunderstanding.

BUG=chromium-os:32600
TEST=Manual -- ran on real system (after following CLs)

Change-Id: I0e34fdada9b0f1b149d0569cf1d942ca67466ea5
Reviewed-on: https://gerrit.chromium.org/gerrit/29793
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/link_monitor_unittest.cc
0443aa578aea08a313e9879a6dce4cacec32952c 09-Aug-2012 Paul Stewart <pstew@chromium.org> shill: LinkMonitor: Add more metrics

LinkMonitorSecondsToFailure, LinkMonitorUnicastErrorsAtFailure,
and LinkMonitorBroadcastErrorsAtFailure.

BUG=chromium-os:32600
TEST=Unit tests.

Change-Id: I0a90deee5675ebfb665a76f8e7707eaaecc23ce9
Reviewed-on: https://gerrit.chromium.org/gerrit/29792
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/link_monitor_unittest.cc
b691efd71561246065eae3cdd73a96ca1b8a528d 09-Aug-2012 Christopher Wiley <wiley@chromium.org> shill: Rename SMLOG to SLOG

Rewrite SMLOG as SLOG, thus saving many edits. Change the location of
the SLOG macro to be memory_log.h, requiring includes to be rewritten
and reordered. While we're rewriting includes, moving all assorted
logging includes into a generic shill/logging.h, thus saving future
logging changes from altering these includes ever again.

BUG=chromium-os:31145
TEST=Builds, unit tests still pass

Change-Id: Ie5129fcbdda87f3149460209a682c698b876b09a
Reviewed-on: https://gerrit.chromium.org/gerrit/29650
Commit-Ready: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Tested-by: Christopher Wiley <wiley@chromium.org>
/system/connectivity/shill/link_monitor_unittest.cc
ff845fc996d6742c9ce2d0cd1939745e7034411f 07-Aug-2012 Paul Stewart <pstew@chromium.org> shill: LinkMonitor: Add Metrics

BUG=chromium-os:32600
TEST=Unit tests

Change-Id: I4a7625fb006e939a5ea63efeede8ca9982115332
Reviewed-on: https://gerrit.chromium.org/gerrit/29421
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/link_monitor_unittest.cc
6c72c972614285b2c01fb38afb2ffe06484a544a 27-Jul-2012 Paul Stewart <pstew@chromium.org> shill: LinkMonitor: Schedule periodic ARP requests

The LinkMonitor performs periodic unicast and broadcast ARP requests
for a connection's gateway IP address. It creates a weighted
average of response time, and can call a failure callback function
whenever the sum of consecutive unicast and broadcast response
failures exceed a threshold.

BUG=chromium-os:32600
TEST=Unit tests

Change-Id: Id5a66ad9ca80c51f227ef4811eb8c3885a70c1b8
Reviewed-on: https://gerrit.chromium.org/gerrit/28610
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/link_monitor_unittest.cc
3f43f432700a31526a57c413a1872284d766ac2f 16-Jul-2012 Paul Stewart <pstew@chromium.org> shill: LinkMonitor: Skeleton of the class

BUG=chromium-os:32600
TEST=Compile; unit test compile

Change-Id: I134ad8fb75d4cb66b3767a7cf93e59d206bba332
Reviewed-on: https://gerrit.chromium.org/gerrit/27899
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/link_monitor_unittest.cc