History log of /system/connectivity/shill/profile_unittest.cc
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/profile_unittest.cc
d48e8140b17d9f04e9848e1e638c483450a5dcfc 22-Sep-2015 mukesh agrawal <quiche@google.com> shill: Profile: change ctor arg type from string to FilePath

The |user_storage_directory| argument to the Profile ctor
is stored inside the Profile object as a FilePath, and the
DefaultProfile ctor takes its path argument as a FilePath.

Both of these facts argue for |user_storage_directory| to
be passed in as a FilePath, rather than a string.

Make it so.

Bug: None
TEST=unit tests

Change-Id: I6094aeb44de96ccd0312c5311bdd195ee64cf510
/system/connectivity/shill/profile_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/profile_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/profile_unittest.cc
b8f04f56133060fada6a65f0494c05b78eee6b88 27-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: StoreInterface: remove set_path()

set_path() is no longer used in a substantive way,
so remove it. Update calling code accordingly.

Also: remove empty-path checks in FakeStore,
since FakeStore no longer needs a path_ member
at all.

BUG=chromium:517570
TEST="USE='asan clang' FEATURES=test emerge-samus shill"

Change-Id: I0bea86264c037cdb758146bd937f237529c38333
Reviewed-on: https://chromium-review.googlesource.com/295926
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/profile_unittest.cc
75b0d042a2f11684d2aab9db64505b4e636e65fa 26-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: StoreFactory: remove set_glib()

The reason we have GLib (the shill class) is so
that we can mock out calls to glib (the library).

As it turns out, though, the callers of
StoreFactory::CreateStore() never make use of
this abiility. That is: all of StoreFactory's
users work with a real GLib.

What's more, all the other code that instantiates
KeyFileStores also uses a real glib. So GLib's
ability to mock out calls to key-file related
methods is unnecessary.

And, in fact, the fact that we don't use MockGLib
with KeyFileStores isn't an accident. The reason is
that we only access the g_key*() functions via
KeyFileStore. And we already have a MockStore.

The places where we actually need a MockGLib are
things like DHCPConfig, which calls SourceRemove()
directly.

Anyway... As a first step towards removing key-file methods
from GLib, we remove the set_glib() method from StoreFactory.

This might seem curious, since hiding the GLib dependency
inside of StoreFactory seems suspect. And, in fact, that
hiding would be suspect. But it's just an interim step.
In short order, we will remove GLib from StoreFactory
entirely.

The primary purpose of this CL is simply to demonstrate
that all users of StoreFactory use a real GLib. Proving
that justifies removing key-file methods from GLib.

To do so, this CL does the following:
- Remove the GLib arg from CreateStore(). This prototype
change forces us to update all the callers of
CreateStore().
- Remove the GLib instances used by those callers. It should
be evident that those instances are (real) GLib, rather than
MockGLib.

Since we're removing the GLib instances, we also update some
tests to pass Manager a nullptr for the GLib* argument.

BUG=b:23386647
TEST=compile

Change-Id: I0c7a6e19f707c3777de019da2d161cf64e929dbc
Reviewed-on: https://chromium-review.googlesource.com/295576
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/profile_unittest.cc
e73f1411812da970075fe74eea28b6dfa1f7d712 24-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: ProfileTest: make use of GLib conditional

ProfileTests should only use GLib if we're using
KeyFileStore. Make it so.

BUG=b:23386647
TEST="FEATURES=test emerge-samus shill"
TEST="USE=json_store emerge-samus shill" [1]

[1] We deliberately leave out FEATURES=test, because some
unit tests require KeyFileStore.

Change-Id: I858f5b3162ca12d35cd4ce694cfe46a40a8763f2
Reviewed-on: https://chromium-review.googlesource.com/295411
Trybot-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/profile_unittest.cc
3d5be0d7fb6d5dfec1e96d619bf98bde6ba55fad 24-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: ProfileTest: remove explicit use of KeyFileStore

Some ProfileTest cases care about how the Profile interacts
with the StoreInterface implementation. Such cases use a
MockStore.

Other ProfileTest cases don't really care about the details
of the interaction. They just need a functioning store,
so that Profile behaves in a reasonable manner.

To date, the second category of tests has used KeyFileStore.
Since KeyFileStore will not be available on some platforms,
we need to move the second category of tests to something
else.

That something else is FakeStore. This CL makes it so.

While there:
- Add explanatory comment to ProfileInitStorage().
- Fix a typo in a comment.

BUG=b:23387120
TEST=unit tests

Change-Id: If0cce56ee024681c36495baa68ddb0ea34bc26fd
Reviewed-on: https://chromium-review.googlesource.com/295410
Trybot-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/profile_unittest.cc
c80c460b90378124cc945b0b1f619d86949000a7 20-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: Profile: remove unnecessary GLib argument

Since StoreFactory now handles the instantiation of KeyFileStore,
Profile no longer needs a GLib argument to InitStorage(). So
remove it.

While there: remove the GLib argument to RemoveStorage(). It
seems that argument was never used.

BUG=b:23386647
TEST=unit tests

Change-Id: Ic81f647dd51865b08811f529850b869c40778966
Reviewed-on: https://chromium-review.googlesource.com/294861
Trybot-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/profile_unittest.cc
04147470fdeaaf9ab7588bd3a7988d74aa990068 18-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: abstract the instantiation of store interfaces

When creating a persistent store, most code in shill shouldn't
have to worry or care about what the storage backend is.

To achieve this, add a StoreFactory, and migrate existing code
to use it. The StoreFactory selects which store interface
backend to use statically (i.e. at compile time).

To facilitate the migration, we move some methods from
StoreInterface implementations, up into the interface.

Note that unit tests continue to use KeyFileStore directly for
now. We'll migrate unit tests in a later CL.

BUG=b:23223416
TEST="FEATURES=test emerge-samus shill"
TEST="USE=json_store emerge-samus shill" [1]

[1] We deliberately leave out FEATURES=test, because some
unit tests require KeyFileStore.

Change-Id: I7e72d79ebc75e63e7fb57e9a96352fea7b31a818
Reviewed-on: https://chromium-review.googlesource.com/294274
Trybot-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/profile_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/profile_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/profile_unittest.cc
d419b6dc297755e8f0546b2f780851b49aab1fc7 17-Oct-2014 Ben Chan <benchan@chromium.org> shill: profile: Replace scoped_ptr with std::unique_ptr.

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

Change-Id: I6fa5ec6fb2dbb6c0f4aa39a1d62ed2070697d89f
Reviewed-on: https://chromium-review.googlesource.com/224158
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/profile_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/profile_unittest.cc
11c213f3cf64f27a0e42ee6da95e98bd1d4b3202 05-Sep-2014 Ben Chan <benchan@chromium.org> Update code to include base/files/file_util.h

file_util.h was moved from base to base/files
(https://codereview.chromium.org/468253002). This CL updates platform2
code to include base/files/file_util.h instead of base/file_util.h.

BUG=chromium:411001
TEST=Trybot run on paladin, release, and chromiumos-sdk builders.

Change-Id: I488925b54615e131e508a460dc1a27f88168f936
Reviewed-on: https://chromium-review.googlesource.com/216851
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/profile_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/profile_unittest.cc
6fbf64f493a9aae7d743888039c61a57386203db 22-May-2014 Ben Chan <benchan@chromium.org> shill: Update to build against libchrome-271506.

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

Change-Id: Ib7c8b2b290caa261cbb61d30cf8a361a1e3345e1
Reviewed-on: https://chromium-review.googlesource.com/201211
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/profile_unittest.cc
0a59a5a484634f798222ad077dbbfa7faa76651d 25-Apr-2014 mukesh agrawal <quiche@chromium.org> shill: stop passing around format strings for profiles

Prior to this CL, shill passed around format strings, to specify
where the user profiles should be stored. While this makes things
more configurable, it also a) makes things more complex, and
b) causes g++ to emit warnings that some format strings can't be
checked statically.

The location of user profiles doesn't need the full power of
printf-format style configurability. We really only need the
ability to specify which directory the user profiles are
stored in.

Note that this changes requires updating some unit tests,
which actually did take advantage of the flexibility. In
particular, some of the Manager and Profile unit tests placed
user profiles directly in a user profile directory, rather
than creating a user-specific sub-directory first. Creating
the user-specific directories seems like the right thing to
do, since that it what the normal (non-test) code does.

BUG=chromium:293668
TEST=unit tests

Change-Id: Ic1afeec84a7797105c9a49b8261a9677e17d91ee
Reviewed-on: https://chromium-review.googlesource.com/197061
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/profile_unittest.cc
a0ddf46e466bd4ba3d20952f0a6988c680c1af14 06-Feb-2014 Ben Chan <benchan@chromium.org> shill: Update to build against libchrome-242728.

BUG=chromium:341521
CQ-DEPEND=CL:193660
TEST=Tested the following:
1. `FEATURES=test USE='cellular wimax' emerge-$BOARD platform2`
2. Run the following tests:
- network_3GSmokeTest
- network_VPNConnect.*
- network_WiMaxSmoke
- wifi_matfunc

Change-Id: Ic1553c182ab7a833a68c45f012f646b8930cb095
Reviewed-on: https://chromium-review.googlesource.com/193606
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Queue: Ben Chan <benchan@chromium.org>
/system/connectivity/shill/profile_unittest.cc
cbfb34e699532f62eb5b381d0ea3a15d39e00b7c 18-Apr-2013 mukesh agrawal <quiche@chromium.org> shill: Emit more property change notifications for Services.

Add property change notifications for all the Service properties that
Chrome currently pays attention to. Also add unit tests for these
property change notifications.

While there:
- add some more tips to TESTING
- update service-api documentation for AutoConnect
(it is settable for non-favorite services, and has been for
some time)
- update some ServiceTests to no longer set_favorite before
changing AutoConnect (set_favorite is no longer necessary,
as noted above)
- clarify service-api documentation for Device property
- make the security_ field of WiFiService const (it is only
set in the ctor, and designating it const makes it obvious
why there's no property change for it)
- fix bug where VPNService would change the Favorite property,
but not signal the change

BUG=chromium:230329
TEST=new unit tests

Change-Id: Ia387b1ab90fa80fd218cd69e0fd8126ff4c5a2ae
Reviewed-on: https://gerrit.chromium.org/gerrit/48459
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/profile_unittest.cc
78af94ce5ff7c3f22bda6148c6115ec8591129a5 18-Apr-2013 Paul Stewart <pstew@chromium.org> shill: Manager: Track loaded profiles internally

Before this change, the list of logged-in profiles was passed to
shill by the shill.conf init script. This change allows shill to
track the list of profiles (and the hashes assigned to them)
internally, ignoring the "--push" flag. A follow-on change will
remove the --push flag entirely.

BUG=chromium:231858
TEST=Unit tests + manual: Restart shill while logged in and make
sure "list-profiles" shows the user profile is loaded. Reboot
while logged in and make sure "list-profiles" only shows the default
profile. Log in and make sure /var/run/shill/loaded_profile_list
contains the user profile name.

Change-Id: Ib3d8cd6d78eeeec532cf876a38da6986587403aa
Reviewed-on: https://gerrit.chromium.org/gerrit/48582
Tested-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/profile_unittest.cc
f3eced90466010ac4b067a565ba371c476e6de67 17-Apr-2013 Paul Stewart <pstew@chromium.org> shill: Profile: Add "UserHash" property

Add a read-only property to the Profile that contains an opaque
"UserHash" string. This string is populated using a new field
in the Profile::Identifier structure, which can be filled in as
it is being created by by using a new Manager::InsertUserProfile
RPC call. InsertUserProfile is so named because it's still not
completely resolved in the design where in the profile stack a
profile inserted via this method will end up (See design doc
https://go/cros-multiprofile for up-to-date discussion).

CQ-DEPEND=CL:48378
BUG=chromium:231858
TEST=Unit tests

Change-Id: I0c6623f3d7253eb4d773712cddb72a222c0be6c5
Reviewed-on: https://gerrit.chromium.org/gerrit/48405
Commit-Queue: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/profile_unittest.cc
0e1cdeae24dd678a5fe27c840802582c0ca45ec0 28-Feb-2013 Albert Chaulk <achaulk@chromium.org> shill: Implement Service.Remove & delete DHCP leases

Implement the Service.Remove dbus API and modify the unload sequence to
remove the DHCP lease file. Add unit tests to DHCPProvider & WiFiService to
check lease file deletion. Currently only WiFi does the DHCP lease delete
from DBus - WiMax/Cell/VPN do their own things for IP configuration and
Ethernet can't be removed as per the API spec.

Also make sure FilePath is qualified as base::FilePath throughout the project.

BUG=chromium-os:32756
TEST=added unittests to test the call path on Unload() to delete the lease file

Change-Id: Ic6eee17b9d81cd0be8d09c683d85d6a4d19278c9
Reviewed-on: https://gerrit.chromium.org/gerrit/44339
Tested-by: Albert Chaulk <achaulk@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Albert Chaulk <achaulk@chromium.org>
/system/connectivity/shill/profile_unittest.cc
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/profile_unittest.cc
457728b3eeb2d67c980e0d20675f0a0f750903e1 09-Jan-2013 Darin Petkov <petkov@chromium.org> shill: Log service's unique name rather than friendly name.

This way we consistently identify the service throughout shill's logs
as well as alleviate PII concerns due to SSIDs leaking into
logs. Renamed Service::UniqueName() to Service::unique_name(), per
style. Made Service::friendly_name() protected to limit its accidental
use.

BUG=chromium-os:37679
TEST=unit tests, tested on device and inspected logs

Change-Id: Idcdba75875a9d10cda51b714730ef633876481c6
Reviewed-on: https://gerrit.chromium.org/gerrit/40926
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Darin Petkov <petkov@chromium.org>
/system/connectivity/shill/profile_unittest.cc
2ebc16da6068c8c61658b39cf70d157d7d0911eb 23-Aug-2012 Paul Stewart <pstew@chromium.org> shill: profile: Mark invalid profiles as corrupted and ignore

If we fail to open a profile due to a failure in loading
the keyfile store, move the broken file out of the way, since
we will never be able to load this file in later attempts.
In situations where this is the default profile, this will
allow us to start up successfully the next time.

BUG=chromium-os:33822
TEST=Unit tests + manual (copy default.profile from the bug
and ensure shill restarts itself and moves the corrupted
profile out of the way.)

Change-Id: Ia3b7716b36b52c559193f6f6e28c9b185a77c01e
Reviewed-on: https://gerrit.chromium.org/gerrit/31374
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/profile_unittest.cc
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/profile_unittest.cc
3e20a2341d0aeb7681e4ee0f89eae6817ade2b3b 16-Feb-2012 Eric Shienbrood <ers@chromium.org> shill: Convert code to use the newest version of libchrome.

The biggest change is a switch from using the deprecated
Task and CallbackN mechanisms to using the new Callback
mechanism.

Note: Original CL was https://gerrit.chromium.org/gerrit/16156.
This is logically another patch to that CL, but since the
latter was already merged, and is considered closed by
Gerrit, it's necessary to create a new CL.

BUG=chromium-os:15330
TEST=Build shill and run it on a zgb with a modem. Build and
run unit tests.
CQ-DEPEND=I37628863370323d30cac493764ea28f8ffd42637

Change-Id: I3ae78a3aa44ec167b79f2170d07650ece888254f
Reviewed-on: https://gerrit.chromium.org/gerrit/18030
Reviewed-by: Eric Shienbrood <ers@chromium.org>
Tested-by: Eric Shienbrood <ers@chromium.org>
Commit-Ready: Eric Shienbrood <ers@chromium.org>
/system/connectivity/shill/profile_unittest.cc
b5c8940ae68f85c8c822936f41f4993c51624dcf 13-Mar-2012 Eric Shienbrood <ers@chromium.org> Revert "shill: Convert code to use the newest version of libchrome."

This reverts commit ffebe0c489e0ecccf497547d7078c30cbc8072e2

Unit tests ran on local machine, but wouldn't run on CQ because of some kind of environment difference.

Change-Id: Ia876c0c17f4cd84bca5e2f1bacd7e24a81832d4d
Reviewed-on: https://gerrit.chromium.org/gerrit/17969
Reviewed-by: Eric Shienbrood <ers@chromium.org>
Tested-by: Eric Shienbrood <ers@chromium.org>
/system/connectivity/shill/profile_unittest.cc
08a4ffb4ecf5893eb55c523d528bf3e52c66facf 16-Feb-2012 Eric Shienbrood <ers@chromium.org> shill: Convert code to use the newest version of libchrome.

The biggest change is a switch from using the deprecated
Task and CallbackN mechanisms to using the new Callback
mechanism.

This cannot be submitted until vapier submits his CL that
slot-enables the libchrome build
(https://gerrit.chromium.org/gerrit/15415).

BUG=chromium-os:15330
TEST=Build shill and run it on a zgb with a modem. Build and
run unit tests.
CQ-DEPEND=Ic24bb16aac3e1d130a784f34e848e308719a43be

Change-Id: I081a7aa66bee391b867a43e08db2eacdff760945
Reviewed-on: https://gerrit.chromium.org/gerrit/16156
Tested-by: Eric Shienbrood <ers@chromium.org>
Commit-Ready: Eric Shienbrood <ers@chromium.org>
Reviewed-by: Eric Shienbrood <ers@chromium.org>
/system/connectivity/shill/profile_unittest.cc
0756db95c9d39d6e6aa9a754e54b441eff46ff34 27-Jan-2012 Paul Stewart <pstew@chromium.org> shill: Implement GetEntry on Profile

Implement "GetEntry" on profile_dbus_adaptor. This change adds
the ability to look up a Service in the Manager by its
StorageIdentifier and then to return its properties to the caller.
If the Service does not exist in the manager, we have to read
directly out of the Profile's store and build a DBus property dict
out of its contents. This is a pretty gross method, and I've already
created a bug to remove this as soon as we can diverge from the
flimflam Profile API. crosbug.com/25813

BUG=chromium-os:25542
TEST=New unit tests + Manual: chrome://settings/internet now lists
both visible and unavailable networks under "Remembered Networks"
and clikcing on "Forget Network" purges the network from the profile.

Change-Id: Ib2f0ab772e40a1f615206a7b985be446fc7facde
Reviewed-on: https://gerrit.chromium.org/gerrit/15200
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/profile_unittest.cc
7522551440b9a287bccf2d95a42357d04ab79814 27-Jan-2012 Paul Stewart <pstew@chromium.org> shill: Implement DeleteEntry Profile method

Implement the DeleteEntry DBus method call, which removes
a Profile entry as well as detaching any connected services
from the profile data. As a bonus change, modify Manager to
consolidate finding a Profile that is suitable for a Service
which does not have one.

BUG=chromium-os:25542
TEST=New unit tests

Change-Id: I6a954a41ab2d1b49f6432858e2263a63b5af21f1
Reviewed-on: https://gerrit.chromium.org/gerrit/14944
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/profile_unittest.cc
1b2531423a15ccc5ac5acaf09edac9a687902dfa 26-Jan-2012 Paul Stewart <pstew@chromium.org> shill: Implement more of Profile DBus interface

Return a DBus path from Manager.GetActiveProfile().
Implement the "Profiles" property on the manager Manager.
Fix the "Entries" property on the Profile to only report group
identifiers that correspond to technologies (not ipconfig,
devices, etc).
Fix the "Services" Profile property, to only appear as a property
of the active profile.

BUG=chromium-os:25538, chromium-os:23702
TEST=Manual: Running "list-profiles" from the flimflam test suite now
works correctly.

Change-Id: I3120fe54f02662822186ac033fab0b3566449705
Reviewed-on: https://gerrit.chromium.org/gerrit/14904
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/profile_unittest.cc
3426c8fc7a3943f2d8fcb2ec78f0593088b42bed 12-Jan-2012 Thieu Le <thieule@chromium.org> shill: Move Metrics from singleton to Shill daemon

While implementing chromium-os:24810, it was discovered that Metrics is
cleaner if it is passed around like ControlInterface, Dispatcher,
Manager, etc. This approach also makes Metrics more testable.

BUG=chromium-os:24810
TEST=Unit tests, network_WiFiManager suite

Change-Id: I556a1bd11f21f0b93ecfeaae8855dfb99ed5e5f9
Reviewed-on: https://gerrit.chromium.org/gerrit/14099
Commit-Ready: Thieu Le <thieule@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
/system/connectivity/shill/profile_unittest.cc
00917ceafbc28599391bfcdd5837faf6d63fec32 23-Nov-2011 mukesh agrawal <quiche@chromium.org> shill: set favorite property when a Service is connected, and
set autoconnect property when a Service is made a favorite

BUG=chromium-os:23346,chromium-os:23349
TEST=new unittests

Bonus changes:
- remove some unused variables in ManagerTest.SortServices
- add "static" comment for Service::DecideBetween and
Service::Compare

Change-Id: I4b7e01f98d1292b9c8f951c9a54a01f76292b740
Reviewed-on: https://gerrit.chromium.org/gerrit/12053
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/profile_unittest.cc
1b7a616197af7ff753dbe7614a8e207b1e10ac1a 09-Nov-2011 Gaurav Shah <gauravsh@chromium.org> shill: Implement write-only properties

Certain properties (e.g. WIFI Passphrase) are write only and must
not be returned when Service.GetProperties() is called over D-Bus.

This CL implements WriteOnlyProperties, a write-only analog of the
read-only ConstProperties.

Also add a ReadablePropertyConstIterator which only returns the
readable properties. Switch over DBus adaptor and PropertyStore
to use that.

BUG=chromium-os:21196
TEST=Added 2 new unittests.

Change-Id: I52815cc395650e0b49e1acac8d4954deeebcee5d
Reviewed-on: https://gerrit.chromium.org/gerrit/11402
Commit-Ready: Gaurav Shah <gauravsh@chromium.org>
Reviewed-by: Gaurav Shah <gauravsh@chromium.org>
Tested-by: Gaurav Shah <gauravsh@chromium.org>
/system/connectivity/shill/profile_unittest.cc
bba6a5b87cb21424770228cd73e10574a2151568 03-Nov-2011 Paul Stewart <pstew@chromium.org> shill: Rename MergeService to ConfigureService

Collateral changes: Use ContainsService internally to profile's
ConfigureService. Refrain from using Service::GetStorageIdentifier
directly. I can think of scenarios coming up where it is important
for the Service to determine for itself whether a StorageInterface
contains anything it can use.

BUG=chromium-os:22422
TEST=ReRun Unit Tests

Change-Id: I34c6cb272c1540ab1e8d8d9bed4083b52e20f75e
Reviewed-on: https://gerrit.chromium.org/gerrit/11099
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/profile_unittest.cc
5dc40aad05908dc435e623e56392780ef6d1079e 29-Oct-2011 Paul Stewart <pstew@chromium.org> shill: Implement CreateProfile, PushProfile, PopProfile

Collateral fixes: Profiles now create a header at the beginning
of the file, and this feature is plumbed down through key_file_store
and glib. InitStorage can be configured to fail if the profile
already exists/doesn't yet exist.

BUG=chromium-os:22221
TEST=New unit tests

Change-Id: Ie7c2d0dee97891b7850cec75b74052fce77eee8f
Reviewed-on: https://gerrit.chromium.org/gerrit/10884
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/profile_unittest.cc
6515aabcd1fbbb9ff2090c9675c17eeef64e7474 13-Oct-2011 Chris Masone <cmasone@chromium.org> [shill] Make profiles backed with StoreInterfaces

Rely on persistence of data in StoreInterface to maintain
Service/Device/IPConfig info for entities that are not
currently active, instead of maintaining lists in Profile
objects themselves.

BUG=chromium-os:17253
TEST=unit, run on device

Change-Id: I206f44ddf16c584354f8fcadb57032f047f33d0a
Reviewed-on: http://gerrit.chromium.org/gerrit/10024
Commit-Ready: Chris Masone <cmasone@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/profile_unittest.cc
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/profile_unittest.cc
2176a88f197d802924d2a83d368e3efab7a6be4b 15-Sep-2011 Chris Masone <cmasone@chromium.org> [shill] Get rid of protected data members in PropertyStoreTest

BUG=chromium-os:19573
TEST=unit
STATUS=Verified

Change-Id: Ib3a2f19abb8cc4aa0e8410fc26bbb60891e35da7
Reviewed-on: http://gerrit.chromium.org/gerrit/7762
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/profile_unittest.cc
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/profile_unittest.cc
7355ce1937c504d836a303ac809bd436272212b3 02-Sep-2011 Paul Stewart <pstew@chromium.org> shill: Naming and lint cleanup pass

Reduce some double-speak in IPAddress constants. Do a cursory
glint pass and clean up a few no-brainer issues.

BUG=None
TEST=Re-run unit tests

Change-Id: I063cd72111bd1f6321f81c6c6591b9f51d87434d
Reviewed-on: http://gerrit.chromium.org/gerrit/7181
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/profile_unittest.cc
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/profile_unittest.cc
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/profile_unittest.cc
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/profile_unittest.cc
51a7e939ed0d260392a40bc5d58e6d2651c6ddc0 28-Jul-2011 mukesh agrawal <quiche@chromium.org> shill: push service naming down into Service class (instead of being
handled in each subclass)

BUG=chromium-os:17974
TEST=FEATURES="test nostrip noclean" emerge-x86-generic shill, and run on device

Change-Id: Ic251fec9c76fec1a4c3aa5ac8d0aba4c664e029d
Reviewed-on: http://gerrit.chromium.org/gerrit/4927
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/profile_unittest.cc
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/profile_unittest.cc
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/profile_unittest.cc
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/profile_unittest.cc
a4766822880815bafdc69778ccaccaf661536181 07-Jul-2011 Darin Petkov <petkov@chromium.org> shill: Support for profile identifiers, and creating persistent storage.

BUG=chromium-os:17252
TEST=unit tests

Change-Id: Iaec7b6b5737a997fde3d5215196fdcbf72eefe09
Reviewed-on: http://gerrit.chromium.org/gerrit/3749
Tested-by: Darin Petkov <petkov@chromium.org>
Reviewed-by: Chris Masone <cmasone@chromium.org>
/system/connectivity/shill/profile_unittest.cc