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
Open
lf_interop_zoom.py: Add Robo motion, Band Steering, Zoom API stats collection, and modular refactoring#248Narayana-CT wants to merge 10 commits intogreearb:masterfrom
Narayana-CT wants to merge 10 commits intogreearb:masterfrom
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR significantly extends
lf_interop_zoom.pywith robot-assisted testing, band steeringsupport, Zoom API-based QoS stats collection, and a full modular refactor of the core test flow.
Changes
Imports & Logging
redisdependency; replaced with instance variable-based state managementHTTPBasicAuth,dotenv,re,glob,Counter,signal,platform,subprocessrobo_base_classimport for robot movement supportlogging.basicConfig()for dual file/terminal output__init__& Core Methodsrobo_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_anglezoom_stats_datacontainer for raw QoS and summary dataset_start_time(),shutdown(),check_gen_cx(),wait_for_flask()Flask Server
stop_previous_flask_server(): kills processes on port 5000 for clean restartshandle_flask_server(): orchestrates stop → start → wait lifecyclemove_ping_logs(): moves ping log directory to report output folder/download_csv,/upload_csv,/upload_ping_log/upload_statsto support API stats mode with coordinate tracking and WiFi dataTest Flow Refactor
run()into:create_host(),wait_for_host_ready(),create_participants(),wait_for_test_start()create_android()for Android generic endpoint creationget_resource_data(),get_ports_data(),get_interop_data()for device info gatheringdelete_current_csv_files()for coordinate-based CSV cleanuprun_robo_test()for robot coordinate/angle iteration loopZoom API Stats
get_access_token(),get_participants_qos(),get_final_qos_data(),get_live_data()summarize_audio_video()andsummarize_csv_audio_video()for metric aggregationparse_value(),parse_zoom_value()for Zoom metric string parsing_get/_set_raw_zoom_stats(),_get/_set_summary_zoom_stats()_get_report_device_data(),_match_summary_data_to_hostnames()get_signal_and_channel_data_dict()for WiFi stats from LANforge APIsave_json()to persist API responses underzoom_api_responses/Reporting
generate_report_from_api(): full API-based report with audio/video graphsgenerate_report_from_data(): robo per-location report generation_generate_robo_per_location_report(): iterates coords/angles for device graphs_build_metric_graph(): horizontal bar graph helper_build_results_table(): summary table helper_move_report_files(): moves CSVs/JSONs to report folderadd_live_view_images_to_report(): embeds heatmap imagesadd_bandsteering_report_section(): BSSID change tracking and graphingstop_webui(): updatesrunning_status.jsonon test completionmain()& CLI--api_stats_collection,--account_id,--client_id,--client_secret,--env_file,--download_csv,--robo_ip,--coordinates,--rotations,--do_robo,--do_bs,--bssids,--cycles,--bandmove_ping_logs()andstop_webui()calls infinallyblockLinting & Misc
get_val()closure over loop variable; replaced with inline dict lookupslogging.error/infowithlogger.error/infothroughoutVerified CLI