Debian Codegraph @

launcher/image/test/scripts/test_custom_token.sh

raw
1 #!/bin/bash
2 set -euo pipefail
3 source util/read_serial.sh
4
5 # This test requires the workload to run and print
6 # corresponding messages to the serial console.
7 SERIAL_OUTPUT=$(read_serial $2 $3)
8 print_serial=false
9
10 if echo $SERIAL_OUTPUT | grep -q "Token valid: $1"
11 then
12 echo "- test custom token"
13 else
14 echo "FAILED: Could not find 'Token valid: $1' in the serial console"
15 echo "TEST FAILED. Token was expected to pass validation." > /workspace/status.txt
16 print_serial=true
17 fi
18
19 if $print_serial; then
20 echo $SERIAL_OUTPUT
21 fi