RustyCAN — SOUP Test Cases

1.1 NMT Heartbeat Decode (SOUPTC001)

Objective: Verify that NMT heartbeat frames are correctly decoded to node state values.

Test suite: host/src/canopen/nmt.rs — unit tests decode_bootup, decode_operational, decode_pre_op, decode_start_all, returns_none_on_empty (6 tests).

Pass criteria: All tests pass with exit code 0.

Execution:

cargo test -p rustycan -- nmt

Parent links: SOUP007 CANopen NMT Node State Monitoring

Attribute Value
method automated
test-command cargo test -p rustycan -- nmt

1.2 NMT Master Command Encoding (SOUPTC002)

Objective: Verify that NMT master commands are correctly encoded into CAN frames.

Test suite: host/src/canopen/nmt.rs — unit test encode_all_commands.

Pass criteria: All NMT command variants (Start, Stop, EnterPreOperational, ResetNode, ResetCommunication) encode to the expected COB-ID 0x000 frame bytes.

Execution:

cargo test -p rustycan -- nmt::tests::encode_all_commands

Parent links: SOUP008 CANopen NMT Master Commands

Attribute Value
method automated
test-command cargo test -p rustycan -- nmt::tests::encode_all_commands

1.3 PDO Decoding from EDS (SOUPTC003)

Objective: Verify that a PDO frame is correctly decoded into named signal values using mappings from an EDS file.

Test suite: host/tests/integration_test.rspdo_decoder_builds_from_eds.

Pass criteria: A known 4-byte PDO payload is decoded to the expected Status Bits, Digital Inputs, and Current Segment values as defined in tests/fixtures/sample_drive.eds.

Execution:

cargo test -p rustycan -- pdo

Parent links: SOUP009 CANopen PDO Decoding

Attribute Value
method automated
test-command cargo test -p rustycan -- pdo

1.4 EDS File Parsing (Integration) (SOUPTC004)

Objective: Verify that EDS files are correctly parsed into an object dictionary with the expected entries.

Test suite: host/tests/integration_test.rseds_parse_device_type, eds_parse_status_word, eds_parse_tpdo1_sub_objects (3 tests).

Pass criteria: Device type (0x1000), Status Word (0x3000), and TPDO1 mapping (0x1A00 sub-objects) parse to the expected types, names, and default values from tests/fixtures/sample_drive.eds.

Execution:

cargo test -p rustycan -- eds_parse

Parent links: SOUP009 CANopen PDO Decoding

Attribute Value
method automated
test-command cargo test -p rustycan -- eds_parse

1.5 EDS Parser Unit Tests (SOUPTC005)

Objective: Verify internal EDS parsing logic — section classification, node-ID string parsing, and default value parsing.

Test suite: host/src/eds/mod.rsparse_section_var, parse_section_sub, parse_section_non_object, parse_node_id_str_variants, parse_default_u32_hex, parse_default_u32_decimal, build_entry_minimal (8 tests).

Pass criteria: All 8 unit tests pass with exit code 0.

Execution:

cargo test -p rustycan -- eds::

Parent links: SOUP024 EDS and DBC File Formats

Attribute Value
method automated
test-command cargo test -p rustycan -- eds::

1.6 SDO Expedited and Segmented Transfer (SOUPTC006)

Objective: Verify that SDO command frames are correctly encoded and decoded for expedited and segmented upload/download operations.

Test suite: host/tests/integration_test.rssdo_decodes_status_word_with_eds, sdo_encode_upload_request_roundtrip, sdo_encode_download_expedited_u16, sdo_encode_value_u32_known_object, sdo_parse_hex_bytes_and_segmented_init (4–5 tests).

Pass criteria: All SDO integration tests pass; round-trip encode/decode produces identical frames; EDS-looked-up object names and values match expectations.

Execution:

cargo test -p rustycan -- sdo

Parent links: SOUP010 CANopen SDO Transfer

Attribute Value
method automated
test-command cargo test -p rustycan -- sdo

1.7 CAN Frame COB-ID Classification (SOUPTC007)

Objective: Verify that incoming CAN frame COB-IDs are correctly classified as heartbeat, TPDO, or RPDO frame types.

Test suite: host/tests/integration_test.rsclassify_heartbeat_frame, classify_tpdo_rpdo.

Pass criteria: COB-IDs 0x701–0x702 are classified as heartbeat; TPDO and RPDO COB-ID ranges are correctly distinguished.

Execution:

cargo test -p rustycan -- classify

Parent links: SOUP005 CAN Frame Reception

Attribute Value
method automated
test-command cargo test -p rustycan -- classify

1.8 DBC Message and Signal Decoding (Integration) (SOUPTC008)

Objective: Verify that DBC files are parsed and CAN signal values are correctly decoded including scaling, offset, and VAL_ descriptions.

Test suite: host/tests/integration_test.rsdbc_parse_fixture_message_name, dbc_decode_engine_speed_intel_le, dbc_decode_coolant_temp_with_val_description (3 tests).

Pass criteria: EngineData message parses correctly from tests/fixtures/sample_bus.dbc; EngineSpeed raw value 0x0320 decodes to 100.0 rpm; CoolantTemp decodes to expected VAL_ description.

Execution:

cargo test -p rustycan -- dbc

Parent links: SOUP011 DBC Signal Decoding

Attribute Value
method automated
test-command cargo test -p rustycan -- dbc

1.9 DBC Bit Extraction Unit Tests (SOUPTC009)

Objective: Verify low-level DBC signal bit-extraction for Intel and Motorola byte orders, including cross-byte signals and two's complement conversion.

Test suite: host/src/dbc/mod.rsextract_intel_single_byte, extract_intel_nibble, extract_intel_cross_byte, extract_motorola_single_byte, to_signed_positive, to_signed_negative (6 tests).

Pass criteria: All 6 unit tests pass with exit code 0.

Execution:

cargo test -p rustycan -- dbc::

Parent links: SOUP011 DBC Signal Decoding

Attribute Value
method automated
test-command cargo test -p rustycan -- dbc::

2.1 Summit Adapter Connection (SOUPTC010)

Objective: Verify that RustyCAN detects and connects to a Summit adapter.

Preconditions: Summit adapter connected to host. Driver installed (macOS/Windows) or pcan kernel module loaded (Linux). CAN bus with termination resistors.

Procedure:

  1. Launch RustyCAN.
  2. On the Connect screen, select adapter type Summit.
  3. Select the correct port/channel and baud rate.
  4. Click Connect.

Pass criteria: The Monitor screen opens. The status bar shows the adapter as connected. No error dialog is displayed.

Parent links: SOUP002 Summit Adapter Support

Attribute Value
method manual

2.2 KCAN Dongle Connection (SOUPTC011)

Objective: Verify that RustyCAN detects and connects to a KCAN Dongle and exposes both CAN channels.

Preconditions: KCAN Dongle (STM32H753ZI) connected via USB. No other software accessing the device.

Procedure:

  1. Launch RustyCAN.
  2. On the Connect screen, select adapter type KCAN Dongle.
  3. Select baud rate and click Connect.

Pass criteria: The Monitor screen opens showing both FDCAN1 (channel 0) and FDCAN2 (channel 1). The status bar shows the dongle firmware version. No error dialog is displayed.

Parent links: SOUP003 KCAN Dongle Adapter Support

Attribute Value
method manual

2.3 Adapter Disconnection Detection (SOUPTC012)

Objective: Verify that RustyCAN detects and surfaces an adapter disconnection event during an active session.

Preconditions: RustyCAN connected to any supported adapter with an active session.

Procedure:

  1. Establish a connection and confirm the Monitor screen is active.
  2. Physically unplug the adapter USB cable.
  3. Observe the UI within 5 seconds.

Pass criteria: The UI displays an AdapterDisconnected notification (error banner or status change). The application does not crash. The user can dismiss the error and return to the Connect screen.

Parent links: SOUP004 Adapter Disconnection Detection

Attribute Value
method manual

2.4 NMT Master Command Execution (SOUPTC013)

Objective: Verify that NMT master commands issued via the GUI result in the correct node state transition on a live CANopen node.

Preconditions: RustyCAN connected. At least one CANopen node active on the bus, implementing standard NMT heartbeat (CiA 301).

Procedure:

  1. Confirm the node appears in the Monitor screen in Operational state.
  2. Issue Stop Remote Node to the node via the GUI.
  3. Confirm node transitions to Stopped.
  4. Issue Start Remote Node to the node.
  5. Confirm node transitions back to Operational.
  6. Issue Reset Node (broadcast, node-ID 0).
  7. Confirm all nodes transition to Bootup then return to Pre-Operational or Operational.

Pass criteria: Each NMT state transition is reflected in the Monitor screen within 2 seconds of the command being issued.

Parent links: SOUP008 CANopen NMT Master Commands

Attribute Value
method manual

2.5 SDO Read and Write on Live Node (SOUPTC014)

Objective: Verify that SDO upload (read) and download (write) operations return correct values on a live CANopen node.

Preconditions: RustyCAN connected. A CANopen node with a known object dictionary accessible via SDO (e.g., Device Type at 0x1000 sub 0).

Procedure:

  1. Using the SDO panel, request an SDO read on index 0x1000, sub 0.
  2. Observe the returned value.
  3. Request an SDO write on a writable object (e.g., a vendor-specific parameter).
  4. Perform an SDO read of the same object to confirm the written value.

Pass criteria: The read returns the expected value. The write completes without error. The subsequent read confirms the written value is stored.

Parent links: SOUP010 CANopen SDO Transfer

Attribute Value
method manual

2.6 JSONL Event Log Integrity (SOUPTC015)

Objective: Verify that the JSONL log file contains well-formed JSON entries with timestamps for all received CAN events.

Preconditions: RustyCAN connected to a CAN bus with at least one active node.

Procedure:

  1. Start a session and allow at least 30 seconds of data capture.
  2. Disconnect and locate the generated .jsonl log file.
  3. Run cat <logfile> | python3 -c "import sys,json; [json.loads(l) for l in sys.stdin]" (or equivalent).
  4. Inspect at least 10 entries for the presence of a timestamp field and a recognised event type field.

Pass criteria: All lines parse as valid JSON. Every entry contains a timestamp field. No truncated or malformed lines are present.

Parent links: SOUP012 JSONL Event Logging

Attribute Value
method manual

2.7 Native Desktop GUI Launch (SOUPTC016)

Objective: Verify that the RustyCAN desktop GUI starts and renders the Connect and Monitor screens.

Preconditions: RustyCAN installed or built from source. No adapter required.

Procedure:

  1. Launch rustycan (no flags).
  2. Observe the Connect screen.
  3. Connect to any available adapter.
  4. Observe the Monitor screen.

Pass criteria: The application window opens without error. The Connect screen renders adapter type and port selection controls. After connection the Monitor screen renders NMT node table, PDO panel, and SDO panel.

Parent links: SOUP013 Native Desktop GUI

Attribute Value
method manual

2.8 TUI Mode Launch (SOUPTC017)

Objective: Verify that the --tui flag starts the full-screen terminal user interface.

Preconditions: A valid JSON config file pointing to an available adapter. Terminal capable of rendering full-screen TUI (e.g., 80×24 minimum).

Procedure:

  1. Run rustycan --tui --config <config.json>.
  2. Observe the terminal.
  3. Press q to quit.

Pass criteria: A full-screen terminal UI is rendered showing NMT, PDO, SDO, and event-log panels. The terminal is fully restored to normal mode after quitting. No graphical window is opened.

Parent links: SOUP014 Terminal User Interface (TUI) Mode

Attribute Value
method manual
test-command rustycan --tui --config

2.9 Live HTTP/SSE Dashboard (SOUPTC018)

Objective: Verify that the live browser dashboard is accessible and streams real-time events.

Preconditions: RustyCAN connected to a CAN bus with active traffic.

Procedure:

  1. Start a session in GUI or TUI mode.
  2. Open http://127.0.0.1:7878/ in a web browser.
  3. Observe the page for at least 10 seconds.

Pass criteria: The page loads without error. The NMT node grid renders. New CAN events appear in the event log in real time via SSE without requiring a page refresh.

Parent links: SOUP015 Live HTTP/SSE Dashboard

Attribute Value
method manual

2.10 JSON Configuration File Loading (SOUPTC019)

Objective: Verify that adapter type and baud rate specified in a JSON config file are correctly applied on startup.

Preconditions: A valid config.kcan.json file specifying KCAN adapter and a specific baud rate.

Procedure:

  1. Run rustycan --config config.kcan.json.
  2. Observe the Connect screen (GUI) or the session startup (TUI/log mode).

Pass criteria: The adapter type shown matches the config file. The baud rate shown matches the config file. No prompts for adapter selection are shown when auto_connect is set in the config.

Parent links: SOUP016 JSON Configuration File

Attribute Value
method manual
test-command rustycan --config config.kcan.json

2.11 KCAN Dongle Firmware Update via DFU (SOUPTC020)

Objective: Verify that a signed firmware image can be successfully flashed to a KCAN Dongle via USB DFU.

Preconditions: KCAN Dongle connected via USB. A valid Ed25519-signed firmware image (.bin) available.

Procedure:

  1. Launch rustycan --dfu-firmware <signed.bin> or initiate DFU from the GUI/TUI DFU flow.
  2. Confirm the signature verification prompt.
  3. Observe the update progress.
  4. After completion, power-cycle the dongle and reconnect.

Pass criteria: The firmware update completes without error. The dongle boots the new firmware. An image with an invalid signature is rejected with an explicit error message before any programming begins.

Parent links: SOUP017 KCAN Dongle Firmware Update

Attribute Value
method manual

2.12 Hardware Timestamp Resolution Verification (SOUPTC021)

Objective: Verify that KCAN Dongle timestamps in the JSONL log have 100 ns resolution.

Preconditions: RustyCAN connected to a KCAN Dongle. CAN bus with periodic frame traffic.

Procedure:

  1. Capture at least 100 frames with the KCAN Dongle.
  2. Stop the session and open the JSONL log.
  3. Inspect the timestamp values of consecutive frames.
  4. Compute the difference between consecutive timestamps for two frames known to arrive close together.

Pass criteria: Timestamp values are expressed with sub-microsecond granularity (100 ns LSB). Differences between close frames resolve to values less than 1 µs where expected from the known frame interval.

Parent links: SOUP018 Hardware Timestamp Resolution

Attribute Value
method manual

2.13 Multi-Node Logging Stability (SOUPTC022)

Objective: Verify that RustyCAN sustains continuous logging without frame loss on a network with seven or more active CANopen nodes.

Preconditions: Seven (7) or more CANopen nodes active on the bus, each transmitting heartbeats and at least one TPDO. Adapter: Summit or KCAN.

Procedure:

  1. Start a session with all seven nodes active.
  2. Allow the session to run for 60 seconds.
  3. Stop the session and open the JSONL log.
  4. Count heartbeat events per node and compare against expected heartbeat count (node heartbeat interval × 60 s).

Pass criteria: Heartbeat frame counts per node deviate by no more than 2% from the expected count. No corruption or truncated JSON lines are present in the log.

Parent links: SOUP020 Multi-Node Logging Stability

Attribute Value
method manual

2.14 Cross-Platform CI Build and Test (SOUPTC023)

Objective: Verify that RustyCAN builds and all automated tests pass on all supported platforms.

Test suite: GitHub Actions CI matrix — ci.yml (build + cargo test) on:

  • macOS (Apple Silicon)
  • macOS (Intel x86-64)
  • Windows 10 x86-64
  • Linux x86-64 (Ubuntu)

Pass criteria: All CI matrix jobs complete with exit code 0. The release.yml workflow produces installable artifacts for all three platforms (DMG, NSIS installer, AppImage/deb).

Parent links: SOUP021 Supported Operating Systems

Attribute Value
method automated
test-command (see CI workflows .github/workflows/ci.yml and release.yml)

2.15 App Update: Version Tag Parsing (SOUPTC026)

Objective: Verify that updater::parse_semver_tag correctly parses Git version tags into (major, minor, patch) triples and rejects malformed input.

Test suite: host/src/updater.rs — unit tests in updater::tests:

Test name Input Expected output
parse_plain_tag "v1.2.3" Some((1, 2, 3))
parse_describe_suffix "v0.2.0-5-gabcdef" Some((0, 2, 0))
parse_zero_patch "v1.0.0" Some((1, 0, 0))
parse_no_v_prefix "2.3.4" Some((2, 3, 4))
parse_empty "" None
parse_garbage "not-a-version" None
parse_too_few_parts "v1.2" None

Pass criteria: All seven tests pass with exit code 0.

Execution:

cargo test -p rustycan -- updater::tests

Parent links: SOUP025 App Update Notification and Self-Update

Attribute Value
method automated
test-command cargo test -p rustycan -- updater::tests

3.1 Code Review: Adapter Interface Implementation (SOUPTC024)

Objective: Confirm by code review that host/src/adapters/summit/mod.rs and host/src/adapters/kcan.rs correctly implement the declared hardware interface requirements.

Reviewers: At least one reviewer with USB and CAN bus expertise.

Review checklist:

  • summit/mod.rs: Uses vendor Summit driver API on macOS/Windows; uses SocketCAN AF_CAN socket on Linux. Correct error propagation on driver failure.
  • kcan.rs: Uses nusb exclusively (no libusb or rusb imports). Bulk endpoints OUT=0x01, IN=0x81. Call order: open()claim_interface(0) → control/bulk I/O. GET_INFO retry logic present. Bulk OUT chunked to 64-byte MPS.

Pass criteria: Review completed and documented. No deviations from SOUP023 (nusb-only) or SOUP022 (driver mapping) found, or deviations are recorded as new anomaly items.

Parent links: SOUP022 Summit Adapter Hardware Interface, SOUP023 KCAN Adapter Hardware Interface

Attribute Value
method review

3.2 Code Review: EDS and DBC Format Compliance (SOUPTC025)

Objective: Confirm by code review that host/src/eds/mod.rs and host/src/dbc/mod.rs accept files in the declared formats and handle malformed input gracefully.

Reviewers: At least one reviewer familiar with CiA 306 (EDS) and Vector DBC format.

Review checklist:

  • eds/mod.rs: Parses INI-style EDS sections; correctly handles ObjectType, DataType, DefaultValue, SubNumber; rejects or skips non-object sections without panic.
  • dbc/mod.rs: Parses BO_ message blocks and SG_ signal lines; correctly handles Intel and Motorola byte orders, signal bit positions, scaling, offset, and VAL_ tables.

Pass criteria: Review completed and documented. Parser correctly handles all test fixtures. Any format limitations are recorded as new anomaly items or known limitations in SOUP024.

Parent links: SOUP024 EDS and DBC File Formats

Attribute Value
method review

3.3 XCP Transport Routing Decode (SOUPTC027)

Objective: Verify XCP CRO/DTO classification and slave byte-order handling.

Test suite: host/src/xcp/mod.rs unit tests.

Pass criteria: All tests pass with exit code 0.

Parent links: SOUP026 XCP-on-CAN Transport and CRO/DTO Routing

Attribute Value
method automated
test-command cargo test -p rustycan -- xcp::tests

3.4 XCP Command Codec (SOUPTC028)

Objective: Verify encoding of XCP master commands and decoding of CONNECT and error responses.

Test suite: host/src/xcp/command.rs unit tests.

Pass criteria: All tests pass with exit code 0.

Parent links: SOUP027 XCP Master Command Set

Attribute Value
method automated
test-command cargo test -p rustycan -- xcp::command

3.5 XCP DAQ Tracker (SOUPTC029)

Objective: Verify dynamic DAQ configuration tracking and DTO DAQ frame decode.

Test suite: host/src/xcp/daq.rs unit tests.

Pass criteria: All tests pass with exit code 0.

Parent links: SOUP028 XCP DAQ Measurement Capture

Attribute Value
method automated
test-command cargo test -p rustycan -- xcp::daq

3.6 A2L Parser (SOUPTC030)

Objective: Verify A2L MEASUREMENT/CHARACTERISTIC parsing and raw value decode.

Test suite: host/src/xcp/a2l.rs unit tests.

Pass criteria: All tests pass with exit code 0.

Parent links: SOUP029 A2L Measurement and Characteristic Resolution

Attribute Value
method automated
test-command cargo test -p rustycan -- xcp::a2l

3.7 Dongle DAQ-Readiness Build Check (SOUPTC031)

Objective: Verify the dongle firmware compiles with the >=256-entry CAN-RX buffer and RX drop counter.

Pass criteria: Clippy passes with no warnings for the thumbv7em target.

Parent links: SOUP030 Dongle CAN-RX Buffering for High-Rate DAQ

Attribute Value
method manual
test-command cargo clippy --manifest-path firmware/Cargo.toml -p dongle-h743 --target thumbv7em-none-eabihf -- -D warnings