diff --git a/.gitlab/tests/cram/arcadyan-mozart/100-pwhm.t b/.gitlab/tests/cram/arcadyan-mozart/100-pwhm.t index ed67f0db4c..7491a14cbf 100644 --- a/.gitlab/tests/cram/arcadyan-mozart/100-pwhm.t +++ b/.gitlab/tests/cram/arcadyan-mozart/100-pwhm.t @@ -50,7 +50,7 @@ Check default SSID configuration of access points: Check that no hostapd instance is running: - $ R "pgrep -f 'hostapd -ddt'" + $ R "pgrep -f 'hostapd'" [1] Test activation of access point 1: @@ -177,11 +177,11 @@ Check that hostapd is operating as expected: $ R logger -t cram "Check that hostapd is operating" - $ R "ps axw" | sed -nE 's/.*(hostapd.*)/\1/p' | head -1 | tr -s ' ' '\n' | LC_ALL=C sort - -ddt - /tmp/wlan0_hapd.conf - /tmp/wlan1_hapd.conf + $ R "ps axw" | sed -nE 's/.*(hostapd .*)/\1/p' | head -1 | tr -s ' ' '\n' | LC_ALL=C sort + -g + -s /tmp/wlan2_hapd.conf + /var/run/hostapd/global\.0x.* (re) hostapd $ R "ubus list | grep -e 'hostapd\.' | sort" @@ -211,6 +211,88 @@ Check iw interfaces and beaconing: ssid prplOS-guest ssid prplOS-guest +Test custom arguments + + $ R "ba-cli 'Device.WiFi.EndPoint.*.Enable=1' | sed '1d' | awk 'NF'" + Device.WiFi.EndPoint.1. + Device.WiFi.EndPoint.1.Enable=1 + Device.WiFi.EndPoint.2. + Device.WiFi.EndPoint.2.Enable=1 + Device.WiFi.EndPoint.3. + Device.WiFi.EndPoint.3.Enable=1 + + $ R "ba-cli -j -l 'protected; WiFi.DaemonMgt.Daemon.hostapd.ExecutionSettings.CustomArguments=-dds' | grep CustomArguments" + [{"WiFi.DaemonMgt.Daemon.1.ExecutionSettings.":{"CustomArguments":"-dds"}}] + + $ R "ba-cli -j -l 'protected; WiFi.DaemonMgt.Daemon.hostapd.ExecutionSettings.CustomArguments?' | grep CustomArguments" + [{"WiFi.DaemonMgt.Daemon.1.ExecutionSettings.":{"CustomArguments":"-dds"}}] + + $ R "ba-cli -j -l 'protected; WiFi.DaemonMgt.Daemon.wpa_supplicant.ExecutionSettings.CustomArguments=-ds' | grep CustomArguments" + [{"WiFi.DaemonMgt.Daemon.2.ExecutionSettings.":{"CustomArguments":"-ds"}}] + + $ R "ba-cli -j -l 'protected; WiFi.DaemonMgt.Daemon.wpa_supplicant.ExecutionSettings.CustomArguments?' | grep CustomArguments" + [{"WiFi.DaemonMgt.Daemon.2.ExecutionSettings.":{"CustomArguments":"-ds"}}] + +$ sleep 10 + + $ R logger -t cram "Check that hostapd is operating" + + $ R "ps axw" | sed -nE 's/.*(hostapd .*)/\1/p' | head -1 | tr -s ' ' '\n' | LC_ALL=C sort + -dds + -g + /tmp/wlan0_hapd.conf + /tmp/wlan1_hapd.conf + /tmp/wlan2_hapd.conf + /var/run/hostapd/global\.0x.* (re) + hostapd + + $ R logger -t cram "Check that wpa_supplicant is operating" + + $ R "ps axw" | sed -n '/[w]pa_supplicant/ { s/^.*\bwpa_supplicant[[:space:]]/wpa_supplicant /; p }' | sort | head -3 + wpa_supplicant -ds -i wlan0 -Dnl80211 -c /tmp/wlan0_wpa_supplicant.conf + wpa_supplicant -ds -i wlan1 -Dnl80211 -c /tmp/wlan1_wpa_supplicant.conf + wpa_supplicant -ds -i wlan2 -Dnl80211 -c /tmp/wlan2_wpa_supplicant.conf + +Setting the custom arguments back to default value: + + $ R "ba-cli -j -l 'protected; WiFi.DaemonMgt.Daemon.hostapd.ExecutionSettings.CustomArguments="-s"' | grep CustomArguments" + [{"WiFi.DaemonMgt.Daemon.1.ExecutionSettings.":{"CustomArguments":"-s"}}] + + $ R "ba-cli -j -l 'protected; WiFi.DaemonMgt.Daemon.hostapd.ExecutionSettings.CustomArguments?' | grep CustomArguments" + [{"WiFi.DaemonMgt.Daemon.1.ExecutionSettings.":{"CustomArguments":"-s"}}] + +$ R "ba-cli -j -l 'protected; WiFi.DaemonMgt.Daemon.wpa_supplicant.ExecutionSettings.CustomArguments="-s"' | grep CustomArguments" + [{"WiFi.DaemonMgt.Daemon.2.ExecutionSettings.":{"CustomArguments":"-s"}}] + + $ R "ba-cli -j -l 'protected; WiFi.DaemonMgt.Daemon.wpa_supplicant.ExecutionSettings.CustomArguments?' | grep CustomArguments" + [{"WiFi.DaemonMgt.Daemon.2.ExecutionSettings.":{"CustomArguments":"-s"}}] + + $ sleep 10 + + $ R logger -t cram "Check that hostapd is operating" + + $ R "ps axw" | sed -nE 's/.*(hostapd .*)/\1/p' | head -1 | tr -s ' ' '\n' | LC_ALL=C sort + -g + -s + /tmp/wlan0_hapd.conf + /tmp/wlan1_hapd.conf + /tmp/wlan2_hapd.conf + /var/run/hostapd/global\.0x.* (re) + hostapd + + $ R "ps axw" | sed -n '/[w]pa_supplicant/ { s/^.*\bwpa_supplicant[[:space:]]/wpa_supplicant /; p }' | sort | head -3 + wpa_supplicant -s -i wlan0 -Dnl80211 -c /tmp/wlan0_wpa_supplicant.conf + wpa_supplicant -s -i wlan1 -Dnl80211 -c /tmp/wlan1_wpa_supplicant.conf + wpa_supplicant -s -i wlan2 -Dnl80211 -c /tmp/wlan2_wpa_supplicant.conf + + $ R "ba-cli 'Device.WiFi.EndPoint.*.Enable=0' | sed '1d' | awk 'NF'" + Device.WiFi.EndPoint.1. + Device.WiFi.EndPoint.1.Enable=0 + Device.WiFi.EndPoint.2. + Device.WiFi.EndPoint.2.Enable=0 + Device.WiFi.EndPoint.3. + Device.WiFi.EndPoint.3.Enable=0 + Test deactivation of access point 6: $ R logger -t cram "Test AccessPoint 6 deactivation "$(get_ssid_ref 6)"" diff --git a/.gitlab/tests/cram/generic/logrotate.t b/.gitlab/tests/cram/generic/logrotate.t index d69394c9f2..9dab0bc290 100644 --- a/.gitlab/tests/cram/generic/logrotate.t +++ b/.gitlab/tests/cram/generic/logrotate.t @@ -14,5 +14,11 @@ Check that logrotate is properly setup: /var/log/messages /var/log/messages_firewall + $ R 'grep /var/log/hostapd /var/lib/logrotate.status | cut -d\" -f2' + /var/log/hostapd + + $ R 'grep /var/log/wpa_supplicant /var/lib/logrotate.status | cut -d\" -f2' + /var/log/wpa_supplicant + $ R "grep /usr/sbin/logrotate /etc/crontabs/root" */10 * * * * /usr/sbin/logrotate /etc/logrotate.conf diff --git a/.gitlab/tests/cram/generic/pwhm-daemon-logfile.t b/.gitlab/tests/cram/generic/pwhm-daemon-logfile.t new file mode 100644 index 0000000000..ff340518eb --- /dev/null +++ b/.gitlab/tests/cram/generic/pwhm-daemon-logfile.t @@ -0,0 +1,11 @@ +Create R alias: + + $ alias R="${CRAM_REMOTE_COMMAND:-}" + +Check that pwhm log files are not empty: + + $ test -s "/var/log/wpa_supplicant" + [1] + + $ test -s "/var/log/hostapd" + [1] diff --git a/.gitlab/tests/cram/wnc-freedom/100-pwhm.t b/.gitlab/tests/cram/wnc-freedom/100-pwhm.t index 4d71f91384..408167c64d 100644 --- a/.gitlab/tests/cram/wnc-freedom/100-pwhm.t +++ b/.gitlab/tests/cram/wnc-freedom/100-pwhm.t @@ -53,7 +53,7 @@ Check default SSID configuration of access points: Check that no hostapd instance is running: - $ R "pgrep -f 'hostapd -ddt'" + $ R "pgrep -f 'hostapd'" [1] Test activation of access point 1: @@ -359,8 +359,8 @@ Check that hostapd is operating as expected: $ R logger -t cram "Check that hostapd is operating" $ R "ps axw" | sed -nE 's/.*(hostapd .*)/\1/p' | head -1 | tr -s ' ' '\n' | LC_ALL=C sort - -ddt -g + -s /tmp/wlan2_hapd.conf /var/run/hostapd/global\.0x.* (re) hostapd @@ -411,6 +411,98 @@ Check that the tree interfaces are present in the main link interface: link 2: channel.* (re) +Check if hostap pid has changed or not before custom arguments is set: + + $ if [ "$(R pgrep -f 'hostapd')" = "$hostap_pid" ]; then echo "true"; else echo "hostapd restarted during the test !"; fi + true + +Test custom arguments + + $ R "ba-cli 'Device.WiFi.EndPoint.*.Enable=1' | sed '1d' | awk 'NF'" + Device.WiFi.EndPoint.1. + Device.WiFi.EndPoint.1.Enable=1 + Device.WiFi.EndPoint.2. + Device.WiFi.EndPoint.2.Enable=1 + Device.WiFi.EndPoint.3. + Device.WiFi.EndPoint.3.Enable=1 + + $ R "ba-cli -j -l 'protected; WiFi.DaemonMgt.Daemon.hostapd.ExecutionSettings.CustomArguments=-dds' | grep CustomArguments" + [{"WiFi.DaemonMgt.Daemon.1.ExecutionSettings.":{"CustomArguments":"-dds"}}] + + $ R "ba-cli -j -l 'protected; WiFi.DaemonMgt.Daemon.hostapd.ExecutionSettings.CustomArguments?' | grep CustomArguments" + [{"WiFi.DaemonMgt.Daemon.1.ExecutionSettings.":{"CustomArguments":"-dds"}}] + + $ R "ba-cli -j -l 'protected; WiFi.DaemonMgt.Daemon.wpa_supplicant.ExecutionSettings.CustomArguments=-ds' | grep CustomArguments" + [{"WiFi.DaemonMgt.Daemon.2.ExecutionSettings.":{"CustomArguments":"-ds"}}] + + $ R "ba-cli -j -l 'protected; WiFi.DaemonMgt.Daemon.wpa_supplicant.ExecutionSettings.CustomArguments?' | grep CustomArguments" + [{"WiFi.DaemonMgt.Daemon.2.ExecutionSettings.":{"CustomArguments":"-ds"}}] + + $ sleep 10 + + $ R logger -t cram "Check that hostapd is operating" + + $ R "ps axw" | sed -nE 's/.*(hostapd .*)/\1/p' | head -1 | tr -s ' ' '\n' | LC_ALL=C sort + -dds + -g + /tmp/wlan0_hapd.conf + /tmp/wlan1_hapd.conf + /tmp/wlan2_hapd.conf + /var/run/hostapd/global\.0x.* (re) + hostapd + + $ R logger -t cram "Check that wpa_supplicant is operating" + + $ R "ps axw" | sed -n '/[w]pa_supplicant/ { s/^.*\bwpa_supplicant[[:space:]]/wpa_supplicant /; p }' | sort | head -3 + wpa_supplicant -ds -i wlan0 -Dnl80211 -c /tmp/wlan0_wpa_supplicant.conf + wpa_supplicant -ds -i wlan1 -Dnl80211 -c /tmp/wlan1_wpa_supplicant.conf + wpa_supplicant -ds -i wlan2 -Dnl80211 -c /tmp/wlan2_wpa_supplicant.conf + +Setting the custom arguments back to default value: + + $ R "ba-cli -j -l 'protected; WiFi.DaemonMgt.Daemon.hostapd.ExecutionSettings.CustomArguments="-s"' | grep CustomArguments" + [{"WiFi.DaemonMgt.Daemon.1.ExecutionSettings.":{"CustomArguments":"-s"}}] + + $ R "ba-cli -j -l 'protected; WiFi.DaemonMgt.Daemon.hostapd.ExecutionSettings.CustomArguments?' | grep CustomArguments" + [{"WiFi.DaemonMgt.Daemon.1.ExecutionSettings.":{"CustomArguments":"-s"}}] + + $ R "ba-cli -j -l 'protected; WiFi.DaemonMgt.Daemon.wpa_supplicant.ExecutionSettings.CustomArguments="-s"' | grep CustomArguments" + [{"WiFi.DaemonMgt.Daemon.2.ExecutionSettings.":{"CustomArguments":"-s"}}] + + $ R "ba-cli -j -l 'protected; WiFi.DaemonMgt.Daemon.wpa_supplicant.ExecutionSettings.CustomArguments?' | grep CustomArguments" + [{"WiFi.DaemonMgt.Daemon.2.ExecutionSettings.":{"CustomArguments":"-s"}}] + + $ sleep 10 + + $ R logger -t cram "Check that hostapd is operating" + + $ R "ps axw" | sed -nE 's/.*(hostapd .*)/\1/p' | head -1 | tr -s ' ' '\n' | LC_ALL=C sort + -g + -s + /tmp/wlan0_hapd.conf + /tmp/wlan1_hapd.conf + /tmp/wlan2_hapd.conf + /var/run/hostapd/global\.0x.* (re) + hostapd + + $ R "ps axw" | sed -n '/[w]pa_supplicant/ { s/^.*\bwpa_supplicant[[:space:]]/wpa_supplicant /; p }' | sort | head -3 + wpa_supplicant -s -i wlan0 -Dnl80211 -c /tmp/wlan0_wpa_supplicant.conf + wpa_supplicant -s -i wlan1 -Dnl80211 -c /tmp/wlan1_wpa_supplicant.conf + wpa_supplicant -s -i wlan2 -Dnl80211 -c /tmp/wlan2_wpa_supplicant.conf + + $ R "ba-cli 'Device.WiFi.EndPoint.*.Enable=0' | sed '1d' | awk 'NF'" + Device.WiFi.EndPoint.1. + Device.WiFi.EndPoint.1.Enable=0 + Device.WiFi.EndPoint.2. + Device.WiFi.EndPoint.2.Enable=0 + Device.WiFi.EndPoint.3. + Device.WiFi.EndPoint.3.Enable=0 + +Saving hostap pid: + + $ hostap_pid=$(R pgrep -f 'hostapd') + $ R logger -t cram "hostap PID after custom arguments test: $hostap_pid" + Test deactivation of access point 9: $ enable_ap_sync 9 0 @@ -691,7 +783,7 @@ Check wpacltrl socket file: Check if hostapd process is stopped: - $ R "pgrep -f 'hostapd -ddt'" + $ R "pgrep -f 'hostapd'" [1] Resume prplMesh: diff --git a/.gitlab/tests/cram/wnc-freedom/101-mlo_step_1.t b/.gitlab/tests/cram/wnc-freedom/101-mlo_step_1.t index cae027f083..69f2f54dc8 100644 --- a/.gitlab/tests/cram/wnc-freedom/101-mlo_step_1.t +++ b/.gitlab/tests/cram/wnc-freedom/101-mlo_step_1.t @@ -308,8 +308,10 @@ Check that hostapd is operating as expected: $ R logger -t cram "Check that hostapd is operating" $ R "ps axw" | sed -nE 's/.*(hostapd .*)/\1/p' | head -1 | tr -s ' ' '\n' | LC_ALL=C sort - -ddt -g + -s + /tmp/wlan0_hapd.conf + /tmp/wlan1_hapd.conf /tmp/wlan2_hapd.conf /var/run/hostapd/global\.0x.* (re) hostapd