Home | History | Annotate | only in /external/autotest/client/common_lib/cros/fake_device_server
Up to higher level directory
NameDateSize
__init__.py22-Oct-20200
client_lib/22-Oct-2020
commands.py22-Oct-20205.9K
commands_unittest.py22-Oct-20204.6K
common.py22-Oct-2020361
common_util.py22-Oct-20203K
common_util_unittest.py22-Oct-20202.7K
constants.py22-Oct-2020344
devices.py22-Oct-20207.3K
devices_unittest.py22-Oct-20203.5K
fail_control.py22-Oct-20201.5K
fake_gcd_helper.py22-Oct-20201.6K
fake_oauth.py22-Oct-2020385
meta_handler.py22-Oct-2020787
oauth.py22-Oct-20203.7K
README22-Oct-20201.2K
registration_tickets.py22-Oct-20207.4K
registration_tickets_unittest.py22-Oct-20204.7K
resource_delegate.py22-Oct-20204K
resource_method.py22-Oct-20201.9K
resource_method_unittest.py22-Oct-20202.2K
server.py22-Oct-20203.8K
server_errors.py22-Oct-2020654

README

      1 # Copyright 2014 The Chromium OS Authors. All rights reserved.
      2 # Use of this source code is governed by a BSD-style license that can be
      3 # found in the LICENSE file.
      4 
      5 A simple web service used by Buffet to test interactions with a
      6 device server. Implements basic functionality for registration, device commands
      7 and state changes.
      8 
      9 To start the test server yourself, run server.py. Otherwise, server.py exposes
     10 start_server/stop_server methods.
     11 
     12 To test locally:
     13 ./server.py
     14 
     15 # Register a device.
     16 curl -X POST -d "" http://localhost:8080/registrationTickets
     17 curl -X PATCH  -d '{"userEmail": "me"}' -H "Authorization: Bearer 1/TEST-ME" \
     18     http://localhost:8080/registrationTickets/<id>
     19 curl -X POST -d "" \
     20     http://localhost:8080/registrationTickets/<id>/finalize
     21 
     22 # List devices
     23 curl -X GET -d "" http://localhost:8080/devices
     24 
     25 # Send your device a command.
     26 curl -X POST -d '{"base": { "Reboot": {}}' http://localhost:8080/devices\
     27   ?deviceId=<device_id>
     28 
     29 # Update the status of your command
     30 curl -X PATCH -d '{"state": "done"}' http://localhost:8080/devices/\
     31     <command_id>
     32 
     33 # You can also use the client library avaiable @ client_lib.
     34 # Check out client_lib_test to see how you can use the API.
     35