Debian Codegraph @

launcher/image/test/scripts/test_launchpolicy_log_debug_cloudlogging.sh

raw
1 #!/bin/bash
2 set -euo pipefail
3 source util/read_cloud_logging.sh
4
5 # Allow VM some time to boot and write to cloud logging.
6 sleep 120
7
8 CLOUD_LOGGING_OUTPUT=$(read_cloud_logging $1)
9 if echo $CLOUD_LOGGING_OUTPUT | grep -q 'logging redirection not allowed by image'
10 then
11 echo "- Log launch policy verified"
12 else
13 echo "FAILED: Log launch policy verification"
14 echo 'TEST FAILED' > /workspace/status.txt
15 echo $CLOUD_LOGGING_OUTPUT
16 fi