History log of /system/connectivity/shill/mock_profile.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
e48186532acb04b9e11efc9b9334dd555ffcae29 29-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: use 'json' extension for JsonStore profiles

To avoid any confusion between files using different formats,
we want KeyFileStore profiles and JsonStore profiles to have
different names. So add '.json' to the file name when using
JsonStore as the backend.

Note: initially, I wanted to isolate the ENABLE_JSON_STORE
dependent code to just StoreFactory. But I've come to change
my mind on that.

The reason for my change of mind is that {Default}ProfileTest
checks the actual path that will be used when writing the file.
And that seems like an appropriate thing to test. But, to do
that, {Default}ProfileTest needs to know when backend we're
using.

So we need ENABLE_JSON_STORE checks in {Default}ProfileTest.
And once we've done that, it seems silly, and unnatural, to
hide this information from Profile.

Along the way:
- Move path computation from InitStorage() and RemoveStorage(),
into the {Default}Profile constructor. This makes the code
slightly simpler (removing a virtual method) and shorter.
- Provide a method for tests to query the path that Profile
would use, so that we don't duplicate path computation logic.
- Remove |storage_path_| field, since it was only needed to
compute the path of the persistent file.

While there:
- Rename |store_path| argument to DefaultProfile ctor. It's
unclear whether such a "path" should refer to a directory
or a file.
- Rename |user_storage_directory| argument to Profile ctor.
This name makes no sense when the Profile ctor is being
called from the DefaultProfile ctor.

Bug: 23561491
TEST="USE=json_store FEATURES=test emerge-samus shill"

Change-Id: I9b7e9b04dc80c89c20ea43158ed293b8a50fadbf
/system/connectivity/shill/mock_profile.h
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/mock_profile.h
1e006c610db980bca337121134d2ba54497b7a59 16-Jun-2015 Paul Stewart <pstew@chromium.org> shill: Top-level mocks: Switch pointer/ref spacing

Switch to Chrome style spacing.

BUG=chromium:501026
TEST=Unit tests

Change-Id: I730ed5115e62319c2745dd6cef642e228b0fb66e
Reviewed-on: https://chromium-review.googlesource.com/278036
Reviewed-by: Rebecca Silberstein <silberst@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/mock_profile.h
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/mock_profile.h
9842441bbfae81053a6c08045f1d7b831e5101b2 01-Oct-2014 mukesh agrawal <quiche@chromium.org> shill: improve handling of profiles in WiFiProvider

Sometimes, WiFiProvider uses a default profile. Other times, WiFiProvider
uses a user profile. This is all well and good, but it's hard to follow
which case is which.

Resolve this problem, by giving WiFiProvider explict default_profile_ and
user_profile_ fields. Most existing tests were updated to explicitly use
the default_profile_.

While there:
- Clean up how default profiles are identified. (Do this via
a method in Profile, rather than a method in Manager.)
- Fix a whitespace issue in wifi_provider.cc.
- Remove some unused local variables in wifi_provider_unittest.cc.

BUG=chromium:419152
TEST=unit tests (on peppy)

Change-Id: Id1d04ad8f112ff4ee6e8d31b10413dbc1dc94350
Reviewed-on: https://chromium-review.googlesource.com/220670
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/mock_profile.h
5ea763b83299b5fad76a87183fb39a74c2d3c61d 13-Aug-2014 Ben Chan <benchan@chromium.org> shill: Add C++11 override specifier to destructors of derived classes.

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

Change-Id: I88d4e29165869b26924cccb94ac940dc8961c312
Reviewed-on: https://chromium-review.googlesource.com/212267
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/mock_profile.h
60a3706bee5686ae2322a774b9e7d5e8e63fcaf7 02-Apr-2013 Wade Guthrie <wdg@chromium.org> shill: Keeps track of successful wifi connection frequencies.

Saves the connection frequencies (and counts therefor) in the default
profile. Sends number of frequencies on which successful connections
have been made to an UMA stat.

BUG=chromium:222081
TEST=unittests and manual (look for UMA stat
'Network.Shill.Wifi.FrequenciesConnectedEver', disconnect from
wifi, reconnect, verify that the UMA stat went up by 1).

Change-Id: I1e3c75b82ac387dd01066c4da4ebfce2c4b2ddc0
Reviewed-on: https://gerrit.chromium.org/gerrit/47154
Commit-Queue: Wade Guthrie <wdg@chromium.org>
Reviewed-by: Wade Guthrie <wdg@chromium.org>
Tested-by: Wade Guthrie <wdg@chromium.org>
/system/connectivity/shill/mock_profile.h
9c6e9818cd1337ee06a218db83ee577ac977c7d9 26-Mar-2013 Darin Petkov <petkov@chromium.org> shill: vpn: Support Service.Name property change.

BUG=chromium:221577
TEST=Unit tests; Tested on device through configure-vpn; Also, tested
on device through corp policy and checked that the service got
renamed.

Change-Id: I936f85573e8d0820e2baa2361f94619e0e655f8f
Reviewed-on: https://gerrit.chromium.org/gerrit/46514
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/mock_profile.h
5133b71eaa00535739ebbddd8a8f31cd8fcf33a8 19-Feb-2013 Thieu Le <thieule@chromium.org> shill: Add metric to track corrupted profiles

New metric Network.Shill.CorruptedProfile.

BUG=chromium-os:38669
TEST=1. Unit tests
2. Stop shill
Corrupt /var/cache/shill/default.profile by adding junk
Start shill
Verify new metric appears in chrome://histograms

Change-Id: I629ed00884ecd2d2fe90744583bd72bf2e9e6af4
Reviewed-on: https://gerrit.chromium.org/gerrit/43556
Reviewed-by: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
Commit-Queue: Thieu Le <thieule@chromium.org>
/system/connectivity/shill/mock_profile.h
5ad1606ad8b3f74b2b7960a3003a2d1ca75d52b8 22-Feb-2013 Paul Stewart <pstew@chromium.org> shill: Compile against libchrome-180609

Made the following fixes to allow compile against a new libchrome:

- ScopedVector::reset() was renamed to "clear".
- Hack in base to add "using base::FilePath;" has been removed.
- Convert MessageLoop::current()->RunAllPending() to
base::RunLoop().RunUntilIdle().
- MessageLoopProxy::PostDelayedTask() now takes a base::TimeDelta().
- scoped_refptr::release() no longer exists.
- base/eintr_wrapper.h -> base/posix/eintr_wrapper.h
- base/scoped_temp_dir.h -> base/files/scoped_temp_dir.h
- base/string_tokenizer.h -> base/strings/string_tokenizer.h
- New scoped_ptr does compile check for naughty people making scoped_ptrs
of refcounted objects.
- base::SplitString() now returns an empty vector when given an empty
string (instead of a single-element vector with an empty string).

CQ-DEPEND=CL:43774
BUG=chromium-os:38931
TEST=Unit tests, run on real hardware

Change-Id: I6f1f5807e81fb2d52f197871d32ccbccc3038a7c
Reviewed-on: https://gerrit.chromium.org/gerrit/43775
Commit-Queue: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/mock_profile.h
2c575d24aae064efe7c52566a8c07da72e6d2a7b 07-Dec-2012 Paul Stewart <pstew@chromium.org> shill: Manager: Merge stored configuration in ConfigureService

In ConfigureService, if there is already stored information available
for a service, merge this stored information into newly created services
instead of overriding them with the defaults. This situation can arise
when configuration is loaded via policy for a service that is not
currently visible. User-specified parameters such as AutoConnect can be
lost in this process otherwise.

BUG=chromium-os:37042
TEST=Modified unit tests + manual: login to ONC-managed account
with WiFi disabled, and ensure configuration is merged (credentials are
available in the service although ONC did not provide them).

Change-Id: I92cbb7d14dc21c4173794ef1eb19b792d97c44ac
Reviewed-on: https://gerrit.chromium.org/gerrit/39398
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/mock_profile.h
e7c6ad35cafed32a0fd1390487c74e66eae1961d 29-Jun-2012 Darin Petkov <petkov@chromium.org> shill: Add Profile and Manager UpdateDevice support.

UpdateDevice persists Devices into profiles. It's similar to UpdateService,
however, only the topmost DefaultProfile handles UpdateDevice. Use UpdateDevice
to persist Device's Enabled and Cellular's AllowRoaming properties. Remove now
unused Manager::SaveActiveProfile method to avoid confusion.

BUG=chrome-os-partner:10178,chromium-os:32230
TEST=unit tests

Change-Id: I1d293fa84e0bce3156943e8e9d313fc98facbde1
Reviewed-on: https://gerrit.chromium.org/gerrit/26405
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/mock_profile.h
6681533daa896254189d1061ede8aab242a82ab9 10-Apr-2012 Paul Stewart <pstew@chromium.org> shill: vpn: Configure VPN services from newly-pushed profiles

When a new profile is pushed, look for VPN entries and configure
services for them.

BUG=chromium-os:28157
TEST=New unit test

Change-Id: I571c791710e172f1385842867342ee96d8eb4eb0
Reviewed-on: https://gerrit.chromium.org/gerrit/19871
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/mock_profile.h
7f61e52dced33bd4cd5af1c7989ee6e59bf8f892 22-Mar-2012 Paul Stewart <pstew@chromium.org> shill: Implement Manager::ConfigureService

As part of this change, add the "Profile" property to the list
of ignored properties for Service::Configure(), since we deal with
it separately in Manager::ConfigureService(). Also, fully deprecate
ConfigureWifiService; since Chrome doesn't use this function, there's
no purpose in supporting it.

BUG=chromium-os:22800
TEST=New unit tests.

Change-Id: Ie58e47d175784688b09e5d85f863ab97a8c8bb44
Reviewed-on: https://gerrit.chromium.org/gerrit/18897
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/mock_profile.h
1b1a7f222bc8a2b6c9f15fd7a41aad7977ff275e 07-Jan-2012 Paul Stewart <pstew@chromium.org> shill: Implement get/set of Profile property for Service

Create getter and setter. To set the "Profile" property on a
service we have to ask the manager to take care of finding the
profile by name, and then moving the service to the new profile.

BUG=chromium-os:22803
TEST=New unit test, manual (via list-services on a live system)

Change-Id: Idfb3f9f68764b926ddf06c0cc0285292aa85864d
Reviewed-on: https://gerrit.chromium.org/gerrit/13847
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/mock_profile.h
3d9bcf58bd29080b96db4a2c9e7bfe6ed3d6e6df 13-Dec-2011 Paul Stewart <pstew@chromium.org> shill: Enable auto-connect for WiFi services

This performs a few of the last tidbits to get auto-connect
working for WiFi networks. The tweaks include:

* Adding calls to SortServices() in Push/PopProfile
* On successful connection, move service to the profile on
the top of the stack if this service was previously in the
ephemeral profile.
* Add a method to Services to return whether they are eligible
for auto-connect. Implement this for the WiFi services by
using a new method to test if the WiFi device is busy.

BUG=chromium-os:24261,chromium-os:17255
TEST=Unit Tests (for regression)
Manual: Connect to WPA-PSK network successfully; restart shill and
observe an auto-connect after scan.

Change-Id: Ia4e1fd94795a4ce64d66ec6db940ee16ff694431
Reviewed-on: https://gerrit.chromium.org/gerrit/12963
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/mock_profile.h
a41e38d57e4fa37bd2c8de6447890b4e1951acb7 11-Nov-2011 Paul Stewart <pstew@chromium.org> shill: wifi: Load hidden services from storage

When a device or profile comes into existence, the device
will search the profile for hidden services and instantiate
services if they do not exist. These services will not
be visible in the RPC service list until they either appear
in scan or are actively being connected.

Side effects:
* Manager now loads the devices with profile data.
* Manager now respects the "powered" attribute loaded by
devices from the profile to determine whether or not
to call Start() on them.
* Key files can be searched for groups with a certain
key. This will be useful when we start supporting GUIDs.
* On service registration go backward (from top of stack
downward) through the list of profiles searching for
configuration instead of forwards.
* Move the update of the "Services" property of the manager
to a more centralized spot in SortServices. This way,
when the service order changes (or anything else that
affects the service list) this RPC property will update.
* Hidden services are not scanned for if they are in the
ephemeral profile -- it means that whatever profile was
supporting them does not exist anymore.
* WiFi services have the unenviable task of also decoding
storage identifiers in order to glean the address, mode
and security parameters.

BUG=chromium-os:22073,chromium-os:22074
TEST=New unit tests, Manual on real hardware.
Note: I could not connect to a hidden network, but this
is because we're not setting the ApScan parameter on
wpa_supplicant so on connect it is just doing broadcast
scans. However if I seed the profile with with a record
containing a hidden SSID, shill will force a scan for
the hidden network, which will allow it to connect.

Change-Id: I97a5b5f6db7c6e6d2aabf212c5c2984ce7f4daaa
Reviewed-on: https://gerrit.chromium.org/gerrit/11558
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/mock_profile.h
b9c00597eb1f6d2560f7e88cb0d1f627228840d4 06-Oct-2011 Chris Masone <cmasone@chromium.org> [shill] Profiles need to own their own storage

We're moving to a model where we rely on the StoreInterface
implementation to maintain profile state, instead of managing
a list of Service objects manually. Thus, we need to allow
Profile to own its own StoreInterface.

BUG=chromium-os:17253
TEST=unit

Change-Id: Ie62462686ecf598efeac08a2d3180cd372430bb9
Reviewed-on: http://gerrit.chromium.org/gerrit/9916
Commit-Ready: Chris Masone <cmasone@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/mock_profile.h
9d779936d8f8c2d74b30883e2a2622c4207fe797 26-Aug-2011 Chris Masone <cmasone@chromium.org> [shill] Add code for persisting profiles and services to disk.

BUG=chromium-os:17253
TEST=unit

Change-Id: Ic6dbbcb10543da3f4615cb305a77f6b9b301e8bc
Reviewed-on: http://gerrit.chromium.org/gerrit/7633
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/mock_profile.h
2ae797d040b7261a5619c750e07037566bcb542b 24-Aug-2011 Chris Masone <cmasone@chromium.org> Re-land "[shill] Provide a cmd line toggle between flimflam and shill storage dirs"

This is so that we can easily switch to (and away from) using
the flimflam profile dir (and user profile dirs) when we start shill.

BUG=chromium-os:17253
TEST=unit

Change-Id: I0264162665607bb180688428c4640e42383ae355
Reviewed-on: http://gerrit.chromium.org/gerrit/6568
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/mock_profile.h
7156c923c9a9d2240ea9c62045337ac8c8f89e57 24-Aug-2011 Chris Masone <cmasone@chromium.org> Revert "[shill] Provide a cmd line toggle between flimflam and shill storage dirs"

This reverts commit 54c93e972563b713030a15ce3c1c1824800e317f

Change-Id: Id4bf4ee1e7e62efea5d116507d8b49d76a7a9556
Reviewed-on: http://gerrit.chromium.org/gerrit/6567
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/mock_profile.h
6402e501258c9f64373dcd05271c6c7dd75e20bc 23-Aug-2011 Chris Masone <cmasone@chromium.org> [shill] Provide a cmd line toggle between flimflam and shill storage dirs

This is so that we can easily switch to (and away from) using
the flimflam profile dir (and user profile dirs) when we start shill.

BUG=chromium-os:17253
TEST=unit

Change-Id: I9352cf5c40a8f77bcda8cdc0b5912782b4e342ed
Reviewed-on: http://gerrit.chromium.org/gerrit/6454
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/mock_profile.h
7df0c672458bee8f4ff33004103351d59a9f4b50 15-Jul-2011 Chris Masone <cmasone@chromium.org> [shill] Start cleaning up some of the naming confusion

We have, so far, not been tidy wrt our objects naming themselves,
for human-readable stuff, RPC-path stuff, etc.

This starts to clean up some of that confusion.

BUG=chromium-os:17744
TEST=unit tests

Change-Id: If4d7f61ba51e527984328a0ccdf4dec461b36074
Reviewed-on: http://gerrit.chromium.org/gerrit/4311
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/mock_profile.h
6791a43add38926966bd420e89541717fb2cb2b5 12-Jul-2011 Chris Masone <cmasone@chromium.org> [shill] Enable Profile objects to manage a list of Services to persist.

The Manager will hang on to a list of active services. They will be sorted,
someday, in an order that makes sense. Every service will be associated with
a Profile, though it may the an ephemeral profile that won't persist state to
disk. Profiles will maintain a map of service name to service references to
track the services whose state they persist to disk. Services may move between
Profiles, and will certainly need to be bound to one after they are registered
with the Manager, so support for this is provided as well.

BUG=chromium-os:17436
TEST=unit tests

Change-Id: Id43a0e1d97302b6f574bd2213d4f3d176bb5223f
Reviewed-on: http://gerrit.chromium.org/gerrit/4033
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/mock_profile.h
7aa5f90848b530999d8b6788ecb40aa30871c7ae 11-Jul-2011 Chris Masone <cmasone@chromium.org> [shill] Back property storage in Service objects with Entry objects

Much of Shill Service state is persisted to disk, by creating an Entry
in a Profile. We should store this info just once, so that we don't
have to worry about keeping multiple data stores in sync. This is a
first step in that direction.

BUG=chromium-os:17436
TEST=unit tests

Change-Id: If94db2a38a7d79c56e2c746b2f069cfd7ab4bf65
Reviewed-on: http://gerrit.chromium.org/gerrit/3876
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/mock_profile.h