mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
Add test for Linux in pytest_esp_http_client.py
This commit is contained in:
parent
af686f2eed
commit
ae403c6210
@ -12,10 +12,12 @@ examples/protocols/coap_server:
|
|||||||
- if: IDF_TARGET in ["esp32h2"]
|
- if: IDF_TARGET in ["esp32h2"]
|
||||||
|
|
||||||
examples/protocols/esp_http_client:
|
examples/protocols/esp_http_client:
|
||||||
|
enable:
|
||||||
|
- if: INCLUDE_DEFAULT == 1 or IDF_TARGET == "linux"
|
||||||
disable:
|
disable:
|
||||||
- if: IDF_TARGET in ["esp32h2"]
|
- if: IDF_TARGET in ["esp32h2"]
|
||||||
disable_test:
|
disable_test:
|
||||||
- if: IDF_TARGET != "esp32"
|
- if: IDF_TARGET not in ["esp32", "linux"]
|
||||||
temporary: true
|
temporary: true
|
||||||
reason: only test on esp32
|
reason: only test on esp32
|
||||||
|
|
||||||
|
@ -1,6 +1,5 @@
|
|||||||
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-S2 | ESP32-S3 |
|
| Supported Targets | ESP32 | ESP32-C2 | ESP32-C3 | ESP32-C6 | ESP32-S2 | ESP32-S3 | Linux |
|
||||||
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- |
|
| ----------------- | ----- | -------- | -------- | -------- | -------- | -------- | ----- |
|
||||||
|
|
||||||
# ESP HTTP Client Example
|
# ESP HTTP Client Example
|
||||||
|
|
||||||
See the README.md file in the upper level 'examples' directory for more information about examples.
|
See the README.md file in the upper level 'examples' directory for more information about examples.
|
||||||
|
@ -98,3 +98,44 @@ def test_examples_protocol_esp_http_client_dynamic_buffer(dut: Dut) -> None:
|
|||||||
dut.expect(r'HTTP Status = 206, content_length = 10')
|
dut.expect(r'HTTP Status = 206, content_length = 10')
|
||||||
dut.expect(r'HTTP Status = 206, content_length = 10')
|
dut.expect(r'HTTP Status = 206, content_length = 10')
|
||||||
dut.expect('Finish http example')
|
dut.expect('Finish http example')
|
||||||
|
|
||||||
|
|
||||||
|
@pytest.mark.linux
|
||||||
|
@pytest.mark.host_test
|
||||||
|
@pytest.mark.parametrize('config', [
|
||||||
|
'default', 'ssldyn',
|
||||||
|
], indirect=True)
|
||||||
|
def test_examples_protocol_esp_http_client_linux(dut: Dut) -> None:
|
||||||
|
# start test
|
||||||
|
dut.expect('Connected to AP, begin http example', timeout=120)
|
||||||
|
dut.expect(r'HTTP GET Status = 200, content_length = (\d)')
|
||||||
|
dut.expect(r'HTTP POST Status = 200, content_length = (\d)')
|
||||||
|
dut.expect(r'HTTP PUT Status = 200, content_length = (\d)')
|
||||||
|
dut.expect(r'HTTP PATCH Status = 200, content_length = (\d)')
|
||||||
|
dut.expect(r'HTTP DELETE Status = 200, content_length = (\d)')
|
||||||
|
dut.expect(r'HTTP HEAD Status = 200, content_length = (\d)')
|
||||||
|
dut.expect(r'HTTP GET Status = 200, content_length = (\d)')
|
||||||
|
dut.expect(r'HTTP POST Status = 200, content_length = (\d)')
|
||||||
|
dut.expect(r'HTTP PUT Status = 200, content_length = (\d)')
|
||||||
|
dut.expect(r'HTTP PATCH Status = 200, content_length = (\d)')
|
||||||
|
dut.expect(r'HTTP DELETE Status = 200, content_length = (\d)')
|
||||||
|
dut.expect(r'HTTP HEAD Status = 200, content_length = (\d)')
|
||||||
|
dut.expect(r'HTTP Basic Auth Status = 200, content_length = (\d)')
|
||||||
|
dut.expect(r'HTTP Basic Auth redirect Status = 200, content_length = (\d)')
|
||||||
|
dut.expect(r'HTTP Relative path redirect Status = 200, content_length = (\d)')
|
||||||
|
dut.expect(r'HTTP Absolute path redirect Status = 200, content_length = (\d)')
|
||||||
|
dut.expect(r'HTTP Absolute path redirect \(manual\) Status = 200, content_length = (\d)')
|
||||||
|
dut.expect(r'HTTPS Status = 200, content_length = (\d)')
|
||||||
|
dut.expect(r'HTTPS Status = 200, content_length = (\d)')
|
||||||
|
dut.expect(r'HTTP redirect to HTTPS Status = 200, content_length = (\d)')
|
||||||
|
dut.expect(r'HTTP chunk encoding Status = 200, content_length = (-?\d)')
|
||||||
|
# content-len for chunked encoding is typically -1, could be a positive length in some cases
|
||||||
|
dut.expect(r'HTTP Stream reader Status = 200, content_length = (\d)')
|
||||||
|
dut.expect(r'HTTPS Status = 200, content_length = (\d)')
|
||||||
|
dut.expect(r'Last esp error code: 0x8001')
|
||||||
|
dut.expect(r'HTTP GET Status = 200, content_length = (\d)')
|
||||||
|
dut.expect(r'HTTP POST Status = 200, content_length = (\d)')
|
||||||
|
dut.expect(r'HTTP Status = 206, content_length = (\d)')
|
||||||
|
dut.expect(r'HTTP Status = 206, content_length = 10')
|
||||||
|
dut.expect(r'HTTP Status = 206, content_length = 10')
|
||||||
|
dut.expect('Finish http example')
|
||||||
|
@ -29,7 +29,7 @@ esp_err_t nvs_flash_erase(void)
|
|||||||
return ESP_OK;
|
return ESP_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main(void)
|
||||||
{
|
{
|
||||||
app_main();
|
app_main();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user