tests(cpu): Add deep sleep and misc tests for CPU #3153
GitHub Actions / Test Results
failed
Sep 29, 2024 in 0s
2 fail, 26 pass in 31m 25s
Annotations
Check warning on line 0 in validation.cpu_misc.test_cpu_misc
github-actions / Test Results
test_cpu_misc (validation.cpu_misc.test_cpu_misc) failed
./artifacts/parent-artifacts/results/hw/validation/cpu_misc/esp32/cpu_misc.xml [took 18s]
Raw output
ValueError: unity test case not found, buffer:
Serial port /dev/ttyUSB1
Connecting....
Connecting.....
esptool.py v4.8.1
Found 4 serial ports
Chip is ESP32-D0WD-V3 (revision v3.0)
Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
Crystal is 40MHz
MAC: 54:43:b2:dc:87:b4
Uploading stub...
Running stub...
Stub running...
Configuring flash size...
Auto-detected Flash size: 8MB
Flash will be erased from 0x00001000 to 0x00006fff...
Flash will be erased from 0x00008000 to 0x00008fff...
Flash will be erased from 0x00010000 to 0x00053fff...
Flash params set to 0x023f
SHA digest in image updated
Compressed 23376 bytes to 15312...
Writing at 0x00001000... (100 %)
Wrote 23376 bytes (15312 compressed) at 0x00001000 in 2.0 seconds (effective 91.4 kbit/s)...
Hash of data verified.
Compressed 3072 bytes to 137...
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (137 compressed) at 0x00008000 in 0.1 seconds (effective 203.4 kbit/s)...
Hash of data verified.
Compressed 277520 bytes to 153730...
Writing at 0x00010000... (10 %)
Writing at 0x0001bfb5... (20 %)
Writing at 0x00024436... (30 %)
Writing at 0x00029820... (40 %)
Writing at 0x0002eb12... (50 %)
Writing at 0x00033fa9... (60 %)
Writing at 0x0003c992... (70 %)
Writing at 0x00046b55... (80 %)
Writing at 0x0004c204... (90 %)
Writing at 0x00051b0e... (100 %)
Wrote 277520 bytes (153730 compressed) at 0x00010000 in 13.6 seconds (effective 163.1 kbit/s)...
Hash of data verified.
Leaving...
Hard resetting via RTS pin...
ets Jul 29 2019 12:21:46
rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:4604
ho 0 tail 12 room 4
load:0x40078000,len:15488
load:0x40080400,len:4
load:0x40080404,len:3180
entry 0x400805b8
dut = <pytest_embedded_serial.dut.SerialDut object at 0x7fbcbe659030>
def test_cpu_misc(dut):
> dut.expect_unity_test_output(timeout=120)
tests/validation/cpu_misc/test_cpu_misc.py:2:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.10/site-packages/pytest_embedded/dut.py:190: in expect_unity_test_output
self.testsuite.add_unity_test_cases(log)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_embedded.unity.TestSuite object at 0x7fbcbe658f40>
s = 'Serial port /dev/ttyUSB1\nConnecting....\nConnecting.....\nesptool.py v4.8.1\nFound 4 serial ports\nChip is ESP32-D0W...2 room 4\r\nload:0x40078000,len:15488\r\nload:0x40080400,len:4\r\nload:0x40080404,len:3180\r\nentry 0x400805b8\r\n\r\n'
additional_attrs = None
def add_unity_test_cases(self, s: AnyStr, additional_attrs: Optional[Dict[str, Any]] = None) -> None:
s = to_str(s)
# check format
check = UNITY_FIXTURE_REGEX.search(s)
if check:
regex = UNITY_FIXTURE_REGEX
else:
regex = UNITY_BASIC_REGEX
# real parsing
res = regex.finditer(s)
for item in res:
attrs = {k: v for k, v in item.groupdict().items() if v is not None}
if additional_attrs:
attrs.update(additional_attrs)
testcase = TestCase(**attrs)
self.testcases.append(testcase)
if testcase.result == 'FAIL':
self.attrs['failures'] += 1
elif testcase.result == 'IGNORE':
self.attrs['skipped'] += 1
self.attrs['tests'] += 1
if not self.testcases:
> raise ValueError(f'unity test case not found, buffer:\n' f'{s}')
E ValueError: unity test case not found, buffer:
E Serial port /dev/ttyUSB1
E Connecting....
E Connecting.....
E esptool.py v4.8.1
E Found 4 serial ports
E Chip is ESP32-D0WD-V3 (revision v3.0)
E Features: WiFi, BT, Dual Core, 240MHz, VRef calibration in efuse, Coding Scheme None
E Crystal is 40MHz
E MAC: 54:43:b2:dc:87:b4
E Uploading stub...
E Running stub...
E Stub running...
E Configuring flash size...
E Auto-detected Flash size: 8MB
E Flash will be erased from 0x00001000 to 0x00006fff...
E Flash will be erased from 0x00008000 to 0x00008fff...
E Flash will be erased from 0x00010000 to 0x00053fff...
E Flash params set to 0x023f
E SHA digest in image updated
E Compressed 23376 bytes to 15312...
E
Writing at 0x00001000... (100 %)
Wrote 23376 bytes (15312 compressed) at 0x00001000 in 2.0 seconds (effective 91.4 kbit/s)...
E Hash of data verified.
E Compressed 3072 bytes to 137...
E
Writing at 0x00008000... (100 %)
Wrote 3072 bytes (137 compressed) at 0x00008000 in 0.1 seconds (effective 203.4 kbit/s)...
E Hash of data verified.
E Compressed 277520 bytes to 153730...
E
Writing at 0x00010000... (10 %)
Writing at 0x0001bfb5... (20 %)
Writing at 0x00024436... (30 %)
Writing at 0x00029820... (40 %)
Writing at 0x0002eb12... (50 %)
Writing at 0x00033fa9... (60 %)
Writing at 0x0003c992... (70 %)
Writing at 0x00046b55... (80 %)
Writing at 0x0004c204... (90 %)
Writing at 0x00051b0e... (100 %)
Wrote 277520 bytes (153730 compressed) at 0x00010000 in 13.6 seconds (effective 163.1 kbit/s)...
E Hash of data verified.
E
E Leaving...
E Hard resetting via RTS pin...
E ets Jul 29 2019 12:21:46
E
E rst:0x1 (POWERON_RESET),boot:0x13 (SPI_FAST_FLASH_BOOT)
E configsip: 0, SPIWP:0xee
E clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x00,wp_drv:0x00
E mode:DIO, clock div:1
E load:0x3fff0030,len:4604
E ho 0 tail 12 room 4
E load:0x40078000,len:15488
E load:0x40080400,len:4
E load:0x40080404,len:3180
E entry 0x400805b8
/usr/local/lib/python3.10/site-packages/pytest_embedded/unity.py:181: ValueError
Check warning on line 0 in validation.sleep.test_sleep
github-actions / Test Results
All 6 runs failed: test_sleep (validation.sleep.test_sleep)
./artifacts/parent-artifacts/results/hw/validation/sleep/esp32/sleep.xml [took 1m 7s]
./artifacts/parent-artifacts/results/hw/validation/sleep/esp32c3/sleep.xml [took 52s]
./artifacts/parent-artifacts/results/hw/validation/sleep/esp32c6/sleep.xml [took 47s]
./artifacts/parent-artifacts/results/hw/validation/sleep/esp32h2/sleep.xml [took 51s]
./artifacts/parent-artifacts/results/hw/validation/sleep/esp32s2/sleep.xml [took 1m 1s]
./artifacts/parent-artifacts/results/hw/validation/sleep/esp32s3/sleep.xml [took 59s]
Raw output
pexpect.exceptions.TIMEOUT: Not found "Wakeup reason: rtc_io"
Bytes in current buffer (color code eliminated): up reason: touchpad
Please check the full log here: /tmp/pytest-embedded/2024-09-29_04-28-01-118215/test_sleep/dut.log
self = <pytest_embedded_serial.dut.SerialDut object at 0x7fba9b5a5210>
pattern = 'Wakeup reason: rtc_io', expect_all = False, not_matching = ()
args = (), kwargs = {}, patterns = ['Wakeup reason: rtc_io'], res = []
debug_str = 'Not found "Wakeup reason: rtc_io"\nBytes in current buffer (color code eliminated): up reason: touchpad\nPlease check the full log here: /tmp/pytest-embedded/2024-09-29_04-28-01-118215/test_sleep/dut.log'
@functools.wraps(func)
def wrapper(
self, pattern, *args, expect_all: bool = False, not_matching: List[Union[str, re.Pattern]] = (), **kwargs
) -> Union[Union[Match, AnyStr], List[Union[Match, AnyStr]]]:
patterns = to_list(pattern)
res = []
while patterns:
try:
> index = func(self, pattern, *args, **kwargs)
/usr/local/lib/python3.10/site-packages/pytest_embedded/dut.py:76:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/usr/local/lib/python3.10/site-packages/pytest_embedded/dut.py:153: in expect_exact
return self.pexpect_proc.expect_exact(pattern, **kwargs)
/usr/local/lib/python3.10/site-packages/pexpect/spawnbase.py:432: in expect_exact
return exp.expect_loop(timeout)
/usr/local/lib/python3.10/site-packages/pexpect/expect.py:181: in expect_loop
return self.timeout(e)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pexpect.expect.Expecter object at 0x7fba9b2b3610>
err = TIMEOUT("<pytest_embedded.log.PexpectProcess object at 0x7fba9b5a4ca0>\nsearcher: searcher_string:\n 0: b'Wakeup reason: rtc_io'")
def timeout(self, err=None):
spawn = self.spawn
spawn.before = spawn._before.getvalue()
spawn.after = TIMEOUT
index = self.searcher.timeout_index
if index >= 0:
spawn.match = TIMEOUT
spawn.match_index = index
return index
else:
spawn.match = None
spawn.match_index = None
msg = str(spawn)
msg += '\nsearcher: %s' % self.searcher
if err is not None:
msg = str(err) + '\n' + msg
exc = TIMEOUT(msg)
exc.__cause__ = None # in Python 3.x we can use "raise exc from None"
> raise exc
E pexpect.exceptions.TIMEOUT: <pytest_embedded.log.PexpectProcess object at 0x7fba9b5a4ca0>
E searcher: searcher_string:
E 0: b'Wakeup reason: rtc_io'
E <pytest_embedded.log.PexpectProcess object at 0x7fba9b5a4ca0>
E searcher: searcher_string:
E 0: b'Wakeup reason: rtc_io'
/usr/local/lib/python3.10/site-packages/pexpect/expect.py:144: TIMEOUT
The above exception was the direct cause of the following exception:
dut = <pytest_embedded_serial.dut.SerialDut object at 0x7fba9b5a5210>
def test_sleep(dut):
LOGGER = logging.getLogger(__name__)
# Deep Sleep
boot_count = 1
dut.expect_exact("Boot number: {}".format(boot_count))
dut.expect_exact("Wakeup reason: power_up")
for capability, devices in capabilities.items():
if dut.app.target in devices and capability not in ["gpio", "uart"]:
LOGGER.info("Testing {} deep sleep capability".format(capability))
boot_count += 1
dut.write("{}_deep".format(capability))
dut.expect_exact("Boot number: {}".format(boot_count))
dut.expect_exact("Wakeup reason: {}".format(capability))
# Light Sleep
for capability, devices in capabilities.items():
if dut.app.target in devices:
LOGGER.info("Testing {} light sleep capability".format(capability))
dut.write("{}_light".format(capability))
if capability == "uart":
dut.write("aaa") # Send 9 positive edges
dut.expect_exact("Woke up from light sleep")
> dut.expect_exact("Wakeup reason: {}".format(capability))
tests/validation/sleep/test_sleep.py:36:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <pytest_embedded_serial.dut.SerialDut object at 0x7fba9b5a5210>
pattern = 'Wakeup reason: rtc_io', expect_all = False, not_matching = ()
args = (), kwargs = {}, patterns = ['Wakeup reason: rtc_io'], res = []
debug_str = 'Not found "Wakeup reason: rtc_io"\nBytes in current buffer (color code eliminated): up reason: touchpad\nPlease check the full log here: /tmp/pytest-embedded/2024-09-29_04-28-01-118215/test_sleep/dut.log'
@functools.wraps(func)
def wrapper(
self, pattern, *args, expect_all: bool = False, not_matching: List[Union[str, re.Pattern]] = (), **kwargs
) -> Union[Union[Match, AnyStr], List[Union[Match, AnyStr]]]:
patterns = to_list(pattern)
res = []
while patterns:
try:
index = func(self, pattern, *args, **kwargs)
except (pexpect.EOF, pexpect.TIMEOUT) as e:
debug_str = (
f'Not found "{pattern!s}"\n'
f'Bytes in current buffer (color code eliminated): {self.pexpect_proc.buffer_debug_str}\n'
f'Please check the full log here: {self.logfile}'
)
> raise e.__class__(debug_str) from e
E pexpect.exceptions.TIMEOUT: Not found "Wakeup reason: rtc_io"
E Bytes in current buffer (color code eliminated): up reason: touchpad
E Please check the full log here: /tmp/pytest-embedded/2024-09-29_04-28-01-118215/test_sleep/dut.log
/usr/local/lib/python3.10/site-packages/pytest_embedded/dut.py:83: TIMEOUT
Check notice on line 0 in .github
github-actions / Test Results
28 tests found
There are 28 tests, see "Raw output" for the full list of tests.
Raw output
auto_baudrate_test
basic_transmission_test
begin_when_running_test
change_baudrate_test
change_cpu_frequency_test
change_pins_test
disabled_uart_calls_test
enabled_uart_calls_test
end_when_stopped_test
get_cpu_temperature
periman_test
resize_buffers_test
test_fail
test_pass
test_touch_errors
test_touch_interrtupt
test_touch_read
timer_clock_select_test
timer_divider_test
timer_interrupt_test
timer_read_test
validation.cpu_misc.test_cpu_misc ‑ test_cpu_misc
validation.democfg.test_democfg ‑ test_cfg
validation.hello_world.test_hello_world ‑ test_hello_world
validation.nvs.test_nvs ‑ test_nvs
validation.periman.test_periman ‑ test_periman
validation.sleep.test_sleep ‑ test_sleep
validation.wifi.test_wifi ‑ test_wifi
Loading