History log of /system/connectivity/shill/json_store_unittest.cc
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
03e6719bae1e0903d94853b896673a033196bcf5 13-Oct-2015 Alex Vakulenko <avakulenko@google.com> shill: Rename "chromeos" -> "brillo" in include paths and namespaces

libchromeos is transitioning to libbrillo and chromeos namespaces
and include directory is changing to brillo.

Bug: 24872993
TEST=built for aosp and brillo, all unit tests pass on dragonboard

Change-Id: I804311e49ee780ca96e05f6a581e8c95709d4e1d
/system/connectivity/shill/json_store_unittest.cc
89bd073a5e0878e844baf8c08d7ed46782c4b16e 28-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: JsonStore: remove empty-path checks

JsonStore's |path_| is non-empty by construction.
So remove the non-ctor code that checks for empty
paths, and tests that exercise those code paths.

BUG=None
TEST="USE='asan clang json_store' FEATURES=test emerge-samus shill"

Change-Id: I2292cc932c06468260b14aea79d4566a7939ea84
Reviewed-on: https://chromium-review.googlesource.com/295930
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/json_store_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/json_store_unittest.cc
d0faedeca1a2900bd06de37cb3a781b2ca8d6abd 27-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: JsonStoreTest: remove use of set_path()

As for KeyFileStoreTest: we need to stop using
set_path(), so that we can remove set_path()
from StoreInterface.

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

Change-Id: Iac7188e581893427f8a788a8f2434b5f1c42ae5c
Reviewed-on: https://chromium-review.googlesource.com/295925
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/json_store_unittest.cc
78e0584ef181fc8a6cfd4d3b54644af21829d2ef 27-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: JsonStore/KeyFileStore: modify ctor

If we want to remove StoreInterface::set_path(),
we need to provide some other way to specify where
a store gets written.

So add a FilePath argument to the JsonStore and
KeyFileStore constructors, and update callers
accordingly.

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

Change-Id: I4afd2d0befb9e95f0d0f3138380ef17cd2ccd603
Reviewed-on: https://chromium-review.googlesource.com/295923
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/json_store_unittest.cc
cbaa24d68afc8e5339059c26101f313f8487dd99 27-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: JsonStoreTest: remove uses of path()

As with KeyFileStoreTest, it'll be easier to remove
the path() method of StoreInterface if there's no code
that calls it. Make it so.

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

Change-Id: I561b3061ef3840dc9c72190e106b827bbeaa4264
Reviewed-on: https://chromium-review.googlesource.com/295921
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/json_store_unittest.cc
f7e118e52bec7f785f6c7fe6f60092d688a34553 27-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: JsonStoreTest: dynamically allocate store

As with KeyFileStoreTest, we won't be able to
statically allocate the store, once the JsonStore
constructor requires a path argument.

Pave the way for that shining future, by allocating
the store dynamically, and updating all code that
references the store.

While the CL doesn't make sense in isolation, it's
done separately to keep the add-arg-to-ctor CL small
and clean.

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

Change-Id: I45b4504a5d50f44d19182a207a5afccb0e819229
Reviewed-on: https://chromium-review.googlesource.com/295858
Commit-Ready: mukesh agrawal <quiche@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
/system/connectivity/shill/json_store_unittest.cc
773cf17b04028b19dd7fefcf2c2a291756cc83a7 14-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: JsonStore: add Close() method

For plug compatibility with KeyFileStore, we need to provide
Close().

As for what Close() should actually do... It's clear that Close()
needs to Flush() the in-memory data to disk. But beyond that,
things are less clear.

Given the comment above Open(), in key_file_store.h, it seems
that calls to setters or getters should fail on a closed store.
It's not quite clear to me why KeyFileStore chose to provide
those semantics. And doing the same would require extra work
in JsonStore (keeping track of the open/close state, and checking
it before any Get/Set operations).

For now, I'm implementing Close() as just a Flush(). We can
revisit this, if that causes problems.

While there: fix style issue with some API comments.

BUG=b:22958135
TEST=unit tests

Change-Id: I3df033e7cac85bdf3d6e2cd838eb0cc41672404d
Reviewed-on: https://chromium-review.googlesource.com/293593
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/json_store_unittest.cc
abd2c09753e4ec353ee8ff0d72c44baadc7316fc 14-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: JsonStore: implement MarkAsCorrupted()

For plug-compatibility with KeyFileStore, we need
a way for callers to mark a store as bad.

BUG=b:22958135
TEST=unit tests

Change-Id: Id29fa7e2c6aa967498ba211c083c29e043e15815
Reviewed-on: https://chromium-review.googlesource.com/293592
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Trybot-Ready: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/json_store_unittest.cc
8cf96b7dc21200c377f8082342276689004ef719 14-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: JsonStore: fill in Flush() functionality

A persistent store is much more interesting if it can
persist data. So add code that serializes the in-memory
store, and writes that data to disk.

BUG=b:22958135
TEST=unit tests

Change-Id: Icd5417bdc059abf99b064cdb5df656b1a845b6ed
Reviewed-on: https://chromium-review.googlesource.com/293591
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Trybot-Ready: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/json_store_unittest.cc
ce1fb4700705476f5202b32427d4d2de200410a8 13-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: JsonStore: fill in Open() functionality

Add the ability to parse settings out of a serialized
JsonStore, and some tests that exercise this new code.

This CL makes assumptions about how the data is
serialized. Those assumptions will be tested later,
after we add the serialization code.

BUG=b:22958135
TEST=unit tests

Change-Id: Ie7df8cb48f745b90ee6ee656ebf0c60f02e14b02
Reviewed-on: https://chromium-review.googlesource.com/293590
Tested-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Trybot-Ready: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/json_store_unittest.cc
93863bf643012a02c633d8e95c9fb07487107f6f 13-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: JsonStore: add skeleton Open() functionality

Add a skeleton implementation of Open(). This skeleton
handles basic file structure, but does not attempt to
deserialize actual settings data.

BUG=b:22958135
TEST=unit tests

Change-Id: I909826ef71f58c41a241f0db5d30134c957e774a
Reviewed-on: https://chromium-review.googlesource.com/293569
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Trybot-Ready: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/json_store_unittest.cc
f13a30f7587d12de5807058b76d09b427dbc9e24 13-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: JsonStore: add skeleton Flush() functionality

Add a skeleton implementation of writing a JsonStore.
This CL just wires up JsonStore, JsonStringValueSerializer,
and ImportFileWriter.

A later CL will actually write JsonStore's data to disk.

BUG=b:22958135
TEST=unit tests

Change-Id: I6f63866520dc87780d3f513364dd76e7438b1b64
Reviewed-on: https://chromium-review.googlesource.com/293568
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Trybot-Ready: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/json_store_unittest.cc
2293273abea61e6185c1df3c17a61fda0d699469 13-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: JsonStore: add group operations

This CL implements the "group"-related methods of
StoreInterface.

While there: update StoreInterface documentation, to
clarify the behavior of DeleteKey() and DeleteGroup().
(These clarifications come from reading some of the
tests for KeyFileStore.)

BUG=b:22958135
TEST=unit tests

Change-Id: I176a0143f11f8cc2ea9ee24792b239cb493297e2
Reviewed-on: https://chromium-review.googlesource.com/293567
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Trybot-Ready: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/json_store_unittest.cc
5002ed63ee532d873c64e0acf2b813015b327077 13-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: JsonStore: add ability to delete keys

This CL implements the DeleteKey method of StoreInterface.

BUG=b:22958135
TEST=unit tests

Change-Id: I02db9973fedc2918829ca23aa6157daca3ad4b0d
Reviewed-on: https://chromium-review.googlesource.com/293566
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Trybot-Ready: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/json_store_unittest.cc
9724f9eac1e16bc1c92caa2b2748597730ab266f 13-Aug-2015 mukesh agrawal <quiche@chromium.org> shill: add beginnings of JsonStore

On some platforms, we will not have GLib available. Hence, we
will not be able to use KeyFileStore (it uses GLib's key_file
functions.)

On such platforms, we want a plug-compatible alternative to
KeyFileStore. Ideally, this alternative will depend only on
libchrome, or libchromeos.

This commit adds the beginnings of such an alternative to
KeyFileStore. JsonStore will use libchrome's JSON reading and
writing capabilities.

In this first commit, however, JsonStore is a simple in-memory
key-value store.

BUG=b:22958135
TEST=unit tests

Change-Id: I820c51ae132b3337a138344c13b86dd477c7de11
Reviewed-on: https://chromium-review.googlesource.com/293565
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: mukesh agrawal <quiche@chromium.org>
Trybot-Ready: mukesh agrawal <quiche@chromium.org>
/system/connectivity/shill/json_store_unittest.cc