Skip to content

Conversation

smuppand
Copy link
Contributor

@smuppand smuppand commented Jun 6, 2025

What Changed

  • The WiFi_Manual_IP connectivity test (run.sh) is fully refactored to call only helper functions from functestlib.sh—no duplicate WPA config or udhcpc logic.
  • Adds a trap so that any temporary modifications to the udhcpc script are always reverted, regardless of test exit path.
  • All credential, WPA config, DHCP, and cleanup logic is delegated to helpers.
  • Logging is improved for debuggability.
  • The script is now fully POSIX sh and ShellCheck compliant.
  • No changes to existing test logic, just a modernization for maintainability and reliability.

Why

  • Makes the test more maintainable, easier to reuse, and less error-prone when multiple tests modify system scripts.
  • Ensures proper cleanup and restores system configuration after testing, even on failure or abort.
  • Consistent use of helper functions enables code reuse across other WiFi/network scripts.

Testing

  • Verified on minimal and full Yocto builds.
  • Clean up, WPA, and DHCP flows validated for both success and failure cases.
  • trap confirmed to revert udhcpc script on all exit paths.
@mwasilew @vnarapar @qcom-anilyada 

@smuppand smuppand requested review from mwasilew and vnarapar June 6, 2025 13:30
@smuppand smuppand force-pushed the wifi-connectivity branch 8 times, most recently from 4ebdf94 to 4533254 Compare June 11, 2025 10:06
@smuppand smuppand force-pushed the wifi-connectivity branch 2 times, most recently from 5872754 to 333283f Compare June 18, 2025 09:00
@smuppand smuppand force-pushed the wifi-connectivity branch 2 times, most recently from 95b052b to 6c3bb9d Compare June 23, 2025 16:10
@smuppand smuppand requested a review from ricardosalveti June 23, 2025 17:09
@smuppand smuppand requested a review from ricardosalveti July 10, 2025 09:46
… and trap-based restore

- Switch WiFi_Manual_IP/run.sh to only use modular helper functions from functestlib.sh.
- Add 'trap' to always restore original udhcpc script on test exit, ensuring testbed is left clean.
- Use wifi_write_wpa_conf for WPA config creation (eliminate code duplication).
- Use ensure_udhcpc_script and restore_udhcpc_script for robust script handling.
- Harden cleanup and error handling (all exits go through helpers).
- Improved logging, POSIX and ShellCheck compliance.
- No change in test semantics or interface.

Signed-off-by: Srikanth Muppandam <[email protected]>
@smuppand smuppand force-pushed the wifi-connectivity branch from 6c3bb9d to 79c092a Compare July 10, 2025 12:50
Copy link
Contributor

@vnarapar vnarapar left a comment

Choose a reason for hiding this comment

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

LGTM

@vnarapar vnarapar merged commit 045e98f into qualcomm-linux:main Jul 11, 2025
7 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