-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding Memory Monitor disable test and launch policy tests
- Loading branch information
1 parent
38bab91
commit e3c5f5b
Showing
10 changed files
with
180 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
16 changes: 16 additions & 0 deletions
16
launcher/image/test/scripts/test_launchpolicy_memory_monitoring.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
source util/read_serial.sh | ||
|
||
# Allow VM some time to boot and write to serial console. | ||
sleep 120 | ||
|
||
SERIAL_OUTPUT=$(read_serial $1 $2) | ||
if echo $SERIAL_OUTPUT | grep -q "$3" | ||
then | ||
echo "- Memory monitoring launch policy verified" | ||
else | ||
echo "FAILED: Memory monitoring launch policy verification" | ||
echo 'TEST FAILED' > /workspace/status.txt | ||
echo $SERIAL_OUTPUT | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
set -euxo pipefail | ||
source util/read_serial.sh | ||
|
||
# Allow VM some time to boot and write to serial console. | ||
sleep 120 | ||
|
||
SERIAL_OUTPUT=$(read_serial $1 $2) | ||
if echo $SERIAL_OUTPUT | grep -q "$3" | ||
then | ||
echo "- '$3' found in the VM serial output" | ||
else | ||
echo "FAILED: '$3' not found in the VM serial output" | ||
echo 'TEST FAILED.' > /workspace/status.txt | ||
echo $SERIAL_OUTPUT | ||
fi | ||
|
21 changes: 0 additions & 21 deletions
21
launcher/image/test/scripts/test_memory_monitoring_enabled.sh
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 14 additions & 0 deletions
14
launcher/image/testworkloads/memorymonitoringdebug/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# From current directory: | ||
# GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o main ../basic | ||
# gcloud builds submit --tag us-west1-docker.pkg.dev/confidential-space-images-dev/cs-integ-test-images/memorymonitoringdebug:latest --project confidential-space-images-dev | ||
FROM alpine | ||
|
||
COPY main / | ||
|
||
ENV env_bar="val_bar" | ||
|
||
LABEL "tee.launch_policy.monitoring_memory_allow"="debugonly" | ||
|
||
ENTRYPOINT ["/main"] | ||
|
||
CMD ["arg_foo"] |
14 changes: 14 additions & 0 deletions
14
launcher/image/testworkloads/memorymonitoringnever/Dockerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# From current directory: | ||
# GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -o main ../basic | ||
# gcloud builds submit --tag us-west1-docker.pkg.dev/confidential-space-images-dev/cs-integ-test-images/memorymonitoringnever:latest --project confidential-space-images-dev | ||
FROM alpine | ||
|
||
COPY main / | ||
|
||
ENV env_bar="val_bar" | ||
|
||
LABEL "tee.launch_policy.monitoring_memory_allow"="never" | ||
|
||
ENTRYPOINT ["/main"] | ||
|
||
CMD ["arg_foo"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters