RemoteRF 2.13.11__tar.gz → 2.13.12__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {remoterf-2.13.11/src/remoterf.egg-info → remoterf-2.13.12}/PKG-INFO +1 -1
- {remoterf-2.13.11 → remoterf-2.13.12}/pyproject.toml +1 -1
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/core/grpc_client.py +59 -0
- {remoterf-2.13.11 → remoterf-2.13.12/src/remoterf.egg-info}/PKG-INFO +1 -1
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf.egg-info/SOURCES.txt +1 -0
- remoterf-2.13.12/tests/test_restart_ride_through.py +163 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/LICENSE +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/README.md +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/setup.cfg +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/setup.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/_remoterf_alias.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/__init__.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/admin.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/agent_cli.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/agent_docs.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/api.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/common/__init__.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/common/grpc/__init__.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/common/grpc/deployment_capabilities.proto +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/common/grpc/deployment_capabilities_pb2.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/common/grpc/deployment_capabilities_pb2_grpc.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/common/grpc/grpc.proto +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/common/grpc/grpc_pb2.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/common/grpc/grpc_pb2_grpc.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/common/grpc/v2_codec.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/common/tos_notice.txt +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/common/utils/__init__.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/common/utils/ansi_codes.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/common/utils/api_token.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/common/utils/banner.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/common/utils/list_string.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/common/utils/process_arg.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/config/__init__.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/config/cert_fetcher.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/config/config.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/core/__init__.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/core/acc_login.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/core/app.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/core/availability.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/core/banner_note.txt +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/core/direct_path.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/core/dynamic_v2_transport.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/core/grpc_acc.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/core/messages.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/core/secure_channel.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/core/v2_errors.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/data/agent_guide.md +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/data/mcp_tools.json +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/deployment/__init__.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/deployment/backend.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/deployment/direct.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/deployment/homes.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/deployment/http.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/deployment/lanpass.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/deployment/state.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/__init__.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/_virtual.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/adalm_pluto/__init__.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/adalm_pluto/adalm_pluto_remote.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/adalm_pluto_mimo/__init__.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/adalm_pluto_mimo/adalm_pluto_mimo_remote.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/bluetooth/__init__.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/bluetooth/bluetooth_remote.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/dynamic_device.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/dynamic_v2.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/gps/__init__.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/gps/gps_remote.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/hackrf/__init__.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/hackrf/hackrf_remote.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/krakensdr/__init__.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/krakensdr/krakensdr_remote.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/rfbeam_kmd7/__init__.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/rfbeam_kmd7/rfbeam_kmd7_remote.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/rtl_sdr/__init__.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/rtl_sdr/rtl_sdr_remote.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/rtlsdr/__init__.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/schema_review.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/sim_sdr/__init__.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/sim_sdr/sim_sdr_remote.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/support/__init__.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/support/krakensdr.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/support/rfbeam_kmd7.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/support/ti_mmwave.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/support/uhd.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/support/uhd_dsp.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/support/uhd_v2.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/support/wifi.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/ti_awr6843/__init__.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/ti_awr6843/ti_awr6843_remote.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/ti_mmwave/__init__.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/ti_mmwave/ti_mmwave_remote.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/usrp/__init__.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/usrp/usrp_remote.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/usrp/usrp_remote.pyi +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/wifi/__init__.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/wifi/wifi_remote.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/mcp_server.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/ops.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/remoterf_cli.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/version.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf.egg-info/dependency_links.txt +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf.egg-info/entry_points.txt +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf.egg-info/requires.txt +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf.egg-info/top_level.txt +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_agent_cli.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_agent_docs.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_api.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_banner.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_batch.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_bundled_drivers.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_ca_pin.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_cli_login_fresh.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_config_address.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_deployment_accounts.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_device_routes.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_devices_api.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_direct_path_fixed.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_direct_path_global.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_direct_path_partner.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_direct_path_race.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_direct_path_relay.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_dynamic_device_codegen.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_dynamic_v2.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_federated_devices.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_fetch_idl_fallback.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_finish_prompt.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_gate_i_direct_path.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_grpc_client_target.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_homes.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_lan_fallback.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_mcp_server.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_messages.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_native_account_credentials.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_native_devices.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_native_drivers.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_old_import_name.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_ops.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_partner_dynamic_v2.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_pluto_virtual.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_process_arg.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_relay_paging.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_remote_admin.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_remoterf_cli.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_rx_readahead.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_schema_review.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_ti_mmwave.py +0 -0
- {remoterf-2.13.11 → remoterf-2.13.12}/tests/test_upgrade_rescue.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: remoterf
|
|
3
|
-
Version: 2.13.
|
|
3
|
+
Version: 2.13.12
|
|
4
4
|
Summary: A python API to remotely access signal centric hardware. Client-side only! Courtesy of Wireless Lab @ UCLA & Prof. Ian Roberts.
|
|
5
5
|
Author-email: Ethan Ge <84103791+ethange1@users.noreply.github.com>
|
|
6
6
|
License-Expression: GPL-3.0-or-later
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "remoterf"
|
|
7
|
-
version = "2.13.
|
|
7
|
+
version = "2.13.12"
|
|
8
8
|
description = "A python API to remotely access signal centric hardware. Client-side only! Courtesy of Wireless Lab @ UCLA & Prof. Ian Roberts."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "GPL-3.0-or-later"
|
|
@@ -833,7 +833,66 @@ def _tx_wire(arg):
|
|
|
833
833
|
return map_iq16(samples) if fits_iq16(samples) else arg
|
|
834
834
|
|
|
835
835
|
|
|
836
|
+
# A lab restart takes about 35 s. A call that only reads, or sets a value again,
|
|
837
|
+
# waits it out (REMOTERF_RESTART_WAIT seconds, 0 = fail at once); a TX does not.
|
|
838
|
+
RESTART_WAIT_SECONDS = 90.0
|
|
839
|
+
_REPEATABLE = (":GET", ":SET", ":rx:CALL0", ":rx_n:CALL1")
|
|
840
|
+
|
|
841
|
+
|
|
842
|
+
def _restart_wait():
|
|
843
|
+
try:
|
|
844
|
+
return float(os.getenv("REMOTERF_RESTART_WAIT", RESTART_WAIT_SECONDS))
|
|
845
|
+
except ValueError:
|
|
846
|
+
return RESTART_WAIT_SECONDS
|
|
847
|
+
|
|
848
|
+
|
|
849
|
+
def _repeatable(function_name, args):
|
|
850
|
+
if function_name.endswith(":batch:CALLN"):
|
|
851
|
+
ops = []
|
|
852
|
+
for key, arg in args.items():
|
|
853
|
+
if key.startswith("op"):
|
|
854
|
+
op = grpc_pb2.GenericRPCRequest()
|
|
855
|
+
op.ParseFromString(arg.bytes_value)
|
|
856
|
+
ops.append(op.function_name)
|
|
857
|
+
return all(_repeatable(name, {}) for name in ops)
|
|
858
|
+
return function_name.startswith("IDL:") or function_name.endswith(_REPEATABLE)
|
|
859
|
+
|
|
860
|
+
|
|
861
|
+
def _lab_down(exc):
|
|
862
|
+
if isinstance(exc, grpc.RpcError) and callable(getattr(exc, "code", None)):
|
|
863
|
+
return exc.code() in (grpc.StatusCode.UNAVAILABLE, grpc.StatusCode.DEADLINE_EXCEEDED)
|
|
864
|
+
return (getattr(exc, "provenance", None) == "transport"
|
|
865
|
+
or getattr(exc, "code", None) in ("route_unavailable", "transport")
|
|
866
|
+
or str(exc).startswith("Partner unreachable"))
|
|
867
|
+
|
|
868
|
+
|
|
869
|
+
def _lab_starting(exc):
|
|
870
|
+
"""Up again but its devices (or their host tunnels) are not back yet."""
|
|
871
|
+
return "device_unavailable" in str(exc) or str(exc) == NO_ANSWER
|
|
872
|
+
|
|
873
|
+
|
|
836
874
|
def _dispatch(function_name, args, connection):
|
|
875
|
+
deadline, down, attempt = None, False, 0
|
|
876
|
+
while True:
|
|
877
|
+
try:
|
|
878
|
+
return _dispatch_once(function_name, args, connection)
|
|
879
|
+
except (RuntimeError, grpc.RpcError) as exc:
|
|
880
|
+
down = down or _lab_down(exc)
|
|
881
|
+
if not (_lab_down(exc) or (down and _lab_starting(exc))) or not _repeatable(function_name, args):
|
|
882
|
+
raise
|
|
883
|
+
now = time.monotonic()
|
|
884
|
+
if deadline is None:
|
|
885
|
+
deadline = now + _restart_wait()
|
|
886
|
+
if deadline > now:
|
|
887
|
+
log.warning("the lab isn't responding; waiting up to %d s for it to come back "
|
|
888
|
+
"(a restart takes about 35 s)", deadline - now)
|
|
889
|
+
if now >= deadline:
|
|
890
|
+
raise
|
|
891
|
+
attempt += 1
|
|
892
|
+
time.sleep(min(2.0 * attempt, 10.0, deadline - now))
|
|
893
|
+
|
|
894
|
+
|
|
895
|
+
def _dispatch_once(function_name, args, connection):
|
|
837
896
|
ref = _federated_ref(function_name, args) if connection is None else None
|
|
838
897
|
if ref is not None:
|
|
839
898
|
return _finish(_federated_call(ref, function_name, args), function_name)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: remoterf
|
|
3
|
-
Version: 2.13.
|
|
3
|
+
Version: 2.13.12
|
|
4
4
|
Summary: A python API to remotely access signal centric hardware. Client-side only! Courtesy of Wireless Lab @ UCLA & Prof. Ian Roberts.
|
|
5
5
|
Author-email: Ethan Ge <84103791+ethange1@users.noreply.github.com>
|
|
6
6
|
License-Expression: GPL-3.0-or-later
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
"""A lab restart mid-session looks like a pause: reads and setters wait it out, a TX does not."""
|
|
2
|
+
|
|
3
|
+
import time as real_time
|
|
4
|
+
|
|
5
|
+
import grpc
|
|
6
|
+
import pytest
|
|
7
|
+
|
|
8
|
+
from remoterf.common.grpc import grpc_pb2
|
|
9
|
+
from remoterf.common.utils import map_arg, unmap_arg
|
|
10
|
+
from remoterf.core import grpc_client
|
|
11
|
+
from remoterf.deployment.http import AccountBackendError
|
|
12
|
+
|
|
13
|
+
TOKEN = "Zm9vYmFy@lab"
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
class Down(grpc.RpcError):
|
|
17
|
+
def code(self):
|
|
18
|
+
return grpc.StatusCode.UNAVAILABLE
|
|
19
|
+
|
|
20
|
+
def details(self):
|
|
21
|
+
return "Socket closed"
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
class Clock:
|
|
25
|
+
"""time.sleep advances it; everything else is the real module."""
|
|
26
|
+
|
|
27
|
+
def __init__(self):
|
|
28
|
+
self.now = 1000.0
|
|
29
|
+
|
|
30
|
+
def monotonic(self):
|
|
31
|
+
return self.now
|
|
32
|
+
|
|
33
|
+
def sleep(self, seconds):
|
|
34
|
+
self.now += seconds
|
|
35
|
+
|
|
36
|
+
def __getattr__(self, name):
|
|
37
|
+
return getattr(real_time, name)
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
class Lab:
|
|
41
|
+
"""Restarts at `restart_at`: refuses for `down` s, then has no devices for `starting` s."""
|
|
42
|
+
|
|
43
|
+
def __init__(self, clock, restart_at=10.0, down=35.0, starting=5.0, relay=False):
|
|
44
|
+
self.clock, self.t0 = clock, clock.now
|
|
45
|
+
self.restart_at, self.down, self.starting, self.relay = restart_at, down, starting, relay
|
|
46
|
+
self.state, self.calls = {}, []
|
|
47
|
+
|
|
48
|
+
def __call__(self, function_name, args, connection):
|
|
49
|
+
self.calls.append(function_name)
|
|
50
|
+
t = self.clock.now - self.t0 - self.restart_at
|
|
51
|
+
if 0 <= t < self.down:
|
|
52
|
+
if self.relay:
|
|
53
|
+
raise AccountBackendError("route_unavailable", provenance="transport")
|
|
54
|
+
raise Down()
|
|
55
|
+
if self.down <= t < self.down + self.starting:
|
|
56
|
+
raise RuntimeError("No schema available for device 14 (device_unavailable)")
|
|
57
|
+
return self.run(function_name, args)
|
|
58
|
+
|
|
59
|
+
def run(self, function_name, args):
|
|
60
|
+
if function_name.count(":") != 2:
|
|
61
|
+
return grpc_pb2.GenericRPCResponse()
|
|
62
|
+
_, prop, verb = function_name.split(":")
|
|
63
|
+
if prop == "batch":
|
|
64
|
+
ops = [grpc_pb2.GenericRPCRequest.FromString(a.bytes_value) for k, a in args.items() if k.startswith("op")]
|
|
65
|
+
for op in ops:
|
|
66
|
+
response = self.run(op.function_name, dict(op.args) | {"a": args["a"]})
|
|
67
|
+
response.results["batch_done"].CopyFrom(map_arg(len(ops)))
|
|
68
|
+
return response
|
|
69
|
+
if verb == "SET":
|
|
70
|
+
self.state[prop] = unmap_arg(args[prop])
|
|
71
|
+
return grpc_pb2.GenericRPCResponse()
|
|
72
|
+
if verb == "GET":
|
|
73
|
+
return grpc_pb2.GenericRPCResponse(results={prop: map_arg(self.state.get(prop, 0))})
|
|
74
|
+
return grpc_pb2.GenericRPCResponse(results={prop: map_arg("called")})
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
@pytest.fixture
|
|
78
|
+
def clock(monkeypatch):
|
|
79
|
+
clock = Clock()
|
|
80
|
+
monkeypatch.delenv("REMOTERF_RX_READAHEAD", raising=False)
|
|
81
|
+
monkeypatch.delenv("REMOTERF_RESTART_WAIT", raising=False)
|
|
82
|
+
monkeypatch.setattr(grpc_client, "time", clock)
|
|
83
|
+
monkeypatch.setattr(grpc_client, "_batch_local", grpc_client._BatchState())
|
|
84
|
+
return clock
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def _lab(monkeypatch, clock, **kw):
|
|
88
|
+
lab = Lab(clock, **kw)
|
|
89
|
+
monkeypatch.setattr(grpc_client, "_dispatch_once", lab)
|
|
90
|
+
return lab
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def _call(function_name, **args):
|
|
94
|
+
return grpc_client.rpc_client(function_name=function_name, args={**{k: map_arg(v) for k, v in args.items()}, "a": map_arg(TOKEN)})
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
@pytest.mark.parametrize("relay", [False, True])
|
|
98
|
+
def test_setter_and_getter_ride_through_a_restart(monkeypatch, clock, relay):
|
|
99
|
+
lab = _lab(monkeypatch, clock, relay=relay)
|
|
100
|
+
_call("Pluto:rx_lo:SET", rx_lo=2.4e9)
|
|
101
|
+
clock.now += 10.0 # the script works for a while, then the lab restarts under it
|
|
102
|
+
_call("Pluto:tx_lo:SET", tx_lo=905e6)
|
|
103
|
+
assert lab.state["tx_lo"] == 905e6
|
|
104
|
+
assert unmap_arg(_call("Pluto:tx_lo:GET").results["tx_lo"]) == 905e6
|
|
105
|
+
assert clock.now - lab.t0 < 10 + 35 + 5 + 10 # waited for the restart, not the whole window
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
def test_rx_rides_through_but_tx_fails_at_once(monkeypatch, clock):
|
|
109
|
+
lab = _lab(monkeypatch, clock)
|
|
110
|
+
clock.now += 10.0
|
|
111
|
+
with pytest.raises(grpc.RpcError):
|
|
112
|
+
_call("Pluto:tx:CALL1", arg1=[1, 2, 3])
|
|
113
|
+
assert lab.calls == ["Pluto:tx:CALL1"]
|
|
114
|
+
assert unmap_arg(_call("Pluto:rx:CALL0").results["rx"]) == "called"
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+
def test_batch_of_setters_rides_through_but_a_batch_with_tx_does_not(monkeypatch, clock):
|
|
118
|
+
lab = _lab(monkeypatch, clock)
|
|
119
|
+
monkeypatch.setattr(grpc_client, "_batch_support", {})
|
|
120
|
+
clock.now += 10.0
|
|
121
|
+
token = TOKEN
|
|
122
|
+
with grpc_client.batch(token):
|
|
123
|
+
_call("Pluto:tx_lo:SET", tx_lo=905e6)
|
|
124
|
+
_call("Pluto:rx_lo:SET", rx_lo=2.4e9)
|
|
125
|
+
assert lab.state == {"tx_lo": 905e6, "rx_lo": 2.4e9}
|
|
126
|
+
lab.state.clear()
|
|
127
|
+
lab.t0, lab.calls = clock.now - 10.0, [] # the lab restarts again
|
|
128
|
+
with pytest.raises(grpc.RpcError):
|
|
129
|
+
with grpc_client.batch(token):
|
|
130
|
+
_call("Pluto:tx_lo:SET", tx_lo=1e9)
|
|
131
|
+
_call("Pluto:tx:CALL1", arg1=[1])
|
|
132
|
+
assert lab.state == {} # nothing ran twice, and nothing ran at all
|
|
133
|
+
|
|
134
|
+
|
|
135
|
+
def test_an_outage_longer_than_the_window_still_fails(monkeypatch, clock):
|
|
136
|
+
_lab(monkeypatch, clock, down=500.0)
|
|
137
|
+
clock.now += 10.0
|
|
138
|
+
start = clock.now
|
|
139
|
+
with pytest.raises(grpc.RpcError):
|
|
140
|
+
_call("Pluto:tx_lo:SET", tx_lo=905e6)
|
|
141
|
+
assert 90 <= clock.now - start <= 91
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
def test_restart_wait_zero_fails_at_once(monkeypatch, clock):
|
|
145
|
+
lab = _lab(monkeypatch, clock)
|
|
146
|
+
monkeypatch.setenv("REMOTERF_RESTART_WAIT", "0")
|
|
147
|
+
clock.now += 10.0
|
|
148
|
+
with pytest.raises(grpc.RpcError):
|
|
149
|
+
_call("Pluto:tx_lo:SET", tx_lo=905e6)
|
|
150
|
+
assert len(lab.calls) == 1
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
def test_a_device_that_is_simply_missing_is_not_retried(monkeypatch, clock):
|
|
154
|
+
calls = []
|
|
155
|
+
|
|
156
|
+
def lab(function_name, args, connection):
|
|
157
|
+
calls.append(function_name)
|
|
158
|
+
raise RuntimeError("No schema available for device 14 (device_unavailable)")
|
|
159
|
+
|
|
160
|
+
monkeypatch.setattr(grpc_client, "_dispatch_once", lab)
|
|
161
|
+
with pytest.raises(RuntimeError):
|
|
162
|
+
_call("Pluto:tx_lo:GET")
|
|
163
|
+
assert len(calls) == 1
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/common/grpc/deployment_capabilities.proto
RENAMED
|
File without changes
|
{remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/common/grpc/deployment_capabilities_pb2.py
RENAMED
|
File without changes
|
{remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/common/grpc/deployment_capabilities_pb2_grpc.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/adalm_pluto/adalm_pluto_remote.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{remoterf-2.13.11 → remoterf-2.13.12}/src/remoterf/drivers/rfbeam_kmd7/rfbeam_kmd7_remote.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|