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

Commit

Permalink
do-not-merge: print containerd log
Browse files Browse the repository at this point in the history
Signed-off-by: ChengyuZhu6 <[email protected]>
  • Loading branch information
ChengyuZhu6 committed Sep 20, 2023
1 parent ee9b157 commit 9627e1a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ cc-containerd:
# Run the Confidential Containers tests for kubernetes.
cc-kubernetes:
bash -f .ci/install_bats.sh
K8S_TEST_UNION="confidential/agent_image.bats confidential/agent_image_encrypted.bats confidential/sealed_secret.bats confidential/image_pulling_with_snapshotter.bats" \
K8S_TEST_UNION="confidential/image_pulling_with_snapshotter.bats" \
bash integration/kubernetes/run_kubernetes_tests.sh

# Run the Confidential Containers AMD SEV specific tests.
Expand Down
9 changes: 5 additions & 4 deletions integration/confidential/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ disable_full_debug() {
}

restart_containerd() {
sudo systemctl restart containerd
systemctl restart containerd
if ! waitForProcess 30 5 "sudo crictl info >/dev/null"; then
die "containerd seems not operational after restarted"
fi
Expand Down Expand Up @@ -475,7 +475,7 @@ is_containerd_support_per_runtime_snapshotter() {
}

set_vanilla_containerd() {
sudo systemctl stop containerd
systemctl stop containerd || true
sleep 5
sudo mv /usr/local/bin/containerd /usr/local/bin/containerd-coco
sudo cp /usr/local/bin/containerd-vanilla /usr/local/bin/containerd
Expand All @@ -484,7 +484,7 @@ set_vanilla_containerd() {
}

unset_vanilla_containerd() {
sudo systemctl stop containerd
systemctl stop containerd
sleep 5
sudo rm -f /usr/local/bin/containerd
sudo mv /usr/local/bin/containerd-coco /usr/local/bin/containerd
Expand All @@ -493,6 +493,7 @@ unset_vanilla_containerd() {

configure_containerd_for_nydus_snapshotter() {
set_vanilla_containerd

local containerd_config="$1"
snapshotter_socket="/run/containerd-nydus/containerd-nydus-grpc.sock"
proxy_config=" [proxy_plugins.$SNAPSHOTTER]\n type = \"snapshot\"\n address = \"${snapshotter_socket}\""
Expand All @@ -503,9 +504,9 @@ configure_containerd_for_nydus_snapshotter() {
sudo echo -e "[proxy_plugins]" >>"$containerd_config"
sudo echo -e "$proxy_config" >>"$containerd_config"
fi

sudo sed -i 's/disable_snapshot_annotations = .*/disable_snapshot_annotations = false/g' "$containerd_config"
sudo sed -i 's/snapshotter = .*/snapshotter = "nydus"/g' "$containerd_config"
echo "containerd config : $(cat $containerd_config)"
}

kill_nydus_snapshotter_process() {
Expand Down
5 changes: 4 additions & 1 deletion integration/kubernetes/confidential/tests_common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ original_kernel_params=$(get_kernel_params)
# $pod_config - path to default pod configuration file.
#
setup_common() {
echo "set start date"
test_start_date=$(date +"%Y-%m-%d %H:%M:%S")

pod_config="$(new_pod_config "$image_simple_signed")"
pod_id=""

echo "delete_all_cc_pods"
kubernetes_delete_all_cc_pods_if_any_exists || true
}

Expand Down Expand Up @@ -53,6 +54,8 @@ reconfigure_kata() {
# Common teardown for tests. Use alongside setup_common().
#
teardown_common() {
echo "-- Containerd logs:"
sudo journalctl -xe -t containerd --since "$test_start_date" -n 200000
# Print the logs and cleanup resources.
echo "-- Kata logs:"
sudo journalctl -xe -t kata --since "$test_start_date" -n 100000
Expand Down

0 comments on commit 9627e1a

Please sign in to comment.