Skip to content
This repository has been archived by the owner on Jun 28, 2024. It is now read-only.

Commit

Permalink
kubernetes: system logs on SEV tests's teardown()
Browse files Browse the repository at this point in the history
The SEV and SNP tests sometimes fail on CI and it is hard to determine
what went wrong because they don't print debug messages. This changed
the tests so that they behave like many others: print the system's logs
since the test's begin time.

Fixes #5708
Signed-off-by: Wainer dos Santos Moschetta <[email protected]>
  • Loading branch information
wainersm committed Jul 12, 2023
1 parent 1a1617b commit b2c69b2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
6 changes: 6 additions & 0 deletions integration/kubernetes/confidential/sev.bats
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ teardown_file() {
}

setup() {
start_date=$(date +"%Y-%m-%d %H:%M:%S")
# Remove any previous k8s test services
echo "Deleting previous test services..."
k8s_delete_all
Expand All @@ -118,6 +119,11 @@ setup() {
simple_kbs_delete_data
}

teardown() {
# Print the logs and cleanup resources.
echo "-- Kata logs:"
sudo journalctl -xe -t kata --since "$start_date" -n 100000
}

@test "${TEST_TAG} Test SEV unencrypted container launch success" {
# Start the service/deployment/pod
Expand Down
6 changes: 6 additions & 0 deletions integration/kubernetes/confidential/snp.bats
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,17 @@ teardown_file() {
}

setup() {
start_date=$(date +"%Y-%m-%d %H:%M:%S")
# Remove any previous k8s test services
echo "Deleting previous test services..."
k8s_delete_all
}

teardown() {
# Print the logs and cleanup resources.
echo "-- Kata logs:"
sudo journalctl -xe -t kata --since "$start_date" -n 100000
}

@test "${TEST_TAG} Test SNP unencrypted container launch success" {
# Start the service/deployment/pod
Expand Down

0 comments on commit b2c69b2

Please sign in to comment.