Skip to content

Commit f12da66

Browse files
authored
gha: re-introduce tdx tests (#168)
1 parent bb87b41 commit f12da66

3 files changed

Lines changed: 12 additions & 8 deletions

File tree

.github/workflows/tests.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ jobs:
4646
matrix:
4747
include:
4848
- tee: snp
49-
# Temporarily disable TDX tests, until server is available again
50-
# - tee: tdx
49+
- tee: tdx
5150

5251
runs-on: [self-hosted, "${{ matrix.tee }}"]
5352
env:

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ export SC2_RUNTIME_CLASS=qemu-snp-sc2
5151

5252
# Knative demo
5353
envsubst < ./demo-apps/helloworld-knative/service.yaml | kubectl apply -f -
54-
curl $(kubectl -n sc2-demo get ksvc helloworld-knative --output=custom-columns=URL:.status.url --no-headers)
54+
curl \
55+
--header "Host: $(kubectl -n sc2-demo get ksvc helloworld-knative --output=custom-columns=URL:.status.url --no-headers | sed 's|^http://||')" \
56+
$(kubectl -n kourier-system get svc kourier -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
5557

5658
# Non-Knative demo
5759
envsubst < ./demo-apps/helloworld-py/deployment.yaml | kubectl apply -f -

tests/utils/helpers.sh

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,10 @@ run_knative_hello_world() {
102102
sleep 1
103103

104104
# Get the service URL
105-
service_url=$(${KUBECTL} -n ${SC2_DEMO_NAMESPACE} get ksvc helloworld-knative --output=custom-columns=URL:.status.url --no-headers)
106-
[ "$(curl --retry 3 ${service_url})" = "Hello World!" ]
105+
service_name=$(${KUBECTL} -n ${SC2_DEMO_NAMESPACE} get ksvc helloworld-knative --output=custom-columns=URL:.status.url --no-headers | sed 's|^http://||')
106+
lb_url=$(${KUBECTL} -n kourier-system get svc kourier -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
107+
curl_out=$(curl -v --retry 3 --header "Host: ${service_name}" ${lb_url})
108+
[ "${curl_out}" = "Hello World!" ]
107109
}
108110

109111
run_knative_lazy_loading() {
@@ -113,9 +115,10 @@ run_knative_lazy_loading() {
113115
envsubst < ./demo-apps/helloworld-knative-nydus/service.yaml | ${KUBECTL} apply -f -
114116
sleep 1
115117

116-
# Get the service URL
117-
service_url=$(${KUBECTL} -n ${SC2_DEMO_NAMESPACE} get ksvc helloworld-knative --output=custom-columns=URL:.status.url --no-headers)
118-
[ "$(curl --retry 3 ${service_url})" = "Hello World!" ]
118+
service_name=$(${KUBECTL} -n ${SC2_DEMO_NAMESPACE} get ksvc helloworld-knative --output=custom-columns=URL:.status.url --no-headers | sed 's|^http://||')
119+
lb_url=$(${KUBECTL} -n kourier-system get svc kourier -o jsonpath='{.status.loadBalancer.ingress[0].ip}')
120+
curl_out=$(curl -v --retry 3 --header "Host: ${service_name}" ${lb_url})
121+
[ "${curl_out}" = "Hello World!" ]
119122
}
120123

121124
run_python_hello_world() {

0 commit comments

Comments
 (0)