Skip to content

lf_interop_ping_plotter.py: add detailed logging around API calls - #294

Merged
goyalsaurabh06 merged 4 commits into
greearb:masterfrom
goyalsaurabh06:ping_logs
Jul 14, 2026
Merged

lf_interop_ping_plotter.py: add detailed logging around API calls#294
goyalsaurabh06 merged 4 commits into
greearb:masterfrom
goyalsaurabh06:ping_logs

Conversation

@Narayana-CT

Copy link
Copy Markdown
Contributor

Summary

  • Adds request/response logging around every LANforge API call in the
    script (json_get, api_get, raw requests.get) so failures show the
    endpoint, context, and response body instead of surfacing as unlogged
    crashes or silent no-ops.
  • change_target_to_ip now aborts the test with a clear error when the
    ping target can't be resolved to an IP; get_results detects and logs
    When a multi-endpoint response is missing data for some of the
    Requested endpoints.
  • hw version and /ports/all/ lookups (in report generation and the
    polling loop) Now log failures with the resource/coordinate they
    occurred at and skip to the next item instead of crashing partway
    through.
  • api_get() now returns (None, None) instead of raising when the
    request fails, and filter_iOS_devices() handles that case gracefully
    (logs and continues) Instead of crashing on 'status' in None.

Test plan

  • Verified CLI: python3 lf_interop_ping_plotter.py --mgr 192.168.207.75 --real --ping_interval 1 --ping_duration 1m --target www.google.com --use_default_config

…calls

Adds request/response logging to change_target_to_ip, api_get,
check_tab_exists, and get_results so API failures (unreachable
manager, unexpected response shape, missing endpoint data) are
visible in the logs instead of surfacing as unlogged crashes or
silent no-ops.

change_target_to_ip now aborts the test with a clear error when
the target port can't be resolved to an IP, instead of silently
falling back to the unresolved target string. get_results also
detects and logs when a multi-endpoint response is missing data
for some of the requested endpoints.

Signed-off-by: Narayana-CT <narayana.pinapatruni@candelatech.com>
Logs the /adb/ endpoint requests used when building the pass/fail
and grouped device lists, and the per-resource hw version lookups
in generate_report/generate_report_robo, so failures are visible
instead of surfacing as unlogged crashes.

The hw version lookups now catch connection failures and non-2xx
responses, log them with the resource they were for, and skip to
the next resource instead of aborting the whole report partway
through.

Signed-off-by: Narayana-CT <narayana.pinapatruni@candelatech.com>
Logs the three /ports/all/ requests used to refresh port data
during robot navigation, initial test setup, and the virtual
station polling loop, so a failed lookup is visible in the logs
with the context it occurred in (e.g. which robot coordinate)
instead of surfacing as an unlogged crash.

Signed-off-by: Narayana-CT <narayana.pinapatruni@candelatech.com>
api_get() now returns (None, None) instead of re-raising when the
request itself fails, and filter_iOS_devices() checks for that None
response, logs which device/endpoint it was for, and skips to the
next device instead of crashing on `'status' in None`.

Verified CLI: python3 lf_interop_ping_plotter.py --mgr 192.168.207.75 --real --ping_interval 1 --ping_duration 1m --target www.google.com --use_default_config
@goyalsaurabh06
goyalsaurabh06 merged commit d82c29a into greearb:master Jul 14, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants