chromiumos/platform/flimflam.git
20 months agoflimflam-test: Remove duplicate scripts from flimflam-test 49/44049/3 factory-spring-3842.B firmware-spring-3824.4.B firmware-spring-3824.55.B firmware-spring-3824.84.B firmware-spring-3824.B firmware-spring-3833.B master release-R27-3912.B release-R28-4100.B stabilize-3881.0.B stabilize-3912.79.B stabilize-4008.0.B stabilize-4035.0.B stabilize-4068.0.B stabilize-4100.38.B stabilize-spring-4100.53.B toolchainA toolchainB
Christopher Wiley [Sat, 23 Feb 2013 00:51:23 +0000 (16:51 -0800)]
flimflam-test: Remove duplicate scripts from flimflam-test

To prevent developers from modifying these scripts, not knowing that more
recent code is in src/platform/shill/test-scripts, remove the scripts.
Leave a note in their place pointing to where they have gone.  In
time, we'll delete the whole package.

BUG=chromium-os:39146
TEST=These scripts aren't being used anymore, because people have
noticed a problem where the migration missed a recently added script.

Change-Id: I54d3cc989dcd7daba4f78d9df57af2d4bdf26f6b
Reviewed-on: https://gerrit.chromium.org/gerrit/44049
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>
Tested-by: Christopher Wiley <wiley@chromium.org>
21 months agoflimflam-test: Add script to clean up profiles 17/42717/4
bowgotsai [Wed, 6 Feb 2013 11:01:51 +0000 (19:01 +0800)]
flimflam-test: Add script to clean up profiles

We have profile related test in wifi autotest:
  network_WiFiManager/091_ProfileProperties
  network_WiFiManager/092_ProfileCredentials
  network_WiFiManager/093_ProfilePopPush
  network_WiFiManager/094_ProfileDelete

Sometimes the test die and leaves the profile stack in a weird state.
Add this script to clean up profiles until 'default' profile is found.

BUG=chromium-os:35374
TEST=/user/local/lib/flimflam/test/create-profile test1
     /user/local/lib/flimflam/test/create-profile test2
     /user/local/lib/flimflam/test/push-profile test1
     /user/local/lib/flimflam/test/push-profile test2
     /user/local/lib/flimflam/test/clean-profiles

Change-Id: If7816f848b688e77808045b078c7e3ccf7795f3e
Reviewed-on: https://gerrit.chromium.org/gerrit/42717
Commit-Queue: Bowgo Tsai <bowgotsai@chromium.org>
Tested-by: Bowgo Tsai <bowgotsai@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
21 months agoflimflam-test: Fix small pylint errors in more scripts 07/42307/4 stabilize-3701.30.0 stabilize-3701.30.0b stabilize-bluetooth-smart
Christopher Wiley [Wed, 30 Jan 2013 17:32:31 +0000 (09:32 -0800)]
flimflam-test: Fix small pylint errors in more scripts

Mostly fix extra imports, rename some variables that redefined python
keywords, and remove semi-colons.

BUG=chromium-os:38166
TEST=Pylint whines less.

Change-Id: I4504f78ac1dd58c6e41199367fd3279ada8f9f11
Reviewed-on: https://gerrit.chromium.org/gerrit/42307
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>

21 months agoflimflam-test: Fix last pylint errors 48/42348/4 stabilize-3658.0.0
Christopher Wiley [Wed, 30 Jan 2013 23:14:22 +0000 (15:14 -0800)]
flimflam-test: Fix last pylint errors

Mark a bunch of method parameters as unused to pass static checks.
Properly throw NotImplementedErrors for abstract methods, and redefine
the abstract method for the static checker.

I've disabled the checks for whether the unary '=' has spaces around it
so that these default parameters don't fail.  Apparently in this area,
pylint differs from PEP8.

TEST=No Pylint errors
BUG=chromium-os:38166

Change-Id: Ia6cfb95a223912b586689559928fc00eb319b1da
Reviewed-on: https://gerrit.chromium.org/gerrit/42348
Reviewed-by: Thieu Le <thieule@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>
Tested-by: Christopher Wiley <wiley@chromium.org>
21 months agoflimflam-test: Clean up pylint errors in mm-* scripts 24/42324/4
Christopher Wiley [Wed, 30 Jan 2013 17:26:33 +0000 (09:26 -0800)]
flimflam-test: Clean up pylint errors in mm-* scripts

Fix spacing and pylint errors in mm-* scripts.

BUG=chromium-os:38166
TEST='ls | grep mm | xargs pylint' doesn't complain about these files.
Change-Id: I6658edc7f3bba27f0eb486f8e5190cf388f4a8bd
Reviewed-on: https://gerrit.chromium.org/gerrit/42324
Commit-Queue: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Tested-by: Christopher Wiley <wiley@chromium.org>
21 months agoflimflam-test: Fix spacing to align with autotest 08/42308/4
Christopher Wiley [Wed, 30 Jan 2013 17:37:18 +0000 (09:37 -0800)]
flimflam-test: Fix spacing to align with autotest

These three files were written with 2 spaces, which is admirable and
pure of heart, but not PEP-8 or autotest compliant.  Fix this.  Along
the way clean up little pylint nits.

BUG=chromium-os:38166
TEST=Pylint whines less.

Change-Id: I66aaa7cf7036eacd6163ed9a9170653df90815e9
Reviewed-on: https://gerrit.chromium.org/gerrit/42308
Commit-Queue: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Tested-by: Christopher Wiley <wiley@chromium.org>
21 months agoflimflam-test: Remove set-passphrase 00/42200/2
Christopher Wiley [Tue, 29 Jan 2013 02:21:50 +0000 (18:21 -0800)]
flimflam-test: Remove set-passphrase

This script deals with the concept of networks and passphrases, which
we don't support in shill.  Remove it.

BUG=chromium-os:38166
TEST=None

Change-Id: I925f4e61d3f8c5a582dbc350f657807722125d01
Reviewed-on: https://gerrit.chromium.org/gerrit/42200
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>

21 months agoflimflam-test: Remove the last agent related code 85/42185/2
Christopher Wiley [Tue, 29 Jan 2013 00:25:06 +0000 (16:25 -0800)]
flimflam-test: Remove the last agent related code

shill has no concept of agents, and so we don't need to carry this code
forward.  Also remove the parts of flimflam.py which are consumed by
this test script.

BUG=chromium-os:38166
TEST=Pylint is slightly happier with this directory.

Change-Id: I63dcf924e95942363750056c355421b2e8c24fe2
Reviewed-on: https://gerrit.chromium.org/gerrit/42185
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>

21 months agoflimflam-test: Fix syntax error in mm-disconnect 55/42155/2
Christopher Wiley [Mon, 28 Jan 2013 22:13:47 +0000 (14:13 -0800)]
flimflam-test: Fix syntax error in mm-disconnect

This triggers pylint warnings and even a cursory glance reveals that
this would trigger an exception at runtime.  This was apparently broken
in b9582b442509904e4b18ba6f40fc4e47f6b858db when the line defining
manager was removed in a refactoring.

TEST=Pylint no longer complains
BUG=None

Change-Id: Ieb055f7fb5a379b107f98c83b6b3b3191ae59a04
Reviewed-on: https://gerrit.chromium.org/gerrit/42155
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>

21 months agoflimflam-test: Fix simple pylint errors 30/42130/2
Christopher Wiley [Mon, 28 Jan 2013 19:57:46 +0000 (11:57 -0800)]
flimflam-test: Fix simple pylint errors

I've gone through the first few files in flimflam test and cleaned up
the simple pylint errors.  This was mostly just indentation errors, poor
imports, and minor python syntax issues.

BUG=chromium-os:38166
TEST=Many few pylint warnings

Change-Id: I8291f459741f32e557c3a935e82d85eefa9eb5bb
Reviewed-on: https://gerrit.chromium.org/gerrit/42130
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>

21 months agoflimflam-test: Refactor and clean flimflam.py 74/41874/2
Christopher Wiley [Wed, 23 Jan 2013 22:25:22 +0000 (14:25 -0800)]
flimflam-test: Refactor and clean flimflam.py

Fix a lot of spacing issues, and make some methods static so that pylint
is happy.  Change two instances where we accessed dbus exception name
strings directly to use getters.

BUG=chromium-os:38166
TEST=Connected and disconnect from WiFi network via script.

Change-Id: I9d1698a187c3caa5dc9441cf3b9471a8a43f4086
Reviewed-on: https://gerrit.chromium.org/gerrit/41874
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>

21 months agoflimflam-test: Remove list-networks 56/41856/2
Christopher Wiley [Wed, 23 Jan 2013 19:58:56 +0000 (11:58 -0800)]
flimflam-test: Remove list-networks

This script used to have some meaning when we were using flimflam,
however, now we use shill and it doesn't even work.  Let it go.

BUG=chromium-os:38107
TEST=None

Change-Id: I5d12ba622d1724ca3c83f79948e69412f55ca4c6
Reviewed-on: https://gerrit.chromium.org/gerrit/41856
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>

22 months agoflimflam-test: Remove tabs from python scripts 91/41891/2
Christopher Wiley [Wed, 23 Jan 2013 23:27:08 +0000 (15:27 -0800)]
flimflam-test: Remove tabs from python scripts

At no point in time was it ever ok to put tabs in python scripts.  Let
our great holy war against tabs continue and these files be cleansed.

BUG=chromium-os:38166
TEST=pylint doesn't complain about indentation errors

Change-Id: If1050b3afb0be941ed3c4205e5fa33f89f1ed106
Reviewed-on: https://gerrit.chromium.org/gerrit/41891
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>

22 months agoflimflam-test: Remove simple-agent 83/41883/2
Christopher Wiley [Wed, 23 Jan 2013 23:29:03 +0000 (15:29 -0800)]
flimflam-test: Remove simple-agent

shill has no concept of agents, so this code is no longer needed.

BUG=chromium-os:38166
TEST=None

Change-Id: I1de1066ed16ba5044d6181b566c97bac556753f3
Reviewed-on: https://gerrit.chromium.org/gerrit/41883
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>

2 years agoflimflam_test: flimflam.py: Increase DisableTechnology() timeout. 53/38153/2 factory-3536.B release-R25-3428.B stabilize-3428.110.0 stabilize-3428.149 stabilize-3428.149.B stabilize-3428.193 stabilize2 toolchain-3428.65.B
Thieu Le [Thu, 15 Nov 2012 22:09:34 +0000 (14:09 -0800)]
flimflam_test: flimflam.py: Increase DisableTechnology() timeout.

BUG=chromium-os:32647
TEST=cellular_ModemControl

Change-Id: I79c7084b18f891c9f0ac88ecaad577f184de5f67
Reviewed-on: https://gerrit.chromium.org/gerrit/38153
Reviewed-by: Arman Uguray <armansito@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
2 years agoflimflam_test: Add netmask when configuring backchannel ethernet. 50/38150/4
Thieu Le [Thu, 15 Nov 2012 22:01:04 +0000 (14:01 -0800)]
flimflam_test: Add netmask when configuring backchannel ethernet.

Specifying a netmask allows the kernel to add the correct network route
to the backchannel ethernet interface.

BUG=chromium-os:36385
TEST=Setup backchannel and verify the netmask is the same as eth0

Change-Id: I20538c05720bfbc440670fdd560638ccf0c19a6e
Reviewed-on: https://gerrit.chromium.org/gerrit/38150
Commit-Ready: Thieu Le <thieule@chromium.org>
Reviewed-by: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
2 years agoAdd functions to return wimax service/device objects
Stanley Wong [Mon, 29 Oct 2012 21:59:51 +0000 (14:59 -0700)]
Add functions to return wimax service/device objects

Added FindWimaxDevice and FindWimaxService that returns
the device object and service object respectively.

BUG=None
TEST=network_MobileSuspendResume should work devices with cellular and wimax modems.

Change-Id: Iba522abedd6856816993c9268c1c0c9aa147b04d
Reviewed-on: https://gerrit.chromium.org/gerrit/36832
Reviewed-by: Ben Chan <benchan@chromium.org>
Reviewed-by: Stanley Wong <stanleyw@chromium.org>
Tested-by: Stanley Wong <stanleyw@chromium.org>
Commit-Ready: Stanley Wong <stanleyw@chromium.org>

2 years agoCHROMIUMOS: "flimflam" init file is now named "shill"
Paul Stewart [Wed, 31 Oct 2012 15:40:54 +0000 (08:40 -0700)]
CHROMIUMOS: "flimflam" init file is now named "shill"

BUG=chromium-os:35909
TEST=Run backchannel

Change-Id: I2acde2fe57423180306b1db902840c9808c84a40
Reviewed-on: https://gerrit.chromium.org/gerrit/37017
Reviewed-by: Thieu Le <thieule@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
2 years agoflimflam: flimflam.py: Supply Passphrase argument only when non-empty
Paul Stewart [Mon, 15 Oct 2012 16:55:42 +0000 (09:55 -0700)]
flimflam: flimflam.py: Supply Passphrase argument only when non-empty

Passing a passphrase argument to shill when the network is open
causes an error.  Don't do that.

BUG=chromium-os:35316
TEST=Run connect-wifi on both open and WPA networks

Change-Id: I1f0a310360532485c83e0edde75ae1533ed97fc4
Reviewed-on: https://gerrit.chromium.org/gerrit/35579
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
2 years agoflimflam: Fix shill debug level. factory-2993.B factory-3004.B
Ben Chan [Wed, 3 Oct 2012 23:43:25 +0000 (16:43 -0700)]
flimflam: Fix shill debug level.

BUG=None
TEST=Run cellular_Smoke and verify that shill logs at verbose level 4.

Change-Id: Ieaac9e5dd721553848bc14ee877cd98cc2631e21
Reviewed-on: https://gerrit.chromium.org/gerrit/34586
Commit-Ready: Ben Chan <benchan@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
2 years ago3G: Unable to connect to gsm modem using fake-gsm-modem factory-2985.B
Arman Uguray [Wed, 26 Sep 2012 23:55:37 +0000 (16:55 -0700)]
3G: Unable to connect to gsm modem using fake-gsm-modem

Shill crashed when it tried to interact with fake-gsm-modem, because
flimflam_test.py did not respond to some DBus messages. This CL
implements the following DBus properties:

    org.freedesktop.ModemManager.Modem.Gsm.Network:

        AllowedMode
        AccessTechnology

    org.freedesktop.ModemManager.Modem.Gsm.Card:

        EnabledFacilityLocks

    org.freedesktop.ModemManager.Modem and
    org.freedesktop.ModemManager.Modem.Cdma:

        Changed MEID to Meid

This CL also updates the steps to test shill using fake-gsm-modem as
described in the comments in fake-gsm-modem.

BUG=chromium-os:34552
TEST=Repeated the following steps on a Lumpy with GOBI3000 modem:

    $ stop flimflam
    $ stop cromo
    $ /usr/local/lib/flimflam/test/veth setup pseudomodem0 172.16.1
    $ /usr/local/lib/flimflam/test/fake-gsm-modem -c tmobile --shill
    $ start flimflam

    T-Mobile should appear as a connectable network in the UI.
    Furthermore, running 'modem status' in crosh should display
    info for TestModem. shill shouldn't crash.

    Cleanup:
    $ stop flimflam
    $ # kill fake-gsm-modem
    $ /usr/local/lib/flimflam/test/veth teardown pseudomodem0
    $ start cromo
    $ start flimflam

Change-Id: If1060e2816e6a720ee258adbbc7b2a6c230915c1
Reviewed-on: https://gerrit.chromium.org/gerrit/34154
Reviewed-by: Thieu Le <thieule@chromium.org>
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Arman Uguray <armansito@chromium.org>
Tested-by: Arman Uguray <armansito@chromium.org>
2 years agoflimflam: Fix compilation errors when compiling with glib 2.32. factory-2914.B stabilize stabilize-link
Ben Chan [Sat, 8 Sep 2012 18:44:23 +0000 (11:44 -0700)]
flimflam: Fix compilation errors when compiling with glib 2.32.

This CL makes the following changes to make the code compatible with
glib 2.30 and 2.32:
- Include glib.h instead of glib/ghash.h as the latter should not be
  included directly.
- Use g_ascii_strcasecmp() instead of g_strcasecmp() for
  case-insensitive comparison of ASCII-only strings. g_strcasecmp() has
  been deprecated.
- Use g_atomic_int_add() instead of g_atomic_int_exchange_and_add().
  g_atomic_int_add() is identical to g_atomic_int_exchange_and_add()
  since glib 2.30 where the latter has been deprecated.
- Use g_io_channel_read_chars() instead of g_io_channel_read() for
  reading binary data from an unbuffered GIO channel without encoding.

BUG=chromium-os:34103
TEST=emerge flimflam with glib 2.30.2 and 2.32.4

Change-Id: I6333472ba8071566de3d0eafd446bcc58f003062
Reviewed-on: https://gerrit.chromium.org/gerrit/32655
Commit-Ready: Ben Chan <benchan@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
2 years agoflimflam_test: Change pseudo modem name to be DBus friendly. factory-2846.B factory-2848.B firmware-butterfly-2788.B firmware-stout-2817.B
Thieu Le [Fri, 17 Aug 2012 18:07:34 +0000 (11:07 -0700)]
flimflam_test: Change pseudo modem name to be DBus friendly.

Shill uses the device name in the DBus path so we need to remove the
dash from the name since it's not a valid DBus character.

BUG=chromium-os:33161
TEST=network_ConnmanCromoCrash

Change-Id: I3484d797f84684cae143037e3a8bb75e454c183c
Reviewed-on: https://gerrit.chromium.org/gerrit/30720
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
2 years agoflimflam_test: Make connect-service work with shill.
Thieu Le [Fri, 17 Aug 2012 17:50:07 +0000 (10:50 -0700)]
flimflam_test: Make connect-service work with shill.

Look for the service using the name property and add retry when
connecting to the service.  The retry is needed because
network_ConnmanCromoCrash starts the connect request before starting the
pseudo modem/manager.

BUG=chromium-os:33161
TEST=network_ConnmanCromoCrash

Change-Id: Ib55bee919204624a795d9c95e8e4028df5ff5a55
Reviewed-on: https://gerrit.chromium.org/gerrit/30718
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
2 years agoflimflam: Fix set_apn issues. factory-2717.B factory-2723.14.B release-R22-2723.B
Ben Chan [Fri, 3 Aug 2012 17:31:26 +0000 (10:31 -0700)]
flimflam: Fix set_apn issues.

This CL fixes set_apn to work on 64-bit platforms and be compatible with
shill.

BUG=chromium-os:33179
TEST=Tested the following commands with flimflam and shill:
1. set_apn
2. set_apn -c
3. set_apn -u <username> -p <password> <apn>
4. set_apn -n <network_id> -u <username> -p <password> <apn>

Change-Id: I1a442d59e601586fee36a17d5daeea2919a24487
Reviewed-on: https://gerrit.chromium.org/gerrit/29195
Reviewed-by: Thieu Le <thieule@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
2 years agoflimflam.py: Set debug level when setting debug tag for shill. firmware-link-2695.2.B firmware-link-2695.B firmware-snow-2695.90.B firmware-snow-2695.B
Thieu Le [Tue, 31 Jul 2012 00:50:24 +0000 (17:50 -0700)]
flimflam.py: Set debug level when setting debug tag for shill.

BUG=chromium-os:33091
TEST=network_3GDisableWhileConnecting

Change-Id: I14836a9a5d8a64aed7f7aba1c273810e1c099def
Reviewed-on: https://gerrit.chromium.org/gerrit/28744
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
2 years agoflimflam: flimflam.py: Add support for enabling devices in shill.
Thieu Le [Mon, 30 Jul 2012 21:25:45 +0000 (14:25 -0700)]
flimflam: flimflam.py: Add support for enabling devices in shill.

BUG=chromium-os:33075
TEST=cellular_Signal, cellular_Smoke

Change-Id: I2c742e3b5dbc61ad735833c92fc8b8ab6829b7e5
Reviewed-on: https://gerrit.chromium.org/gerrit/28720
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Thieu Le <thieule@chromium.org>
Tested-by: Thieu Le <thieule@chromium.org>
2 years ago[flimflam] allow debugd to call GetProperties firmware-parrot-2685.B
Elly Jones [Thu, 26 Jul 2012 15:32:52 +0000 (11:32 -0400)]
[flimflam] allow debugd to call GetProperties

BUG=chromium-os:32806
TEST=platform_DebugDaemonGetNetworkStatus

Change-Id: I6fea070c7b2783a1027f12804a1226fda39237de
Signed-off-by: Elly Jones <ellyjones@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/28490
Reviewed-by: Paul Stewart <pstew@chromium.org>
2 years agoExtend mm_debug to support various modem managers.
Ben Chan [Sun, 22 Jul 2012 01:13:56 +0000 (18:13 -0700)]
Extend mm_debug to support various modem managers.

BUG=chromium-os:32803
TEST=Tested mm_debug with cromo, ModemManager, and ModemManager1.

Change-Id: I05c78d28f360af55a343c2000d2e842774d31411
Reviewed-on: https://gerrit.chromium.org/gerrit/28134
Commit-Ready: Ben Chan <benchan@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
2 years agoAdd Dbus.Service property to modem devices. factory-2460.B factory-2475.B factory-2569.B
Jason Glasgow [Wed, 13 Jun 2012 18:53:03 +0000 (14:53 -0400)]
Add Dbus.Service property to modem devices.

Add DBus.Service property to modem devices so that Chrome can watch
for signals on the service name rather than the connection name.

BUG=chromium-os:31575
TEST=Read instructions in fake-gsm-modem for running with flimflam.
TEST=run /usr/local/lib/flimflam/test/fake-gsm-modem -s 3 -S, ctrl-c, re-run

Change-Id: Ide5d0a9250ff9ca176805a22e2e077b28ad221ae
Reviewed-on: https://gerrit.chromium.org/gerrit/25314
Tested-by: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
2 years agoCHROMIUMOS: flimflam: Disable or reduce frequency of background scan
Paul Stewart [Sun, 10 Jun 2012 19:51:59 +0000 (12:51 -0700)]
CHROMIUMOS: flimflam: Disable or reduce frequency of background scan

Due to receint issues found with background scan, reduce the
frequency of background scan in campus environments where
multiple networks are avaialbe.  In situations where no
other networks are available that provide the same service,
disable background scanning completely.

This behavior can be overridden by explicitly specifying
a background scan method to the device.

BUG=chromium-os:31617
TEST=Test with a network with only one visible AP and observe background
scan disabled.  Test with a campus network with more than one visible AP,
and observer background scan enabled with interval 3601.

Change-Id: I84ee37e5fc3382ded60cbf612e443f542306b515
Reviewed-on: https://gerrit.chromium.org/gerrit/24960
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
2 years agoflimflam: Add simulation of SMS message to fake-modem
Jason Glasgow [Tue, 29 May 2012 19:39:08 +0000 (15:39 -0400)]
flimflam: Add simulation of SMS message to fake-modem

BUG=none
TEST=run fake-gsm modem, observe UI

Change-Id: I1f1204fc2f6d872b460d2f7d729360af25e082c2
Reviewed-on: https://gerrit.chromium.org/gerrit/23927
Tested-by: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: Stanley Wong <stanleyw@chromium.org>
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>

2 years agoflimflam: Set ArpGateway by default
Paul Stewart [Mon, 4 Jun 2012 21:21:59 +0000 (14:21 -0700)]
flimflam: Set ArpGateway by default

Perform ARP check for default gateway by default, since
it is now proven to work correctly in the field, and it
might be impossible for a user to do so when they need
to now, due to crosh requiring a non-guest user to be
logged in.

BUG=chromium-os:16885
TEST=Manual: Start flimflam on a system with no profile
and ensure ArpGateway is enabled.

Change-Id: I88962200a394f38c2b95c61eda528f4961114460
Reviewed-on: https://gerrit.chromium.org/gerrit/24419
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>

2 years agoflimflam_test: DeviceManager: fix reference to FlimFlam object
Jason Glasgow [Mon, 4 Jun 2012 17:36:28 +0000 (13:36 -0400)]
flimflam_test: DeviceManager: fix reference to FlimFlam object

The reference to flimflam.FlimFlam is incorrect, because FlimFlam is
defined within this file.  Fix that.

BUG=none
TEST=cellular_Smoke

Change-Id: Ifc1686c74a975fad94460bd30a22dfe763e4574f
Reviewed-on: https://gerrit.chromium.org/gerrit/24391
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Tested-by: Jason Glasgow <jglasgow@chromium.org>
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>

2 years agoflimflam: Don't free existing services in ConfigureService factory-2394.B
Paul Stewart [Tue, 29 May 2012 23:35:18 +0000 (16:35 -0700)]
flimflam: Don't free existing services in ConfigureService

Fix a corner case where ConfigureService cannot find a service
by GUID, but we can find it by identifier.  In this situation,
do not blindly set "created = TRUE" since this will remove a
currently visible service and orphan the network, causing many
strange problems later on.  This scenario happens often now
with the way Chrome treats ONC-created networks.

BUG=chromium-os:30709
TEST=Manual: Enroll and provision ONC 802.1x network.  Reboot while
logged-on.  Log in and re-join ONC network.  Observe that network
can be successfully joined and "bad order" messages do not appear
in syslog.

Change-Id: Icdf2a0bd75716ed3fe321bbba3b0a73427732a6a
Reviewed-on: https://gerrit.chromium.org/gerrit/23965
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
2 years agoAdd D-Bus permissions for 'dhcp' user in flimflam. factory-2305.B factory-2338.B factory-2368.B firmware-link-2348.B
Jorge Lucangeli Obes [Fri, 9 Mar 2012 17:33:41 +0000 (09:33 -0800)]
Add D-Bus permissions for 'dhcp' user in flimflam.

BUG=chromium-os:28336
TEST=Build and boot an image, network still works.

Change-Id: I9a5e947dd157d701c50499ca9ca6f374f643817e
Reviewed-on: https://gerrit.chromium.org/gerrit/20633
Tested-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Jorge Lucangeli Obes <jorgelo@chromium.org>

2 years agoUpdate dhcpcd plugin with the new dbdir/rundir for dhcpcd.
Jorge Lucangeli Obes [Tue, 8 May 2012 16:57:59 +0000 (09:57 -0700)]
Update dhcpcd plugin with the new dbdir/rundir for dhcpcd.

For dhcpcd to run as a regular user, it needs to be able to write
lease files and pid files to /var. Update dhcpcd plugin to use
/var/lib/dhcpcd for leases and /var/run/dhcpcd for pid files,
which we can later chown() to the 'dhcp' user.

BUG=chromium-os:28336
TEST=network_netperf2 to verify networking.
TEST=Connect and disconnect networks and check that pid files get deleted.
CQ-DEPEND=I655f730aaf35a4ed71d0ac01a7850b8601999fdc,I3844dcc511d6867b4dc2d0cc62d5a59226358c88

Change-Id: I67eb52c74c7f66e83d95b7bb26b313443acfbb91
Reviewed-on: https://gerrit.chromium.org/gerrit/22126
Tested-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Jorge Lucangeli Obes <jorgelo@chromium.org>

2 years agoRevert "Documenting the rebuff of connection to non-connectable services" because... factory-2268.16.B
Wade Guthrie [Thu, 3 May 2012 20:30:08 +0000 (13:30 -0700)]
Revert "Documenting the rebuff of connection to non-connectable services" because the documentation for shill has been forked.

This reverts commit 9edb3fa6afe3f83c81456eeb6027a114c057794f

Change-Id: I969b5fdd866e7c929ecce6ecb362af1512e8fde4
Reviewed-on: https://gerrit.chromium.org/gerrit/21803
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Wade Guthrie <wdg@chromium.org>
Commit-Ready: Wade Guthrie <wdg@chromium.org>

2 years agoDocumenting the rebuff of connection to non-connectable services.
Wade Guthrie [Wed, 2 May 2012 18:18:26 +0000 (11:18 -0700)]
Documenting the rebuff of connection to non-connectable services.

BUG=chromium-os:30382
TEST=This is a doc - I read it and it tests as successfully readable.

Change-Id: I0bb7c3bda5bd4e0262955710badc19edd80471e8
Reviewed-on: https://gerrit.chromium.org/gerrit/21654
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Wade Guthrie <wdg@chromium.org>
Tested-by: Wade Guthrie <wdg@chromium.org>
2 years agoflimflam: update {enable,disable}-device to work with shill
Jason Glasgow [Wed, 2 May 2012 14:57:03 +0000 (10:57 -0400)]
flimflam: update {enable,disable}-device to work with shill

Update {enable,disable}-device to work with shill by calling the
Enable() and Disable() methods on the device instead of setting the
readonly Powered property.

Add a set-device-property script for manual testing.

BUG=none
TEST=run scripts at command line

Change-Id: I0ad26d240f27fbd7b5686a0f34c3e18e268331c7
Reviewed-on: https://gerrit.chromium.org/gerrit/21622
Tested-by: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>

2 years agoflimflam: Do not save an uninitialized ipconfig while loading device profile
Paul Stewart [Thu, 19 Apr 2012 23:19:09 +0000 (16:19 -0700)]
flimflam: Do not save an uninitialized ipconfig while loading device profile

..as that will destroy the saved configuration before it is loaded.

BUG=chromium-os:29050
TEST=Manual:
Disconnect and reconnect USB-Ethernet ethernet adaptor and
ensure that the static configuration is still in the profile
and that we reconnect with the stored parameters.

Change-Id: I88a11a1af9e3b1b46869dd556016b9e1b2bb22cc
Reviewed-on: https://gerrit.chromium.org/gerrit/20693
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
2 years agoflimflam: Configure static addresses on reload
Paul Stewart [Thu, 19 Apr 2012 23:19:09 +0000 (16:19 -0700)]
flimflam: Configure static addresses on reload

Call connman_ipconfig_set_address even in the static case.
It clearly needs to be done to set the interface gateway
paramater and to reset mask with smask.

BUG=chromium-os:29050
TEST=Manual:
Disconnect and reconnect Ethernet connector to make sure that
network parameters are restored.

Change-Id: I7ac72166a4138370a924ec72c178a86aef31dd19
Reviewed-on: https://gerrit.chromium.org/gerrit/20692
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
2 years agoflimflam: Set correct service state for static IP
Paul Stewart [Thu, 19 Apr 2012 23:19:09 +0000 (16:19 -0700)]
flimflam: Set correct service state for static IP

Some IPConfigs immediately set the service to the "READY"
state.  Do not revert the service to the "CONFIGURING" state.

BUG=chromium-os:29050
TEST=Manual:
Mark an Ethernet connection as static IP and ensure we
stay connected (actually we quickly bounce back to connected)

Change-Id: Id23706e3a223af2404ecc681e3a9f86d39c5c73a
Reviewed-on: https://gerrit.chromium.org/gerrit/20691
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
2 years agoflimflam: Choose another ipconfig when one goes away
Paul Stewart [Thu, 19 Apr 2012 23:19:09 +0000 (16:19 -0700)]
flimflam: Choose another ipconfig when one goes away

A connection is associated with an IPConfig.  Thus, when
we remove an IPConfig the associated connection is destroyed,
marking the service as disconnected as well.  If the device
still has alternate IPConfigs, we should try to launch one
of them.

BUG=chromium-os:29050
TEST=Manual:
Mark an Ethernet connection as static IP and ensure we
stay connected (actually we quickly bounce back to the CONFIGURING
state -- fixed in follow-on CL)

Change-Id: Ia46c82df5310200e89ce262440464d0b20d96341
Reviewed-on: https://gerrit.chromium.org/gerrit/20689
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
2 years agoflimflam: Save SSID when configuring hidden services
Paul Stewart [Wed, 18 Apr 2012 23:49:43 +0000 (16:49 -0700)]
flimflam: Save SSID when configuring hidden services

The SSID parameter wasn't being saved when configuring non-visible
hidden services, which caused them not to be selected for scan.  Fix
this by performing a synchronous save of the service before removing
the network.

BUG=chromium-os:26676
TEST=Manual: use new configure-hidden-wifi script to create hidden
non-available WiFi networks and confirm SSID parameter was not being
saved.  After change, verify that SSID parameter is saved for a new
network, and confirm that on a flimflam restart this network (and
unfortunately not the old one saved before the flimflam change) is
scanned for.

Change-Id: I32e67fa3d607df441e6698bf3487b1c3597d3c91
Reviewed-on: https://gerrit.chromium.org/gerrit/20526
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
2 years agoflimflam: Implement 'ff_debug --level' to get/set debug level.
Ben Chan [Wed, 18 Apr 2012 01:34:20 +0000 (18:34 -0700)]
flimflam: Implement 'ff_debug --level' to get/set debug level.

The DBus API of shill implements two methods, GetDebugLevel and
SetDebugLevel, for getting and setting the debug level for logging. This
CL adds a '--level' option in ff_debug to make use of these two methods.

BUG=chromium-os:29627
TEST=Run ff_debug to get/set debug level with flimflam and shill.

Change-Id: Ia12c5b4ce762be480e4264db943202a56faebf40
Reviewed-on: https://gerrit.chromium.org/gerrit/20438
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
2 years agoflimflam: Reduce the DNS timeout to the minimum
Paul Stewart [Sat, 7 Apr 2012 20:08:22 +0000 (13:08 -0700)]
flimflam: Reduce the DNS timeout to the minimum

The resolver library has a timeout parameter set in seconds.  Reduce
the timeout from the default of 5 seconds to 1 second.

BUG=chromium-os:29124
TEST=Manual -- strace a ping to a host while manually modifying
resolv.conf to point to a black hole.

Change-Id: Ib26f3d578c11ce1c25e50d22e400cbdc316eec72
Reviewed-on: https://gerrit.chromium.org/gerrit/19801
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
2 years agoDebugd is allowed to call SetDebugTags method on org.chromium.flimflam
Yuri Gorshenin [Tue, 10 Apr 2012 10:36:11 +0000 (14:36 +0400)]
Debugd is allowed to call SetDebugTags method on org.chromium.flimflam
interface via DBus.

BUG=chromium-os:25701
TEST=No tests needed.

Change-Id: I9a3765a71150cc92e1bf86269026ae12bf90042e
Reviewed-on: https://gerrit.chromium.org/gerrit/19883
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Tested-by: Yuri Gorshenin <ygorshenin@chromium.org>
Commit-Ready: Yuri Gorshenin <ygorshenin@chromium.org>

2 years agoflimflam: Separate "Favorite" from "PreviouslyConnected"
Paul Stewart [Fri, 6 Apr 2012 15:45:40 +0000 (08:45 -0700)]
flimflam: Separate "Favorite" from "PreviouslyConnected"

ONC can set the "Favorite" flag on a service, so it is no longer
an accurate indicator of whether a service has been connected to
before.  We need this signal unambiguously, so create a separate
service flag for this which is not exported for setting over DBus.

BUG=chromium-os:29058
TEST=Manual: Repeatedly fail to connect to an ONC-created WEP network.

Change-Id: I8cb42ccf40770e9d5504a1c94cbf9b1aafba5a74
Reviewed-on: https://gerrit.chromium.org/gerrit/19757
Reviewed-by: Steven Bennetts <stevenjb@chromium.org>
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>

2 years agoflimflam: Disconnect service when delete_entry is called
Paul Stewart [Thu, 5 Apr 2012 01:46:06 +0000 (18:46 -0700)]
flimflam: Disconnect service when delete_entry is called

Disconnect service if one is associated with a deleted profile
entry.  At the same time, modify delete-profile test script so
it can try to remove the named entry from any/all profiles in the
stack.  This change has the side effect of causing "Forget" for
remembered networks to automatically disconnect.  The behavior
of staying connected during a "forget" always seemed inconsistent.

BUG=chromium-os:28963
TEST=Manual: Use modified delete-profile

Change-Id: Ifb8851a9e574acb9974b08961a7cb56994ba05cf
Reviewed-on: https://gerrit.chromium.org/gerrit/19631
Reviewed-by: Mattias Nissler <mnissler@chromium.org>
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
2 years agoflimflam: openvpn: send platform name+version
Sam Leffler [Thu, 29 Mar 2012 23:10:25 +0000 (16:10 -0700)]
flimflam: openvpn: send platform name+version

Pass the platform name and version information to openvpn to pass on to
the server. Data are passed through the environment and openvpn sends them
on only when OpenVPN.PushPeerInfo is enabled (using a private change).

BUG=chromium-os:27507
TEST=setup an openvpn tunnel and check arguments passed to openvpn with ff_debug vpn

Change-Id: I8ba668cafdb3bc36736e3f4a858708c5b448d6b7
Reviewed-on: https://gerrit.chromium.org/gerrit/19359
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Sam Leffler <sleffler@chromium.org>

2 years agoflimflam: Mark network favorite when setting AutoConnect on a service.
Mattias Nissler [Mon, 2 Apr 2012 15:20:27 +0000 (17:20 +0200)]
flimflam: Mark network favorite when setting AutoConnect on a service.

BUG=chromium-os:28271
TEST=Configured ONC-pushed network to AutoConnect. Check whether device automatically connects to that network.

Change-Id: Ia5714ce8d17d71ff2e003d10d8f11dd9f3b7324b
Reviewed-on: https://gerrit.chromium.org/gerrit/19462
Commit-Ready: Mattias Nissler <mnissler@chromium.org>
Reviewed-by: Mattias Nissler <mnissler@chromium.org>
Tested-by: Mattias Nissler <mnissler@chromium.org>
2 years agoflimflam: add modemmgr plugin to plugin_objects list
Mike Frysinger [Fri, 30 Mar 2012 19:05:47 +0000 (15:05 -0400)]
flimflam: add modemmgr plugin to plugin_objects list

Someone forgot to add modemmgr.la to the plugin_objects list, so make
would sometimes try to build the code before it had created the include
symlinks leading to a build failure:

make --no-print-directory all-am
  CC     plugins/plugins_modemmgr_la-modemmgr.lo
plugins/modemmgr.c:34:28: fatal error: connman/assert.h: No such file or directory
compilation terminated.

BUG=None
TEST=`MAKEOPTS=-j1 emerge-x86-alex flimflam` now works

Change-Id: I64eea77a0e04c6be636c4b629e06ab43b1e2c434
Reviewed-on: https://gerrit.chromium.org/gerrit/19368
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Mike Frysinger <vapier@chromium.org>
Tested-by: Mike Frysinger <vapier@chromium.org>
2 years agoflimflam: Cancel service writebacks when remove a service from a profile.
Mattias Nissler [Fri, 30 Mar 2012 19:52:30 +0000 (21:52 +0200)]
flimflam: Cancel service writebacks when remove a service from a profile.

BUG=chromium-os:27862
TEST=Configure WiFi service through ONC policy. Load chrome://settings. Remove network from policy and refresh policy. Check that the service gets removed.

Change-Id: I2c599d0292736aa8c5ea39198733484e16a3bf74
Reviewed-on: https://gerrit.chromium.org/gerrit/19379
Commit-Ready: Mattias Nissler <mnissler@chromium.org>
Reviewed-by: Mattias Nissler <mnissler@chromium.org>
Tested-by: Mattias Nissler <mnissler@chromium.org>
2 years agoflimflam: stop encrypting profile entries with des
barfab@chromium.org [Tue, 27 Mar 2012 15:42:02 +0000 (17:42 +0200)]
flimflam: stop encrypting profile entries with des

Remove the encryption support from the des module so profile data are
not affected by owner key rotation.  The encryption was a stopgap mechanism
until an encrypted global partition is available.  Note that it was only
useful for shared/global profile entries.

This is a re-upload of CL 16842 which was erroneously abandoned.

BUG=chromium-os:26634
TEST=Manually verified against a testserver with key rotation enabled.

Change-Id: I43c4aa712bff52ec777125e202e16427fe1bb21c
Reviewed-on: https://gerrit.chromium.org/gerrit/19159
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Reviewed-by: Will Drewry <wad@chromium.org>
Commit-Ready: Bartosz Fabianowski <bartfab@chromium.org>
Tested-by: Bartosz Fabianowski <bartfab@chromium.org>
2 years agoflimflam: portal: allow recheck portal state even when online
Jason Glasgow [Tue, 27 Mar 2012 20:01:36 +0000 (16:01 -0400)]
flimflam: portal: allow recheck portal state even when online

Allow recheck of portal state even when online.  When the list of
technologies that are subject to portal checks changes, recheck the
active service.  If the default list was empty and now new
technologies are checked, this may result in the active service moving
from online to portal state.

BUG=chromium-os:28432
TEST=network_Portal

Change-Id: I97f683af245fd209e782b2d3cd9a80755675e66b
Reviewed-on: https://gerrit.chromium.org/gerrit/19223
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Tested-by: Jason Glasgow <jglasgow@chromium.org>
2 years agoflimflam: portal: allow command line to alter default portal list
Jason Glasgow [Fri, 23 Mar 2012 20:16:12 +0000 (16:16 -0400)]
flimflam: portal: allow command line to alter default portal list

Allow a command line flag to alter the default list of services which
are checked for portal state.

BUG=chromium-os:28311
TEST=run flimflam, use get-portal-list to examine value: notice wifi,ethernet, etc.
restart flimflam -l "", get-portal-list: notice no technologies
set-portal-list wifi, restart flimflam -l "", notice wifi

Change-Id: Ic6e930de909b1fa4468113e9e7eeea9752e2d205
Reviewed-on: https://gerrit.chromium.org/gerrit/18991
Tested-by: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Reviewed-by: Kris Rambish <krisr@chromium.org>
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>

2 years agoflimflam: Mask out sensitive information from the debug log.
Ben Chan [Fri, 23 Mar 2012 17:16:15 +0000 (10:16 -0700)]
flimflam: Mask out sensitive information from the debug log.

BUG=chromium-os:28313
TEST=Tested the following on a Cr48:
1. Run "ff_debug service+vpn" from crosh.
2. Connect to a L2TP/IPsec VPN server.
3. Verify that sensitive information is masked out from /var/log/messages.
4. Connect to a OpenVPN server.
5. Verify that sensitive information is masked out from /var/log/messages.

Change-Id: Id2fe2ebc39f220678ad2b795b2edfe0ee4279c06
Reviewed-on: https://gerrit.chromium.org/gerrit/18970
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
2 years agoflimflam: Consistently use 'StickyHostRoute' as a property name
Jason Glasgow [Thu, 22 Mar 2012 14:51:05 +0000 (10:51 -0400)]
flimflam: Consistently use 'StickyHostRoute' as a property name

Consistently use 'StickyHostRoute' as a property name.  It had been
called StickyHostRoute when sending an update signal and StickyRoute
for GetProperties.  Cashew depends on the name StickyHostRoute.

BUG=chromium-os:27904
TEST=run cashew observe this is the proper name for the property

Change-Id: I4a8dbb25ae7a210b2d6b1f4f4980d808ce6610ed
Reviewed-on: https://gerrit.chromium.org/gerrit/18829
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>
Tested-by: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: Sam Leffler <sleffler@chromium.org>
2 years ago[flimflam] Don't write back services when they are already dead. factory-1987.B
Mattias Nissler [Wed, 14 Mar 2012 18:54:23 +0000 (19:54 +0100)]
[flimflam] Don't write back services when they are already dead.

BUG=chromium-os:27751
TEST=Policy-configured VPN networks should actually go away when removed from policy.

Change-Id: I2c8bd97906c28207cda5959fbd2ce3706e54e4aa
Reviewed-on: https://gerrit.chromium.org/gerrit/18153
Tested-by: Mattias Nissler <mnissler@chromium.org>
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Mattias Nissler <mnissler@chromium.org>

2 years agoflimflam: network: reset network state on immediate failure
Jason Glasgow [Fri, 9 Mar 2012 19:10:53 +0000 (14:10 -0500)]
flimflam: network: reset network state on immediate failure

If the network_connect operation fails, the connman_network object
should not be left in the CONNECTING state.  Otherwsise all subsequent
network connect attempts will fail.

BUG=chromium-os:27591
TEST=run network_3g suite, matfunc

Change-Id: I9078ae84cdee84d300eb561726d9d3ed7f15d208
Reviewed-on: https://gerrit.chromium.org/gerrit/17735
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Jason Glasgow <jglasgow@chromium.org>
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>

2 years agoflimflam: modemmgr: add support for ProviderRequiresRoaming
Jason Glasgow [Thu, 8 Mar 2012 23:31:54 +0000 (18:31 -0500)]
flimflam: modemmgr: add support for ProviderRequiresRoaming

Add support for ProviderRequiresRoaming which allows certain MVNO
partners to connect to the cellular network independent of the users
Cellular.AllowRoaming setting.  This is important for Cubic and
MaxxRoam which are always on a roaming network.  The setting is
determined based on an attribute in the mobile broadband provider info
database.

BUG=chrome-os-partner:5370
TEST=run with a Cubic SIM verify that user connects independent of
TEST=the allow roaming setting.  Test with other roaming SIM.
CQ-DEPEND=I4c0c1d6cc39a499a0baf164d7cd31d9632495f31

Change-Id: I501bee1afb5b016101856f35bfc6845d1fa86c7d
Reviewed-on: https://gerrit.chromium.org/gerrit/17632
Tested-by: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: Eric Shienbrood <ers@chromium.org>
Reviewed-by: Nathan J. Williams <njw@chromium.org>
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>

2 years agoflimflam: fix check of OIF attribute length in connman_rtnl_read_route
mukesh agrawal [Thu, 8 Mar 2012 23:12:12 +0000 (15:12 -0800)]
flimflam: fix check of OIF attribute length in connman_rtnl_read_route

When reading the RTA_OIF attribute of a route, we check that
the size of the attribute is the same as the size of the
(caller's) storage for the attribute.

Unfortunately, we were checking the size of the pointer
to the storage, rather than the size of the storage itself.
On x86-64, this fails, as the pointer is 8 bytes, while
the storage is 4.

BUG=chromium-os:27452
TEST=manual: connected to VPN on 32-bit and 64-bit platforms

Change-Id: I568ef2fe3bd2e923742b2b078defc9271cadbee5
Reviewed-on: https://gerrit.chromium.org/gerrit/17646
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>

2 years agoflimflam: Auto-connect to failed services
Paul Stewart [Thu, 8 Mar 2012 22:32:24 +0000 (14:32 -0800)]
flimflam: Auto-connect to failed services

This change removes code in flimflam to ignore failed services
for purposes of autoconnect.  In order to make sure that failed
services are attempted last (after all non-failed services),
fix the sorting algorithm to put failed services at the tail
of favorite services.

BUG=chromium-os:27540
TEST=Manual: Walk out of range of an AP and then return close
enough to receive beacons but far enough so DHCP fails.  This
puts the service into a "failed" state (as observed from reading
the profile).  Coming back in range of the AP, verify that the
system reconnects to this failed service on the next scan.
Verify that when this AP is failed a lower ranked AP (such as
an open network, where the failed network is WPA) is preferred
for autoconnect.

Change-Id: Ide47f9b3422fe1c2bf8b41b1c32385a65f6a02d5
Reviewed-on: https://gerrit.chromium.org/gerrit/17627
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
2 years agoflimflam: Indicate whether VPN PSK and user passphrase are set.
Ben Chan [Mon, 5 Mar 2012 09:06:35 +0000 (01:06 -0800)]
flimflam: Indicate whether VPN PSK and user passphrase are set.

This CL addes L2TPIPsec.PSKRequired and reuses PassphraseRequired to
indicate whether a VPN profile has the PSK and user passphrase set,
such that Chrome can decide how to show the PSK and user passphrase
fields in the VPN configuration dialog.

BUG=chromium-os:27042
TEST=Tested the following:
1. emerge-{x86,amd64,arm}-generic flimflam
2. Observe that PassphraseRequired and L2TPIPsec.PSKRequired are set
   properly and sent back to Chrome over DBus.

Change-Id: I4d4aaa6b65d74d8cc5cb78e302e2eaefc6686623
Reviewed-on: https://gerrit.chromium.org/gerrit/17341
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>

2 years agoflimflam: Fix "Set output NSS certs to be world readable"
Paul Stewart [Wed, 29 Feb 2012 23:23:46 +0000 (15:23 -0800)]
flimflam: Fix "Set output NSS certs to be world readable"

Used fp instead of file name.

BUG=chromium-os:27094
TEST=Manual: Worked with bug submitter to repro issue -- visually
verified file permissions.

Change-Id: I8526d9857e25175715871abdecf416f95ea71fb5
Reviewed-on: https://gerrit.chromium.org/gerrit/17260
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Reviewed-by: Danielle Drew <ddrew@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
2 years agoflimflam: Set output NSS certs to be world readable
Paul Stewart [Wed, 29 Feb 2012 23:23:46 +0000 (15:23 -0800)]
flimflam: Set output NSS certs to be world readable

Since wpa_supplicant is now running as a different (non-root)
user, output nss certs need to be permitted so it can read
them.

BUG=chromium-os:27094
TEST=Please verify this using the same repro steps as 27094

Change-Id: Idc1231e2c2e894cdc6ff039b98175f4c38d8278a
Reviewed-on: https://gerrit.chromium.org/gerrit/17101
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
2 years agoflimflam: Set "hidden_ssid" wifi property on hidden services
Paul Stewart [Wed, 29 Feb 2012 00:51:54 +0000 (16:51 -0800)]
flimflam: Set "hidden_ssid" wifi property on hidden services

Correct the default setting of the WiFi.HiddenSSID property on
services created via the DBus without an explicit setting for
the property.  This was being defaulted to FALSE causing hidden
WiFi networks to be incorrectly handled.  This was a regression
introduced when the ConfigureService api changes were done.

BUG=chromium-os:26977
TEST=Manual: Associate to hidden SSID, observe contents of
profile have WiFi.HiddenSSID=true.  Also tested with new
WiFiManager autotest: https://gerrit.chromium.org/gerrit/17036.

Change-Id: Ifda24f86de5f31729d18fb86815d68bb8a07bafa
Reviewed-on: https://gerrit.chromium.org/gerrit/17029
Commit-Ready: Paul Stewart <pstew@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
2 years agoflimflam: recheck portal state periodically
Jason Glasgow [Sat, 25 Feb 2012 09:33:46 +0000 (04:33 -0500)]
flimflam: recheck portal state periodically

As long as at least one service is marked portal, keep a periodic
timer alive to recheck the portal state of the active service.  Do not
bother running portal checks on the non-default services, but be
prepared to run them in case the default changes.

BUG=chromium-os:23793
TEST=ran a VM with two interfaces.  use iptables to blackhole eth1
ifdown eth1 ; iptables -I INPUT -i eth1 -j REJECT ; ifup eth1
examine logs, list-services.  See portal checked repeatedly on eth1
iptables -D input -i eth1 -j REJECT
examine logs, list-services.  See services is marked online (after up to 20 seconds)

Change-Id: I49f35cbc3d676caacf3b65662f385da0c68acc87
Reviewed-on: https://gerrit.chromium.org/gerrit/16799
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Tested-by: Jason Glasgow <jglasgow@chromium.org>
2 years agoflimflam: Fix potential memory leaks in g_key_file_get_string calls.
Ben Chan [Mon, 27 Feb 2012 19:54:38 +0000 (11:54 -0800)]
flimflam: Fix potential memory leaks in g_key_file_get_string calls.

BUG=chromium-os:26940
TEST=Tested the following:
1. emerge-{x86,amd64,arm}-generic flimflam
2. Run network_VPN tests.
3. Manually test OpenVPN and L2TP/IPsec VPN connections on a Cr48.

Change-Id: I81f28625fc72e117d8d5ea5214b9ea2e94fbe560
Reviewed-on: https://gerrit.chromium.org/gerrit/16843
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
2 years agoflimflam (openvpn): preserve ordering of foreign options.
mukesh agrawal [Tue, 28 Feb 2012 03:14:10 +0000 (19:14 -0800)]
flimflam (openvpn): preserve ordering of foreign options.

Foreign options provide configuration parameters such
as DNS servers and DNS search domains. The foreign
options are provided as key value pairs such as
foreign_option_1 = dhcp-option DNS 8.8.8.8.

For whatever reason, the DBus message we receive contains
the options in opposite of their sort order. i.e., we
receive foreign_option_2 before foreign_option_1.

This causes problems because the search domains and
DNS servers should be used in the order specified.
Resolve this by sorting foreign options by name
(i.e. foreign_option_1 before foreign_option_2),
before applying them.

BUG=chromium-os:26253
TEST=manual

Manual testing: gmerge on to device, check that order of
nameservers in /etc/resolv.conf matches the ordering of
foreign_options. Also, check that search domain order
matches the ordering of foreign options.

Change-Id: I8051038aaab32bee9c47e999efbba87cbde19516
Reviewed-on: https://gerrit.chromium.org/gerrit/16888
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>

2 years agoflimflam: vpn: Save PSK and Password properties to profile.
Ben Chan [Sat, 25 Feb 2012 05:35:20 +0000 (21:35 -0800)]
flimflam: vpn: Save PSK and Password properties to profile.

This CL saves OpenVPN.Password, L2TPIPsec.PSK, and L2TPIPsec.Password
properties to the profile, which can be used to establish a VPN
connection if flimflam does not receive the PSK/password over DBus.

BUG=chromium-os:24685
TEST=Tested the following:
1. emerge-{x86,amd64,arm}-generic flimflam
2. Run network_VPN tests.
3. Manually test OpenVPN and L2TP/IPsec VPN using the regular flow and
   the ONC flow on a Cr48.

Change-Id: I062a0af6053f843d60726ec5844472c71726c48c
Reviewed-on: https://gerrit.chromium.org/gerrit/16769
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
2 years agoflimflam: Refactor common code in openvpn and l2tpipsec plugin.
Ben Chan [Fri, 24 Feb 2012 23:58:04 +0000 (15:58 -0800)]
flimflam: Refactor common code in openvpn and l2tpipsec plugin.

This CL moves the common code for handling provider properties in
the openvpn and l2tpipsec plugin to the provider module.

BUG=none
TEST=Tested the following:
1. emerge-{x86,amd64,arm}-generic flimflam
2. Run network_VPN tests.

Change-Id: I948a8af20197c9c3941fa6bc5adcf221cef15462
Reviewed-on: https://gerrit.chromium.org/gerrit/16768
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Tested-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>

2 years agoAllow user "wpa" to send messages to flimflam.
Jorge Lucangeli Obes [Wed, 15 Feb 2012 00:54:05 +0000 (16:54 -0800)]
Allow user "wpa" to send messages to flimflam.

BUG=chromium-os:26569
TEST=build_image, connect to a wireless network.
TEST=Run WiFiMatFunc, WiFiSecMat and WiFiPerf on the WiFi testbed.
CQ-DEPEND=I3eca905e16cd2aec2108c435e5483169ec0a2406,Icd52e965c1c6899110b76319b6c02f49b5ce43f0

Change-Id: I1840c7b6eade177fc79229964c2336ab70fcc272
Reviewed-on: https://gerrit.chromium.org/gerrit/16177
Commit-Ready: Jorge Lucangeli Obes <jorgelo@chromium.org>
Reviewed-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
Tested-by: Jorge Lucangeli Obes <jorgelo@chromium.org>
2 years agoflimflam: correct provider refcnt handling on unregister
Sam Leffler [Sat, 4 Feb 2012 00:26:05 +0000 (16:26 -0800)]
flimflam: correct provider refcnt handling on unregister

Fix the previous attempt to correct refcnt confusion between
service+provider object pairs.  The root cause was that
unregister_provider was decrementing the provider refcnt twice (it
wasn't obvious because one dec was to the object and the other was to
the embedded element).

With this fixed we can cleanup related work that was contorted to
workaround this problem.  On service_free release the provider by
de-register'ing the service path and dropping the (implicit) reference.
This consolidates the work on profile pop and when handling Service.Remove
so adjust those code paths appropriately.  This also requires we remove
the profile pop notifier in the provider as the remove work is now done
when the service is free'd.

While working through provider refcnt handling also noticed the provider
hooks offline mode to unregister provider objects when going offline.
Remove this as it will leave us with an imbalanced service/provider
refcnt and we don't (currently) use Manager.SetProperty(OfflineMode).
(If we want to make them inaccessible then we need to do other work too
convoluted to describe here.)

BUG=chromium-os:25810
TEST=run multiple iterations of the VPN test suite and individual tests and verify service+provider objects are correctly reclaimed by inspecting service+vpn debug msgs
TEST=manual:instantiate vpn service object with get-service and remove with rm-service scripts
TEST=manual:forget vpn service object and verify service+provider objects are properly reclaimed by inspecting service+vpn debug msgs

Change-Id: I03f88f6282dbf4627e7b68c1e1db112d245c4937
Reviewed-on: https://gerrit.chromium.org/gerrit/15282
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>

2 years agoflimflam: fix incorrect refcnt bump in __connman_service_create_from_provider
Sam Leffler [Sat, 4 Feb 2012 00:15:08 +0000 (16:15 -0800)]
flimflam: fix incorrect refcnt bump in __connman_service_create_from_provider

Do not increment the refcnt on an existing service object as this will
cause the service+provider object refcnts to get out of sync.  This can
happen when Manager.ConfigureService (or GetService) is called with a
GUID and we first create a service object, then the provider, and then
splice them together by calling into this routine.

BUG=chromium-os:25810
TEST=network_VPN.050IPSecGenesis

Change-Id: I530529b334c5c79c5954b722b20436d5f4a43ee7
Reviewed-on: https://gerrit.chromium.org/gerrit/15281
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Ben Chan <benchan@chromium.org>

2 years agoflimflam: flimflam.py: allow SetDebugTags to function with shill
Jason Glasgow [Fri, 27 Jan 2012 04:47:40 +0000 (23:47 -0500)]
flimflam: flimflam.py: allow SetDebugTags to function with shill

Handle failures to SetDebugTags gracefully by trying to set the debug
level which is all that can be done with shill.

BUG=chromium-os:25566
TEST=run network_3GModemControl

Change-Id: I699e49923f93eb7a3d41012d9c2104e3e4581bb8
Reviewed-on: https://gerrit.chromium.org/gerrit/14937
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Tested-by: Jason Glasgow <jglasgow@chromium.org>
2 years agoflimflam: l2tpipsec/openvpn: cleanup debug msgs
Sam Leffler [Thu, 2 Feb 2012 19:19:03 +0000 (11:19 -0800)]
flimflam: l2tpipsec/openvpn: cleanup debug msgs

Remove function names from debug msgs; they are automatically included by
the macros.

BUG=none
TEST=run with vpn debug msgs enabled

Change-Id: I8fbaf7e29e913d2f1573dcdba11ce0ba79f21b08
Reviewed-on: https://gerrit.chromium.org/gerrit/15280
Reviewed-by: Ben Chan <benchan@chromium.org>
Commit-Ready: Sam Leffler <sleffler@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
2 years agoflimflam: Clear wpa_supplicant PMKSA cache on logout
Paul Stewart [Wed, 25 Jan 2012 22:00:08 +0000 (14:00 -0800)]
flimflam: Clear wpa_supplicant PMKSA cache on logout

This is a heavy-handed workaround for dropping PMKSA cache entries
in wpa_supplicant when the user logs out (detected by profile pop).
Newer versions of wpa_supplicant will support dropping cache entries
automatically when netblocks are changed.  This will require some
very subtle changes in the interaction with supplicant, most of which
will be tackled in shill instead.

BUG=chromium-os:23367
TEST=Manual: Verify that wpa_supplicant shows "RSN: flushing PMKSA list"
on logout.

Change-Id: I318b3697c34b8dfa938ff0238c56e10a29fa7ab6
Reviewed-on: https://gerrit.chromium.org/gerrit/15027
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
2 years agoflimflam: Turn off fast-reauth
Paul Stewart [Wed, 25 Jan 2012 23:04:25 +0000 (15:04 -0800)]
flimflam: Turn off fast-reauth

This change disables TLS session resumption for EAP-TLS 802.1x
network connections.  Some versons of freeradius, for example,
reply with an improper response when session resumption is
proposed by the client, and causes wpa_supplicant to offline
the connection.  The user experience when this interaction is
triggered is that the network connection fails.  This decision
will be revisited when newer versions of wpa_supplicant account
for this interaction issue.

BUG=chromium-os:23367, chromium-os:25497
TEST=Manual: Restart flimflam, and ensure FastReauth property is
set using dbus: dbus-send --system --dest=fi.w1.wpa_supplicant1
--print-reply /fi/w1/wpa_supplicant1/Interfaces/1
org.freedesktop.DBus.Properties.Get
string:fi.w1.wpa_supplicant1.Interface string:FastReauth

Change-Id: Ibf1769478b78673f946c91bb072e82a3f72e8354
Reviewed-on: https://gerrit.chromium.org/gerrit/14828
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Paul Stewart <pstew@chromium.org>
Tested-by: Paul Stewart <pstew@chromium.org>
2 years agoflimflam: Enable curl debugging via _DBG_PORTAL
Jason Glasgow [Wed, 25 Jan 2012 01:18:30 +0000 (20:18 -0500)]
flimflam: Enable curl debugging via _DBG_PORTAL

Enable curl debugging to help understand portal bugs

BUG=chromium-os:25185
TEST=/usr/local/lib/flimflam/debug +portal, examine logs

Change-Id: I664f58003237c004461ef4e6c8502c96dd3cbe99
Reviewed-on: https://gerrit.chromium.org/gerrit/14936
Tested-by: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>

2 years agoflimflam: export EAP properties for a service
Sam Leffler [Wed, 25 Jan 2012 22:32:21 +0000 (14:32 -0800)]
flimflam: export EAP properties for a service

Include all EAP properties except EAP.Password and EAP.PrivateKeyPassword
in Service.GetProperties.  This allows clients to present "safe data" when
prompting for privileged (and missing) data.

BUG=chromium-os:25490
TEST=manual:connect to Google-A and run list-services to verify only the intended EAP properties are disclosed

Change-Id: I39e833d60a0926ac3c8f44f010448d6c12e6e8ca
Reviewed-on: https://gerrit.chromium.org/gerrit/14821
Reviewed-by: Mattias Nissler <mnissler@chromium.org>
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Tested-by: Mattias Nissler <mnissler@chromium.org>
Commit-Ready: Sam Leffler <sleffler@chromium.org>

2 years agoflimflam: deprecate Device.ProposeScan
Sam Leffler [Mon, 23 Jan 2012 22:50:03 +0000 (14:50 -0800)]
flimflam: deprecate Device.ProposeScan

Deprecate the Device.ProposeScan api in favor of Manager.RequestScan.
To make this possible support scanning of all technologies in
__connman_element_request_scan and complete the half-done code in
request_scan.

BUG=none
TEST=manual:set-scanning script works for "wifi" and "cellular"

Change-Id: I93caa116daaa461539a855e75b2eceb5d57207a2
Reviewed-on: https://gerrit.chromium.org/gerrit/14645
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Sam Leffler <sleffler@chromium.org>

2 years agomodemmgr: Handle ENABLING -> SEARCHING transition
ttuttle [Wed, 25 Jan 2012 01:19:02 +0000 (20:19 -0500)]
modemmgr: Handle ENABLING -> SEARCHING transition

modem-manager will sometimes have the modem go straight from ENABLING
to SEARCHING, skipping ENABLED.  Make sure we still mark the modem as
enabled in this case.

This was resulting in network_3GModemControl failing on Y3300/3400
modems with "Device failed to enter state Powered=True".

BUG=chromium-os:25378
TEST=3GModemControl now fails with a different error.

Change-Id: I73cd6b58d1c1d99496c85c10912c29410c33f12b
Reviewed-on: https://gerrit.chromium.org/gerrit/14758
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Commit-Ready: ttuttle <ttuttle@chromium.org>
Tested-by: ttuttle <ttuttle@chromium.org>
2 years agoflimflam: crosmetrics: Fix computation of TimeOnline
Jason Glasgow [Tue, 24 Jan 2012 20:28:48 +0000 (15:28 -0500)]
flimflam: crosmetrics: Fix computation of TimeOnline

Make TimeOnline be the amount of time that a service is the default.
Otherwise any time that a service type is not the default, until it
becomes the default, even if it is disabled, erroneously gets counted
as TimeOnline.

BUG=chromium-os:19199
TEST=/usr/local/lib/flimflam/test/debug +metrics ; switch between networks

Change-Id: I9f19d5836f9503d6d582019f52127f3245558491
Reviewed-on: https://gerrit.chromium.org/gerrit/14715
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>
Reviewed-by: Jason Glasgow <jglasgow@chromium.org>
Tested-by: Jason Glasgow <jglasgow@chromium.org>
2 years agoflimflam: implement Manager.GetService(GUID) for type vpn
Sam Leffler [Wed, 11 Jan 2012 22:40:16 +0000 (14:40 -0800)]
flimflam: implement Manager.GetService(GUID) for type vpn

Fill in missing support for a GetService request that instantiates
a Service object of type VPN.  This requires the associated Provider
object be created and bound to the Service object.

BUG=none
TEST=create a new vpn service with configure-service and use get-service to immediately instantiate the service using only the GUID

Change-Id: Iaf3498a1e1585e22815f0d9aed01ffdb676a32e4
Reviewed-on: https://gerrit.chromium.org/gerrit/14017
Tested-by: Sam Leffler <sleffler@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Commit-Ready: Sam Leffler <sleffler@chromium.org>

2 years agoflimflam: fix provider/service refcnt issues
Sam Leffler [Thu, 12 Jan 2012 21:22:38 +0000 (13:22 -0800)]
flimflam: fix provider/service refcnt issues

Provider and Service objects are meant to be created+destroyed lock-step
but were not in all cases.  VPN services created with ConfigureService
were leaving the associated provider in-memory causing subsequent lookups
to pickup a provider object with an invalid service reference.  Fix this
by using __connman_provider_remove instead of connman_provider_unref to
release a provider reference when free'ing a Service object.  To make
this work we also need to change the provider backpointer to the service
to an unref-counted pointer as otherwise Service objects with an associated
provider will never get free'd.

BUG=chromium-os:24241
BUG=chromium-os:24495
TEST=import l2tp.onc as described in issue 24248

Change-Id: If56329fcc7eaa86a61c08357538a2aea97488a90
Reviewed-on: https://gerrit.chromium.org/gerrit/14087
Reviewed-by: Ben Chan <benchan@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Sam Leffler <sleffler@chromium.org>

2 years agoflimflam: openvpn: enable openvpn logging when vpn debugging is enabled
Sam Leffler [Wed, 11 Jan 2012 23:51:05 +0000 (15:51 -0800)]
flimflam: openvpn: enable openvpn logging when vpn debugging is enabled

When there is no explicit openvpn verbose setting and vpn debug
is enabled in flimflam add a default verbose setting.  This enables
debugging openvpn run-time issues when the associated service lacks
an OpenVPN.Verb property (e.g. when the config comes from ONC).

BUG=chromium-os:24904
TEST=create openvpn service w/o verbosity and use ff_debug vpn to enable openvpn debug msgs

Change-Id: I48cd1c3350898e994e9c9f7b07a52e198eb94a05
Reviewed-on: https://gerrit.chromium.org/gerrit/14032
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Commit-Ready: Sam Leffler <sleffler@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
2 years agoflimflam: promote connman_debug_enabled to public status
Sam Leffler [Wed, 11 Jan 2012 23:47:56 +0000 (15:47 -0800)]
flimflam: promote connman_debug_enabled to public status

Promote the routine connman_debug_enabled to be public so modules can use
it.  l2tpipsec already used this routine (violating the implicit module
construction rules); adjust it to match.

BUG=none
TEST=build and run

Change-Id: Ic4d24c3409f38502ea12eed8776723d3a8bd5f26
Reviewed-on: https://gerrit.chromium.org/gerrit/14031
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Commit-Ready: Sam Leffler <sleffler@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
2 years agoflimflam: update device API documentation
mukesh agrawal [Fri, 6 Jan 2012 20:03:21 +0000 (12:03 -0800)]
flimflam: update device API documentation

Make it clear that changes to bgscan properties do not necessarily
affect existing connections. (Motivation: wpa_supplicant does not
provide a method to change bgscan parameters without disconnecting
and reconnecting.)

BUG=None
TEST=None

Change-Id: I8a745ef0ffbc1423bd65f6992644deaad082d999
Reviewed-on: https://gerrit.chromium.org/gerrit/13818
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>

2 years agoflimflam: recalculate preferred service network on remove
Sam Leffler [Tue, 3 Jan 2012 17:17:23 +0000 (09:17 -0800)]
flimflam: recalculate preferred service network on remove

When a network is removed from a service (e.g. a WiFi network going out
range) immediately recalculate the preferred network so subsequent work
can be done.

Previously we just invalidated the network bound to the service so,
for example, an autoconnect request for a device might fail because no
network is bound to the service and the autoconnect logic cannot identify
the associated device.

BUG=chromium-os:11393
BUG=chromium-os:20233
TEST=50 iterations of WiFiRoaming:002Suspend

Change-Id: I2192b6bd79829746e48c60eb0c796ffdbfae406d
Reviewed-on: https://gerrit.chromium.org/gerrit/13582
Reviewed-by: mukesh agrawal <quiche@chromium.org>
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Sam Leffler <sleffler@chromium.org>

2 years agoflimflam: correct error in service api documentation
mukesh agrawal [Fri, 6 Jan 2012 01:48:56 +0000 (17:48 -0800)]
flimflam: correct error in service api documentation

Change type of Service's WiFi.PhyMode property from
uint16 to string, to be consistent with the code.
(See service.c:get_properties.)

BUG=None
TEST=None

Change-Id: I654e595d017bd95d03794d3e14ed17b62c95ad47
Reviewed-on: https://gerrit.chromium.org/gerrit/13766
Reviewed-by: Paul Stewart <pstew@chromium.org>
Tested-by: mukesh agrawal <quiche@chromium.org>
Commit-Ready: mukesh agrawal <quiche@chromium.org>

2 years agoflimflam: correct handling of missing/invalid owner key
Sam Leffler [Thu, 29 Dec 2011 19:23:50 +0000 (11:23 -0800)]
flimflam: correct handling of missing/invalid owner key

When the owner key is unavailable the des-cbc crypto plugin was disabled.
This caused des-encrypted profile data to be returned as the ascii-encoded
(and encrypted) plaintext instead of being discarded.  One result of this
was that invalid data for EAP networks would be passed to the back-end
authenticator who, in some cases, would do "unusual things".  Fix this
by always registering the plugin and handle the missing keymatter at
each encrypt/decrypt request.

While here also fix some typos in the rot47 code and add a rot47 test
app that was done when fixing the rot47 algorithm.

BUG=chromium-os:23583
TEST=manual:remove/corrupt owner.key and verify des-encrypted data is not returned as plaintext and new data is encoded with rot47

Change-Id: I2f32a98f0441a098d2a420ff2883b2e465da3090
Reviewed-on: https://gerrit.chromium.org/gerrit/13542
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
2 years agoAllow UIData property to be cleared.
Mattias Nissler [Wed, 28 Dec 2011 13:15:46 +0000 (14:15 +0100)]
Allow UIData property to be cleared.

BUG=chromium-os:21992
TEST=Policy-configured networks switch back to normal once removed from the policy configuration.

Change-Id: I3e2f5b9c338e1fa2a48b34cf7c47bce2027e6829
Reviewed-on: https://gerrit.chromium.org/gerrit/13510
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Mattias Nissler <mnissler@chromium.org>
Tested-by: Mattias Nissler <mnissler@chromium.org>
2 years agoflimflam: service: mark service ONLINE if a proxy is configured
Jason Glasgow [Fri, 16 Dec 2011 16:31:52 +0000 (11:31 -0500)]
flimflam: service: mark service ONLINE if a proxy is configured

BUG=chromium-os:24348
TEST=configure network via squid, install new image, login as guest config proxy, check service state

Change-Id: Ief7924933dbe7950fa954d56267e9ea9cfc2f17f
Reviewed-on: https://gerrit.chromium.org/gerrit/13101
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>
Tested-by: Jason Glasgow <jglasgow@chromium.org>
2 years agoflimflam: crosmetrics: fix 5GHz frequency mapping
Sam Leffler [Fri, 16 Dec 2011 21:04:36 +0000 (13:04 -0800)]
flimflam: crosmetrics: fix 5GHz frequency mapping

Correct the mapping of 5GHz frequencies to the enum value sent for
Network.Wifi.Channel.  Also add mappings for 5170, 5190, 5210, and 5230.

BUG=chromium-os:24342
TEST=new unit test

Change-Id: I33a62ee73cb33123083d394988c4ae6ae567192e
Reviewed-on: https://gerrit.chromium.org/gerrit/13103
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: Sam Leffler <sleffler@chromium.org>

2 years agoflimflam: service: update service state when disconnecting
Jason Glasgow [Wed, 7 Dec 2011 04:07:23 +0000 (23:07 -0500)]
flimflam: service: update service state when disconnecting

Update service state when disconnecting so that the portal code can
release references to the service object.

Tested by connecting to two wifi networks alternately, both while
connecting and after connect succeeds.

BUG=chromium-os:23391
TEST=network_3GModemControl passes; also, see above

Change-Id: Iefdb42b751ec925d4b06ae0d7041c4c2c75c19d0
Reviewed-on: https://gerrit.chromium.org/gerrit/12530
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Commit-Ready: ttuttle <ttuttle@chromium.org>
Tested-by: ttuttle <ttuttle@chromium.org>
2 years agoflimflam: portal: disable portal checks on services with a proxy config
Jason Glasgow [Wed, 14 Dec 2011 13:09:58 +0000 (08:09 -0500)]
flimflam: portal: disable portal checks on services with a proxy config

Disable portal checks on services with a proxy config because the
portal code does not know how to handle proxies.  The portal code
cannot interpret the JS code that might be associated with a PAC file.

BUG=chromium-os:23810
TEST=setup squid to act as a proxy, block http traffic

Change-Id: Id8fe9e7b29b4811d3128e29057ba49375db99827
Reviewed-on: https://gerrit.chromium.org/gerrit/12902
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Tested-by: Jason Glasgow <jglasgow@chromium.org>
Commit-Ready: Jason Glasgow <jglasgow@chromium.org>

2 years agoflimflam: openvpn: handle tunnel restarts
Sam Leffler [Mon, 12 Dec 2011 01:55:23 +0000 (17:55 -0800)]
flimflam: openvpn: handle tunnel restarts

When entering RECONNECT state notify the vpn support code to drop the
default route so openvpn can re-resolve the remote address/hostname.
After re-connecting we are notified as usual through the d-bus callback
but the parameters passed back lack the ifconfig state so preserve our
local state so we can re-plumb the complete ipaddress.

BUG=chromium-os:24116
TEST=setup a tunnel, suspend long enough for the tunnel timeout to occur; then verify the subsequent restart results in a working tunnel

Change-Id: Ib664be2f2508cbadf42c33cbfdcdb6488968f986
Reviewed-on: https://gerrit.chromium.org/gerrit/12784
Commit-Ready: Sam Leffler <sleffler@chromium.org>
Reviewed-by: Sam Leffler <sleffler@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>
2 years agoflimflam: vpn: add reconnect state
Sam Leffler [Mon, 12 Dec 2011 22:22:37 +0000 (14:22 -0800)]
flimflam: vpn: add reconnect state

Add VPN_STATE_RECONNECT to the common vpn code to handle reconnect
work.  The plugin should call vpn_reconnect to enter this state;
the associated ipconfig state is dropped (so dns can be resolved, etc)
and the associated provider is clocked to CONNMAN_PROVIDER_STATE_CONNECT.
Return to VPN_STATE_READY happens with a notify callback or a link up
event on the device (through the registered RTNL event).

BUG=chromium-os:24116
TEST=(openvpn reconnect testing)

Change-Id: I937713f5f8d4afe9e5534ba7b015c2594fff3a85
Reviewed-on: https://gerrit.chromium.org/gerrit/12783
Reviewed-by: Ken Mixter <kmixter@chromium.org>
Commit-Ready: Sam Leffler <sleffler@chromium.org>
Tested-by: Sam Leffler <sleffler@chromium.org>