Skip to content

Commit

Permalink
Use IPC interaction mode in the test system
Browse files Browse the repository at this point in the history
  • Loading branch information
jonlamb-gh committed May 9, 2024
1 parent 3d0867c commit a4a567d
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 31 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,12 +203,21 @@ jobs:
modality workspace inspect ${{env.MODALITY_WORKSPACE}}
modality segment list
- name: Evaluate specs
- name: Evaluate specs over RTT data
env:
MODALITY_AUTH_TOKEN: ${{env.MODALITY_AUTH_TOKEN}}
run: |
conform spec eval --name device-specs --segment "TCP:$GITHUB_RUN_NUMBER"
conform spec eval --name device-specs --segment "RTT:$GITHUB_RUN_NUMBER"
echo '# RTT Spec Coverage' >> $GITHUB_STEP_SUMMARY
conform spec coverage --format text --segment "RTT:$GITHUB_RUN_NUMBER" >> $GITHUB_STEP_SUMMARY
- name: Evaluate specs over TCP data
env:
MODALITY_AUTH_TOKEN: ${{env.MODALITY_AUTH_TOKEN}}
run: |
conform spec eval --name device-specs --segment "TCP:$GITHUB_RUN_NUMBER"
echo '# TCP Spec Coverage' >> $GITHUB_STEP_SUMMARY
conform spec coverage --format text --segment "TCP:$GITHUB_RUN_NUMBER" >> $GITHUB_STEP_SUMMARY
- name: Export Data
if: always()
Expand Down
1 change: 1 addition & 0 deletions test_system/config/reflector_config_rtt.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ additional-timeline-attributes = [
[plugins.ingest.importers.trace-recorder.metadata]
startup-task-name = 'init'
user-event-channel = true
interaction-mode = 'ipc'
deviant-event-id-base = 0x0FF0
# NOTE: this is inside the docker container's fs
file = "/rtt_log.bin"
Expand Down
1 change: 1 addition & 0 deletions test_system/config/reflector_config_tcp.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ additional-timeline-attributes = [
[plugins.ingest.collectors.trace-recorder-tcp.metadata]
startup-task-name = 'init'
user-event-channel = true
interaction-mode = 'ipc'
deviant-event-id-base = 0x0FF0
remote = "192.0.2.80:8888"
connect-timeout = "60s"
Expand Down
65 changes: 36 additions & 29 deletions test_system/specs/device.speqtr
Original file line number Diff line number Diff line change
@@ -1,6 +1,21 @@
# @author = "[email protected]"
# @project = "Test System"

behavior "Tracing"
nominal case "Start event"
TRACE_START @ init as start
# Should be the first event in the log
NOT PRECEDED BY *@*
AND start.internal.trace_recorder.id = 1
AND start.internal.trace_recorder.event_count = 6
AND start.internal.trace_recorder.nonce = 1
AND start.internal.trace_recorder.object_handle = 2
AND start.internal.trace_recorder.type = "TRACE_START"
AND start.timeline.internal.trace_recorder.kernel.port = "FreeRTOS"
AND start.timeline.internal.trace_recorder.protocol = "streaming"
end
end

# @type = "task-resources"
behavior "Task Scheduling Resource Usage"
when "a stats event is logged for a task"
Expand Down Expand Up @@ -69,31 +84,41 @@ behavior "Control Cycle"
adc @ Sensor
end

recovery case "a higher priority context is activated"
nominal case "program execution follows the control cycle expectations"
adc
FOLLOWED BY
QUEUE_SEND @ Sensor (_.queue = "adc_queue")
FOLLOWED BY
TASK_READY @ Sensor (_.task != "Actuator") as other_task
QUEUE_RECEIVE @ Actuator (_.queue = "adc_queue")
FOLLOWED BY
TASK_ACTIVATE @ * (_.timeline.name = other_task.task AND _.priority > 2)
pwm @ Actuator as pwm
FOLLOWED BY
QUEUE_SEND @ Actuator (_.queue = "comms_queue")
FOLLOWED BY
QUEUE_RECEIVE @ Comms (_.queue = "comms_queue")
FOLLOWED BY
comms_tx @ Comms (_.adc = adc.measurement AND _.pwm = pwm.value)
end

recovery case "task is suspended"
adc
FOLLOWED BY
TASK_READY @ Sensor
FOLLOWED BY
warn @ Sensor (_.formatted_string = "Called vTaskSuspend")
end

recovery case "a higher priority context is activated"
adc
FOLLOWED BY
QUEUE_SEND @ Sensor (_.queue = "adc_queue")
FOLLOWED BY
TASK_READY @ Sensor (_.task = "Actuator")
FOLLOWED BY
TASK_ACTIVATE @ Actuator
FOLLOWED BY
TASK_READY @ Actuator (_.task != "Actuator") as other_task
TASK_READY @ Sensor (_.task != "Actuator") as other_task
FOLLOWED BY
TASK_ACTIVATE @ * (_.timeline.name = other_task.task AND _.priority > 2)
end

nominal case "program execution follows the control cycle expectations"
recovery case "another higher priority context is activated"
adc
FOLLOWED BY
QUEUE_SEND @ Sensor (_.queue = "adc_queue")
Expand All @@ -102,26 +127,8 @@ behavior "Control Cycle"
FOLLOWED BY
TASK_ACTIVATE @ Actuator
FOLLOWED BY
QUEUE_RECEIVE @ Actuator (_.queue = "adc_queue")
FOLLOWED BY
pwm @ Actuator as pwm
FOLLOWED BY
QUEUE_SEND @ Actuator (_.queue = "comms_queue")
FOLLOWED BY
TASK_READY @ Actuator (_.task = "Comms")
FOLLOWED BY
TASK_ACTIVATE @ Comms
FOLLOWED BY
QUEUE_RECEIVE @ Comms (_.queue = "comms_queue")
TASK_READY @ Actuator (_.task != "Actuator") as other_task
FOLLOWED BY
comms_tx @ Comms (_.adc = adc.measurement AND _.pwm = pwm.value)
end
end

behavior "Tracing"
nominal case "Start event"
TRACE_START @ init (_.internal.trace_recorder.id = 1 AND _.internal.trace_recorder.event_count = 6)
# Should be the first event in the log
NOT PRECEDED BY *@*
TASK_ACTIVATE @ * (_.timeline.name = other_task.task AND _.priority > 2)
end
end

0 comments on commit a4a567d

Please sign in to comment.