Commit Graph

1126 Commits

Author SHA1 Message Date
Jiang Jiang Jian
5ea07be8b5 Merge branch 'fix/ws_echo_server_uri_registration_race_v5.5' into 'release/v5.5'
fix(http_server/ws_echo_server): Fix ws_echo_server test URI registration race condition (backport v5.5)

See merge request espressif/esp-idf!47726
2026-06-01 16:45:44 +08:00
Marius Vikhammer
e60589404d Merge branch 'fix/heap-minimum-free-size_v5.5' into 'release/v5.5'
fix(heap): Do not consider newly registered heap in minimum free size calculation (v5.5)

See merge request espressif/esp-idf!49037
2026-06-01 15:39:26 +08:00
Hrushikesh Bhosale
9ab588078e fix(http_server/ws_echo_server): Fix ws_echo_server test URI registration race condition
The WebSocket echo server tests connect immediately after seeing
'Starting server on port:' in the device log, but URI handlers
(/ws, /auth) are registered asynchronously after the server starts,
taking 40-660ms depending on config and CI load.

This causes two failures:
1. WebSocket handshake returns 404 Not Found because the URI
   handler is not registered yet when the client connects.
2. WebSocket echo returns wrong data because the server is in a
   partially initialized state.

Wait for 'Returned from app_main()' before connecting, which
guarantees all URI handlers are registered. Add connection retry
with WebSocketBadStatusException handling to WsClient.

Extract _wait_for_server_ready() helper to deduplicate the WiFi
credential input and server readiness logic.

(cherry picked from commit 7a50e3ab04)
2026-06-01 11:36:01 +05:30
Aditya Patwardhan
b14621021e Merge branch 'fix_https_request_rom_impl_ci_failure_v5.5' into 'release/v5.5'
fix(examples): make https_request rom_impl CI test resilient to transient external server failures (backport v5.5)

See merge request espressif/esp-idf!48417
2026-05-29 18:14:57 +05:30
Aditya Patwardhan
d9cdb04c72 Merge branch 'fix_https_request_ci_failure_v5.5' into 'release/v5.5'
fix(https_request): write host time to NVS to eliminate SNTP dependency in CI (backport v5.5)

See merge request espressif/esp-idf!48416
2026-05-29 18:14:49 +05:30
Guillaume Souchere
ca7deb4bf7 fix(mqtt): increase partition size for ssl_mutual_auth example
The binary size (0x100110) slightly exceeds the default 1MB factory
partition, causing a build failure with 0x110 bytes overflow.
Use CONFIG_PARTITION_TABLE_SINGLE_APP_LARGE to provide sufficient
space, consistent with other TLS-based mqtt examples.
2026-05-29 11:37:53 +02:00
muhaidong
f5b743df6a fix(ci): enlarge ssl mutual auth app partition on esp32c5 2026-05-29 11:01:36 +08:00
Hrushikesh Bhosale
a756e5d6f3 fix(https_request): use write_flash esptool subcommand for compatibility
The esptool version bundled with the release/v5.5 IDF environment only
accepts the underscore subcommand name 'write_flash'. The hyphenated
alias 'write-flash' is rejected by argparse on this esptool version.
Use the canonical 'write_flash' name accepted by all esptool versions.
2026-05-27 11:53:34 +05:30
hrushikesh.bhosale
c8684960af ci(pre-commit): apply ruff-format and ruff autofix on release/v5.5 2026-05-27 11:53:03 +05:30
hrushikesh.bhosale
3143a3a343 ci(pre-commit): add write_time_to_nvs helper to satisfy F821/mypy on release/v5.5
The write_time_to_nvs helper is introduced by parent MR !47528's sibling on master
(!47201). On release/v5.5 the parent hasn't merged yet, so this MR's rom_impl test
resilience patch references an undefined name. Include the helper inline here so
pre-commit (ruff F821 + mypy) passes; if the parent's backport (!48415/!48416)
lands first, the merge will need a trivial dedup of this helper.
2026-05-27 11:53:03 +05:30
hrushikesh.bhosale
d63f5d4a15 fix(https_request): Make https_request rom_impl test resilient
The test_examples_protocol_https_request_rom_impl test on ESP32-C2 with
the ROM mbedTLS implementation hits a public TLS endpoint
(tls13.browserleaks.com / www.howsmyssl.com) for five sequential
sub-tests. CI runs frequently fail mid-test with one of:

  * mbedtls_ssl_handshake returned -0x7780
    (MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE - server-side fatal alert)
  * esp-tls: [sock=NN] select() timeout
  * esp-tls: Failed to open new connection in specified timeout

In a representative log the first three sub-tests succeed and only the
fourth/fifth fail, which is consistent with rate-limiting or transient
server unavailability rather than a device bug. Mark the test as
flaky with up to two reruns (10 s delay) so a single transient remote
failure does not fail the CI job.

Also align this test with the rest of the file by injecting the host
timestamp via NVS (write_time_to_nvs) so the device clock no longer
depends on a previous boot's persisted SNTP result, removing one more
source of CI flakiness on first-boot or after NVS erase.
2026-05-27 11:53:03 +05:30
hrushikesh.bhosale
69e3d5bd8a fix(examples): make https_request rom_impl test resilient to transient external server errors
The test_examples_protocol_https_request_rom_impl test on ESP32-C2 with
the ROM mbedTLS implementation hits a public TLS endpoint
(tls13.browserleaks.com / www.howsmyssl.com) for five sequential
sub-tests. CI runs frequently fail mid-test with one of:

  * mbedtls_ssl_handshake returned -0x7780
    (MBEDTLS_ERR_SSL_FATAL_ALERT_MESSAGE - server-side fatal alert)
  * esp-tls: [sock=NN] select() timeout
  * esp-tls: Failed to open new connection in specified timeout

In a representative log the first three sub-tests succeed and only the
fourth/fifth fail, which is consistent with rate-limiting or transient
server unavailability rather than a device bug. Mark the test as
flaky with up to two reruns (10 s delay) so a single transient remote
failure does not fail the CI job.

Also align this test with the rest of the file by injecting the host
timestamp via NVS (write_time_to_nvs) so the device clock no longer
depends on a previous boot's persisted SNTP result, removing one more
source of CI flakiness on first-boot or after NVS erase.
2026-05-27 11:53:03 +05:30
Hrushikesh Bhosale
aff90e29f8 fix(https_request): use write_flash esptool subcommand for compatibility
The esptool version bundled with the release/v5.5 IDF environment only
accepts the underscore subcommand name 'write_flash'. The hyphenated
alias 'write-flash' was added in later esptool releases, so the CI
target test failed with 'argparse.ArgumentError: invalid choice:
write-flash'. Use the canonical 'write_flash' name, which is accepted
by all esptool versions.
2026-05-27 11:51:29 +05:30
muhaidong
8f92270cf6 fix(wifi): add ESP_WIFI_MAX_CONN_NUM-aligned ranges for soft-AP max STA Kconfig 2026-05-19 21:12:11 +08:00
hrushikesh.bhosale
efa7ad42be ci(pre-commit): use typing.Callable for Python 3.8 compatibility on release/v5.5 2026-05-13 11:39:25 +05:30
hrushikesh.bhosale
59a43ed4f7 fix(https_request): write host time to NVS to eliminate SNTP dependency in CI
Replace erase_nvs + SNTP time sync with direct NVS timestamp injection
from the pytest host. This eliminates CI flakiness caused by NTP servers
being unreachable from the CI lab network.

Changes:
- Add write_time_to_nvs() helper that generates an NVS partition image
  with the current host timestamp and flashes it to the DUT before each
  test. The firmware reads this via the existing update_time_from_nvs()
  path and skips SNTP entirely.
- Remove @pytest.mark.parametrize('erase_nvs', ['y']) from all 4
  Ethernet-based tests since NVS is now written with valid data.
2026-05-12 10:45:08 +05:30
Ashish Sharma
d0903c1cb4 fix(http_request): fixes failing pytest 2026-05-11 18:08:54 +08:00
Aditya Patwardhan
1d573ef72c Merge branch 'fix/x509_bundle_replace_unreliable_url_v5.5' into 'release/v5.5'
fix(examples): replace unreliable external URL in https_x509_bundle example (backport v5.5)

See merge request espressif/esp-idf!47719
2026-05-10 14:48:07 +05:30
Aditya Patwardhan
4b9f9ffa38 Merge branch 'fix/http_server_async_handler_connection_retry_v5.5' into 'release/v5.5'
fix(http_server/async_handler): Fix http_server async handler tests (backport v5.5)

See merge request espressif/esp-idf!47724
2026-05-10 14:47:08 +05:30
Fu Hanxi
8a9c2cbeb1 tests: change wifi tests expect timeout to 60
- wifi_router
- wifi_ap
- wifi_high_traffic
2026-04-22 09:22:20 +02:00
Hrushikesh Bhosale
1f44f4022e fix(http_server/async_handler): Fix http_server async handler tests
The async handler CI tests fail intermittently because the TCP
connection from the pytest host to the ESP32 HTTP server times out
or gets refused.

Add a _connect_with_retry() helper that retries the TCP connection
up to 3 times with a 2-second delay between attempts, catching
TimeoutError, ConnectionRefusedError, and OSError.

Extract common server startup waiting into _wait_for_server_ready()
which includes a 2-second stabilization delay after the server
registers its URI handlers before tests begin sending requests.

(cherry picked from commit a665e7410c)
2026-04-17 14:42:15 +05:30
Hrushikesh Bhosale
af58b0c058 fix(https_x509_bundle): replace unreliable external URL in https_x509_bundle example
Replace howsmyssl.com with letsencrypt.org in the https_x509_bundle
example. howsmyssl.com is a third-party server that is frequently
unreachable from CI, causing flaky test failures. letsencrypt.org
chains to the same ISRG Root X1 CA, so the custom certificate bundle
validation coverage is identical.

Since letsencrypt.org was already present in the full bundle URL list,
remove the duplicate entry and reduce MAX_URLS from 9 to 8. All 6
unique root CAs in the stress test are still covered.

For the QEMU stress test, increase per-connection timeout from 30s to
60s and final completion timeout from 60s to 180s. QEMU emulated
network is 3-5x slower than real hardware for TLS handshakes.

(cherry picked from commit d6596eff3a)
(squashed with commit 995c0f129e)
2026-04-17 14:39:08 +05:30
Ashish Sharma
a4c40112c3 fix: removes deprecated http_crypto sources 2026-03-30 13:45:28 +08:00
Ashish Sharma
9681ec0f9c fix: fixes failing dynamic buffer tests 2026-03-30 13:45:28 +08:00
Mahavir Jain
4322004453 Merge branch 'contrib/github_pr_18310_v5.5' into 'release/v5.5'
fix(esp_http_server): Dispatch PONG frames to WebSocket handler (GitHub PR) (v5.5)

See merge request espressif/esp-idf!46656
2026-03-30 10:24:02 +05:30
Ashish Sharma
4425dbf4af feat(http_server): adds example to test server pong response 2026-03-16 16:55:54 +08:00
Ashish Sharma
6f392e6fd6 feat(http_server): improve websocket server handling
1. Adds post handshake callback
2. Removes requirement to handle HTTP_GET message in websocket handler

Closes https://github.com/espressif/esp-idf/issues/18215
2026-03-16 13:57:59 +08:00
Jiang Jiang Jian
99492e859b Merge branch 'ci/fix_mqtt_sll_test_v5.x' into 'release/v5.5'
ci(mqtt): use QoS=1 for control messages in SSL test

See merge request espressif/esp-idf!44092
2026-03-03 19:37:33 +08:00
Mahavir Jain
53c7697465 Merge branch 'bugfix/esp_local_ctrl_arg_check_v5.5' into 'release/v5.5'
fix(esp_local_ctrl): validate payload_case matches msg_type in command dispatcher (v5.5)

See merge request espressif/esp-idf!45925
2026-02-27 09:43:33 +05:30
Alexey Gerenkov
0c7eac2565 Merge branch 'feature/picolibc_v5.5' into 'release/v5.5'
feat(build): add Picolibc support (v5.5)

See merge request espressif/esp-idf!44108
2026-02-26 18:12:58 +08:00
Mahavir Jain
dbc3098182 Merge branch 'contrib/github_pr_17641_v5.5' into 'release/v5.5'
Allow the https server to request client certs only with OPTIONAL (GitHub PR) (v5.5)

See merge request espressif/esp-idf!45797
2026-02-18 18:03:52 +05:30
Mahavir Jain
ab9e5cc34d docs(protocomm): recommend using security2 scheme for production purpose 2026-02-17 11:47:12 +05:30
0xFEEDC0DE64
2ed84eb04b feat(esp_http_server): Allow the https server to request client certs optionally
Closes https://github.com/espressif/esp-idf/pull/17641
2026-02-11 17:49:44 +08:00
Alexey Lapshin
250db2464d fix(icmp_echo): fix incorrect test expectation logic 2026-02-05 13:40:11 +07:00
Bogdan Kolendovskyy
7518cae20f ci(mqtt): use QoS=1 for control messages in SSL test
SSL test relies on the device receiving a control message during the test, which was being sent
with QoS=0. Send the control message with QoS=1 to avoid failures due to poor network connection.
2026-02-03 13:05:26 +01:00
hrushikesh.bhosale
e1caea2e14 fix(esp_http_client): Fixed the esp_http_client example test
- remove the dut expect which was expect error code for invalid
request, as the HTTP_EVENT_DISCONNECTED is not getting triggered
2026-01-27 17:22:39 +05:30
hrushikesh.bhosale
6733adaccc fix(esp_http_client): Fixed the example pytest
Pytest was expect the positive content length for async req
2026-01-27 17:08:08 +05:30
Jiang Jiang Jian
f32cadd971 Merge branch 'fix/enable_p4v3_tests_v5.5' into 'release/v5.5'
fix(ci): re-enabled ESP32P4 tests on different HW vers (v5.5)

See merge request espressif/esp-idf!44453
2026-01-16 14:31:48 +08:00
Chen Yudong
5ffa9d5dcb fix(example): add nvs_flash to mqtt ssl_ds requirement 2026-01-15 12:57:26 +08:00
Ondrej Kosta
498989ea10 fix(ci): re-enabled ESP32P4 tests on different HW vers 2026-01-06 22:17:58 +08:00
Ondrej Kosta
3fe406aa92 feat(ci): updated Ethernet tests to align with new runners 2025-12-01 16:16:03 +01:00
hrushikesh.bhosale
b554cbe9b4 fix(http_server): Fixed response status code for temporary redirect
Closes https://github.com/espressif/esp-idf/issues/17791
2025-11-04 15:05:07 +05:30
Ondrej Kosta
c80867e16a fix(examples): fix version ref. to ethernet_init in static_ip example 2025-10-21 09:57:06 +02:00
hrushikesh.bhosale
067faa25c2 fix(http_server): Fix CI test failure async_handler
pytest trying to hit the server, before registration
of URI handlers or starting of server
2025-10-13 10:36:52 +05:30
Mahavir Jain
b966e396d3 Merge branch 'feat/support_authentication_feature_for_ws_v5.5' into 'release/v5.5'
Added pre handshake callback for websocket (v5.5)

See merge request espressif/esp-idf!41037
2025-09-02 09:18:29 +05:30
hrushikesh.bhosale
80b26b6c2b feat(esp_http_client): Make https_async request under CERT BUNDLE config
Make https_async rqeuest under MBEDTLS_CERTIFICATE_BUNDLE config
2025-08-22 16:31:15 +05:30
muhaidong
8fe3d573d2 fix(ci): increase the bin size of esp-mqtt ssl example with psk verification 2025-08-21 10:11:09 +08:00
muhaidong
12e1db7753 fix(ci): increased app partition size in mqtt5 example 2025-08-20 19:52:49 +08:00
hrushikesh.bhosale
2ac79a842c fix(esp_http_client): Moved httpd_async request from cert_pem to crt_bundle
Moved the httpd_async request from cert_pem to esp_crt_bundle. As cert_pem
is alredy tested for howmyssl URL
2025-08-05 16:25:40 +05:30
hrushikesh.bhosale
415a05a6a5 feat(esp_http_server): Added pre handshake callback for websocket
1. If the user wants authenticate the request, then user needs to do
this before upgrading the protocol to websocket.
2. To achieve this, added pre_handshake_callack, which will execute
before handshake, i.e. before switching protocol.
2025-08-04 20:58:54 +05:30