mirror of
https://github.com/espressif/esp-idf.git
synced 2025-07-30 18:57:19 +02:00
Merge branch 'bugfix/example_test_import_error_4.2' into 'release/v4.2'
bugfix: import error in example tests (4.2) See merge request espressif/esp-idf!11048
This commit is contained in:
@ -19,13 +19,17 @@ import os
|
|||||||
import re
|
import re
|
||||||
import threading
|
import threading
|
||||||
import traceback
|
import traceback
|
||||||
import Queue
|
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
from tiny_test_fw import Utility
|
from tiny_test_fw import Utility
|
||||||
import ttfw_idf
|
import ttfw_idf
|
||||||
from ble import lib_ble_client
|
from ble import lib_ble_client
|
||||||
|
|
||||||
|
try:
|
||||||
|
import Queue
|
||||||
|
except ImportError:
|
||||||
|
import queue as Queue
|
||||||
|
|
||||||
# When running on local machine execute the following before running this script
|
# When running on local machine execute the following before running this script
|
||||||
# > make app bootloader
|
# > make app bootloader
|
||||||
# > make print_flash_cmd | tail -n 1 > build/download.config
|
# > make print_flash_cmd | tail -n 1 > build/download.config
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
import socket
|
import socket
|
||||||
import BaseHTTPServer
|
|
||||||
import SimpleHTTPServer
|
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
import ssl
|
import ssl
|
||||||
|
|
||||||
@ -11,6 +9,13 @@ import ttfw_idf
|
|||||||
import random
|
import random
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
try:
|
||||||
|
import BaseHTTPServer
|
||||||
|
from SimpleHTTPServer import SimpleHTTPRequestHandler
|
||||||
|
except ImportError:
|
||||||
|
import http.server as BaseHTTPServer
|
||||||
|
from http.server import SimpleHTTPRequestHandler
|
||||||
|
|
||||||
server_cert = "-----BEGIN CERTIFICATE-----\n" \
|
server_cert = "-----BEGIN CERTIFICATE-----\n" \
|
||||||
"MIIDXTCCAkWgAwIBAgIJAP4LF7E72HakMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\n"\
|
"MIIDXTCCAkWgAwIBAgIJAP4LF7E72HakMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\n"\
|
||||||
"BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX\n"\
|
"BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX\n"\
|
||||||
@ -99,7 +104,7 @@ def https_request_handler():
|
|||||||
"""
|
"""
|
||||||
Returns a request handler class that handles broken pipe exception
|
Returns a request handler class that handles broken pipe exception
|
||||||
"""
|
"""
|
||||||
class RequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
class RequestHandler(SimpleHTTPRequestHandler):
|
||||||
def finish(self):
|
def finish(self):
|
||||||
try:
|
try:
|
||||||
if not self.wfile.closed:
|
if not self.wfile.closed:
|
||||||
@ -121,8 +126,7 @@ def https_request_handler():
|
|||||||
def start_https_server(ota_image_dir, server_ip, server_port):
|
def start_https_server(ota_image_dir, server_ip, server_port):
|
||||||
server_file, key_file = get_ca_cert(ota_image_dir)
|
server_file, key_file = get_ca_cert(ota_image_dir)
|
||||||
requestHandler = https_request_handler()
|
requestHandler = https_request_handler()
|
||||||
httpd = BaseHTTPServer.HTTPServer((server_ip, server_port),
|
httpd = BaseHTTPServer.HTTPServer((server_ip, server_port), requestHandler)
|
||||||
requestHandler)
|
|
||||||
|
|
||||||
httpd.socket = ssl.wrap_socket(httpd.socket,
|
httpd.socket = ssl.wrap_socket(httpd.socket,
|
||||||
keyfile=key_file,
|
keyfile=key_file,
|
||||||
@ -140,7 +144,7 @@ def redirect_handler_factory(url):
|
|||||||
"""
|
"""
|
||||||
Returns a request handler class that redirects to supplied `url`
|
Returns a request handler class that redirects to supplied `url`
|
||||||
"""
|
"""
|
||||||
class RedirectHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
class RedirectHandler(SimpleHTTPRequestHandler):
|
||||||
def do_GET(self):
|
def do_GET(self):
|
||||||
print("Sending resp, URL: " + url)
|
print("Sending resp, URL: " + url)
|
||||||
self.send_response(301)
|
self.send_response(301)
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
import socket
|
import socket
|
||||||
import BaseHTTPServer
|
|
||||||
import SimpleHTTPServer
|
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
import ssl
|
import ssl
|
||||||
|
|
||||||
@ -11,6 +9,13 @@ import ttfw_idf
|
|||||||
import random
|
import random
|
||||||
import subprocess
|
import subprocess
|
||||||
|
|
||||||
|
try:
|
||||||
|
import BaseHTTPServer
|
||||||
|
from SimpleHTTPServer import SimpleHTTPRequestHandler
|
||||||
|
except ImportError:
|
||||||
|
import http.server as BaseHTTPServer
|
||||||
|
from http.server import SimpleHTTPRequestHandler
|
||||||
|
|
||||||
server_cert = "-----BEGIN CERTIFICATE-----\n" \
|
server_cert = "-----BEGIN CERTIFICATE-----\n" \
|
||||||
"MIIDXTCCAkWgAwIBAgIJAP4LF7E72HakMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\n"\
|
"MIIDXTCCAkWgAwIBAgIJAP4LF7E72HakMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\n"\
|
||||||
"BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX\n"\
|
"BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX\n"\
|
||||||
@ -99,7 +104,7 @@ def https_request_handler():
|
|||||||
"""
|
"""
|
||||||
Returns a request handler class that handles broken pipe exception
|
Returns a request handler class that handles broken pipe exception
|
||||||
"""
|
"""
|
||||||
class RequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
|
class RequestHandler(SimpleHTTPRequestHandler):
|
||||||
def finish(self):
|
def finish(self):
|
||||||
try:
|
try:
|
||||||
if not self.wfile.closed:
|
if not self.wfile.closed:
|
||||||
@ -121,8 +126,7 @@ def https_request_handler():
|
|||||||
def start_https_server(ota_image_dir, server_ip, server_port):
|
def start_https_server(ota_image_dir, server_ip, server_port):
|
||||||
server_file, key_file = get_ca_cert(ota_image_dir)
|
server_file, key_file = get_ca_cert(ota_image_dir)
|
||||||
requestHandler = https_request_handler()
|
requestHandler = https_request_handler()
|
||||||
httpd = BaseHTTPServer.HTTPServer((server_ip, server_port),
|
httpd = BaseHTTPServer.HTTPServer((server_ip, server_port), requestHandler)
|
||||||
requestHandler)
|
|
||||||
|
|
||||||
httpd.socket = ssl.wrap_socket(httpd.socket,
|
httpd.socket = ssl.wrap_socket(httpd.socket,
|
||||||
keyfile=key_file,
|
keyfile=key_file,
|
||||||
|
@ -1,14 +1,19 @@
|
|||||||
import re
|
import re
|
||||||
import os
|
import os
|
||||||
import socket
|
import socket
|
||||||
import BaseHTTPServer
|
|
||||||
import SimpleHTTPServer
|
|
||||||
from threading import Thread
|
from threading import Thread
|
||||||
import ssl
|
import ssl
|
||||||
|
|
||||||
from tiny_test_fw import DUT
|
from tiny_test_fw import DUT
|
||||||
import ttfw_idf
|
import ttfw_idf
|
||||||
|
|
||||||
|
try:
|
||||||
|
import BaseHTTPServer
|
||||||
|
from SimpleHTTPServer import SimpleHTTPRequestHandler
|
||||||
|
except ImportError:
|
||||||
|
import http.server as BaseHTTPServer
|
||||||
|
from http.server import SimpleHTTPRequestHandler
|
||||||
|
|
||||||
server_cert = "-----BEGIN CERTIFICATE-----\n" \
|
server_cert = "-----BEGIN CERTIFICATE-----\n" \
|
||||||
"MIIDXTCCAkWgAwIBAgIJAP4LF7E72HakMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\n"\
|
"MIIDXTCCAkWgAwIBAgIJAP4LF7E72HakMA0GCSqGSIb3DQEBCwUAMEUxCzAJBgNV\n"\
|
||||||
"BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX\n"\
|
"BAYTAkFVMRMwEQYDVQQIDApTb21lLVN0YXRlMSEwHwYDVQQKDBhJbnRlcm5ldCBX\n"\
|
||||||
@ -87,7 +92,7 @@ def start_https_server(ota_image_dir, server_ip, server_port):
|
|||||||
key_file_handle.close()
|
key_file_handle.close()
|
||||||
|
|
||||||
httpd = BaseHTTPServer.HTTPServer((server_ip, server_port),
|
httpd = BaseHTTPServer.HTTPServer((server_ip, server_port),
|
||||||
SimpleHTTPServer.SimpleHTTPRequestHandler)
|
SimpleHTTPRequestHandler)
|
||||||
|
|
||||||
httpd.socket = ssl.wrap_socket(httpd.socket,
|
httpd.socket = ssl.wrap_socket(httpd.socket,
|
||||||
keyfile=key_file,
|
keyfile=key_file,
|
||||||
|
Reference in New Issue
Block a user