From 1ab5fa22b7765b3163dd6b3c5efbbbb8ac6b0d66 Mon Sep 17 00:00:00 2001 From: Chen Yudong Date: Fri, 30 Sep 2022 21:04:35 +0800 Subject: [PATCH 1/2] ci: change example simple sniffer test channel --- examples/network/simple_sniffer/pytest_simple_sniffer.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/examples/network/simple_sniffer/pytest_simple_sniffer.py b/examples/network/simple_sniffer/pytest_simple_sniffer.py index cb8dcefd45..1805c84fb5 100644 --- a/examples/network/simple_sniffer/pytest_simple_sniffer.py +++ b/examples/network/simple_sniffer/pytest_simple_sniffer.py @@ -2,13 +2,14 @@ # SPDX-License-Identifier: Apache-2.0 import pytest +from common_test_methods import get_env_config_variable from pytest_embedded import Dut -def _sniffer_packets_check(dut: Dut, packet_num: int) -> None: +def _sniffer_packets_check(dut: Dut, channel: int, packet_num: int) -> None: dut.write('pcap --open -f simple-sniffer') dut.expect('cmd_pcap: open file successfully') - dut.write(f'sniffer -i wlan -c 2 -n {packet_num}') + dut.write(f'sniffer -i wlan -c {channel} -n {packet_num}') dut.expect(f'cmd_sniffer: {packet_num} packages will be captured') dut.expect('cmd_sniffer: start WiFi promiscuous ok') dut.expect('cmd_sniffer: stop promiscuous ok') @@ -43,8 +44,9 @@ def _sniffer_packets_check(dut: Dut, packet_num: int) -> None: ], indirect=True) def test_examples_simple_sniffer(dut: Dut) -> None: dut.expect('sniffer>') + channel = get_env_config_variable('wifi_ap', 'sniffer_channel', default=1) # Sniffer multiple times with few packets for _ in range(3): - _sniffer_packets_check(dut, 5) + _sniffer_packets_check(dut, channel, 5) dut.write('') dut.expect('sniffer>') From 2a8f2978403c6fa9532dd48a3f34554fc4070286 Mon Sep 17 00:00:00 2001 From: Chen Yudong Date: Sat, 8 Oct 2022 13:41:16 +0800 Subject: [PATCH 2/2] CI: enable psram in sniffer example --- examples/network/simple_sniffer/sdkconfig.ci.mem | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/network/simple_sniffer/sdkconfig.ci.mem b/examples/network/simple_sniffer/sdkconfig.ci.mem index 5e21d301f7..c74dc32ce5 100644 --- a/examples/network/simple_sniffer/sdkconfig.ci.mem +++ b/examples/network/simple_sniffer/sdkconfig.ci.mem @@ -1 +1,3 @@ +CONFIG_SPIRAM=y +CONFIG_SPIRAM_IGNORE_NOTFOUND=y CONFIG_SNIFFER_PCAP_DESTINATION_MEMORY=y