History log of /external/autotest/client/common_lib/cros/fake_device_server/commands.py
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
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/commands.py
28c4689b8f25a7ddbff3d1c84d5e675994877b41 03-Mar-2015 David Zeuthen <zeuthen@chromium.org> buffet: Check that buffet refreshes its access token if getting a 401.

We do this by requesting fake_device_server to mark the access token
used by buffet as invalid so requests from the device will error
out. This actually exposed a bug in buffet which is fixed in the
dependent CL.

Also rename fake_oauth.py to oauth.py to make room for a fake and use
that in unit-tests where needed.

BUG=brillo:275
TEST=The brillo_Registration autotest passes.
CQ-DEPEND=CL:255590

Change-Id: I0e7afeb9d1ff11fa0acbe52d88f7685021d5329c
Reviewed-on: https://chromium-review.googlesource.com/255480
Reviewed-by: Christopher Wiley <wiley@chromium.org>
Commit-Queue: David Zeuthen <zeuthen@chromium.org>
Tested-by: David Zeuthen <zeuthen@chromium.org>
/external/autotest/client/common_lib/cros/fake_device_server/commands.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/commands.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/commands.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/commands.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/commands.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/commands.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/commands.py