Merge branch 'bugfix/ota_tests_python3' into 'master'

ota: Fix UnicodeDecodeError in example_tests

See merge request espressif/esp-idf!10746
This commit is contained in:
Mahavir Jain 2020-10-11 15:07:06 +08:00
commit d5929bd737
2 changed files with 8 additions and 8 deletions

View File

@ -234,8 +234,8 @@ def test_examples_protocol_advanced_https_ota_example_truncated_bin(env, extra_d
truncated_bin_size = 64000
# check and log bin size
binary_file = os.path.join(dut1.app.binary_path, bin_name)
f = open(binary_file, "r+")
fo = open(os.path.join(dut1.app.binary_path, truncated_bin_name), "w+")
f = open(binary_file, "rb+")
fo = open(os.path.join(dut1.app.binary_path, truncated_bin_name), "wb+")
fo.write(f.read(truncated_bin_size))
fo.close()
f.close()
@ -285,8 +285,8 @@ def test_examples_protocol_advanced_https_ota_example_truncated_header(env, extr
truncated_bin_size = 180
# check and log bin size
binary_file = os.path.join(dut1.app.binary_path, bin_name)
f = open(binary_file, "r+")
fo = open(os.path.join(dut1.app.binary_path, truncated_bin_name), "w+")
f = open(binary_file, "rb+")
fo = open(os.path.join(dut1.app.binary_path, truncated_bin_name), "wb+")
fo.write(f.read(truncated_bin_size))
fo.close()
f.close()

View File

@ -201,8 +201,8 @@ def test_examples_protocol_native_ota_example_truncated_bin(env, extra_data):
truncated_bin_size = 64000
# check and log bin size
binary_file = os.path.join(dut1.app.binary_path, bin_name)
f = open(binary_file, "r+")
fo = open(os.path.join(dut1.app.binary_path, truncated_bin_name), "w+")
f = open(binary_file, "rb+")
fo = open(os.path.join(dut1.app.binary_path, truncated_bin_name), "wb+")
fo.write(f.read(truncated_bin_size))
fo.close()
f.close()
@ -252,8 +252,8 @@ def test_examples_protocol_native_ota_example_truncated_header(env, extra_data):
truncated_bin_size = 180
# check and log bin size
binary_file = os.path.join(dut1.app.binary_path, bin_name)
f = open(binary_file, "r+")
fo = open(os.path.join(dut1.app.binary_path, truncated_bin_name), "w+")
f = open(binary_file, "rb+")
fo = open(os.path.join(dut1.app.binary_path, truncated_bin_name), "wb+")
fo.write(f.read(truncated_bin_size))
fo.close()
f.close()