shopfloor_service

Invoke remote procedure call for interaction with shopfloor backend.

Description

The Chromium OS Factory Software has defined a protocol, “Chrome OS Factory Shopfloor Service Specification”, to access factory manufacturing line shopfloor system (or MES) backend system. This test allows interaction with a server following the protocol.

For more information about Chrome OS Factory Shopfloor Service Specification, read https://chromium.googlesource.com/chromiumos/platform/factory/+/master/py/shopfloor/README.md

By default, the protocol has been simplified so you don’t need to manually generate or process FactoryDeviceData or DeviceData - just provide the constant arguments from test list.

For example, the method NotifyStart(data, station) can be invoked by (assume station is 'SMT') method='NotifyStart' and args=['SMT']. Also the return value is automatically merged into Device Data (see cros.factory.test.device_data for more details).

For OEM Chromebook projects, you should only use the standard methods defined in Chrome OS Factory Shopfloor Service Specification. However, if you need to work on a customized project or using a fixture with XMLRPC interface, it is possible to use this test by setting argument raw_invocation to True.

When raw_invocation is True, the invocation will simply run with argument args and kargs, no auto-generation of FactoryDeviceData or DeviceData. The return value will still be merged to device data.

Test Procedure

This is an automated test without user interaction unless manually ‘retry’ is needed.

When started, the test will connect to remote server and try to invoke specified method with given arguments, and will display return (error) messages and wait for retry on failure.

Dependency

No special dependency on client side, but the server must be implemented with needed XMLRPC methods.

Examples

To start ‘SMT’ station tests, add this in test list:

{
  "pytest_name": "shopfloor_service",
  "args": {
    "args": ["SMT"],
    "method": "NotifyStart"
  }
}

To invoke a non-standard call ‘DoSomething’ with args (1, 2) and keyword args {‘arg1’: 1}:

{
  "pytest_name": "shopfloor_service",
  "args": {
    "args": [1, 2],
    "raw_invocation": true,
    "kargs": {
      "arg1": 1
    },
    "method": "DoSomething"
  }
}

Test Arguments

Name Type Description
method str Name of shopfloor service method to call
args list, None (optional; default: None) Arguments for specified method.
kargs Mapping, None (optional; default: None) Keyword arguments for method.
raw_invocation bool (optional; default: False) Allow invocation of arbitrary calls.
server_url str, None (optional; default: None) The URL to shopfloor service server

Table Of Contents

Previous topic

serial_echo

Next topic

shutdown

This Page