Skip to content

readable naming, macOS wifi-msg counting, and cleanup - #373

Merged
goyalsaurabh06 merged 13 commits into
greearb:masterfrom
goyalsaurabh06:port_reset_fix_latest
Aug 25, 2026
Merged

readable naming, macOS wifi-msg counting, and cleanup#373
goyalsaurabh06 merged 13 commits into
greearb:masterfrom
goyalsaurabh06:port_reset_fix_latest

Conversation

@Narayana-CT

@Narayana-CT Narayana-CT commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Behaviour changes

macOS devices reported 0 for every metric. Two separate causes, both fixed.

count_wifi_msg_matches() tokenized messages with text.split(" "), which
leaves punctuation glued to the token. A macOS line reads
en0: STA is connected to a wireless network., so the port token is "en0:"
and never equals the "en0" taken from the device EID. The port gate runs
before the filter test, so every macOS message was dropped before any filter was
considered. A new tokenize_wifi_msg() splits on whitespace and colons and
strips trailing .,;, and is applied to both the message text and the match
text — normalising one side alone would break filters that carry their own
punctuation, such as "association started.".

Even with the port matching, macOS had no branch of its own. It fell through to
the linux/mac path, which matches wpa_supplicant text like
<3>CTRL-EVENT-CONNECTED that macOS never sends. Across 631 live wifi-msgs from
resource 1.29, macOS sends exactly two shapes and nothing else:

CLI argument renames ( old flags removed)

Old New
--host --lanforge_ip
--port --lanforge_port
--mgr_ip --upstream_port
--reset --iterations
--release --android_releases
--time_int --reset_interval

Parser now uses allow_abbrev=False — otherwise --reset 10 was silently read
as an abbreviation of the new --reset_interval. --encryp, --dowebgui,
--passwd etc. were left alone (shared across 9+ sibling scripts).

__init__ attribute typos also fixed: total_ass_attemsttotal_assoc_attempts,
total_ass_rejectstotal_assoc_rejections.


Function renames

Old New
get_count() count_wifi_msg_matches()
get_time_from_wifi_msgs() collect_device_metrics()
write_reset_csvs() write_iteration_csvs()
aggregate_reset_dict() aggregate_device_metrics()
generate_coordinate_csv() write_coordinate_csv()
create_dict_csv() write_overall_csv()
get_last_wifi_msg() get_last_wifi_msg_timestamp()

New function added: tokenize_wifi_msg() — splits a wifi-msg string into
tokens (handles :/whitespace/trailing punctuation), replacing 6 duplicated
text.split(" ") call sites inside count_wifi_msg_matches().


Argument / parameter renames

Old New
value= wifi_messages=
keys_list= message_keys=
device= device_eid=
filter= match_text=
reset_dict= / reset_count_= (locals too) per_iteration_results=
test_dur= test_duration=
local_dict= device_metrics=
phn_name= device_eid=
timee= since_time=
reset_cnt= iteration=
r= / port_reset_dict= per_iteration_results= / iteration=
data= / name= metric_totals= / image_name=
_alignmen= (typo) _alignment=

adb_* prefix → android_*; other_* prefix → linux_mac_* throughout.


Local variable renames (representative — full list is large)

  • local, local_2local_5connected, disconnected, scanning,
    assoc_attempts, assoc_rejections (dead local_6 removed outright)
  • conected_list (typo) → connected_counts
  • courses / valuesbar_labels / bar_totals
  • fig_sizefig (it's a Figure, not a size)
  • dict_metric_labels
  • yaxis_visable (typo) → yaxis_visible
  • i_dftotals_per_device (was never a DataFrame)
  • df_summarysummary_df, colscolumns, statsmetrics
  • clientdevice_eid (and the second loop's client, which held the
    suffixed name, → client_name)
  • y/zdevice_eid/device_index; iiteration/index (context-dependent)
  • reset_count_/reset_countiteration_indexes/iteration_numbers
  • assorejassoc_rejections; asso_attemptsassoc_attempts
  • dis/scan/asso/asso_rej/condisconnect_total/scan_total/
    assoc_attempt_total/assoc_rejection_total/connect_total
  • adb_user_nameandroid_user_name
  • graph1/graph2overall_graph/client_graph
  • table_1/table_2/test_setupper_iteration_table/device_summary_table/
    client_table_df/device_summary_df (context-dependent)
  • d_name/device_type/user_name/s_nodevice_names/device_types/
    user_names/serial_numbers
  • coordinate/angle (loop indexes) → coordinate_index/angle_index;
    coord_key/angle_keycoordinate/angle
  • port_reset_img_pathport_reset_image_path; timeouttimeout_sec
  • aresponse; lastlast_timestamp (in get_last_wifi_msg_timestamp())

Dict key renamed (both write and read sites, since it's a plain string key,
not an attribute): self.port_reset_data[...]['reset_dict']
self.port_reset_data[...]['per_iteration_results'].

…nd change_port_to_ip()

Signed-off-by: Narayana-CT <narayana.pinapatruni@candelatech.com>
…carry

Signed-off-by: Narayana-CT <narayana.pinapatruni@candelatech.com>
…om_available(), performing_resets() and run()

Signed-off-by: Narayana-CT <narayana.pinapatruni@candelatech.com>
…_msgs() and write_reset_csvs()

Signed-off-by: Narayana-CT <narayana.pinapatruni@candelatech.com>
…te_coordinate_csv() and create_dict_csv()"

Signed-off-by: Narayana-CT <narayana.pinapatruni@candelatech.com>
…ph(),

per_client_graph() and generate_overall_graph_table()

Signed-off-by: Narayana-CT <narayana.pinapatruni@candelatech.com>
…fo(),

generate_report(), add_live_view_images_to_report(), generate_report_for_robo()
and get_last_wifi_msg_timestamp()

Signed-off-by: Narayana-CT <narayana.pinapatruni@candelatech.com>
Signed-off-by: Narayana-CT <narayana.pinapatruni@candelatech.com>
…atching

Signed-off-by: Narayana-CT <narayana.pinapatruni@candelatech.com>
Signed-off-by: Narayana-CT <narayana.pinapatruni@candelatech.com>
Signed-off-by: Narayana-CT <narayana.pinapatruni@candelatech.com>
Signed-off-by: Narayana-CT <narayana.pinapatruni@candelatech.com>
Verified CLI:

python3 lf_interop_port_reset_test.py \
  --lanforge_ip 192.168.245.117 \
  --upstream_port eth2 \
  --dut 'Testing_wpa2 AP' \
  --ssid Testing_wpa2 --encryp psk2 --passwd lanforge \
  --iterations 2 --reset_interval 5 \
  --android_releases 13 16 \
  --device_list 08301JEC207624,13301JEC205162,R9ZY30RD0KW,user-ThinkPad-T450,Macs-MacBook-Air.local,user-HP-ProBook-445R-G6 \
  --test_name pr_manual_robo \
  --robot_test --coordinate P1 \
  --robot_ip 127.0.0.1:6000

python3 lf_interop_port_reset_test.py \
  --lanforge_ip 192.168.245.117 \
  --upstream_port eth2 \
  --dut 'Testing_wpa2 AP' \
  --ssid Testing_wpa2 --encryp psk2 --passwd lanforge \
  --iterations 2 --reset_interval 5 \
  --android_releases 13 16 \
  --device_list 08301JEC207624,13301JEC205162,R9ZY30RD0KW,user-ThinkPad-T450,Macs-MacBook-Air.local,user-HP-ProBook-445R-G6 \
  --test_name pr_manual_rot1 \
  --robot_test --coordinate P1 \
  --robot_ip 127.0.0.1:6000 \
  --rotation 0,90,180

python3 lf_interop_port_reset_test.py \
  --lanforge_ip 192.168.245.117 \
  --upstream_port eth2 \
  --dut 'Testing_wpa2 AP' \
  --ssid Testing_wpa2 --encryp psk2 --passwd lanforge \
  --iterations 2 --reset_interval 5 \
  --android_releases 13 16 \
  --device_list 08301JEC207624,13301JEC205162,R9ZY30RD0KW,user-ThinkPad-T450,Macs-MacBook-Air.local,user-HP-ProBook-445R-G6 \
  --test_name pr_manual_rot2 \
  --robot_test --coordinate P1 \
  --robot_ip 127.0.0.1:6000 \
  --rotation 45,135,225,315

python3 lf_interop_port_reset_test.py \
  --lanforge_ip 192.168.245.117 \
  --upstream_port eth2 \
  --dut 'Testing_wpa2 AP' \
  --ssid Testing_wpa2 --encryp psk2 --passwd lanforge \
  --iterations 2 --reset_interval 5 \
  --android_releases 13 16 \
  --device_list 08301JEC207624,13301JEC205162,R9ZY30RD0KW,user-ThinkPad-T450,DesktopLatitude5490,Macs-MacBook-Air.local,user-HP-ProBook-445R-G6 \
  --test_name pr_manual_normal

Signed-off-by: Narayana-CT <narayana.pinapatruni@candelatech.com>
Comment thread py-scripts/lf_interop_port_reset_test.py
Comment thread py-scripts/lf_interop_port_reset_test.py
Comment thread py-scripts/lf_interop_port_reset_test.py
Comment thread py-scripts/lf_interop_port_reset_test.py
Comment thread py-scripts/lf_interop_port_reset_test.py

@haricharan-candela haricharan-candela left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Too many changes have been made to script.
What was the issue we are fixing? Could you add that jira? List out what are the changes we have done to fix that and what other/extra changes we have made to script to fix any other issues.
Thank you for all the work

@haricharan-candela haricharan-candela left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving, Hoping we have done enough testing. Next time onwards only keep the PR related to fix no formatting changes also atleast near the release

@goyalsaurabh06
goyalsaurabh06 merged commit 56109f0 into greearb:master Aug 25, 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.

3 participants