pytest_wifi_getting_started.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. # SPDX-FileCopyrightText: 2022 Espressif Systems (Shanghai) CO LTD
  2. # SPDX-License-Identifier: CC0-1.0
  3. import os.path
  4. from typing import Tuple
  5. import pytest
  6. from pytest_embedded_idf.dut import IdfDut
  7. # @pytest.mark.supported_targets
  8. # This test should support all targets, even between different target types
  9. # For now our CI only support multi dut with esp32
  10. # If you want to enable different target type, please use the following param
  11. # @pytest.mark.parametrize(
  12. # 'count, app_path, target', [
  13. # (2,
  14. # f'{os.path.join(os.path.dirname(__file__), "softAP")}|{os.path.join(os.path.dirname(__file__), "station")}',
  15. # 'esp32|esp32s2'),
  16. # ],
  17. # indirect=True,
  18. # )
  19. @pytest.mark.esp32
  20. @pytest.mark.multi_dut_generic
  21. @pytest.mark.parametrize(
  22. 'count, app_path', [
  23. (2,
  24. f'{os.path.join(os.path.dirname(__file__), "softAP")}|{os.path.join(os.path.dirname(__file__), "station")}'),
  25. ], indirect=True
  26. )
  27. def test_wifi_getting_started(dut: Tuple[IdfDut, IdfDut]) -> None:
  28. softap = dut[0]
  29. station = dut[1]
  30. ssid = 'myssid'
  31. password = 'mypassword'
  32. tag = 'wifi station'
  33. station.expect(f'{tag}: got ip:', timeout=60)
  34. station.expect(f'{tag}: connected to ap SSID:{ssid} password:{password}', timeout=60)
  35. softap.expect('station .+ join, AID=', timeout=60)