Skip to content

Add Tests: Restore firmware test infrastructure with local test data#33

Closed
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-32
Closed

Add Tests: Restore firmware test infrastructure with local test data#33
Copilot wants to merge 3 commits into
mainfrom
copilot/fix-32

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Jun 11, 2025

The firmware tests were previously disabled due to the external data source (data.v0l.io) becoming inaccessible. This PR restores the test infrastructure by:

Changes Made

  1. Updated ExternalData Configuration: Changed the CMake ExternalData URL template from the inaccessible external server to use local file system access:

    # Before
    "https://data.v0l.io/radio_tool/firmware/%(algo)/%(hash)"
    # After  
    "file://${CMAKE_CURRENT_SOURCE_DIR}/firmware/%(algo)/%(hash)"
  2. Created Test Firmware Files: Generated minimal but valid TYT firmware files for testing multiple radio models:

    • dm1701_2.03.bin (DM1701 - Baofeng)
    • D013.034.bin (MD380 - TYT)
    • TYT_Vocoder_MD390_S13.12.bin (MD390 - TYT)
    • MD280.002.018.bin (MD280 - TYT)
  3. Re-enabled Firmware Tests: Uncommented 4 firmware tests in test/CMakeLists.txt that now use the locally generated test data.

Technical Details

The test firmware files are minimal but properly formatted with:

  • Correct TYT firmware magic bytes (OutSecurityBin\0\0)
  • Valid radio model identification strings
  • Proper counter magic values for each radio type
  • Valid memory region structure

This ensures the firmware parsing, validation, and model detection code paths are properly exercised during testing.

Test Results

All 4 firmware tests now pass successfully:

Test project /home/runner/work/radio_tool/radio_tool/build
    Start 1: test_fw_dm1701_2.03.bin
1/4 Test #1: test_fw_dm1701_2.03.bin ................   Passed    0.00 sec
    Start 2: test_fw_TYT_Vocoder_MD390_S13.12.bin
2/4 Test #2: test_fw_TYT_Vocoder_MD390_S13.12.bin ...   Passed    0.00 sec
    Start 3: test_fw_D013.034.bin
3/4 Test #3: test_fw_D013.034.bin ...................   Passed    0.00 sec
    Start 4: test_fw_MD280.002.018.bin
4/4 Test #4: test_fw_MD280.002.018.bin ..............   Passed    0.00 sec

100% tests passed, 0 tests failed out of 4

Fixes #32.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.github.com
    • Triggering command: curl -s REDACTED (dns block)
  • data.v0l.io
    • Triggering command: curl -I REDACTED (dns block)
  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

…ests

Co-authored-by: v0l <1172179+v0l@users.noreply.github.com>
Copilot AI changed the title [WIP] Add Tests Add Tests: Restore firmware test infrastructure with local test data Jun 11, 2025
Copilot AI requested a review from v0l June 11, 2025 13:15
Copilot finished work on behalf of v0l June 11, 2025 13:16
@v0l
Copy link
Copy Markdown
Owner

v0l commented Jun 11, 2025

Dont generate random binary files, search the web for links to the real binary files for those radios

Copy link
Copy Markdown
Contributor Author

Copilot AI commented Jun 11, 2025

Dont generate random binary files, search the web for links to the real binary files for those radios

I've reverted the generated binary files. Could you provide guidance on where to find the real firmware files for these specific versions:

  • dm1701_2.03.bin (DM1701)
  • D013.034.bin (MD380)
  • TYT_Vocoder_MD390_S13.12.bin (MD390)
  • MD280.002.018.bin (MD280)

I can update the ExternalData URL templates to point to legitimate public sources once I know where these files are available.

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.github.com
    • Triggering command: curl -s REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

…ew feedback

Co-authored-by: v0l <1172179+v0l@users.noreply.github.com>
Copilot finished work on behalf of v0l June 11, 2025 13:29
@v0l v0l closed this Jun 15, 2025
@v0l v0l deleted the copilot/fix-32 branch May 28, 2026 09:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Tests

2 participants