chromiumos/platform/cashew.git
2 years agocashew: Prevent double deletion of ProcfsByteCounter instance. factory-2268.16.B factory-2305.B factory-2338.B factory-2368.B factory-2394.B factory-2460.B factory-2475.B firmware-link-2348.B master release-R20-2268.B release-R21-2465.B stabilize2
Ben Chan [Thu, 19 Apr 2012 05:27:01 +0000 (22:27 -0700)]
cashew: Prevent double deletion of ProcfsByteCounter instance.

BUG=chromium-os:29181
TEST=Build cashew and run unit tests.

Change-Id: I4d0226882b5e4a33c0b899c589199a438a2ee844
Reviewed-on: https://gerrit.chromium.org/gerrit/20545
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
2 years agocashew: cashew should retrieve data plans even while in a portal state
Jason Glasgow [Tue, 3 Apr 2012 15:08:17 +0000 (11:08 -0400)]
cashew: cashew should retrieve data plans even while in a portal state

cashew should retrieve data plans even while in a portal state.  There
may be some interesting information about auto renew plans that have
not yet renewed.  This information is available even when no data plan
is active.

BUG=chromium-os:23047
TEST=run cashew when out of data

Change-Id: I68d5b9b7a451d80c8cd21e8ab79cc73d5946be35
Reviewed-on: https://gerrit.chromium.org/gerrit/19515
Tested-by: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: Nathan J. Williams <njw@chromium.org>
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>

2 years agocashew: Use an http proxy server if specified by shill
Jason Glasgow [Fri, 30 Mar 2012 14:26:04 +0000 (10:26 -0400)]
cashew: Use an http proxy server if specified by shill

Use an http proxy server if shill specifies one by setting an http
proxy port property on the service.  Either a sticky host route or a
proxy server can be used when the cellular service is not the default.

Adapt cashew to work with both shill and flimflam by no longer
requiring that the service object names have the string "cellular_" in
them.

BUG=chromium-os:23047
TEST=run cashew with shill, ensure data plan is fetched when connected via Ethernet & Cellular

Change-Id: I2d129b9e2c524158c2d6f9fd0e0f535246568575
Reviewed-on: https://gerrit.chromium.org/gerrit/19374
Tested-by: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: Nathan J. Williams <njw@chromium.org>
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>

2 years agocashew: use nameservers from the ipconfig object release-R19-2046.B
Jason Glasgow [Thu, 22 Mar 2012 00:54:12 +0000 (20:54 -0400)]
cashew: use nameservers from the ipconfig object

Use nameservers from the ipconfig object when fetching usage
information from a data plan provider.

BUG=chromium-os:27904
TEST=fetch usage information while attached to Ethernet

Change-Id: I2fcbaa060ae940bb76b29acabcfa0c8ff260461c
Reviewed-on: https://gerrit.chromium.org/gerrit/18803
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Tested-by: Jason Glasgow <jglasgow@chromium.org>
2 years agocashew: Add ipconfig dbus object
Jason Glasgow [Thu, 22 Mar 2012 02:05:36 +0000 (22:05 -0400)]
cashew: Add ipconfig dbus object

Add ipconfig dbus object

BUG=chromium-os:27904
TEST=fetch usage information while attached to Ethernet

Change-Id: I112f6c1e07657215170c925d06a6bde245186d47
Reviewed-on: https://gerrit.chromium.org/gerrit/18802
Reviewed-by: Nathan J. Williams <njw@chromium.org>
Commit-Ready: <jglasgow@google.com>
Tested-by: <jglasgow@google.com>
2 years agocashew: generate dbus proxies for ipconfig object
Jason Glasgow [Wed, 21 Mar 2012 21:59:32 +0000 (17:59 -0400)]
cashew: generate dbus proxies for ipconfig object

Generate dbus proxies for ipconfig object

BUG=chromium-os:27904
TEST=get usage information while attached to an Ethernet

Change-Id: Ice3f5c1eedc217f40668e5c97c1070de8b13081b
Reviewed-on: https://gerrit.chromium.org/gerrit/18801
Reviewed-by: Nathan J. Williams <njw@chromium.org>
Commit-Ready: <jglasgow@google.com>
Tested-by: <jglasgow@google.com>
2 years agocashew: Allow specification of nameservers in http_fetcher
Jason Glasgow [Wed, 21 Mar 2012 21:58:03 +0000 (17:58 -0400)]
cashew: Allow specification of nameservers in http_fetcher

Allow specification of nameservers in http_fetcher

BUG=chromium-os:27904
TEST=get usage information while attached to an Ethernet

Change-Id: I7222c4c852b3b70dc09c52b49a1633a3529849a7
Reviewed-on: https://gerrit.chromium.org/gerrit/18800
Reviewed-by: Nathan J. Williams <njw@chromium.org>
Commit-Ready: <jglasgow@google.com>
Tested-by: <jglasgow@google.com>
2 years agoCashew: Fix AggregatorTest.TrimOld for roundoff factory-1987.B
Paul Stewart [Tue, 13 Mar 2012 18:09:20 +0000 (11:09 -0700)]
Cashew: Fix AggregatorTest.TrimOld for roundoff

The AggregatorTest.TrimOld can fail randomly due to round-off error
in converting backwards and forwards between day and date.  The
underlying function under test has no need to be hour-accurate, so
remove this test and instead test forwards and backwards by a day
and two days.

Partially reverts f04c4bd726b6acc527b1e4a224f03eb33bbad47a

BUG=chromium-os:27657
TEST=Manual, rerun unit tests.

Change-Id: I78bc2f3b3aae6debcceb5e669499633c34d91565
Reviewed-on: https://gerrit.chromium.org/gerrit/17989
Reviewed-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
2 years agoCashew: HACK Temporarily Disable AggregatorTest.TrimOld
Bernie Thompson [Mon, 12 Mar 2012 18:06:05 +0000 (11:06 -0700)]
Cashew: HACK Temporarily Disable AggregatorTest.TrimOld

The AggregatorTest.TrimOld has been failing on amd64-generic, no immediate
CL appears to be the cause to allow for easy reversion. This CL temporarily
disables the unit test while this is under investigation.

BUG=chromium-os:27657
TEST=Manual, verify that FEATURES="test" emerge-amd64-generic cashew
    is successfull.

Change-Id: I1267c589c92336866bd19598492952ba3403dd85
Reviewed-on: https://gerrit.chromium.org/gerrit/17847
Reviewed-by: Bernie Thompson <bhthompson@chromium.org>
Tested-by: Bernie Thompson <bhthompson@chromium.org>
Commit-Ready: Bernie Thompson <bhthompson@chromium.org>

2 years agoinstall /etc config files
Mike Frysinger [Thu, 8 Mar 2012 18:07:47 +0000 (13:07 -0500)]
install /etc config files

This integrates the init.d and dbus config install into `make install`.

BUG=None
TEST=`emerge-x86-alex cashew` installs same set of files

Change-Id: I482ad68730fcbf70256b442b5bb375bfd8c188d4
Reviewed-on: https://gerrit.chromium.org/gerrit/17593
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2 years agoallow selection of libchrome version
Mike Frysinger [Thu, 8 Mar 2012 18:14:00 +0000 (13:14 -0500)]
allow selection of libchrome version

There is no libchrome.pc file anymore -- you have to specify the
version.  Add a configure flag to allow people to set the version
to build cashew against.

BUG=chromium-os:16623
TEST=`emerge-x86-alex cashew` installs same set of files

Change-Id: I50f2222606faf3c7e4cc60af17a53cb57d807d76
Reviewed-on: https://gerrit.chromium.org/gerrit/17594
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2 years ago[cashew] stop building our own json/values
Elly Jones [Wed, 25 Jan 2012 22:21:47 +0000 (17:21 -0500)]
[cashew] stop building our own json/values

These were ripped off from libbase and had int64 support added, but we don't
really need 64 bits of precision; use doubles instead.

BUG=None
TEST=unit

Change-Id: Ia9a3f9bf29e8657dcab1e23203e08516e56d85ea
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/14817

2 years ago[cashew] Use libchrome.pc
Elly Jones [Wed, 25 Jan 2012 21:11:14 +0000 (16:11 -0500)]
[cashew] Use libchrome.pc

Also, add myself to OWNERS, as cashew has no OWNERS and vlaviano is former.

BUG=chromium-os:24959,chromium-os:22007
TEST=Build

Change-Id: Ifec247a85a61829e630b966d74f076a28dca0966
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/14814
Reviewed-by: Kees Cook <keescook@chromium.org>
2 years agocashew: use g_unix_signal_add to catch signals 64 bit safe
Jason Glasgow [Thu, 5 Jan 2012 20:54:27 +0000 (15:54 -0500)]
cashew: use g_unix_signal_add to catch signals 64 bit safe

Register a GSourceCallbackFunc to handle signals so that we do not log
in the signal handler itself.  Logging in the actual signal handler
can causes crashes.

BUG=chromium-os:24749
TEST=run cashew, restart it.  Make sure that it exists cleanly without a core.

Change-Id: Ic7dec46e5069a95905bb2a5c6beccb5359d1ed28
Reviewed-on: https://gerrit.chromium.org/gerrit/13772
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>
Tested-by: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: Eric Shienbrood <ers@chromium.org>
2 years agoRevert "cashew: use g_unix_signal_add to catch signals"
Josh Horwich [Fri, 6 Jan 2012 00:28:44 +0000 (16:28 -0800)]
Revert "cashew: use g_unix_signal_add to catch signals"

Reverting due to build failure on amd64 corei7 PFQ

This reverts commit 3e1c5e47407aa08de1795e4dc677c8bed2c864ad

Change-Id: I23382b2b64aa61c01e32f27bdd1330efda256d1b
Reviewed-on: https://gerrit.chromium.org/gerrit/13759
Commit-Ready: Josh Horwich <jhorwich@google.com>
Reviewed-by: Josh Horwich <jhorwich@google.com>
Tested-by: Josh Horwich <jhorwich@google.com>
2 years agocashew: use g_unix_signal_add to catch signals
Jason Glasgow [Thu, 5 Jan 2012 20:54:27 +0000 (15:54 -0500)]
cashew: use g_unix_signal_add to catch signals

Register a GSourceCallbackFunc to handle signals so that we do not log
in the signal handler itself.  Logging in the actual signal handler
can causes crashes.

BUG=chromium-os:24749
TEST=run cashew, restart it.  Make sure that it exists cleanly without a core.

Change-Id: I3e9d4fb046951a9c2445b9f2ebbd601065f21960
Reviewed-on: https://gerrit.chromium.org/gerrit/13738
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Tested-by: Jason Glasgow <jglasgow@chromium.org>
2 years agocashew: send usage requests via cellular interface factory-1284.B factory-1412.B firmware-kiev-2.112.B firmware-uboot_v2-1299.B
Vince Laviano [Tue, 30 Aug 2011 00:53:46 +0000 (17:53 -0700)]
cashew: send usage requests via cellular interface

cashew currently sends usage requests via the default service. Since
requests must be sent over-the-air, this forces us to send requests for
a cellular service only when it's the default service.

This CL changes cashew to send requests for a cellular service over the
interface corresponding to that service, whether or not it's the default
service. This allows us to retrieve and display plan info as soon as the
cellular service is connected.

We accomplish this by changing flimflam to install a host route that
causes all traffic to the usage API to go out via the cellular
interface (see issue 17920) and monitoring the service's StickyHostRoute
property from cashew. If a service has a sticky host route, we no longer
require it to be the default service before sending usage requests.

BUG=chromium-os:16250
TEST=Ran unit tests and performed manual testing on device

Change-Id: Ib248aac6f254a5b4e3a070ddd05969538331e999
Reviewed-on: https://gerrit.chromium.org/gerrit/7184
Tested-by: Vince Laviano <vlaviano@chromium.org>
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Commit-Ready: Vince Laviano <vlaviano@chromium.org>

3 years agocashew: prevent nested byte counter deletion factory-1235.B
Vince Laviano [Wed, 19 Oct 2011 00:03:45 +0000 (17:03 -0700)]
cashew: prevent nested byte counter deletion

When a byte counter is deleted, the byte counter makes a final stats
report to its delegate. It's possible for the callback handler for this
report to decide to delete the byte counter, causing a nested deletion.

Repro steps for this issue are to connect to 3G and then disable mobile
data from the internet settings page.

This CL prevents this nested deletion by changing
DataPlan::OnByteCounterUpdate not to stop the byte counter if there are
no active plans.

This CL also fixes some minor cpplint errors.

BUG=chromium-os:20144
TEST=unit tests and manual testing on device

Change-Id: I82998f5a610b13be808251b36934d3b7c29bad0d
Reviewed-on: http://gerrit.chromium.org/gerrit/10282
Tested-by: Vince Laviano <vlaviano@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Vince Laviano <vlaviano@chromium.org>

3 years agocashew: minijail -> minijail0
Elly Jones [Thu, 22 Sep 2011 19:56:09 +0000 (15:56 -0400)]
cashew: minijail -> minijail0

BUG=chromium-os:383
TESTED_ON=kaen
TEST=Adhoc
Built, booted, ps aux | grep cashew

Change-Id: I32ec90e1f7b41a66b14193593828d0369332e27e
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/8152
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
3 years agoChanged ASSERT_EQ(bool, ...) to ASSERT_TRUE/ASSERT_FALSE. factory-1020.B
Ahmad Sharif [Fri, 9 Sep 2011 17:48:26 +0000 (10:48 -0700)]
Changed ASSERT_EQ(bool, ...) to ASSERT_TRUE/ASSERT_FALSE.

This is necessary to get the unittests to compile with gcc-4.6.0.

TEST=FEATURES=test emerge-$board cashew
BUG=chromium-os:20063

Change-Id: I867d7d0a0ed766b42001b73470a82dc1e9c73741
Reviewed-on: http://gerrit.chromium.org/gerrit/7489
Tested-by: asharif <asharif@chromium.org>
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
3 years agocashew: libcurl_http_fetcher improvements
Vince Laviano [Fri, 2 Sep 2011 19:05:08 +0000 (12:05 -0700)]
cashew: libcurl_http_fetcher improvements

This CL enhances cashew's libcurl http fetcher to address some issues
that I noticed while working on issue 16250:
- Log more specific error information in the event of a request failure
- Reduce tcp and http timeouts to 30 seconds
- Reduce log spam during a lengthy request by not generating a log msg
  each time that we enter the TimeoutCallback (once per second).

BUG=None
TEST=Ran unit tests and performed manual testing on device

Change-Id: Iae7b72661b4723bb3910d60fd7e63292088e3857
Reviewed-on: http://gerrit.chromium.org/gerrit/7187
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Tested-by: Vince Laviano <vlaviano@chromium.org>
3 years agocashew: start byte counter on connect factory-980.B test-982.B
Michael Mekonnen [Fri, 19 Aug 2011 18:42:43 +0000 (14:42 -0400)]
cashew: start byte counter on connect

Changed places where we start and stop byte counters so that aggregator
tracks daily usage on all cellular services (not just ones that implement
usage API).

BUG=chromium-os:19405
TEST=run manual tests on chrome book: tracks daily usage on AT&T

Change-Id: I40a5e0db1236f033bf83921d9afcf41a2a61658d
Reviewed-on: http://gerrit.chromium.org/gerrit/6322
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Tested-by: Michael Mekonnen <mikemeko@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/6404
Tested-by: Vince Laviano <vlaviano@chromium.org>
3 years agoAdded expiration timer to data plan that fires when the data plan expires, and assign...
Michael Mekonnen [Thu, 18 Aug 2011 18:03:32 +0000 (14:03 -0400)]
Added expiration timer to data plan that fires when the data plan expires, and assigns it the bytes used since the last byte counter update.

BUG=chromium-os:19343
TEST=run basic manual tests on chrome book

Change-Id: I8f014f4c228081f32048dcc820ffb8c988be0e0c
Reviewed-on: http://gerrit.chromium.org/gerrit/6229
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Tested-by: Michael Mekonnen <mikemeko@chromium.org>
3 years agoImplemented GetBytesPerDay in aggregator.
Michael Mekonnen [Fri, 19 Aug 2011 00:57:14 +0000 (20:57 -0400)]
Implemented GetBytesPerDay in aggregator.

BUG=chromium-os:18816
TEST=run unittests

Change-Id: I83ab797924e37b529847557f86a84985656d113f
Reviewed-on: http://gerrit.chromium.org/gerrit/6279
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Tested-by: Michael Mekonnen <mikemeko@chromium.org>
3 years agoFixed aggregator storage file creation bug (needs to be created on the first run).
Michael Mekonnen [Thu, 18 Aug 2011 23:23:28 +0000 (19:23 -0400)]
Fixed aggregator storage file creation bug (needs to be created on the first run).

BUG=chromium-os:19365
TEST=run manual tests on chrome book

Change-Id: Iebe17f60aaaa64f00e3cb054094d528196bb2e56
Reviewed-on: http://gerrit.chromium.org/gerrit/6267
Reviewed-by: David Rochberg <rochberg@chromium.org>
Tested-by: Michael Mekonnen <mikemeko@chromium.org>
3 years agocashew: fix build error
Vince Laviano [Thu, 18 Aug 2011 20:41:55 +0000 (13:41 -0700)]
cashew: fix build error

Modify the signature of CashewServer::RequestCellularUsageInfo to match
pure virtual function defined by generated dbus-c++ base class from which
it inherits.

BUG=chromium-os:18816
TEST=FEATURES=test emerge-${BOARD} cashew

Change-Id: Ice069980e108481cfca3c40037c69f153ef6bd9f
Reviewed-on: http://gerrit.chromium.org/gerrit/6247
Tested-by: Vince Laviano <vlaviano@chromium.org>
Reviewed-by: Anne Kenyon (Chromium) <annemkenyon@chromium.org>
3 years agoFixed const argument problem from previous commit.
Anne Kenyon [Thu, 18 Aug 2011 18:58:08 +0000 (14:58 -0400)]
Fixed const argument problem from previous commit.

BUG=chromium-os:18816
TEST=ran unittests

Change-Id: Iade85438677475d428a31f872ba55b522b945d26
Reviewed-on: http://gerrit.chromium.org/gerrit/6235
Reviewed-by: David Rochberg <rochberg@chromium.org>
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Tested-by: Anne Kenyon (Chromium) <annemkenyon@chromium.org>
3 years agoChanged DBus methods to apply to daily usage rather than user usage
Anne Kenyon [Sun, 7 Aug 2011 15:00:14 +0000 (11:00 -0400)]
Changed DBus methods to apply to daily usage rather than user usage

BUG=chromium-os:18816
TEST=ran unittests

Change-Id: I38f24963d57fef32b7cdb9d5a6bc56b715384e1a
Reviewed-on: http://gerrit.chromium.org/gerrit/5463
Reviewed-by: Anne Kenyon (Chromium) <annemkenyon@chromium.org>
Tested-by: Anne Kenyon (Chromium) <annemkenyon@chromium.org>
3 years agoAdded Aggregator that tracks daily data usage.
Michael Mekonnen [Sat, 6 Aug 2011 23:19:31 +0000 (19:19 -0400)]
Added Aggregator that tracks daily data usage.

BUG=chromium-os:18816
TEST=ran unit test and manual tests on chrome book

Change-Id: I599f146112d9d2c692fbf85fab2291cef7848094
Reviewed-on: http://gerrit.chromium.org/gerrit/5443
Reviewed-by: Michael Mekonnen <mikemeko@chromium.org>
Tested-by: Michael Mekonnen <mikemeko@chromium.org>
3 years agocashew: rename UsageRequestStatus metric 0.15.877.B firmware-881-u-boot-v1 firmware-u-boot-v1
Vince Laviano [Fri, 5 Aug 2011 01:19:44 +0000 (18:19 -0700)]
cashew: rename UsageRequestStatus metric

This CL renames the Cros.Network.Cashew.UsageRequestStatus metric to
Network.Cellular.UsageRequestStatus to better conform with existing
conventions.

BUG=chromium-os:9887
TEST=unit tests, manual testing on device

Change-Id: I681f7f7e17493805723d8a51130ccdce709698c5
Reviewed-on: http://gerrit.chromium.org/gerrit/5363
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Vince Laviano <vlaviano@chromium.org>
3 years agocashew: fix cpplint errors in user_aggregator_unittest.cc
Vince Laviano [Thu, 28 Jul 2011 20:55:27 +0000 (13:55 -0700)]
cashew: fix cpplint errors in user_aggregator_unittest.cc

BUG=None
TEST=FEATURES=test emerge-${BOARD} cashew

Change-Id: I77572efc74ee9075e37a51a04f4707267ad71a6a
Reviewed-on: http://gerrit.chromium.org/gerrit/4945
Tested-by: Vince Laviano <vlaviano@chromium.org>
Reviewed-by: Michael Mekonnen <mikemeko@chromium.org>
3 years agoAdded the User Aggregator
Michael Mekonnen [Thu, 14 Jul 2011 19:56:54 +0000 (15:56 -0400)]
Added the User Aggregator

BUG=chromium-os:16802
TEST=ran unittest and manual tests on chrome book

Change-Id: Ic1f2828ab5f9c0cbac282212f80385a85c16b813
Reviewed-on: http://gerrit.chromium.org/gerrit/4108
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Tested-by: Michael Mekonnen <mikemeko@chromium.org>
3 years agocashew: detect service disconnection when leaving "online" state
Vince Laviano [Fri, 22 Jul 2011 21:07:25 +0000 (14:07 -0700)]
cashew: detect service disconnection when leaving "online" state

Commit 1d93ab11e9ab023f5cb1401c1d8722f1c3024b56, tracking changes in
flimflam, introduced a new "online" state. Prior to this, "ready" was
the only state that represented a connected service. We failed to update
ServiceImpl::OnStateUpdate to consider a transition from this new
"online" state as a service disconnection. This resulted in
OnDisconnected not being called when the cellular service disconnected,
leaving the byte counter running when it shouldn't be.

This CL resolves this issue by centralizing the notion of what's a
connected state in a new IsConnectedState method and updating the
existing OnStateUpdate and IsConnected methods to use it.

BUG=chromium-os:18083
TEST=unit tests, manual testing on device

Change-Id: I6704f0dc4443769d89b030d58d1157c0298ddd0a
Reviewed-on: http://gerrit.chromium.org/gerrit/4612
Tested-by: Vince Laviano <vlaviano@chromium.org>
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
3 years agocashew: fix cpplint errors
Vince Laviano [Fri, 22 Jul 2011 20:36:56 +0000 (13:36 -0700)]
cashew: fix cpplint errors

This CL fixes cpplint errors introduced in recent commits:
- whitespace fixes
- make members of ProcfsByteCounter::netdev_stats struct uint64s instead
  of unsigned longs.

BUG=chromium-os:18082
TEST=run cpplint, run unit tests, sanity check on device

Change-Id: Id09668360832d0ba09470ee54711f2e0df3bd7f1
Reviewed-on: http://gerrit.chromium.org/gerrit/4608
Tested-by: Vince Laviano <vlaviano@chromium.org>
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
3 years agocashew: fix assertion failure in ProcfsByteCounter dtor
Vince Laviano [Fri, 22 Jul 2011 00:38:15 +0000 (17:38 -0700)]
cashew: fix assertion failure in ProcfsByteCounter dtor

In ProcfsByteCounter, OnStatsUpdate invokes the delegate's
OnByteCounterUpdate callback. It's possible for the byte counter to be
deleted before this callback returns.

This CL fixes two issues related to this possible deletion:

1) ReadStats calls OnStatsUpdate before calling CloseProcNetDev. If the
counter is deleted before OnStatsUpdate returns, then there is an
assertion failure within the dtor because /proc/net/dev is still open.
This CL ensures that CloseProcNetDev is called before OnStatsUpdate to
prevent this assertion failure.

2) OnStatsUpdate updates baseline_stats_ after invoking the delegate's
OnByteCounterUpdate callback. If the counter is deleted during the
callback, accessing this member variable afterwards results in undefined
behavior. This CL changes OnStatsUpdate to update baseline_stats_
earlier before invoking the delegate's callback.

BUG=chromium-os:17997
TEST=unit tests and manual testing on device

Change-Id: I113350a9bfccd4d5e2601accc992ce656e79adf2
Reviewed-on: http://gerrit.chromium.org/gerrit/4548
Tested-by: Vince Laviano <vlaviano@chromium.org>
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
3 years agocashew: add metrics support
Vince Laviano [Thu, 14 Jul 2011 00:52:51 +0000 (17:52 -0700)]
cashew: add metrics support

This CL adds a MetricsManager class wrapping libmetrics and adds an
initial metric, Cros.Network.Cashew.UsageRequestStatus, that tracks the
success or failure of usage API requests.  We'll add additional metrics
in subsequent CLs.

BUG=chromium-os:9887
TEST=ran unit tests and performed manual testing on device, looking at
cashew logs and chrome://histograms.

Change-Id: I3c5b2fdb23d4203ba8466a831896630a9c5bab7e
Reviewed-on: http://gerrit.chromium.org/gerrit/4459
Tested-by: Vince Laviano <vlaviano@chromium.org>
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
3 years agoAdded methods to .xml to track users' data usage 780.B
Anne Kenyon [Wed, 22 Jun 2011 13:38:54 +0000 (09:38 -0400)]
Added methods to .xml to track users' data usage

BUG=chromium-os:16802
TEST=ran FEATURES=test emerge
Change-Id: Id9d8191bd743fd8b2ba2af8d151900ea3f3b3f05
Reviewed-on: http://gerrit.chromium.org/gerrit/3005
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Tested-by: Anne Kenyon (Chromium) <annemkenyon@chromium.org>
3 years agocashew: Don't depend on kernel-internal structures
Elly Jones [Fri, 3 Jun 2011 15:50:57 +0000 (11:50 -0400)]
cashew: Don't depend on kernel-internal structures

It was jolly convenient to be able to use the kernel's net_device_stats
structure, but those innocent days are behind us now. Define our own copy of it.

BUG=chromium-os:16105
TEST=Build

Change-Id: Ic5715754e7be0e206131a14acc71650d09f8754d
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: http://gerrit.chromium.org/gerrit/2032
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
3 years agocashew: remove GetConnectivityState from ServiceManagerMock 0.13.587.B
Vince Laviano [Tue, 31 May 2011 18:33:36 +0000 (11:33 -0700)]
cashew: remove GetConnectivityState from ServiceManagerMock

The CL for issue 3281 removed the GetConnectivityState method from the
ServiceManager class, but did not remove it from the mock for that
class. Fix this so that unit tests will build.

BUG=chromium-os:3281
TEST=FEATURES=test emerge-${BOARD} cashew

Change-Id: I4148f22f4e1f9d02990757feb1b7002c14a0f301
Reviewed-on: http://gerrit.chromium.org/gerrit/1834
Tested-by: Vince Laviano <vlaviano@chromium.org>
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
3 years agocashew: portal/online state is now a service state instead of separate connectivity...
Jason Glasgow [Wed, 4 May 2011 14:37:51 +0000 (10:37 -0400)]
cashew: portal/online state is now a service state instead of separate connectivity state

Change the connectivity state to be part of the overlay service state
so that code does not test two different state variables to determine
the service state.  When the service is in "portal" state, the error
property can be consulted for additional details on why the portal
state was detected.

This change depends on changes to flimflam.

BUG=3281
TEST=Connect to a 3G network and validate that cashew retrieves usage
information.

Change-Id: I8ac40ff3459d64965aee574c3a47b624a989eb67
Reviewed-on: http://gerrit.chromium.org/gerrit/271
Tested-by: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
3 years agocashew: log more info when compiled in NDEBUG mode 0.13.558.B
Vince Laviano [Tue, 24 May 2011 18:32:05 +0000 (11:32 -0700)]
cashew: log more info when compiled in NDEBUG mode

cashew doesn't produce enough diagnostic info when compiled with NDEBUG
defined. This CL converts debug DLOG msgs to production LOG msgs so that
we can better debug issues with production images.

BUG=chromium-os:12691
TEST= USE=-cros-debug FEATURES=test emerge-${BOARD} cashew
      boot image on device
      view contents of /var/log/cashew/cashewd.INFO

Change-Id: I1c163f4ae24dbb6dbb4f228841e2bd5c626b487b
Reviewed-on: http://gerrit.chromium.org/gerrit/1477
Tested-by: Vince Laviano <vlaviano@chromium.org>
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
3 years ago[cashew] Roll forward to new libchrome
Chris Masone [Thu, 12 May 2011 19:15:28 +0000 (12:15 -0700)]
[cashew] Roll forward to new libchrome

BUG=chromium-os:14304
TEST=build, unit tests

Change-Id: Icb8352e7b80e5ff44716bff24081c523aaca4b06
Reviewed-on: http://gerrit.chromium.org/gerrit/812
Reviewed-by: Vince Laviano <vlaviano@chromium.org>
Tested-by: Chris Masone <cmasone@chromium.org>
3 years agocashew: reset local counter on plan transition 0.11.241.B 0.11.257.B 0.11.257.B90 0.12.362.B 0.12.369.B 0.12.392.B 0.12.433.B 0.12.433.B109 0.12.433.B62 0.13.434.B 0.13.509.B 11.1.241.B
Vince Laviano [Fri, 11 Feb 2011 18:28:57 +0000 (10:28 -0800)]
cashew: reset local counter on plan transition

The local counter fails to estimate data usage correctly if it is active
during a transition from one plan to another. This CL is the first of
two that will resolve this issue. It addresses plan transitions due to
data quota exhaustion. The subsequent CL will address plan transitions
due to the expiration time having passed.

Changes:
- Add the ability to reset the local byte counter.
- Update OnByteCounterUpdate event handler to iterate over all active
  plans and assign measured data traffic appropriately to each plan in
  turn. If a plan is consumed, any overage is applied to the next active
  plan and the local byte counter is reset accordingly. This continues
  until we're either out of data to assign or out of active plans.
- Move the bulk of the ServiceImpl::OnByteCounterUpdate logic to the
  DataPlan class to isolate it for unit testing.

BUG=chromium-os:9860
TEST=unit tests, manual testing on device

Change-Id: Ibfe2ee15eb6b79cb4f6575f289629be8388e12f7

Review URL: http://codereview.chromium.org/6250171

3 years agocashew: gmock integration
Vince Laviano [Fri, 28 Jan 2011 21:44:25 +0000 (13:44 -0800)]
cashew: gmock integration

Separate interfaces from impls to support creation of mock
ServiceManager, Service, and Device objects.
Integrate gmock (Google C++ Mocking Framework).
Remove glib integration from public interfaces.

BUG=chromium-os:7775
TEST=unit tests (FEATURES=test emerge-<board> cashew)

Change-Id: I46156233836468d319710e578e9a08427964b7eb

Review URL: http://codereview.chromium.org/6395007

3 years agocashew: DataPlan: init struct tm properly before calling mktime
Vince Laviano [Fri, 14 Jan 2011 01:07:52 +0000 (17:07 -0800)]
cashew: DataPlan: init struct tm properly before calling mktime

This CL fixes an issue where the ZonelessTimeStringWithLocalPolicy
automated unit test fails nondeterministically.

DataPlan::TimeFromIso8601 calls strptime to convert a time string into a
struct tm and then calls mktime or timegm to convert that struct tm into
a time_t. strptime doesn't set the tm.tm_isdst field, but mktime uses
the uninitialized value of the field. This can cause the resulting time
to be an hour off because we assume that daylight savings time is in
effect when it really isn't, or vice versa.

The fix is two-fold: memset the stack-allocated struct tm to 0
prior to calling strptime to remove the nondeterminism (modulo which
half of the year it is), and explicitly set tm_isdst to the appropriate
value of -1 (meaning "I don't know, you figure it out") before calling
mktime.

See the strptime(3) and ctime(3) manpages for more info.

BUG=chromium-os:10950
TEST=unit tests (FEATURES=test emerge-<board> cashew)

Change-Id: If7506fc1683e9069c9fcebd3b0d6149895dec402

Review URL: http://codereview.chromium.org/6303002

3 years agocashew: fix NDEBUG build failure
Vince Laviano [Wed, 15 Dec 2010 19:17:09 +0000 (11:17 -0800)]
cashew: fix NDEBUG build failure

DCHECK_NOTNULL(foo) produces a "statement has no effect" error during
NDEBUG compilation, while DCHECK(foo != NULL) does not.

BUG=chromium-os:8800
TEST=USE=-cros-debug emerge-<board> cashew

Change-Id: I6e62d0e2f90f1412cd2d252a11e73623c308178d

TBR=djkurtz@chromium.org

3 years agocashew: add cros-debug support
Vince Laviano [Tue, 14 Dec 2010 21:32:41 +0000 (13:32 -0800)]
cashew: add cros-debug support

DCHECK macro in default clause of switch statement is compiled out when
cashew is compiled NDEBUG, causing a compilation error. Replace with a
CHECK macro.

Uncomment use of google::ShutdownGoogleLogging now that we have updated
glog to version 0.3.1 (see issue 8823).

BUG=chromium-os:8800
TEST=USE=-cros-debug emerge-<board> cashew

Change-Id: Ib60933ca908c2d383e6e241fcf77c2e32e8b92f9

Review URL: http://codereview.chromium.org/5696004

3 years agocashew: defer all D-Bus signal processing to main loop
Vince Laviano [Mon, 29 Nov 2010 21:53:23 +0000 (13:53 -0800)]
cashew: defer all D-Bus signal processing to main loop

Avoid libdbus-c++ deadlock issues with sending dbus messages in dbus
signal callbacks by doing as little as possible in these callbacks.

Instead, have the callbacks schedule dbus signal processing to be done
later from the main loop.

This blanket deferral should be simpler and more robust than trying to
defer specific actions such as Service deletion as we've done in
previous CLs.

BUG=chromium-os:8892
TEST=unit tests, manual testing on device (suspend/resume while
connected to 3G)

Change-Id: I05e9026f2ad253d503d6de702b108a4d261237de

Review URL: http://codereview.chromium.org/5380002

3 years agoRevert "cashew: do not delete DBus::ObjectProxy objects from D-Bus callbacks"
Vince Laviano [Wed, 24 Nov 2010 21:24:45 +0000 (13:24 -0800)]
Revert "cashew: do not delete DBus::ObjectProxy objects from D-Bus callbacks"

This reverts commit 35386a9949355d796f2b195b0577e5a39fe72477.

Reverting this CL in preparation for a more comprehensive CL that will
also address the DBus::ObjectProxy creation case, which can also trigger
a deadlock if done in a D-Bus callback.

Change-Id: Ic60a1eb517b1cd76997aa3f8e00b42c44eeb018c

BUG=chromium-os:8892
TEST=emerge cashew

Review URL: http://codereview.chromium.org/5284004

3 years agocashew: do not delete DBus::ObjectProxy objects from D-Bus callbacks
Vince Laviano [Wed, 24 Nov 2010 05:18:40 +0000 (21:18 -0800)]
cashew: do not delete DBus::ObjectProxy objects from D-Bus callbacks

This CL resolves a deadlock that causes cashew to hang indefinitely.

Deleting a subclass of DBus::ObjectProxy such as Service or Device
causes an unregister message to be sent to the bus daemon, and is
effectively the same as explicitly sending a D-Bus message from within a
D-Bus callback. As such, it can trigger the same libdbus-c++ deadlock
that caused issues 8516 and 8486.

We avoid this by scheduling deferred deletion of these objects from the
main loop.

BUG=chromium-os:8892
TEST=manual testing on device (suspend/resume while connected to 3G)

Change-Id: I5882bb581a2b3edb440954d1c32a41fef48ac48d

Review URL: http://codereview.chromium.org/5333003

3 years agocashew: don't propagate inactive plans to clients
Vince Laviano [Tue, 23 Nov 2010 05:13:12 +0000 (21:13 -0800)]
cashew: don't propagate inactive plans to clients

Filter inactive (future, expired, consumed) plans when responding to
client D-Bus requests or emitting D-Bus signals.

BUG=chromium-os:9397
TEST=unit tests, manual testing on device

Change-Id: Ie221823627b3864802100aa619aa04b8cb949ac7

Review URL: http://codereview.chromium.org/5321001

3 years agocashew: add local byte counters
Vince Laviano [Sat, 20 Nov 2010 03:56:47 +0000 (19:56 -0800)]
cashew: add local byte counters

The data provided by the carrier usage API isn't always updated in real
time after a cellular device has connected to the network, and carriers
would prefer if we didn't make frequent API requests.

So, instead of making periodic API requests and relying on the returned
data to be fresh, we hit the API once on connect to set a baseline and
then track usage relative to this baseline by looking at local network
interface counters maintained by the system.

This change should be transparent to our clients, who trust us to provide
the best info possible regardless of its source.

BUG=chromium-os:7770
TEST=unit tests, manual testing on device

Change-Id: Ib88dee5ee52d0e781f853356a3d68da714627bc8

Review URL: http://codereview.chromium.org/5180003

3 years agocashew: set User-Agent http header field when making requests
Vince Laviano [Wed, 17 Nov 2010 00:15:48 +0000 (16:15 -0800)]
cashew: set User-Agent http header field when making requests

BUG=chromium-os:9247
TEST=Manual testing on device.

Change-Id: I802cd05e8f170778200f6a3a5ab99ebb8d3728bb

Review URL: http://codereview.chromium.org/4978003

3 years agocashew: SeviceManager: remove incorrect assert
Vince Laviano [Tue, 9 Nov 2010 23:24:54 +0000 (15:24 -0800)]
cashew: SeviceManager: remove incorrect assert

In ServiceManager::ClearDefaultCellularService, we have the following
assert:

DCHECK(GetService(default_cellular_service_->GetPath()) != NULL);

This checks that we can look up the service pointed to by
|default_cellular_service_| with GetService, meaning that it's in our
|services_| collection.

The intent was to check that |default_cellular_service_| points to a
valid service before we attempt to interact with it, but this check is
inappropriate, because it is not always true that the default service is
in the |services_| collection.

In OnServicesUpdate, it's possible for ClearDefaultCellularService to be
called after the default service has been moved from |services_| to
|old_services| in preparation for its deletion. In this scenario,
GetService will fail to locate it and trip the assert even though
|default_cellular_service_| still points to a valid Service object.

Resolution:
Remove the assert. Our expectation was incorrect.

BUG=chromium-os:8935
TEST=Manual testing on device

Change-Id: I941b9dd06985b92737f553b215924792c7748575

Review URL: http://codereview.chromium.org/4746002

3 years agocashew: don't invoke D-Bus methods from within a D-Bus handler
Vince Laviano [Wed, 3 Nov 2010 18:34:48 +0000 (11:34 -0700)]
cashew: don't invoke D-Bus methods from within a D-Bus handler

Call D-Bus methods from main loop to avoid deadlock (see issue 8486)
Set D-Bus connection timeout to 1 sec instead of using 25 sec default
Retry failed or timed out D-Bus calls

BUG=chromium-os:8516
TEST=Manual testing on device, with flimflam running and not running.

Change-Id: I27de7b539ceacc0471e89f595154fdb04fd74e5a

Review URL: http://codereview.chromium.org/4304002

3 years agocashew: ServiceManager: clear default service before deleting it
Vince Laviano [Tue, 2 Nov 2010 00:13:17 +0000 (17:13 -0700)]
cashew: ServiceManager: clear default service before deleting it

This CL prevents an ordering of events that creates a dangling
pointer that leads to a crash.

Root cause: OnServicesUpdate deletes services that did not appear in the
most recent update from flimflam and also reevaluates the default
service based on the ordering of the service paths in the update. If the
current default cellular service fails to appear in the most recent
update, we delete it, but we erroneously don't first clear the
|default_cellular_service_| ptr that holds a reference to it.  Shortly
thereafter, when reevaluating the default service and attempting to
clear the old default service, we make a method call through the
dangling ptr to notify the (already deleted) service that it is no
longer the default. Badness ensues.

Resolution: Clear the default service earlier. If, after processing an
update in OnServicesUpdate, the default cellular service is scheduled
for deletion, we call ClearDefaultServices prior to deleting the
service. This clears |default_cellular_service_| and prevents the
subsequent crash during OnDefaultServiceUpdate.

BUG=chromium-os:8326
TEST=manual testing on device, configuring 3G as default and then
causing it to go away abruptly by killing cromo

Change-Id: I9cba07d2e744d71677040b232025e744eac92f71

Review URL: http://codereview.chromium.org/4129011

4 years agocashew: fork Value and JSONReader from libchrome and add 64-bit int support
Vince Laviano [Sun, 31 Oct 2010 00:22:24 +0000 (17:22 -0700)]
cashew: fork Value and JSONReader from libchrome and add 64-bit int support

Rationale:
JSONReader returns Value objects, but these objects don't support
int64s. Instead, JSONReader promotes overflowing numeric values to
doubles. Our JSON data plan representations contain such overflowing
values (byte counters), and we'd like them to be returned as int64s.
It's cleaner than the current behavior and it allows our counters to
assume the full range of an int64.

Changes:
Integrate libchrome Value and its unit tests into cashew
Integrate libchrome JSONReader and its unit tests into cashew
Add int64 support to Value
Add int64 support to JSONReader
Update JSONReader unit tests
Tweak integrated code to pass cpplint
Update DataPlan to use int64 Values that may be returned
Add DataPlan unit tests that exercise parsing large integers

Note:
It's infeasible to rev the version of libchrome to which Chromium OS
is pinned at this time, but we plan to upstream these changes as soon
as possible.

BUG=chromium-os:7774,chromium-os:7775
TEST=unit tests, manual testing on device

Change-Id: I20ac194f8594b4f9e15333e8cfc87fa7cc744d67

Review URL: http://codereview.chromium.org/4204006

4 years agocashew: patch in libcurl_http_fetcher changes from update_engine
Vince Laviano [Thu, 28 Oct 2010 04:44:47 +0000 (21:44 -0700)]
cashew: patch in libcurl_http_fetcher changes from update_engine

This patches in update_engine commit
60e1415b31b58bc17017d29c8e06f6e5452fdf4e (AU: Watch for writes on write
fds only, and for reads on read fds.)

original code review is here:
http://codereview.chromium.org/4190009

This fix addresses a CPU consumption issue.

BUG=chromium-os:7974
TEST=Manual testing on device, running top

Change-Id: I673feef97fa8678ece21059c877e453b113fe033

Review URL: http://codereview.chromium.org/4116007

4 years agocashew: data plans: used bytes should be optional for unlimited plans
Vince Laviano [Wed, 27 Oct 2010 20:15:24 +0000 (13:15 -0700)]
cashew: data plans: used bytes should be optional for unlimited plans

BUG=chromium-os:8231,chromium-os:7775
TEST=unit tests

Change-Id: I2042c7fe4c8cd93172a8719fd8da020bc164cb7b

Review URL: http://codereview.chromium.org/4114002

4 years agocashew: libcurl http fetcher: use default CA certificate path
Vince Laviano [Wed, 27 Oct 2010 17:54:17 +0000 (10:54 -0700)]
cashew: libcurl http fetcher: use default CA certificate path

Modify LibcurlHttpFetcher to use the default CA certificate path instead
of a custom path

Cherrypick change introducing LibcurlHttpFetcher::GetHttpResponseCode
method from update_engine, and augment it with better error logging when
curl_easy_getinfo call fails.

Tweak Service::OnUsageUrlUpdate to make it easier to override the
incoming url.

BUG=chromium-os:8225
TEST=Manual testing. Overrode url to be an https url and performed
requests against https-enabled test server. Observed results in logs.

Change-Id: I7a106cb62385b48fdfc6b49c6042a3c29f92ac9d

Review URL: http://codereview.chromium.org/4203001

4 years agocashew: default policy: reduce request timer frequency
Vince Laviano [Tue, 26 Oct 2010 22:04:17 +0000 (15:04 -0700)]
cashew: default policy: reduce request timer frequency

Reduce default request timer frequency from once per minute to once
every ten minutes. This will reduce load on the usage API and reduce
user data consumption.

Add unit tests for DefaultPolicy

BUG=chromium-os:8188, chromium-os:7775
TEST=unit tests, manual testing on device

Change-Id: I015e3152971e6dad32cc36e77b96e9e8bf753cb4

Review URL: http://codereview.chromium.org/4201001

4 years agocashew: accept usage API replies with no timezone information
Vince Laviano [Tue, 26 Oct 2010 17:12:05 +0000 (10:12 -0700)]
cashew: accept usage API replies with no timezone information

Accept timestamps with no timezone suffix
Add gtest automated unit test infrastructure
Add unit tests for timestring conversion

BUG=chromium-os:7963,chromium-os:7775
TEST=FEATURES=test emerge-<board> cashew

Change-Id: I108f791e2192ee58f268c9f372c4eda41576f3ab

Review URL: http://codereview.chromium.org/4091002

4 years agocashew: support "usage requests allowed OTA only" policy
Vince Laviano [Wed, 20 Oct 2010 21:07:33 +0000 (14:07 -0700)]
cashew: support "usage requests allowed OTA only" policy

BUG=chromium-os:7769
TEST=Manual: connect to 3G and observe logs while unplugging/plugging
ethernet

Change-Id: I70498abe97b1eb85e3bd6cc8ae20ecda6f7650b9

Review URL: http://codereview.chromium.org/3764012

4 years agocashew: support additional usage API error result strings
Vince Laviano [Fri, 15 Oct 2010 17:42:58 +0000 (10:42 -0700)]
cashew: support additional usage API error result strings

BUG=chromium-os:7728
TEST=Manual

Change-Id: I0cbf2f95605dff132ecb7f776b1d40e1925fbe4f

Review URL: http://codereview.chromium.org/3797006

4 years agocashew: Service: set "in progress" flag before requesting usage update
Vince Laviano [Thu, 14 Oct 2010 02:44:43 +0000 (19:44 -0700)]
cashew: Service: set "in progress" flag before requesting usage update

This CL fixes an inconsistency in the request_in_progress_ flag that
triggers an assertion failure.

Root cause: OnRequestComplete asserts that the request_in_progress_ flag
is set. RequestUsageUpdate sets the flag *after* initiating an update via
DataPlanProvider::RequestUsageUpdate. However, it's possible for the
OnRequestComplete callback to be invoked from within this initial call,
prior to the flag being set.

Resolution: Set the flag first, then initiate the update.

BUG=chromium-os:7687
TEST=None

Change-Id: I302093d0ae51107aed350e590327e7a9f44a2ae0

Review URL: http://codereview.chromium.org/3764005

4 years agoCashew: implement backend usage API
Vince Laviano [Mon, 11 Oct 2010 22:10:16 +0000 (15:10 -0700)]
Cashew: implement backend usage API

BUG=chromium-os:7330
TEST=libcros/monitor_network and manual testing

Change-Id: I65e0035c0cc83ee3343b9e66e9a76ad553fe04ba

Review URL: http://codereview.chromium.org/3528016

4 years agoCashew: track cellular service state.
Vince Laviano [Wed, 6 Oct 2010 20:42:56 +0000 (13:42 -0700)]
Cashew: track cellular service state.

BUG=chromium-os:7190
TEST=libcros/monitor_network and manual testing, observing cashew logs

Change-Id: I60a175f72dc665e12ab0eaa1c87054ad4c2dfe8b

Review URL: http://codereview.chromium.org/3576011

4 years agoD-Bus API: Add GetDataPlans, DataPlansUpdate, and RequestDataPlansUpdate
Vince Laviano [Thu, 30 Sep 2010 22:33:38 +0000 (15:33 -0700)]
D-Bus API: Add GetDataPlans, DataPlansUpdate, and RequestDataPlansUpdate

Implement "the real" D-Bus API for use by libcros. Returns hardcoded test data for now.

The related CL for libcros changes is: http://codereview.chromium.org/3578003/show

BUG=chromium-os:3510
TEST=libcros/monitor_network

Change-Id: I50530f90a083f6bdba3ef15c718c43e94e308f50

Review URL: http://codereview.chromium.org/3595001

4 years agoImplement org.chromium.Cashew D-Bus interface
Vince Laviano [Fri, 17 Sep 2010 21:17:02 +0000 (14:17 -0700)]
Implement org.chromium.Cashew D-Bus interface

BUG=chromium-os:3510
TEST=dbus-send --system --print-reply --dest=org.chromium.Cashew \
  /org/chromium/Cashew org.chromium.Cashew.IsAlive

Change-Id: If899f5991a6328562633f0e24ccf59b01b285159

Review URL: http://codereview.chromium.org/3384011

4 years agoRun cashew in minijail with its own uid instead of as root.
Vince Laviano [Tue, 7 Sep 2010 20:46:43 +0000 (13:46 -0700)]
Run cashew in minijail with its own uid instead of as root.

BUG=chromium-os:6435
TEST=ps -ef | grep cashew; ls -al /var/log/cashew

Change-Id: Id630471f74d9ef7192f4e49479107de15a4185cb

Review URL: http://codereview.chromium.org/3325013

4 years agoAdd LICENSE file
J. Richard Barnette [Thu, 5 Aug 2010 21:13:48 +0000 (14:13 -0700)]
Add LICENSE file

4 years agoClean cashew logs from post-stop stanza in upstart script.
Vince Laviano [Mon, 2 Aug 2010 22:55:51 +0000 (15:55 -0700)]
Clean cashew logs from post-stop stanza in upstart script.

BUG=chromium-os:5288
TEST=Stop cashew. Observe that old logs are deleted.

Review URL: http://codereview.chromium.org/3043045

4 years agoCreate cashew log directory from pre-start stanza in upstart script.
Vince Laviano [Sat, 31 Jul 2010 01:09:59 +0000 (18:09 -0700)]
Create cashew log directory from pre-start stanza in upstart script.

BUG=chromium-os:5253
TEST=Stop cashew (sudo /sbin/stop cashew). Delete log directory (sudo rm -rf /var/log/cashew). Start cashew (sudo /sbin/start cashew). Observe that log directory has been created. Restart cashew (sudo /sbin/restart cashew). Observe that existing log directory has not been disrupted.

Review URL: http://codereview.chromium.org/3036032

4 years agoAdd "stop on" stanza to cashew upstart script to prevent repeated respawning during...
Vince Laviano [Fri, 30 Jul 2010 18:58:50 +0000 (11:58 -0700)]
Add "stop on" stanza to cashew upstart script to prevent repeated respawning during system shutdown.

BUG=chromium-os:5245
TEST=Shutdown system and observe from logs that cashew is not respawned repeatedly.

Review URL: http://codereview.chromium.org/3048037

4 years agoImplement basic infrastructure for cashew daemon.
Vince Laviano [Thu, 24 Jun 2010 01:45:42 +0000 (18:45 -0700)]
Implement basic infrastructure for cashew daemon.

BUG=chromium-os:3519
TEST=Built and installed on st8. Tested cashewd flags, logging, signal handling, and upstart launch/respawn.

Review URL: http://codereview.chromium.org/2812018

4 years agoAdd inherit-review-settings-ok file.
Vince Laviano [Wed, 16 Jun 2010 18:23:42 +0000 (11:23 -0700)]
Add inherit-review-settings-ok file.

4 years agoInitialize repo.
Vince Laviano [Fri, 11 Jun 2010 20:43:55 +0000 (13:43 -0700)]
Initialize repo.