Skip to content

lf_test_generic.py: Add toolbox support - #370

Merged
goyalsaurabh06 merged 3 commits into
greearb:masterfrom
goyalsaurabh06:lf_test_generic_toolbox_support
Aug 25, 2026
Merged

lf_test_generic.py: Add toolbox support#370
goyalsaurabh06 merged 3 commits into
greearb:masterfrom
goyalsaurabh06:lf_test_generic_toolbox_support

Conversation

@tarun-candela

Copy link
Copy Markdown
Collaborator

Description:

  • Enabled toolbox support for lf_test_generic.py script functionalities.

Verified CLIs:

  1. Build new WiFi stations + ping endpoints
python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --build --test_type ping --target www.google.com --radio wiphy1 --num_stations 2 --ssid Tarun --passwd 12345678 --security wpa2 --endp_names ping_sta0,ping_sta1
  1. Build ping endpoint on an existing station
python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --build --test_type ping --target 8.8.8.8 --use_existing_eid 1.1.sta0000 --interval 0.01 --endp_names roam_ping_sta0
  1. Start a specific generic endpoint
python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --start_gen_cx ping_sta0
  1. Start multiple generic endpoints
python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --start_gen_cx ping_sta0,ping_sta1
  1. Start all generic endpoints
python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --start_gen_cx all
  1. Stop a specific generic endpoint
python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --stop_gen_cx ping_sta0
  1. Stop all generic endpoints
python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --stop_gen_cx all
  1. Delete a specific generic endpoint
python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --del_gen_cx ping_sta0
  1. Delete all generic endpoints
python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --del_gen_cx all
  1. Build and start all generic endpoints in one command
python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --build --test_type ping --target www.google.com --radio wiphy1 --num_stations 2 --ssid Tarun --passwd 12345678 --security wpa2 --endp_names ping_sta0,ping_sta1 --start_gen_cx all

Verified CLIs:

1. Build new WiFi stations + ping endpoints
   python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --build --test_type ping --target www.google.com --radio wiphy1 --num_stations 2 --ssid Tarun --passwd 12345678 --security wpa2 --endp_names ping_sta0,ping_sta1
2. Build ping endpoint on an existing station
   python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --build --test_type ping --target 8.8.8.8 --use_existing_eid 1.1.sta0000 --interval 0.01 --endp_names roam_ping_sta0
3. Start a specific generic endpoint
   python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --start_gen_cx ping_sta0
4. Start multiple generic endpoints
   python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --start_gen_cx ping_sta0,ping_sta1
5. Start all generic endpoints
   python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --start_gen_cx all
6. Stop a specific generic endpoint
   python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --stop_gen_cx ping_sta0
7. Stop all generic endpoints
   python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --stop_gen_cx all
8. Delete a specific generic endpoint
   python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --del_gen_cx ping_sta0
9. Delete all generic endpoints
   python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --del_gen_cx all
10. Build and start all generic endpoints in one command
   python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --build --test_type ping --target www.google.com --radio wiphy1 --num_stations 2 --ssid Tarun --passwd 12345678 --security wpa2 --endp_names ping_sta0,ping_sta1 --start_gen_cx all

Signed-off-by: Tarun <tarunkumar.madabathula@candelatech.com>
@tarun-candela tarun-candela added the Hold Use when changes or additional testing are still required before merging. label Aug 21, 2026
…initialization

Verified CLIs:
python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --build --test_type ping --target www.google.com --radio wiphy1 --num_stations 2 --ssid Tarun --passwd 12345678 --security wpa2 --endp_names ping_sta0,ping_sta1
python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --build --test_type ping --target 8.8.8.8 --use_existing_eid 1.1.sta0000 --interval 0.01 --endp_names roam_ping_sta0

Signed-off-by: Tarun <tarunkumar.madabathula@candelatech.com>
@tarun-candela tarun-candela added Ready for review Ready for code review and feedback. and removed Hold Use when changes or additional testing are still required before merging. labels Aug 21, 2026
Comment thread py-scripts/lf_test_generic.py Outdated
Comment thread py-scripts/lf_test_generic.py Outdated

@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.

  1. iperf3 server port gets DHCP switched off, then we wait 50 min for an IP

    In LANforge's set_port, interest says "apply these settings" and current_flags carries the values. Putting dhcp in interest while current_flags=0 omits the use_dhcp bit means "apply DHCP = off."

Fix: drop back to interest=['ifdown'], or keep dhcp and pass current_flags=set_flags(SetPortCurrentFlags, 0, ['use_dhcp']).

  1. get_generic_endpoint_names() hits /generic/all, which returns every generic-tab endpoint on the manager
    Made sharper by nargs='?', const='all' — someone typing --del_gen_cx and forgetting the name wipes the whole generic tab on a shared box.

Fix: scope to self.created_endp or a name prefix. If manager-wide is genuinely intended, drop const='all' so it must be typed explicitly, and reword the docs to say "all generic endpoints on the manager, including those created by other scripts."

  1. port_wait_time is a constructor kwarg only. No argparse entry, and neither main() nor handle_toolbox() passes it — so it is always 3000. wait_for_action runs range(int(secs/2)) with sleep(2), so 3000 means 50 minutes per wait

@tarun-candela Could you cross check these once?

Comment thread py-scripts/lf_test_generic.py
Comment thread py-scripts/lf_test_generic.py Outdated
@haricharan-candela haricharan-candela added Reviewed Code review completed. and removed Ready for review Ready for code review and feedback. labels Aug 23, 2026
@tarun-candela tarun-candela added Ready for review Ready for code review and feedback. and removed Reviewed Code review completed. labels Aug 24, 2026
@tarun-candela

Copy link
Copy Markdown
Collaborator Author
  1. iperf3 server port gets DHCP switched off, then we wait 50 min for an IP
    In LANforge's set_port, interest says "apply these settings" and current_flags carries the values. Putting dhcp in interest while current_flags=0 omits the use_dhcp bit means "apply DHCP = off."

Fix: drop back to interest=['ifdown'], or keep dhcp and pass current_flags=set_flags(SetPortCurrentFlags, 0, ['use_dhcp']).

  1. get_generic_endpoint_names() hits /generic/all, which returns every generic-tab endpoint on the manager
    Made sharper by nargs='?', const='all' — someone typing --del_gen_cx and forgetting the name wipes the whole generic tab on a shared box.

Fix: scope to self.created_endp or a name prefix. If manager-wide is genuinely intended, drop const='all' so it must be typed explicitly, and reword the docs to say "all generic endpoints on the manager, including those created by other scripts."

  1. port_wait_time is a constructor kwarg only. No argparse entry, and neither main() nor handle_toolbox() passes it — so it is always 3000. wait_for_action runs range(int(secs/2)) with sleep(2), so 3000 means 50 minutes per wait

@tarun-candela Could you cross check these once?

Addressed all the comments.

@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.

LGTM

…meout handling

Verified CLIs:
python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --build --test_type ping --target www.google.com --radio wiphy1 --num_stations 12 --ssid Tarun --passwd 12345678 --security wpa2
  python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --start_gen_cx all
  python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --stop_gen_cx all
  python3 py-scripts/lf_test_generic.py --mgr 192.168.244.45 --toolbox --del_gen_cx all

Signed-off-by: Tarun <tarunkumar.madabathula@candelatech.com>
@tarun-candela
tarun-candela force-pushed the lf_test_generic_toolbox_support branch from 083d7be to 514c839 Compare August 25, 2026 06:24
@goyalsaurabh06
goyalsaurabh06 merged commit d79408d into greearb:master Aug 25, 2026
2 checks passed
@tarun-candela tarun-candela added Approved Approved for merging. and removed Ready for review Ready for code review and feedback. labels Aug 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Approved Approved for merging.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants