Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wireless: T6597: improve hostapd startup and corresponding smoketests (backport #3833) #3845

Merged
merged 4 commits into from
Jul 24, 2024

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jul 22, 2024

Change Summary

This was found during smoketesting as thoase started to repeadingly fail in the last weeks

  File "/usr/libexec/vyos/tests/smoke/cli/test_interfaces_wireless.py", line 534, in test_wireless_security_station_address
      self.assertTrue(process_named_running('hostapd'))
  AssertionError: None is not true

Digging into this revealed that this is NOT related to the smoketest coding but to hostapd/systemd instead. With a configured WIFI interface and calling:

sudo systemctl reload-or-restart hostapd@wlan1

multiple times in a short period caused systemd to report:

Jul 18 16:15:32 systemd[1]: [email protected]: Deactivated successfully.

According to the internal systemd logic used in our version this is explained by:

  /* If there's a stop job queued before we enter the DEAD state, we shouldn't act on Restart=, in order to not
   * undo what has already been enqueued. */
  if (unit_stop_pending(UNIT(s)))
          allow_restart = false;

  if (s->result == SERVICE_SUCCESS)
          s->result = f;

  if (s->result == SERVICE_SUCCESS) {
          unit_log_success(UNIT(s));
          end_state = SERVICE_DEAD;`

Where unit_log_success() generates the log message in question.

Improve the restart login in the wireless interface script and an upgrade to hostapd solved the issue.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes)
  • Migration from an old Vyatta component to vyos-1x, please link to related PR inside obsoleted component
  • Other (please describe):

Related Task(s)

Related PR(s)

Component(s) name

wireless

How to test

Smoketests

Smoketest result

image

DEBUG - Running Testcase: /usr/libexec/vyos/tests/smoke/cli/test_interfaces_wireless.py
DEBUG - test_add_multiple_ip_addresses (__main__.WirelessInterfaceTest.test_add_multiple_ip_addresses) ... ok
DEBUG - test_add_single_ip_address (__main__.WirelessInterfaceTest.test_add_single_ip_address) ... ok
DEBUG - test_dhcp_client_options (__main__.WirelessInterfaceTest.test_dhcp_client_options) ... ok
DEBUG - test_dhcp_disable_interface (__main__.WirelessInterfaceTest.test_dhcp_disable_interface) ... ok
DEBUG - test_dhcp_vrf (__main__.WirelessInterfaceTest.test_dhcp_vrf) ... ok
DEBUG - test_dhcpv6_client_options (__main__.WirelessInterfaceTest.test_dhcpv6_client_options) ... ok
DEBUG - test_dhcpv6_vrf (__main__.WirelessInterfaceTest.test_dhcpv6_vrf) ... ok
DEBUG - test_dhcpv6pd_auto_sla_id (__main__.WirelessInterfaceTest.test_dhcpv6pd_auto_sla_id) ... ok
DEBUG - test_dhcpv6pd_manual_sla_id (__main__.WirelessInterfaceTest.test_dhcpv6pd_manual_sla_id) ... ok
DEBUG - test_interface_description (__main__.WirelessInterfaceTest.test_interface_description) ... ok
DEBUG - test_interface_disable (__main__.WirelessInterfaceTest.test_interface_disable) ... ok
DEBUG - test_interface_ip_options (__main__.WirelessInterfaceTest.test_interface_ip_options) ... ok
DEBUG - test_interface_ipv6_options (__main__.WirelessInterfaceTest.test_interface_ipv6_options) ... skipped 'not supported'
DEBUG - test_interface_mtu (__main__.WirelessInterfaceTest.test_interface_mtu) ... skipped 'not supported'
DEBUG - test_ipv6_link_local_address (__main__.WirelessInterfaceTest.test_ipv6_link_local_address) ... skipped 'not supported'
DEBUG - test_mtu_1200_no_ipv6_interface (__main__.WirelessInterfaceTest.test_mtu_1200_no_ipv6_interface) ... skipped 'not supported'
DEBUG - test_span_mirror (__main__.WirelessInterfaceTest.test_span_mirror) ... skipped 'not supported'
DEBUG - test_vif_8021q_interfaces (__main__.WirelessInterfaceTest.test_vif_8021q_interfaces) ... skipped 'not supported'
DEBUG - test_vif_8021q_lower_up_down (__main__.WirelessInterfaceTest.test_vif_8021q_lower_up_down) ... skipped 'not supported'
DEBUG - test_vif_8021q_mtu_limits (__main__.WirelessInterfaceTest.test_vif_8021q_mtu_limits) ... skipped 'not supported'
DEBUG - test_vif_8021q_qos_change (__main__.WirelessInterfaceTest.test_vif_8021q_qos_change) ... skipped 'not supported'
DEBUG - test_vif_s_8021ad_vlan_interfaces (__main__.WirelessInterfaceTest.test_vif_s_8021ad_vlan_interfaces) ... ok
DEBUG - test_vif_s_protocol_change (__main__.WirelessInterfaceTest.test_vif_s_protocol_change) ... ok
DEBUG - test_wireless_access_point_bridge (__main__.WirelessInterfaceTest.test_wireless_access_point_bridge) ... ok
DEBUG - test_wireless_add_single_ip_address (__main__.WirelessInterfaceTest.test_wireless_add_single_ip_address) ... ok
DEBUG - test_wireless_hostapd_config (__main__.WirelessInterfaceTest.test_wireless_hostapd_config) ... ok
DEBUG - test_wireless_hostapd_he_config (__main__.WirelessInterfaceTest.test_wireless_hostapd_he_config) ... ok
DEBUG - test_wireless_hostapd_vht_mu_beamformer_config (__main__.WirelessInterfaceTest.test_wireless_hostapd_vht_mu_beamformer_config) ... ok
DEBUG - test_wireless_hostapd_vht_su_beamformer_config (__main__.WirelessInterfaceTest.test_wireless_hostapd_vht_su_beamformer_config) ... ok
DEBUG - test_wireless_hostapd_wpa_config (__main__.WirelessInterfaceTest.test_wireless_hostapd_wpa_config) ... ok
DEBUG - test_wireless_security_station_address (__main__.WirelessInterfaceTest.test_wireless_security_station_address) ... ok
DEBUG -
DEBUG - ----------------------------------------------------------------------
DEBUG - Ran 31 tests in 141.327s
DEBUG -
DEBUG - OK (skipped=9)

Checklist:

  • I have read the CONTRIBUTING document
  • I have linked this PR to one or more Phabricator Task(s)
  • I have run the components SMOKETESTS if applicable
  • My commit headlines contain a valid Task id
  • My change requires a change to the documentation
  • I have updated the documentation accordingly

This is an automatic backport of pull request #3833 done by [Mergify](https://mergify.com).

@mergify mergify bot requested a review from a team as a code owner July 22, 2024 13:23
@mergify mergify bot added the conflicts label Jul 22, 2024
@github-actions github-actions bot added the sagitta VyOS 1.4 LTS label Jul 22, 2024
Copy link

github-actions bot commented Jul 22, 2024

👍
No issues in PR Title / Commit Title

Copy link

github-actions bot commented Jul 22, 2024

👍
No issues in unused-imports

@c-po
Copy link
Member

c-po commented Jul 22, 2024

Will be rebased after #3847

Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

c-po added 4 commits July 23, 2024 19:18
(cherry picked from commit 11b2731)
This was found during smoketesting as thoase started to repeadingly fail in the last weeks

  File "/usr/libexec/vyos/tests/smoke/cli/test_interfaces_wireless.py", line 534, in test_wireless_security_station_address
      self.assertTrue(process_named_running('hostapd'))
  AssertionError: None is not true

Digging into this revealed that this is NOT related to the smoketest coding but
to hostapd/systemd instead. With a configured WIFI interface and calling:
"sudo systemctl reload-or-restart hostapd@wlan1" multiple times in a short
period caused systemd to report:
"Jul 18 16:15:32 systemd[1]: [email protected]: Deactivated successfully."

According to the internal systemd logic used in our version this is explained by:

  /* If there's a stop job queued before we enter the DEAD state, we shouldn't act on Restart=, in order to not
   * undo what has already been enqueued. */
  if (unit_stop_pending(UNIT(s)))
          allow_restart = false;

  if (s->result == SERVICE_SUCCESS)
          s->result = f;

  if (s->result == SERVICE_SUCCESS) {
          unit_log_success(UNIT(s));
          end_state = SERVICE_DEAD;`

Where unit_log_success() generates the log message in question.

Improve the restart login in the wireless interface script and an upgrade to
hostapd solved the issue.

(cherry picked from commit a67f49d)
@c-po c-po force-pushed the mergify/bp/sagitta/pr-3833 branch from 3b55d99 to 43e0c4b Compare July 23, 2024 17:18
@c-po c-po self-assigned this Jul 23, 2024
@vyos vyos deleted a comment from mergify bot Jul 23, 2024
@c-po c-po enabled auto-merge July 23, 2024 17:19
@c-po c-po merged commit 3147c58 into sagitta Jul 24, 2024
8 checks passed
@mergify mergify bot deleted the mergify/bp/sagitta/pr-3833 branch July 24, 2024 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sagitta VyOS 1.4 LTS
Development

Successfully merging this pull request may close these issues.

3 participants