diff --git a/Jenkinsfile b/Jenkinsfile index 4c1f6ad8440..d97071ce92a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -109,7 +109,7 @@ pipeline { ["build", "scons -j4"], ["flash", "cd scripts/ && ./reflash_internal_panda.py"], ["flash jungle", "cd board/jungle && ./flash.py --all"], - ["test", "cd tests/hitl && HW_TYPES=10 pytest --durations=0 2*.py [5-9]*.py"], + ["test", "cd tests/hitl && pytest --durations=0 *.py"], ]) } } @@ -121,7 +121,7 @@ pipeline { ["build", "scons -j4"], ["flash", "cd scripts/ && ./reflash_internal_panda.py"], ["flash jungle", "cd board/jungle && ./flash.py --all"], - ["test", "cd tests/hitl && HW_TYPES=9 pytest --durations=0 2*.py [5-9]*.py"], + ["test", "cd tests/hitl && pytest --durations=0 *.py"], ]) } } diff --git a/tests/hitl/1_program.py b/tests/hitl/1_program.py deleted file mode 100644 index 09c8b867445..00000000000 --- a/tests/hitl/1_program.py +++ /dev/null @@ -1,95 +0,0 @@ -import os -import time -import pytest - -from panda import Panda, PandaDFU, McuType, BASEDIR - - -def check_signature(p): - assert not p.bootstub, "Flashed firmware not booting. Stuck in bootstub." - assert p.up_to_date() - - -def test_dfu(p): - app_mcu_type = p.get_mcu_type() - dfu_serial = p.get_dfu_serial() - - p.reset(enter_bootstub=True) - p.reset(enter_bootloader=True) - assert Panda.wait_for_dfu(dfu_serial, timeout=19), "failed to enter DFU" - - dfu = PandaDFU(dfu_serial) - assert dfu.get_mcu_type() == app_mcu_type - - assert dfu_serial in PandaDFU.list() - - dfu._handle.clear_status() - dfu.reset() - p.reconnect() - -# TODO: make more comprehensive bootstub tests and run on a few production ones + current -# TODO: also test release-signed app -@pytest.mark.timeout(30) -def test_known_bootstub(p): - """ - Test that compiled app can work with known production bootstub - """ - known_bootstubs = { - McuType.H7: ["bootstub.panda_h7.bin"], - } - - for kb in known_bootstubs[p.get_mcu_type()]: - app_ids = (p.get_mcu_type(), p.get_usb_serial()) - assert None not in app_ids - - p.reset(enter_bootstub=True) - p.reset(enter_bootloader=True) - - dfu_serial = p.get_dfu_serial() - assert Panda.wait_for_dfu(dfu_serial, timeout=30) - - dfu = PandaDFU(dfu_serial) - with open(os.path.join(BASEDIR, "tests/hitl/known_bootstub", kb), "rb") as f: - code = f.read() - - dfu.program_bootstub(code) - dfu.reset() - - p.connect(claim=False, wait=True) - - # check for MCU or serial mismatch - with Panda(p._serial, claim=False) as np: - bootstub_ids = (np.get_mcu_type(), np.get_usb_serial()) - assert app_ids == bootstub_ids - - # ensure we can flash app and it jumps to app - p.flash() - check_signature(p) - assert not p.bootstub - -@pytest.mark.timeout(25) -def test_recover(p): - assert p.recover(timeout=30) - check_signature(p) - -@pytest.mark.timeout(25) -def test_flash(p): - # test flash from bootstub - serial = p._serial - assert serial is not None - p.reset(enter_bootstub=True) - p.close() - time.sleep(2) - - with Panda(serial) as np: - assert np.bootstub - assert np._serial == serial - np.flash() - - p.reconnect() - p.reset() - check_signature(p) - - # test flash from app - p.flash() - check_signature(p) diff --git a/tests/hitl/3_usb.py b/tests/hitl/3_usb.py index f3ae43e2c1a..f5c861af372 100644 --- a/tests/hitl/3_usb.py +++ b/tests/hitl/3_usb.py @@ -6,9 +6,6 @@ from panda import Panda from panda.tests.hitl.helpers import time_many_sends -pytestmark = [ - pytest.mark.test_panda_types((Panda.HW_TYPE_RED_PANDA, )) -] def test_can_loopback(p): p.set_safety_mode(CarParams.SafetyModel.allOutput) diff --git a/tests/hitl/5_spi.py b/tests/hitl/5_spi.py index 1861ffefd2d..bbc0f3e8b95 100644 --- a/tests/hitl/5_spi.py +++ b/tests/hitl/5_spi.py @@ -6,10 +6,6 @@ from panda import Panda, PandaDFU from panda.python.spi import SpiDevice, PandaProtocolMismatch, PandaSpiNackResponse -pytestmark = [ - pytest.mark.test_panda_types((Panda.HW_TYPE_TRES, )) -] - @pytest.mark.skip("doesn't work, bootloader seems to ignore commands once it sees junk") def test_dfu_with_spam(p): dfu_serial = p.get_dfu_serial()