Skip to content

lf_interop_zoom.py: Add Robo motion, Band Steering, Zoom API stats collection, and modular refactoring#248

Open
Narayana-CT wants to merge 10 commits intogreearb:masterfrom
goyalsaurabh06:zoom_robo_pr
Open

lf_interop_zoom.py: Add Robo motion, Band Steering, Zoom API stats collection, and modular refactoring#248
Narayana-CT wants to merge 10 commits intogreearb:masterfrom
goyalsaurabh06:zoom_robo_pr

Conversation

@Narayana-CT
Copy link
Copy Markdown
Contributor

Summary

This PR significantly extends lf_interop_zoom.py with robot-assisted testing, band steering
support, Zoom API-based QoS stats collection, and a full modular refactor of the core test flow.


Changes

Imports & Logging

  • Removed redis dependency; replaced with instance variable-based state management
  • Added imports: HTTPBasicAuth, dotenv, re, glob, Counter, signal, platform, subprocess
  • Added robo_base_class import for robot movement support
  • Replaced simple logger setup with logging.basicConfig() for dual file/terminal output

__init__ & Core Methods

  • Added constructor params: robo_ip, coordinates_list, angles_list, do_robo, do_bs,
    signin_email, signin_passwd, duration, participants_req, api_stats_collection,
    env_file, do_webui, cycles, bssids, wait_at_point, resource_ip,
    rotations_enabled, current_cord, current_angle
  • Added zoom_stats_data container for raw QoS and summary data
  • Updated set_start_time(), shutdown(), check_gen_cx(), wait_for_flask()

Flask Server

  • Added stop_previous_flask_server(): kills processes on port 5000 for clean restarts
  • Added handle_flask_server(): orchestrates stop → start → wait lifecycle
  • Added move_ping_logs(): moves ping log directory to report output folder
  • Added new Flask routes: /download_csv, /upload_csv, /upload_ping_log
  • Overhauled /upload_stats to support API stats mode with coordinate tracking and WiFi data

Test Flow Refactor

  • Split monolithic run() into: create_host(), wait_for_host_ready(),
    create_participants(), wait_for_test_start()
  • Added create_android() for Android generic endpoint creation
  • Added get_resource_data(), get_ports_data(), get_interop_data() for device info gathering
  • Added delete_current_csv_files() for coordinate-based CSV cleanup
  • Added run_robo_test() for robot coordinate/angle iteration loop

Zoom API Stats

  • Added get_access_token(), get_participants_qos(), get_final_qos_data(), get_live_data()
  • Added summarize_audio_video() and summarize_csv_audio_video() for metric aggregation
  • Added parse_value(), parse_zoom_value() for Zoom metric string parsing
  • Added _get/_set_raw_zoom_stats(), _get/_set_summary_zoom_stats()
  • Added _get_report_device_data(), _match_summary_data_to_hostnames()
  • Added get_signal_and_channel_data_dict() for WiFi stats from LANforge API
  • Added save_json() to persist API responses under zoom_api_responses/

Reporting

  • Added generate_report_from_api(): full API-based report with audio/video graphs
  • Added generate_report_from_data(): robo per-location report generation
  • Added _generate_robo_per_location_report(): iterates coords/angles for device graphs
  • Added _build_metric_graph(): horizontal bar graph helper
  • Added _build_results_table(): summary table helper
  • Added _move_report_files(): moves CSVs/JSONs to report folder
  • Added add_live_view_images_to_report(): embeds heatmap images
  • Added add_bandsteering_report_section(): BSSID change tracking and graphing
  • Added stop_webui(): updates running_status.json on test completion

main() & CLI

  • Added CLI args: --api_stats_collection, --account_id, --client_id, --client_secret,
    --env_file, --download_csv, --robo_ip, --coordinates, --rotations, --do_robo,
    --do_bs, --bssids, --cycles, --band
  • Added conditional report generation (API vs CSV-based)
  • Added move_ping_logs() and stop_webui() calls in finally block

Linting & Misc

  • Fixed B023: removed get_val() closure over loop variable; replaced with inline dict lookups
  • Replaced logging.error/info with logger.error/info throughout
  • Added new CLI examples (Robo, API stats, MOS score, Band Steering) to module docstring

Verified CLI

python3 lf_interop_zoom.py --lanforge_ip 10.17.1.208 --signin_email demo@gmail.com \
  --signin_passwd demo123 --participants 2 --audio --video --upstream_port 10.17.1.68 \
  --robo_ip 127.0.0.1:6000 --coordinates 1,2 --cycles 2 --do_bs \
  --api_stats_collection --env_file .env --bssids 00:11:22:33:44:55,66:77:88:99:AA:BB

…ependency

- Remove 'import redis' (no longer used for state management)
- Add new imports: HTTPBasicAuth, dotenv, re, glob, Counter, signal,
  platform, subprocess for API stats, robo, and process management
- Add robo_base_class import for robot movement features
- Replace simple logger setup with logging.basicConfig() using both
  FileHandler and StreamHandler for dual file/terminal output
- Rename 'log' variable to 'flask_server_log' for clarity
- Update docstring with new examples (robo, API stats, MOS score)
- Add constructor params: robo_ip, coordinates_list, angles_list,
  do_robo, do_bs, signin_email, signin_passwd, duration,
  participants_req, api_stats_collection, env_file, do_webui, cycles,
  bssids, wait_at_point, resource_ip, rotations_enabled, current_cord,
  current_angle
- Remove Redis client initialization (replaced by instance variables)
- Move signin_email/passwd/duration/participants_req from run() to init
- Add android counter, download_csv, csv_file_name, zoom_stats_data
  container, API credential fields, robo/BS initialization
- Update selected_groups/profiles to use list(... or []) pattern
- set_start_time: use 60s offset (was 30), handle do_bs long duration
- shutdown: call report generation and cleanup before exit
- check_gen_cx: check for Stopped/WAITING/NO-CX statuses
- wait_for_flask: remove emoji characters from log messages
…ethods

- Add stop_previous_flask_server(): kills processes on port 5000 using
  lsof/SIGKILL for clean Flask restarts (Linux/Darwin)
- Add handle_flask_server(): orchestrates stop -> start -> wait sequence
  for robust Flask server lifecycle management
- Add move_ping_logs(): moves participant ping log directory to the
  report output folder, with merge support for existing destinations
- Remove Redis from /login_completed route, use self.login_completed directly
- Add meeting link transform in /meeting_link POST route
- Overhaul /upload_stats to support API stats mode with DictWriter,
  robo coordinate tracking, and WiFi data integration alongside legacy mode
- Update /get_latest_stats to return self._get_summary_zoom_stats()
- Add /download_csv GET route for CSV download flag
- Add /upload_csv POST route for receiving Zoom dashboard CSV data
- Add /upload_ping_log POST route for participant ping log uploads
- Replace logging.info with logger.info throughout Flask routes
- Use consistent double-quote string formatting
…elpers, update select_real_devices

- Split monolithic run() into create_host(), wait_for_host_ready(),
  create_participants(), wait_for_test_start() methods
- New run() orchestrates these methods and supports do_bs coordinate
  loop, do_robo battery pause flow, and standard timer flow
- Add create_android() for Android device generic endpoint creation
- Add get_resource_data() for LANforge resource matching
- Add get_ports_data() for port info gathering (MAC, RSSI, link rate)
- Add get_interop_data() for ADB/mobile device serial number fetching
- Add delete_current_csv_files() for coordinate-based CSV cleanup
- Remove start_client_cx() (logic merged into create_participants)
- Remove Redis polling from wait_for_host_ready (uses self.login_completed)
- Add meet_link construction and file saving in wait_for_host_ready
- Add timeout to wait_for_test_start (exits after 3 minutes)
- Update select_real_devices with device_found flag for proper loop break
- Replace list mutation with clean dedup using seen_sta set
- Handle Android hostname (use 'user' field when ostype is android)
- Add self.android counter and self.hostname_to_station_map dict
- Remove real_device_obj.get_devices() call from select_real_devices
…ilities

- Add get_access_token() for Zoom OAuth token retrieval
- Add get_participants_qos() with pagination and cache fallback
- Add save_json() for saving API responses to zoom_api_responses/
- Add get_final_qos_data() for end-of-meeting data collection
- Add get_live_data() for real-time QoS data during meeting
- Add summarize_audio_video() for computing avg metrics from JSON QoS
- Add summarize_csv_audio_video() for parsing Zoom CSV dashboard export
- Add parse_value() and parse_zoom_value() metric string parsers
- Add _clean_zoom_participant_name() to strip '(Guest)' suffix
- Add _get/_set_raw_zoom_stats() and _get/_set_summary_zoom_stats()
- Add _get_report_device_data() for resolving report data source
- Add _match_summary_data_to_hostnames() for normalizing participant names
- Add get_signal_and_channel_data_dict() for WiFi stats from LANforge API
…main() with new CLI args

- Add generate_report_from_api(): Full API-based report with audio/video graphs
- Add generate_report_from_data(): Robo per-location report generation
- Add _generate_robo_per_location_report(): Iterate coords/angles for device graphs
- Add _build_metric_graph(): Horizontal bar graph helper
- Add _build_results_table(): Summary table helper
- Add _move_report_files(): Move CSVs/JSONs to report folder
- Add add_live_view_images_to_report(): Heatmap image embedding
- Add add_bandsteering_report_section(): BSSID change tracking/graphing
- Add stop_webui(): Update running_status.json
- Add run_robo_test(): Robot coordinate/angle iteration loop
- Update main() with new CLI args: api_stats_collection, account_id,
  client_id, client_secret, env_file, download_csv, robo args, band
  steering args, roaming args (for compatibility)
- Update ZoomAutomation instantiation with all new parameters
- Add handle_flask_server, get_resource_data, get_ports_data,
  get_interop_data calls
- Remove Redis cleanup from finally block
- Add conditional report generation (API vs CSV-based)
- Add move_ping_logs() and stop_webui() calls in finally
- Replace logging.error/info with logger.error/info
- Remove 'if True:' indentation wrapper
Signed-off-by: Narayana-CT <narayana.pinapatruni@candelatech.com>
Verified CLI: python3 lf_interop_zoom.py --lanforge_ip 10.17.1.208 --signin_email demo@gmail.com --signin_passwd demo123 --participants 2 --audio --video --upstream_port 10.17.1.68 --robo_ip 127.0.0.1:6000
--coordinates 1,2 --cycles 2 --do_bs --api_stats_collection --env_file .env --bssids 00:11:22:33:44:55,66:77:88:99:AA:BB

Signed-off-by: Narayana-CT <narayana.pinapatruni@candelatech.com>
Signed-off-by: Narayana-CT <narayana.pinapatruni@candelatech.com>
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.

1 participant