OSDN Git Service

android-x86/system-connectivity-wificond.git
7 years agoMerge "Add a helper function for logging scan result"
TreeHugger Robot [Wed, 17 Aug 2016 00:51:59 +0000 (00:51 +0000)]
Merge "Add a helper function for logging scan result"

7 years agoMerge "Get SSID from information element"
TreeHugger Robot [Wed, 17 Aug 2016 00:30:59 +0000 (00:30 +0000)]
Merge "Get SSID from information element"

7 years agoAdd a helper function for logging scan result
Ningyuan Wang [Tue, 16 Aug 2016 20:05:08 +0000 (13:05 -0700)]
Add a helper function for logging scan result

This function is only used for debugging now.

Example output:
Scan result:
SSID: GoogleGuest
BSSID: 6c:f3:7f:af:fa:b1
FREQUENCY: 5220
SIGNAL: -86dBm
TSF: 23486915

BUG=30746278
TEST=manual tests

Change-Id: Ia504a0e18723dcbffcd3d8da0920d1ea2238af70

7 years agoGet SSID from information element
Ningyuan Wang [Tue, 16 Aug 2016 20:23:09 +0000 (13:23 -0700)]
Get SSID from information element

Scan result netlink message doesn't provide SSID directly.
It provides raw information elemnt array, which contains SSID.
This helper function can get SSID from that array.

BUG=30896985
TEST=manul tests

Change-Id: I38f43a3528ddddbdc052333e5d0e15875517c89e

7 years agoCreate functions to handle scan result notification
Ningyuan Wang [Fri, 12 Aug 2016 20:42:02 +0000 (13:42 -0700)]
Create functions to handle scan result notification

BUG=30737305
TEST=compile, unit tests, integration tests

Change-Id: I763db062ccb59b71ee358723b8285e1c5f2f8aa2

7 years agoMerge "Get interface index from kernel for wificond"
TreeHugger Robot [Sat, 13 Aug 2016 00:38:37 +0000 (00:38 +0000)]
Merge "Get interface index from kernel for wificond"

7 years agoMerge changes I31237daf,Ie4c8eb49
Roshan Pius [Fri, 12 Aug 2016 21:24:25 +0000 (21:24 +0000)]
Merge changes I31237daf,Ie4c8eb49

* changes:
  wpa_supplicant_binder_test: Add reconnect tests
  wpa_supplicant_binder_test: Simple connect tests

7 years agoGet interface index from kernel for wificond
Ningyuan Wang [Thu, 11 Aug 2016 16:59:22 +0000 (09:59 -0700)]
Get interface index from kernel for wificond

This CL adds the interface index query to interface name query.

With interface index wificond can assign scan request to specific
interface and ignore scan result from uninteresting interfaces.

BUG=30808053
TEST=compile, unit tests, integration tests

Change-Id: I2a6333dcad4e9faadb7793501762602017125865

7 years agoMerge "Create a ScanResult class for wificond internal use"
TreeHugger Robot [Fri, 12 Aug 2016 21:16:59 +0000 (21:16 +0000)]
Merge "Create a ScanResult class for wificond internal use"

7 years agoCreate a ScanResult class for wificond internal use
Ningyuan Wang [Wed, 10 Aug 2016 21:40:04 +0000 (14:40 -0700)]
Create a ScanResult class for wificond internal use

An object of this class is used for storing the scan result
of a BSS.

More fields will added to this class if it is neccessary.
Future parcelable scan result class is expected to inherit
from this class.

BUG=30746278
TEST=compile

Change-Id: I5d65a6eb51e4ffdd8b92345eef6a51de61aab236

7 years agowpa_supplicant_binder_test: Add reconnect tests
Roshan Pius [Thu, 11 Aug 2016 18:21:27 +0000 (11:21 -0700)]
wpa_supplicant_binder_test: Add reconnect tests

Create a base class for all connect tests and add a
test which exercies the new iface methods:
1. IIface.Disconnect
2. IIface.Reconnect

BUG: 30667354
TEST: Ran
/data/nativetest/wpa_supplicant_binder_test/wpa_supplicant_binder_test

Change-Id: I31237dafbcbc276feef7a2814d2246f0069c12e4

7 years agowpa_supplicant_binder_test: Simple connect tests
Roshan Pius [Thu, 4 Aug 2016 22:19:56 +0000 (15:19 -0700)]
wpa_supplicant_binder_test: Simple connect tests

Add a new test file for connection tests. All the tests in this file
parse a json formatted |NetworkParams| structire from command line args.

Changes in the CL:
1. Store any incoming test args in a global |kGlobalTestArgs| variable.
These can be used by the tests as needed.
2. Add a data type |NetworkParams| which is used to deserialize json
formatted command line args to parameters that can be used to connect to
a network.
3. Add a simple connect/disconnect using the above.

BUG: 30667354
TEST: Initiated connection to open/psk networks around.
Open Networks:
/data/nativetest/wpa_supplicant_binder_test/wpa_supplicant_binder_test
'{\"NetworkParams\":{\"ssid\":\"<SSID>\"}}'
PSk Networks:
/data/nativetest/wpa_supplicant_binder_test/wpa_supplicant_binder_test
'{\"NetworkParams\":{\"ssid\":\"<SSID>\",\"psk_passphrase\":\"<PSK>\"
,\"key_mgmt\":2}}'

Change-Id: Ie4c8eb49ea5f10bfd7ba3cde19aac87ab3c85e64

7 years agoProcess all responses to queries for interface name
Christopher Wiley [Wed, 10 Aug 2016 19:10:37 +0000 (12:10 -0700)]
Process all responses to queries for interface name

Sometimes the kernel will tell us about unexpected network devices (e.g.
p2p devices without a real netdev backing them).

Also added a quick facility to log these packets in excruciating detail.
This should only be used for debugging.

Bug: 30773545
Test: angler can now configure client network interfaces in this state.
      added a unittest

Change-Id: I5423acd7dc6177f73e54150e5ef734d15703163d

7 years agoMerge "Support receiving broadcast for NetlinkManager"
TreeHugger Robot [Tue, 9 Aug 2016 22:32:47 +0000 (22:32 +0000)]
Merge "Support receiving broadcast for NetlinkManager"

7 years agoSupport receiving broadcast for NetlinkManager
Ningyuan Wang [Thu, 4 Aug 2016 22:49:09 +0000 (15:49 -0700)]
Support receiving broadcast for NetlinkManager

BUG=30737305
TEST=unit tests and integration tests

Change-Id: Ia9fb32d428970560452949b6f980b634a48c84e4

7 years agoMerge "Add unit tests for NetlinkUtils"
TreeHugger Robot [Tue, 9 Aug 2016 18:39:17 +0000 (18:39 +0000)]
Merge "Add unit tests for NetlinkUtils"

8 years agoAdd unit tests for NetlinkUtils
Ningyuan Wang [Wed, 3 Aug 2016 20:14:29 +0000 (13:14 -0700)]
Add unit tests for NetlinkUtils

This creates unit tests for helper class NetlinkUtils.
This also creates mock classes for NetlinkManager and EventLoop.

BUG=30642046
TEST=unit tests and integration tests

Change-Id: Idc3cea812e700af8a1727c380ec92cfc1f364e28

8 years agoMerge "Fix netlink errno parsing"
TreeHugger Robot [Mon, 8 Aug 2016 19:48:33 +0000 (19:48 +0000)]
Merge "Fix netlink errno parsing"

8 years agoFix netlink errno parsing
Ningyuan Wang [Thu, 4 Aug 2016 20:12:08 +0000 (13:12 -0700)]
Fix netlink errno parsing

Kernel uses negative errno for nl80211 messages.

BUG=None
TEST=compile and manual tests

Change-Id: I50f5fa82ec946f8121c846017023a76e3597589e

8 years agowpa_suppplicant_binder_test: Restructure tests
Roshan Pius [Thu, 4 Aug 2016 18:02:55 +0000 (11:02 -0700)]
wpa_suppplicant_binder_test: Restructure tests

Restructure the existing tests before adding simple connect tests.
Move the test base class and it's dependencies into a separate file
test_base.cpp & test_base.h. The original tests.cpp will only hold the
actual tests now and will add a separate |connect_tests.cpp| for
connection tests which will need some additional parsing of input args.

BUG: 30667354
Change-Id: I7c8a5e3d7ca3a291c35ad51cb2d9d4b62adeda8f
TEST: Ran existing tests.

8 years agowpa_supplicant_binder_test: Set/Get Network params
Roshan Pius [Fri, 29 Jul 2016 22:35:24 +0000 (15:35 -0700)]
wpa_supplicant_binder_test: Set/Get Network params

Add integration tests for network params set/get methods.

BUG: 1252274
Change-Id: I4b02bcff5c2d46d42cdd96524580bf7d1f521858
TEST: adb shell /data/wpa_supplicant_binder_test
--gtest_filter=*SetGet*

8 years agoSeperate netlink util functions to NL80211Utils
Ningyuan Wang [Mon, 1 Aug 2016 18:04:22 +0000 (11:04 -0700)]
Seperate netlink util functions to NL80211Utils

This creates a new clas NetlinkUtils and moves two util
functions GetWiphyIndex() and GetInterfaceName() from
NelinkManager to NetlinkUtils.

BUG=30565670
TEST=unit tests and integration tests

Change-Id: I713d4388e688f5235b7fbf61c7b9ea9341d667db

8 years agoMerge changes I1960dfc7,I82b5eb43
Roshan Pius [Wed, 3 Aug 2016 17:17:00 +0000 (17:17 +0000)]
Merge changes I1960dfc7,I82b5eb43

* changes:
  binder_dispatcher: Prevent test flakes
  Add iface/network addition/removal callback tests

8 years agobinder_dispatcher: Prevent test flakes
Roshan Pius [Tue, 26 Jul 2016 16:30:01 +0000 (09:30 -0700)]
binder_dispatcher: Prevent test flakes

Loopers & binder fd instances are sticky on a given thread. So, every
test with a new instance of |BinderDispatcher| still share the same
looper & fd instances which could lead to potential leakage of events
across tests.

Changes in the CL:
1. Stop using |PostDelayed| task to enforce the wait timeout. This could
leave behind a stale message which might affect any future tests. So,
revert back to the original design of processing each event and then
checking if the |elapsed_time| has crossed over the |timeout|.
2. In the destructor of |BinderDispatcher|, destroy the |ProcessState|
instance to trigger cleanup of the binder driver.

While there,
Flip the |needs_init| flag usage to correctly reflect the name of the
variable.

BUG: 30122642
Change-Id: I1960dfc782c6b93dcb591964b5b6cc9a984a536a
TEST: All tests run successfully.

8 years agoAdd iface/network addition/removal callback tests
Roshan Pius [Thu, 21 Jul 2016 15:56:41 +0000 (08:56 -0700)]
Add iface/network addition/removal callback tests

Use the |BinderDispatcher| module to verify callbacks from
wpa_supplicant for interface/network addition/removal.

BUG: 30093041
Change-Id: I82b5eb432b7c355407c3c383960b0d1258cc76ae
TEST: /data/wpa_supplicant_binder_test

8 years agoAdd support for creating client interfaces
Christopher Wiley [Wed, 27 Jul 2016 20:48:22 +0000 (13:48 -0700)]
Add support for creating client interfaces

Bug: 30041062
Test: unit/integration tests pass

Change-Id: I48a0adc338e474085c399750441198a4acae2cf5

8 years agoMerge "Move integration tests for IApInterface to their own file"
TreeHugger Robot [Tue, 2 Aug 2016 15:51:08 +0000 (15:51 +0000)]
Merge "Move integration tests for IApInterface to their own file"

8 years agoMerge "Add script to run related unit tests"
Christopher Wiley [Tue, 2 Aug 2016 15:50:35 +0000 (15:50 +0000)]
Merge "Add script to run related unit tests"

8 years agoMerge "Give hostapd a hint that it is about to die"
Christopher Wiley [Tue, 2 Aug 2016 15:49:57 +0000 (15:49 +0000)]
Merge "Give hostapd a hint that it is about to die"

8 years agoHandle control messages for NetlinkManager
Ningyuan Wang [Thu, 28 Jul 2016 22:44:10 +0000 (15:44 -0700)]
Handle control messages for NetlinkManager

BUG=30508758
TEST=compile
TEST=unittests and intergration tests still pass

Change-Id: I6de34a4b3b7537e68a74810e4416735bc69ba3b3

8 years agouse DISALLOW_COPY_AND_ASSIGN for NetlinkManager
Ningyuan Wang [Fri, 29 Jul 2016 23:18:00 +0000 (16:18 -0700)]
use DISALLOW_COPY_AND_ASSIGN for NetlinkManager

BUG=None
TEST=compile

Change-Id: I34d979561c85c754e8af4c06954d19b5f7153799

8 years agoMerge "Get interface name for server"
Ningyuan Wang [Fri, 29 Jul 2016 22:29:15 +0000 (22:29 +0000)]
Merge "Get interface name for server"

8 years agoAdd IsStarted() to NetlinkManager
Ningyuan Wang [Fri, 29 Jul 2016 17:47:06 +0000 (10:47 -0700)]
Add IsStarted() to NetlinkManager

This is useful to prevent multiple Start() on a NetlinkManager
obejct.

BUG=29454786
TEST=compile
TEST=unittests and intergration tests still pass

Change-Id: I006d6d9d229b16d42670534518703d9f20e602ec

8 years agoMove integration tests for IApInterface to their own file
Christopher Wiley [Thu, 21 Jul 2016 16:06:33 +0000 (09:06 -0700)]
Move integration tests for IApInterface to their own file

Move existing tests related to IApInterface to a new file.
Add additional test coverage to exercise IApInterface.

Bug: 30040724
Test: These tests pass.  Unfortunately, hostapd start/stop
      is still not as reliable as we'd like.

Change-Id: I08956798c917cf6abf09ab44c48b3588c61c8de5

8 years agoAdd script to run related unit tests
Christopher Wiley [Fri, 29 Jul 2016 17:59:00 +0000 (10:59 -0700)]
Add script to run related unit tests

This helps us believe we're going to pass continuous testing.

Bug: 30501113
Change-Id: I053ae37fa80c5e75186a07e259a1d6609dbdf4ce
Test: This script reliably runs tests.

8 years agoGive hostapd a hint that it is about to die
Christopher Wiley [Thu, 28 Jul 2016 22:07:47 +0000 (15:07 -0700)]
Give hostapd a hint that it is about to die

Give hostapd SIGTERM and some time do take itself down
before dropping SIGKILL on it.  This is blocking, and
we'll eventually replace it with an asynchronous interface
but it keeps us healthy for now.

Bug: 30311493
Change-Id: Iadbd3a4fd5c49c42d9bba12f19cfcd65ee567a67
Test: Integration tests finally pass reliably

8 years agoGet interface name for server
Ningyuan Wang [Thu, 28 Jul 2016 00:38:32 +0000 (17:38 -0700)]
Get interface name for server

This CL adds a util function on NetlinkManager for getting
interface name from kernel.

Server uses this function after driver and firmware reloading
to verify the interface is set up correctly.

BUG=29454786
TEST=unit tests and intergration tests

Change-Id: Ib8cea0e7cb744be428ddaf96b6d50f10a6cea255

8 years agoDo not use callback parameter for synchronous NL80211 interface
Ningyuan Wang [Thu, 28 Jul 2016 00:08:07 +0000 (17:08 -0700)]
Do not use callback parameter for synchronous NL80211 interface

BUG=29454786
TEST=compile
TEST=unittests and intergration tests still pass

Change-Id: Ibaf15c82035837b73021c70922e96f870fcec36b

8 years agoGet wiphy index using NL80211 messages
Ningyuan Wang [Thu, 21 Jul 2016 18:12:10 +0000 (11:12 -0700)]
Get wiphy index using NL80211 messages

Add utils functions in NetlinkManager to get wiphy index.
wificond should refresh wiphy index using those utils after
reloading the driver.

BUG=29454786
TEST=compile
TEST=unittests and intergration tests still pass

Change-Id: I303ac6b81ab3650acfb7a823cb0b423f55d373b4

8 years agoMerge "Add function StopWatchFileDescriptor() to event_loop"
TreeHugger Robot [Wed, 27 Jul 2016 22:50:05 +0000 (22:50 +0000)]
Merge "Add function StopWatchFileDescriptor() to event_loop"

8 years agoAdd function StopWatchFileDescriptor() to event_loop
Ningyuan Wang [Tue, 26 Jul 2016 20:45:57 +0000 (13:45 -0700)]
Add function StopWatchFileDescriptor() to event_loop

This add a function StopWatchFileDescriptor() to wificond
event_loop implementation.

This function is useful when we need to clean up old fds.

This also adds the corresponding unit tests, and fixes a few
typing problems in looper unit tests.

BUG=30442552
TEST=compile
TEST=unit tests

Change-Id: I787670c26f0389d5060362454c55525629494023

8 years agoUpdate netlink timeout value
Ningyuan Wang [Tue, 26 Jul 2016 17:54:24 +0000 (10:54 -0700)]
Update netlink timeout value

android.net.ip uses 300ms as a waiting timeout for
netlink requests.
This CL updates the value according to that.
while there fixes a typo.

BUG=29454786
TEST=compile
TEST=unit tests and intergration tests

Change-Id: I9e7b1b5ed282499cdd2bd637bc9e2a39d35ded67

8 years agoAdd a module for binder callback handling in tests
Roshan Pius [Thu, 21 Jul 2016 15:55:25 +0000 (08:55 -0700)]
Add a module for binder callback handling in tests

Add a new module |BinderDispatcher| to wait for callback events
from |wificond| & |wpa_supplicant|.
The new module provides 2 public methods:
1. |DispatchFor()|: Will be invoked from the body of the test to
process all incoming binder events until |InterruptDispatch|.
2. |InterruptDispatch()|: Will be invoked from the binder object
to indicate the occurence of an event.

PS: Opted against using a multi-threaded approach here because we
anyway need to block the main thread until the callback is received.

BUG: 30122642
Change-Id: Ibfff79977bcf51942b5a67eb5b345be433ec9cc8

8 years agoControl hostapd from IApInterface
Christopher Wiley [Mon, 18 Jul 2016 22:30:58 +0000 (15:30 -0700)]
Control hostapd from IApInterface

Add AIDL interfaces, implementation, and tests to wificond.

Bug: 30040724
Test: unitests pass
Test: integration tests pass

Change-Id: I75339d64bf92941de26c7552b6b711cbea00eb80

8 years agoMove process utilities to process_utils.cpp
Christopher Wiley [Wed, 20 Jul 2016 18:09:32 +0000 (11:09 -0700)]
Move process utilities to process_utils.cpp

These are handy for a number of other tests.

Bug: 30040724
Change-Id: I5510b0df39831c8df842d6d7c9d55ea51a2b8c0b
Test: Compiles, unit/integration tests pass

8 years agoUse different sockets for synchronous and asynchrouns netlink interface
Ningyuan Wang [Tue, 19 Jul 2016 18:09:45 +0000 (11:09 -0700)]
Use different sockets for synchronous and asynchrouns netlink interface

NetlinkManager provides an interface synchronously waiting for netlink
reply.
In order not to bring in complexity of message rescheduling we use
different sockets for synchrounous and asynchrounous interfaces.

BUG=29454786
TEST=compile
TEST=unittests pass and wificond can still get nl80211 family id

Change-Id: I3fd693882d6e1734c3ee7f470b17ffc05152f28b

8 years agoMerge "Create NetlinkManager instance"
TreeHugger Robot [Wed, 20 Jul 2016 18:29:23 +0000 (18:29 +0000)]
Merge "Create NetlinkManager instance"

8 years agoCreate NetlinkManager instance
Ningyuan Wang [Mon, 18 Jul 2016 23:27:39 +0000 (16:27 -0700)]
Create NetlinkManager instance

BUG=29454786
TEST=compile
TEST=unittests

Change-Id: I1834cc558282ec15f92ce846e5e6921151aa64ed

8 years agoMerge "Change netlink message receive buffer size"
Ningyuan Wang [Wed, 20 Jul 2016 16:58:57 +0000 (16:58 +0000)]
Merge "Change netlink message receive buffer size"

8 years agoChange netlink message receive buffer size
Ningyuan Wang [Tue, 19 Jul 2016 20:32:47 +0000 (13:32 -0700)]
Change netlink message receive buffer size

TEST=compile
BUG=30167405

Change-Id: Ifbe39350f852978873a1858791d922d54ad75afe

8 years agoFix integration tests to not expect binder exceptions
Christopher Wiley [Tue, 19 Jul 2016 14:56:55 +0000 (07:56 -0700)]
Fix integration tests to not expect binder exceptions

We removed these exceptions in favor of a null binder from
createApInterface().

Bug: 30159593
Change-Id: I5789676df7068dfc01e6106321412c312fa1283b

8 years agoMerge "Expect to always get a Status::ok() from IWificond methods"
TreeHugger Robot [Tue, 19 Jul 2016 01:43:36 +0000 (01:43 +0000)]
Merge "Expect to always get a Status::ok() from IWificond methods"

8 years agoExpect to always get a Status::ok() from IWificond methods
Christopher Wiley [Tue, 19 Jul 2016 00:15:28 +0000 (17:15 -0700)]
Expect to always get a Status::ok() from IWificond methods

Bug: 30159593
Change-Id: I9d9d1ee78d3fb51c801ea8a4cce877468f77613f

8 years agoMerge "Create NetlinkManager for wificond"
TreeHugger Robot [Mon, 18 Jul 2016 22:56:26 +0000 (22:56 +0000)]
Merge "Create NetlinkManager for wificond"

8 years agoCreate NetlinkManager for wificond
Ningyuan Wang [Wed, 13 Jul 2016 21:11:24 +0000 (14:11 -0700)]
Create NetlinkManager for wificond

This CL creates class NetlinkManager.
In this CL, NetlinkManager sets up netlink socket and
requests NL80211 family id from kernel.
This is the start point of all other NL80211 operations.

BUG=29454786
TEST=compile
TEST=unit tests
TEST=manual tests

Change-Id: I3f8e08c2836d64a39243efb71cf387dab226a621

8 years agoMerge "Change include directory"
TreeHugger Robot [Mon, 18 Jul 2016 21:04:20 +0000 (21:04 +0000)]
Merge "Change include directory"

8 years agoChange include directory
Ningyuan Wang [Fri, 15 Jul 2016 23:47:54 +0000 (16:47 -0700)]
Change include directory

This make our local headers clearly wificond prefixed.

TEST=compile
BUG=None

Change-Id: I68cc9efd2f73bec7a4cbec09a470af58420ac3e1

8 years agoMerge "Do not throw RuntimeException on error"
TreeHugger Robot [Mon, 18 Jul 2016 18:47:56 +0000 (18:47 +0000)]
Merge "Do not throw RuntimeException on error"

8 years agoDo not throw RuntimeException on error
Christopher Wiley [Fri, 15 Jul 2016 18:30:34 +0000 (11:30 -0700)]
Do not throw RuntimeException on error

Signal that we've hit an error condition while creating an interface by
returning null and logging a message in wificond.  The Java can't do
anything more meaningful with an exception.

Bug: 30159593
Change-Id: I5e75f2edad4a5e319adc865216a2e3566d9a1573
Test: WiFi tethering continues to work.

8 years agoMove to ParcelableIfaceParams for |CreateInterface|
Roshan Pius [Wed, 13 Jul 2016 18:12:34 +0000 (11:12 -0700)]
Move to ParcelableIfaceParams for |CreateInterface|

BUG: 29877893
Change-Id: I426a1fed5dc7a7d0daf6b0240910dbd4f8fa2085
TEST: /data/wpa_supplicant_binder_test

8 years agoAdd wpa debug params setter/getter tests
Roshan Pius [Mon, 11 Jul 2016 18:02:03 +0000 (11:02 -0700)]
Add wpa debug params setter/getter tests

Changes in the CL:
Increase wpa_supplicant debug level before test starts in
|WpaSupplicantBinderTest.Setup|.
Tests in the CL:
1. Verification of |GetDebugLevel|, |GetDebugShowTimeStamp| &
|GetDebugShowKeys| RPMC calls..

BUG: 29877893
Change-Id: Iaf504559fdd0bec5c66b7b49d80f843f188c3b6d
TEST: /data/wpa_supplicant_binder_test

8 years agoAdd wpa |network| binder object tests
Roshan Pius [Sat, 9 Jul 2016 00:04:31 +0000 (17:04 -0700)]
Add wpa |network| binder object tests

Tests in the CL:
1. AddNetwork/RemoveNetwork tests under |IIfaceTest|.
2. GetID/GetInterfaceName tests under |IINetworkTest|.
3. GetId on a stale network object.

BUG: 29877893
Change-Id: If77ab57eb5f81bcfeffff07e01be6d032d2a659f
TEST: /data/wpa_supplicant_binder_test

8 years agoAdd wpa |iface| binder object tests.
Roshan Pius [Fri, 8 Jul 2016 23:35:58 +0000 (16:35 -0700)]
Add wpa |iface| binder object tests.

2 tests added:
1. Verify the name of the iface from the binder object.
2. Verify that any binder calls on a removed interface raises error.

BUG: 29877893
TEST: /data/wpa_binder_test

Change-Id: I554f3ae7fc626116714b0fed076cbce9af2ef310

8 years agoAdd wpa binder integration tests
Roshan Pius [Thu, 7 Jul 2016 16:37:25 +0000 (09:37 -0700)]
Add wpa binder integration tests

Moving the wpa_supplicant binder interface integration tests to wificond.

These tests uses |gtests| and need to hardcode some strings for basic
verification of the binder interface. So, we probably don't want to put this in
wpa_supplicant's open source codebase.

BUG: 29877893
Change-Id: I778fceab418354e106ab36fb15fb9746a88c6947
TEST: Ran existings test on device: /data/wpa_binder_test

8 years agoChange AIDL style to match other AIDL style
Christopher Wiley [Tue, 12 Jul 2016 18:46:08 +0000 (11:46 -0700)]
Change AIDL style to match other AIDL style

Bug: 30090557
Change-Id: Ic0ecca115bb94c04446edfe5c7299a70bc10e4b2
Test: Compiles

8 years agoMerge "Initial commit for NL80211Packet"
Ningyuan Wang [Wed, 13 Jul 2016 21:19:33 +0000 (21:19 +0000)]
Merge "Initial commit for NL80211Packet"

8 years agoInitial commit for NL80211Packet
Ningyuan Wang [Thu, 7 Jul 2016 21:25:14 +0000 (14:25 -0700)]
Initial commit for NL80211Packet

This CL adds the initial implementation of class NL80211Packet
as well as the corresponding unit tests.

BUG=29454786
TEST=compile
TEST=run unittests

Change-Id: Ide5393e77650d157cc3045ffdaaf5b62615a5346

8 years agowificond: Fix ServerTest
Ningyuan Wang [Wed, 13 Jul 2016 18:22:31 +0000 (11:22 -0700)]
wificond: Fix ServerTest

ServerTest failed because we no longer turn down interface
explicitly in wificond when setting up interface mode.

TEST=compile
TEST=unit tests

Change-Id: I05448944a063bdb95885ad20aa8228fbea08288a

8 years agoRemove extra interface down
Christopher Wiley [Fri, 8 Jul 2016 22:15:02 +0000 (15:15 -0700)]
Remove extra interface down

This code was put here because WifiStateMachine#setupDriverForSoftAp()
had a similar clause.  However that code was a no-op, because the HAL
was stopped at the point that it was called, preventing WSM from getting
the interface index to turn down.

The very next thing that WSM did after setting the interface status to
down was to start the HAL, which sets the interface state to up anyway.

Change-Id: I184166bfd45b33171c3b2603a4ac3423e1674132

8 years agoMerge "Support more types of nl80211 attributes"
Ningyuan Wang [Thu, 7 Jul 2016 21:14:18 +0000 (21:14 +0000)]
Merge "Support more types of nl80211 attributes"

8 years agoSupport more types of nl80211 attributes
Ningyuan Wang [Thu, 30 Jun 2016 17:36:47 +0000 (10:36 -0700)]
Support more types of nl80211 attributes

This CL includes the following changes:
1.
  Improve the interface design of NL80211Attribute classes.
  Add a function GetAttributeValue() to NL80211NestedAttr class.
2.
  Support more types of nl80211 attributes. This includes all
  size of interger types, string, flag, and raw buffer.
3.
  Guarantee payload size alignment by padding 0s.
4.
  Support FLAG attribute by adding a function AddAttribute(int id).
  We don't instanciate any flag attribute because it has no payload.
5.
  Add corresponding unit tests.

BUG=29454786
TEST=compile
TEST=run unittests

Change-Id: I3653a3babfc1df5dde42eecf4410fd636d26b956

8 years agoSetup wlan0 in AP mode on request
Christopher Wiley [Fri, 24 Jun 2016 20:40:25 +0000 (13:40 -0700)]
Setup wlan0 in AP mode on request

Test: Added unittests that we call appropriate functionality from
      libwifi-system, integration tests continue to pass
Bug: 29579539

Change-Id: I7f3c565765d88f9bb522fd31d2e8e5be6e289e5c

8 years agoMove nl80211 code to its own library
Ningyuan Wang [Thu, 30 Jun 2016 21:29:11 +0000 (14:29 -0700)]
Move nl80211 code to its own library

BUG=29454786
TEST=compile
TEST=unit tests passed

Change-Id: I30db0ec98876967221c15c1519cd5c98211ca379

8 years agoMerge "Initial commit for nl80211 attribute"
TreeHugger Robot [Thu, 30 Jun 2016 18:08:58 +0000 (18:08 +0000)]
Merge "Initial commit for nl80211 attribute"

8 years agoInitial commit for nl80211 attribute
Ningyuan Wang [Fri, 24 Jun 2016 22:31:13 +0000 (15:31 -0700)]
Initial commit for nl80211 attribute

This CL includes the following changes:
1. Initial design for NL80211Attribute classes.
2. Unittests verifying the functions of NL80211Attribute
   classes. This also shows how these internal interfaces
   are going to be used.

BUG=29454786
TEST=compile
TEST=run unittests

Change-Id: I52f07f9a45d5966a7787c591c5f90dc1bf55ecf8

8 years agoAdd a developer mode to wificond
Christopher Wiley [Mon, 27 Jun 2016 20:43:03 +0000 (13:43 -0700)]
Add a developer mode to wificond

When wificond starts up it will now check a system property
and claim a slightly different service name if the property
is set to true.

This allows us to restart wificond in a way which prevents the framework
from talking to wificond.

Bug: 29584274
Test: Modified integration tests confirm this is working.

Change-Id: I1aed389fbcb047f466f94ca568b66df4b7f9a419

8 years agoRefactor initial binder configuration
Christopher Wiley [Mon, 27 Jun 2016 18:38:27 +0000 (11:38 -0700)]
Refactor initial binder configuration

Separate blocks of functionality into functions for readability.
Rename event_dispatcher_ to event_dispatcher, since it isn't a class
    member.
Check that service registration was successful.

Bug: 29584274
Change-Id: Iec7c01e8974062403c1a207a80f028b70d9d11c1
Test: unit, integration tests pass

8 years agoExpose IPC interfaces to create/destroy AP interfaces
Christopher Wiley [Thu, 23 Jun 2016 00:20:04 +0000 (17:20 -0700)]
Expose IPC interfaces to create/destroy AP interfaces

Bug: 29579539
Change-Id: I49e050a6c806a5841931b1c2cddfbba7925f744a
Test: Unit, integration tests pass

8 years agoSpeed up LifeCycleTest
Christopher Wiley [Thu, 23 Jun 2016 00:23:46 +0000 (17:23 -0700)]
Speed up LifeCycleTest

IServiceManager::checkService() returns immediately, while
getService() will block for 5 seconds.

Change-Id: Ic64add5b60bff0f509ff879fc75a0194ec883e8f

8 years agoRemove the concept of a chip from wificond
Christopher Wiley [Wed, 22 Jun 2016 21:46:18 +0000 (14:46 -0700)]
Remove the concept of a chip from wificond

Today, there is little point in obsessing about chips, since we have
exactly one chip per device.  At some point, wificond will need to
become aware of chips, but we can make more progress by delaying
speculation until the HAL is ready.

Bug: 29578895
Change-Id: I68b2d069118538555b7a9fb315e62f294f13bbeb
Test: Compiles, unit, integration tests pass

8 years agoWificond: support multiple callbacks registration
Ningyuan Wang [Thu, 16 Jun 2016 21:39:44 +0000 (14:39 -0700)]
Wificond: support multiple callbacks registration

This allows multiple callbacks to be registered
simultaneously with wificond chip object.

Duplicate registrations of the same callback will be ignored.

BUG=29222398
TEST=compile
TEST=A local integration test registering same objects.
    Then check log to ensure it is handled correctly.

Change-Id: I946a9935f6c839ef2f97ed345c20fc2932853b33

8 years agoUse SYSTEM instead of MAIN for wificond logging
Ningyuan Wang [Thu, 16 Jun 2016 20:08:31 +0000 (13:08 -0700)]
Use SYSTEM instead of MAIN for wificond logging

BUG=29418605
TEST=compile
TEST=adb logcat -b system | grep wificond

Change-Id: I1ea949cb5c9cec9884d9cf25be372a8bfd86e1cb

8 years agoWificond: Expose IChip and IClientInterface object
Ningyuan Wang [Tue, 14 Jun 2016 18:35:58 +0000 (11:35 -0700)]
Wificond: Expose IChip and IClientInterface object

This CL enabls wificond to expose chips and client
interfaces through binder.

This also adds an intergration test to verify we can
access these objects through binder.

BUG=29222398
TEST=compile
TEST=unit tests passed
TEST=new intergration tests passed

Change-Id: I352928de382aa22e9bdb27e9dfb49fdc8ce36994

8 years agoMerge "Keep watching file descriptor after callback is called."
TreeHugger Robot [Tue, 14 Jun 2016 18:00:29 +0000 (18:00 +0000)]
Merge "Keep watching file descriptor after callback is called."

8 years agoKeep watching file descriptor after callback is called.
Ningyuan Wang [Tue, 14 Jun 2016 00:00:31 +0000 (17:00 -0700)]
Keep watching file descriptor after callback is called.

BUG=NONE
TEST=compile and run unittests

Change-Id: I6c8039661071d594f7405288e41622560ca1dc5f

8 years agoAdd missing header guards to server.h
Christopher Wiley [Mon, 13 Jun 2016 23:53:29 +0000 (16:53 -0700)]
Add missing header guards to server.h

Bug: None
Change-Id: I143d6556c85670e75c52c36bcf2726333ca08984
Test: Compiles

8 years agoTest that wificond claims its binder service
Christopher Wiley [Thu, 9 Jun 2016 23:42:49 +0000 (16:42 -0700)]
Test that wificond claims its binder service

Bug: 28867751
Test: Integration, unit tests continue to pass

Change-Id: I6eb42fa25d46154d6c60dc25caa9e606806705f9

8 years agoRe-organize wificond makefile
Christopher Wiley [Fri, 10 Jun 2016 16:25:49 +0000 (09:25 -0700)]
Re-organize wificond makefile

All tests are now run on the device (unittest and integration).
Stop compiling host side versions of our static libraries.
Move IPC related source into a dedicated static library.
  - integration tests need to be able to speak to wificond
  - integration tests should not be linked against wificond internal
    logic
Move server.cpp into the static library implementing wificond.

Bug: 28867751
Test: Compiles, unittests still pass

Change-Id: Ibe118576dbc09b309d589e5a015941428e3096b7

8 years agoFix shell path on linux host
Christopher Wiley [Thu, 9 Jun 2016 21:13:17 +0000 (14:13 -0700)]
Fix shell path on linux host

__ANDROID__ defines our building for a device target vs host target,
not ANDROID.

Bug: 28867215
Change-Id: I52aab82cbd0ed3902105c97fcd8d111440ae893b
Test: ./out/host/linux-x86/nativetest/wificond_unit_test/wificond_unit_test

8 years agoMerge "Add integration test for wificond lifetime"
TreeHugger Robot [Thu, 9 Jun 2016 19:47:48 +0000 (19:47 +0000)]
Merge "Add integration test for wificond lifetime"

8 years agoMerge "Add AIDL defining AP and client interfaces"
TreeHugger Robot [Thu, 9 Jun 2016 18:27:25 +0000 (18:27 +0000)]
Merge "Add AIDL defining AP and client interfaces"

8 years agoMerge "Add android.net.wifi.IWificond AIDL"
Christopher Wiley [Thu, 9 Jun 2016 18:27:13 +0000 (18:27 +0000)]
Merge "Add android.net.wifi.IWificond AIDL"

8 years agoAdd integration test for wificond lifetime
Christopher Wiley [Tue, 7 Jun 2016 15:53:15 +0000 (08:53 -0700)]
Add integration test for wificond lifetime

This test merely confirms that we can stop wificond, then restart it.

Bug: 28867215
Test: This test pases when wificond is added into PRODUCT_PACKAGES for
      a device.

Change-Id: I5e8cc450f9bc299ce67ae97ecee01c665746c501

8 years agoAdd a utility for executing shell commands
Christopher Wiley [Mon, 6 Jun 2016 22:50:59 +0000 (15:50 -0700)]
Add a utility for executing shell commands

This comes in handy for writing integration tests that exercise system
services.

Bug: 28867215
Test: Unitttests pass, added another

Change-Id: Ief84c9170e1d07b3064d7e4016f74175e12ccded

8 years agoAdd AIDL defining AP and client interfaces
Christopher Wiley [Wed, 8 Jun 2016 22:44:55 +0000 (15:44 -0700)]
Add AIDL defining AP and client interfaces

Right now, we don't actually implement any of these classes.

Bug: 29218284
Test: Compiles, integration, unittests complete

Change-Id: Ib2a507a21f1c7366e7eec0c02494b7edd3bbf3fa

8 years agoAdd android.net.wifi.IWificond AIDL
Christopher Wiley [Wed, 8 Jun 2016 21:55:36 +0000 (14:55 -0700)]
Add android.net.wifi.IWificond AIDL

This is the root object exposed by wificond via Binder as described in
the design document.

Bug: 29218284
Change-Id: Ia6a21285f974d322f3ed9dd20e865fac4c4b31ac
Test: Compiles, unit, integration tests pass.

8 years agoBinder interface skeleten of wificond
Ningyuan Wang [Thu, 2 Jun 2016 22:33:10 +0000 (15:33 -0700)]
Binder interface skeleten of wificond

This CL adds a dummy binder interface of wificond.
There is only one function called Ping() which is
supposed to return a std string "Pong".

BUG=28867093
TEST=compile
TEST=Mannually modify wificond sepolicy file to allow
  binder operations.
     Use an executable to test this interface by calling
  Ping() through binder and verifying the response is
  "Pong".

Change-Id: I8b5b1b65811f018612ad095f692d8acf2289c3c9

8 years agoImplement watching file descriptor for wificond event loop
Ningyuan Wang [Fri, 27 May 2016 20:44:22 +0000 (13:44 -0700)]
Implement watching file descriptor for wificond event loop

This CL allows wificond event loop to watch a file descriptor.
Specific callback will be executed when a file descriptor is
ready for input or output.

BUG=28982981
BUG=28867514
TEST=compile
TEST=run out/host/linux-x86/bin/wificond_unit_test

Change-Id: I6417ccdf08fa175acf90824dab16804d4bc624c5

8 years agoUnit tests for wificond looper backed event loop
Ningyuan Wang [Thu, 26 May 2016 22:49:07 +0000 (15:49 -0700)]
Unit tests for wificond looper backed event loop

BUG=28982981
TEST=compile
TEST=run out/host/linux-x86/bin/wificond_unit_test

Change-Id: If54c7e02b68ca82cbb1fddfae144a71c73561b8d

8 years agoEvent loop wrapper classes for wificond
Ningyuan Wang [Tue, 24 May 2016 20:35:04 +0000 (13:35 -0700)]
Event loop wrapper classes for wificond

This CL includes the following change:
  1. An abstract class EventLoop for the event loop.
  2. An impementation LooperBackedEventLoop using
  looper in libutils.

BUG=28867514
TEST=compile
TEST=manually tested

Change-Id: Ieeded846761d627487144d122d3a733abda46d1e