diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 72d0ba7..48e2006 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -43,4 +43,36 @@ jobs: - name: Check CGroup run: systemd-run --user --scope cat /proc/self/cgroup - name: Run example ${{ matrix.example }} - run: nix develop --command systemd-run-example-${{ matrix.example }} --duration $DURATION + shell: nix develop --command bash -e {0} + run: systemd-run-example-${{ matrix.example }} --duration $DURATION 2>&1 | tee ./output.log + - name: Verify output + run: | + ! grep "ERROR" ./output.log || false + ! grep "panic" ./output.log || false + + if [ "${{ matrix.example }}" = "hello_part" ]; then + ! grep "WARN" ./output.log || false + grep "Received via Sampling Port: CustomMessage" ./output.log || + { printf "no custom message received"; exit 1; } + fi + if [ "${{ matrix.example }}" = "fuel_tank" ]; then + ! grep "WARN" ./output.log || false + fi + if [ "${{ matrix.example }}" = "ping" ]; then + grep "received valid response" ./output.log || + { printf "no valid response received"; exit 1; } + fi + if [ "${{ matrix.example }}" = "dev_random" ]; then + ! grep "WARN" ./output.log || false + grep "got some randomness" ./output.log || + { printf "missing randomness log info"; exit 1; } + fi + if [ "${{ matrix.example }}" = "ping_queue" ]; then + grep "Received valid response" ./output.log || + { printf "no valid response received"; exit 1; } + fi + if [ "${{ matrix.example }}" = "redirect_stdio" ]; then + ! grep "WARN" ./output.log || false + grep "Terminating partition" ./output.log || + { printf "partition didn't terminate as expected"; exit 1; } + fi diff --git a/examples/ping/ping.yaml b/examples/ping/ping.yaml index d74b401..a403d2a 100644 --- a/examples/ping/ping.yaml +++ b/examples/ping/ping.yaml @@ -2,13 +2,13 @@ major_frame: 1s partitions: - id: 0 name: ping_client - duration: 10ms + duration: 30ms offset: 0ms period: 1s image: ping_client - id: 1 name: ping_server - duration: 20ms + duration: 30ms offset: 450ms period: 1s image: ping_server diff --git a/examples/ping_queue/ping_queue.yaml b/examples/ping_queue/ping_queue.yaml index 55b5ada..40fcfa5 100644 --- a/examples/ping_queue/ping_queue.yaml +++ b/examples/ping_queue/ping_queue.yaml @@ -2,13 +2,13 @@ major_frame: 1s partitions: - id: 0 name: ping_queue_client - duration: 10ms + duration: 30ms offset: 0ms period: 1s image: ping_queue_client - id: 1 name: ping_queue_server - duration: 20ms + duration: 30ms offset: 450ms period: 1s image: ping_queue_server