History log of /external/autotest/server/hosts/rpc_server_tracker.py
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ad248a87c20916552933c96067d0eb79e0ae70e3 23-Nov-2016 Cheng-Yi Chiang <cychiang@chromium.org> [autotest] rpc_server_tracker: Support timeout on the request

Add a subclass of xmlrpclib.ServerProxy that supports timeout on the
request. This makes test fail earlier if a request does not return
forever due to some issue on Cros host.

BUG=chromium:666242
TEST=use with the next CL of multimedia server proxy.

Change-Id: I459b02294914c96135c37586bd8007d3923549c5
Reviewed-on: https://chromium-review.googlesource.com/413867
Commit-Ready: Cheng-Yi Chiang <cychiang@chromium.org>
Tested-by: Cheng-Yi Chiang <cychiang@chromium.org>
Reviewed-by: Shyh-In Hwang <josephsih@chromium.org>
/external/autotest/server/hosts/rpc_server_tracker.py
118363234bcf45c56932f3a495f545d1dd081c89 22-Nov-2016 Aviv Keshet <akeshet@chromium.org> autotest: eliminate or migrate various autotest_stats stats

A few stats are migrated, others eliminated. In particular, the stats in
provision_AutoUpdate.py seem obsolete as we now require devservers to be
in the same subnet as the DUT.

BUG=chromium:667171
TEST=Unit tests

Change-Id: I2618347308fd90babffb1aaaba6a01c770970090
Reviewed-on: https://chromium-review.googlesource.com/413624
Commit-Ready: Aviv Keshet <akeshet@chromium.org>
Tested-by: Aviv Keshet <akeshet@chromium.org>
Reviewed-by: Aviv Keshet <akeshet@chromium.org>
/external/autotest/server/hosts/rpc_server_tracker.py
6c0f09b5d4c5b93e5cfa6b6a344343019e00d472 11-Nov-2016 Wai-Hong Tam <waihong@google.com> [autotest] Print the last log of the xmlrpc server on failure

When a test fails to connect the xmlrpc server, it may be caused by
some init error of the server. Better to print the last log to know
what happened.

BUG=chrome-os-partner:59748
TEST=Inserted an assertion to fail the xmlrpc server. Ran a FAFT test and got:
[ FAILED ]
ERROR: Unhandled BadStatusLine: ''
11/11 12:51:43.586 ERROR|rpc_server_tracker:0198| Failed to start XMLRPC server.
11/11 12:51:43.731 ERROR|rpc_server_tracker:0203| The log of XML RPC server:
[2016-11-11 10:51:23.699670] XMLRPC Server: Spinning up FAFT server
keyboard device /dev/input/event3
Traceback (most recent call last):
File "/usr/local/autotest/cros/faft/rpc_server.py", line 39, in <module>
main()
File "/usr/local/autotest/cros/faft/rpc_server.py", line 31, in main
server.register_instance(RPCFunctions())
File "/usr/local/autotest/cros/faft/rpc_functions.py", line 145, in __init__
assert('Assertion to fail' == 0)
AssertionError
...

Change-Id: I1bcf19ece9c045346a3da216969925fa6f733059
Reviewed-on: https://chromium-review.googlesource.com/410130
Commit-Ready: Wai-Hong Tam <waihong@google.com>
Tested-by: Wai-Hong Tam <waihong@google.com>
Reviewed-by: Vadim Bendebury <vbendeb@chromium.org>
/external/autotest/server/hosts/rpc_server_tracker.py
476408397bec660680d7d4f347ead1eb7dc21aa4 24-Mar-2016 xixuan <xixuan@google.com> Autotest: Make Devserver retry ssh connection, and Add stats for ssh
failures.

When trying to SSH to a devserver, this SSH connection could be aborted
by the devserver itself, which causes staging failure.

This CL add 'retry' to all ssh connections to devserver, and add stats
for ssh failures: ssh_dev_server_failure, and ssh_tunnel_failure, to
estimate the stabality of ssh-based approaches.

BUG=chromium:597680
TEST=Ran dev_server_unittest to ensure error.CmdError causes retry. Turn
on the enable_ssh switch to test that ssh to devserver & servo still works.

Change-Id: I4b9e6092d8989fb2ecb770367c5869042e8e5740
Reviewed-on: https://chromium-review.googlesource.com/334770
Reviewed-by: Xixuan Wu <xixuan@chromium.org>
Tested-by: Xixuan Wu <xixuan@chromium.org>
Commit-Queue: Xixuan Wu <xixuan@chromium.org>
/external/autotest/server/hosts/rpc_server_tracker.py
10ce09c325cc46c993929af23d2f54807862d005 09-Mar-2016 xixuan <xixuan@google.com> Autotest: Use SSH For Communication to Moblab

Create an ssh tunnel for autoserv to communicate to moblab. MoblabHost calls
rpc_server_tracker to create a safe ssh connection to moblab when it is
created or moblab is rebooted.

Related Change:

1. Refactoring rpc_server_tracker to seperate tunnel creating process
|_setup_tracker_for_rpc| and URL/host construction functions,
|_setup_rpc| or |tunnel_connect|.

2. Add a |enable_ssh_tunnel_for_moblab| to enable/disable ssh tunnel for
moblab.

BUG=chromium:593965
TEST=Ran verify&repair, moblab_RunSuite:dummyServer, on local moblab to
verify ssh tunnel for moblab. Ran network_WiFi_SimpleConnect.wifi_check11g
to make sure that rpc_server_tracker still works.

Change-Id: I0d35209c3ba7b27cca00bbdff1a714ed6d8d40d3
Reviewed-on: https://chromium-review.googlesource.com/331792
Commit-Ready: Xixuan Wu <xixuan@chromium.org>
Tested-by: Xixuan Wu <xixuan@chromium.org>
Reviewed-by: Richard Barnette <jrbarnette@chromium.org>
/external/autotest/server/hosts/rpc_server_tracker.py
6cf6d2fa8d69d9896eba005310e110fa521b9cc3 30-Jan-2016 xixuan <xixuan@google.com> autotest: Use SSH Tunnel For Communication to Servo & Chameleon

Create a ssh tunnel for autoserv to communicate to servo/chameleon.
ServoHost/ChameleonHost call rpc_server_tracker to create a safe ssh connection
to servo/chameleon.

Related Change:

1. In AbstractSSH, remove |rpc_port_forward| since it does the same thing
as |create_ssh_tunnel|.

2. In AstractSSH, Change |rpc_port_disconnect| to |disconnect_ssh_tunnel|
since that the whole function is about to disconnect the existing ssh tunnel.

3. Add an exception of input arg 'command' in |xmlrpc_connect| of
rpc_server_tracker, so that it can be reused by ServoHost and ChameleonHost.

4. Add a |enable_ssh_tunnel_for_servo|/|enable_ssh_tunnel_for_chameleon| flag
to enable/disable ssh tunnel for servo/chameleon.

The refactoring of SSH tunneling code in ChameleonHost will be in a seperate CL
related to BUG=chromium:588806.

BUG=chromium:582646
TEST=For Servo:
Ran platform_ServoPowerStateController in local autotest instance & moblab to
test enable/disable SSH tunnel connection to ServoHost.
Ran network_WiFi_SimpleConnect.wifi_check11g in local autotest instance &
moblab to ensure that rpc_server_tracker still works other tasks.

For Chameleon:
Ran display_ServerChameleonConnection in chromeos2-row1-rack4-host4 to test
enable/disable SSH tunnel connection to ChameleonHost.

Change-Id: I45b5191f088f72819641f19d457d38a9d29cf1fd
Reviewed-on: https://chromium-review.googlesource.com/324841
Commit-Ready: Xixuan Wu <xixuan@chromium.org>
Tested-by: Xixuan Wu <xixuan@chromium.org>
Reviewed-by: Xixuan Wu <xixuan@chromium.org>
/external/autotest/server/hosts/rpc_server_tracker.py
a28f89a1ad06d4b04ea05b85c0de8ddccb3564f4 28-Dec-2015 Dane Pollock <danepollock@google.com> autotest: fix missing import in rpc_server_tracker

TEST=Ran jetstream_Connect test.
BUG=None

Change-Id: Ie199c3c1c815dd37f3b4133a814bc4e5e9d3ab21
Reviewed-on: https://chromium-review.googlesource.com/320040
Commit-Ready: Dane Pollock <danepollock@google.com>
Tested-by: Dane Pollock <danepollock@google.com>
Reviewed-by: Roshan Pius <rpius@chromium.org>
/external/autotest/server/hosts/rpc_server_tracker.py
58e5dd3b600081607d5ecb514d9bf3ebea83c533 17-Oct-2015 Roshan Pius <rpius@google.com> autotest: Create RpcServerTracker for Host objects.

Create a generic RpcServerTracker which can be used by any host object
to start and manage RPC server connections. The RPCServerTracker uses
the associated host object to start the required XML/JSON RPC server on the
DUT and forwards the port from the AutoTest Server to Brillo/Cros DUT.
This CL basically ports over most of the RPC server connection
management code from CrosHost into a separate class so that it can be
reused by AdbHost as well.
AdbHost modifies the |host.rpc_port_forward/disconnect| method to forward the
RPC connection from the AdbHost to Brillo DUT using 'adb forward'.

Related Change:
1. Add a |verbose| flag to the |host.run| method in AdbHost so that we can
reuse the |host.run_background| method already implemented by SshHost.

BUG=brillo:24338381
TEST=Ran network_WiFi_SimpleConnect.wifi_check11g on both dragonboard
and cros DUT.
`test_that $host --board=panther network_WiFi_SimpleConnect.wifi_check11g`

Change-Id: I7e44cbd5897871f01f320cb57377a28491571478
Reviewed-on: https://chromium-review.googlesource.com/307163
Commit-Ready: Roshan Pius <rpius@chromium.org>
Tested-by: Roshan Pius <rpius@chromium.org>
Reviewed-by: Roshan Pius <rpius@chromium.org>
/external/autotest/server/hosts/rpc_server_tracker.py