mirror of
https://github.com/espressif/esp-idf.git
synced 2025-08-05 05:34:32 +02:00
Merge branch 'bugfix/http2_request' into 'master'
CI: Fix example test for http_request See merge request espressif/esp-idf!15819
This commit is contained in:
@@ -16,13 +16,16 @@ TEST_SERVER = 'http2.golang.org'
|
|||||||
|
|
||||||
def is_test_server_available(): # type: () -> bool
|
def is_test_server_available(): # type: () -> bool
|
||||||
# 443 - default https port
|
# 443 - default https port
|
||||||
|
try:
|
||||||
conn = http.client.HTTPSConnection(TEST_SERVER, 443, timeout=10)
|
conn = http.client.HTTPSConnection(TEST_SERVER, 443, timeout=10)
|
||||||
conn.request('GET', '/')
|
conn.request('GET', '/')
|
||||||
resp = conn.getresponse()
|
resp = conn.getresponse()
|
||||||
conn.close()
|
return True if resp.status == HTTP_OK else False
|
||||||
if resp.status == HTTP_OK:
|
except Exception as msg:
|
||||||
return True
|
Utility.console_log('Exception occurred when connecting to {}: {}'.format(TEST_SERVER, msg))
|
||||||
return False
|
return False
|
||||||
|
finally:
|
||||||
|
conn.close()
|
||||||
|
|
||||||
|
|
||||||
@ttfw_idf.idf_example_test(env_tag='Example_EthKitV1')
|
@ttfw_idf.idf_example_test(env_tag='Example_EthKitV1')
|
||||||
|
Reference in New Issue
Block a user