History log of /external/autotest/client/common_lib/cros/fake_device_server/devices.py
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
735fec04a0041878cddd4877433414f528fac68d 16-Aug-2015 Vitaly Buka <vitalybuka@chromium.org> libweave: Remove device_kind and embedded_code_path

Keep only embedded_code, implementation will decide how to get it.
device_kind is not supported by server already.

BUG=brillo:1257
TEST=`FEATURES=test emerge-gizmo libweave buffet`
`test_that -b $BOARD $DEV_HOST e:buffet_.*`

Change-Id: I3ed09c8e879db4c0c5737b523d3b16cd31360619
Reviewed-on: https://chromium-review.googlesource.com/293940
Reviewed-by: Vitaly Buka <vitalybuka@chromium.org>
Commit-Queue: Vitaly Buka <vitalybuka@chromium.org>
Tested-by: Vitaly Buka <vitalybuka@chromium.org>
/external/autotest/client/common_lib/cros/fake_device_server/devices.py
c5e287d5afa2a565674154437b744acbe77e1912 24-Jul-2015 Alex Vakulenko <avakulenko@chromium.org> Fix fake-gcd-server to include device resource timestamp

Buffet now requires lastUpdateTimeMs timestamp on device resource,
so changed the test fake GCD server to include the timestamp.

Also, fixed GET request for '/devices/<id>' to retrieve the api_key
from the authorization header via access token, when this call
originates from buffet process (which does not include "?key=..."
query parameters on the URL).

BUG=brillo:1261
TEST=`test_that -b link <ip> "e:buffet_.*"`

Change-Id: I35b7b56bf51d52c38f4324827d7f48422c690ad5
Reviewed-on: https://chromium-review.googlesource.com/288010
Reviewed-by: Vitaly Buka <vitalybuka@chromium.org>
Tested-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
/external/autotest/client/common_lib/cros/fake_device_server/devices.py
e24dba0976c3e97df4640c6b89502a430cc91ebb 19-Mar-2015 David Zeuthen <zeuthen@chromium.org> buffet: Check that buffet reconnects in case the server return an error.

We do this by making fake_device_server return HTTP Error 500 and then
check that buffet reverts to the CONNECTING state. Then we stop
failing requests and check that buffet reverts to CONNECTED. This is
intended to simulate the device losing connectivity to the server and
then reconnecting once connectivity has been restored.

TEST=buffet_Registration still passes.
BUG=brillo:593

Change-Id: I496120ad72d44c225c5a53dbf3bd92c437bdc8a8
Reviewed-on: https://chromium-review.googlesource.com/260842
Tested-by: David Zeuthen <zeuthen@chromium.org>
Reviewed-by: Vitaly Buka <vitalybuka@chromium.org>
Commit-Queue: David Zeuthen <zeuthen@chromium.org>
/external/autotest/client/common_lib/cros/fake_device_server/devices.py
57f2ed1cddace69c180e956d12b56a60150112ce 27-Feb-2015 Nathan Bullock <nathanbullock@google.com> buffet: Handle authentication failures better

Previously the lack of an access token would raise a "list index out
of range" assertion, and cause a 500 response. This was causing buffet
to fail since it didn't realize it needed to reauthenticate.

TEST=test_that <ip_address> buffet_Registration
BUG=brillo:378

Change-Id: Ifdbc64c6a28cbedea7cd176b395666be975da71d
Reviewed-on: https://chromium-review.googlesource.com/254560
Reviewed-by: David Zeuthen <zeuthen@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: Nathan Bullock <nathanbullock@google.com>
Tested-by: Nathan Bullock <nathanbullock@google.com>
/external/autotest/client/common_lib/cros/fake_device_server/devices.py
3c02dbac644d951bc264158d3f4efea577345b84 12-Feb-2015 Christopher Wiley <wiley@chromium.org> autotest: Support post Registration Buffet requests

Buffet tries to patch its device resource on startup, aborts
limbo commands, and then starts periodically polling for commands.

BUG=brillo:15
TEST=buffet_Registration passes with these changes after being
expanded to expect command polling to work.

Change-Id: I0e3cce44fdf088bf2d063a03ff07e5073624e03d
Reviewed-on: https://chromium-review.googlesource.com/249540
Tested-by: Christopher Wiley <wiley@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>
/external/autotest/client/common_lib/cros/fake_device_server/devices.py
0f333af62f6f39a9cdc1bd0521345cd3a39c29e3 09-Feb-2015 Christopher Wiley <wiley@chromium.org> buffet: Bring fake_device_server up to speed with registation flow

The actual registration flow has changed a little bit. In particular,
now the client POSTs to create a ticket, the device PATCHes it, and
then the device POSTs to finalize the ticket.

BUG=brillo:172
TEST=A test consuming these APIs passes.

Change-Id: Ifd1d1c6e4bbd23ef34062c12529eca1e36e66713
Reviewed-on: https://chromium-review.googlesource.com/247560
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: Christopher Wiley <wiley@chromium.org>
Tested-by: Christopher Wiley <wiley@chromium.org>
/external/autotest/client/common_lib/cros/fake_device_server/devices.py
feedba871f9ea080e3562f7d9875f09e63468c55 08-May-2014 Chris Sosa <sosa@chromium.org> Add auth support to client_lib and test to be able to use against the live server.

In this CL I've added various oauth helpers to convert codes to auth tokens
for use when interacting with our actual servers. In order to facilitate quick
testing I've modified this test script to either test against the fake
server OR the live server based on whether you pass in an auth code
to the command line (see usage).

There's still a couple issues (left as TODO's here) but this seems like
a good point for review.

BUG=chromium:361204
TEST=Tested up to command insertion with live server + fake server + unittests

Change-Id: Ic7166ddaa50d171dbf9a8cbb4b50b736f79a32b6
Reviewed-on: https://chromium-review.googlesource.com/198784
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: Chris Sosa <sosa@chromium.org>
/external/autotest/client/common_lib/cros/fake_device_server/devices.py
12dd813c417478dffb4bf66994eebbb125db7a27 29-Apr-2014 Chris Sosa <sosa@chromium.org> Add a small Python client library to communicate with the buffet server.

This CL adds a small client library for interacting with the
fake_device_server. Currently it does not support the actual service
as I do not pass all the necessary HEADERS to auth needed (which I will
add later).

I've also added an integration test script that runs through all the common
client methods / server interactions for testing this library.

BUG=chromium:361204
TEST=Ran integration test.

Change-Id: Ieb0c4d594557fabbc3871f549e932c87f73afb05
Reviewed-on: https://chromium-review.googlesource.com/197430
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Alex Vakulenko <avakulenko@chromium.org>
/external/autotest/client/common_lib/cros/fake_device_server/devices.py
8e9f21c005c170c5868576d86870bc175af8c610 17-Apr-2014 Chris Sosa <sosa@chromium.org> Remove complex autotest common code.

So the autotest imports make it really hard to install fake_device_server
as a standalone server. This CL removes that and just requires that the
Python code be installed in a directory called fake_device_server since
we have no Autotest dependencies.

BUG=chromium:361204
TEST=Started server + ran all unittests.

Change-Id: Iefcb5105cb96f07a99c919a1d3d41bf5ff3cb46f
Reviewed-on: https://chromium-review.googlesource.com/195454
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Commit-Queue: Chris Sosa <sosa@chromium.org>
/external/autotest/client/common_lib/cros/fake_device_server/devices.py
626d491db01f46f7ac9943a2508b1e8e9844d39c 17-Apr-2014 Chris Sosa <sosa@chromium.org> Buffet server: upgraded cherrpy to 3.2, use @tools.json_out to return json properly.

Cherrypy provides good tooling for auto-converting dictionaries to json and
setting the return header correctly. Let's use it!

BUG=chromium:364138
TEST=Unittests + curl and expected return types.
CQ-DEPEND=CL:195241

Change-Id: I1ab95a3f4cc606313c7412e2c582c3b9ea873469
Reviewed-on: https://chromium-review.googlesource.com/195332
Reviewed-by: Chris Sosa <sosa@chromium.org>
Commit-Queue: Chris Sosa <sosa@chromium.org>
Tested-by: Chris Sosa <sosa@chromium.org>
/external/autotest/client/common_lib/cros/fake_device_server/devices.py
fb08e82e29ad2232361c6662c3842f5617f4032a 04-Apr-2014 Chris Sosa <sosa@chromium.org> Buffet server: add support for both devices and commands.

This CL adds both the device and commands methods to buffet's
fake_device_server.

For devices:
- Devices are created when either registration tickets are finalized
OR a device INSERT method (via a POST) is called.

For commands:
- Commands are associated to devices by deviceId which is required
whenever creating a new command. I store the mapping between devices
and their commands in a dictionary. The only reason I need to keep a
mapping is I need to map a device to its commands for the listing
method i.e. GET on commands without an id.

I have also made a small common class used by devices/commands that
implements PATCH/PUT as they are indentical for both. I almost did the
same for registration but I couldn't find a good way to deal with the
"claim" part of it.

I have left a couple pieces left TODO as they will require a bit more
thinking and we won't likely need them immediately. These are:
1) The upload API i.e. commands that require uploading a blob of data
to give to a device e.g. storage.writeFile.
2) A couple specific fields like owner in devices which don't seem
to matter yet.

BUG=chromium:358277
TEST=See README + unittests

Change-Id: I0eb11a2f1bdb31b5d3dc4f17a72499f5160eafc2
Reviewed-on: https://chromium-review.googlesource.com/193529
Tested-by: Chris Sosa <sosa@chromium.org>
Reviewed-by: Alex Vakulenko <avakulenko@chromium.org>
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: Chris Sosa <sosa@chromium.org>
/external/autotest/client/common_lib/cros/fake_device_server/devices.py