From 24f1f003ad18d484a263d43ad6a1d39e4019ca35 Mon Sep 17 00:00:00 2001 From: Faisal Memon Date: Sun, 10 Nov 2024 23:00:24 -0800 Subject: [PATCH 1/6] Update SPIRE version in tests to 1.11.0 Signed-off-by: Faisal Memon --- .github/tests/it/docker-compose.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/tests/it/docker-compose.yaml b/.github/tests/it/docker-compose.yaml index f19357c5..39b0558c 100644 --- a/.github/tests/it/docker-compose.yaml +++ b/.github/tests/it/docker-compose.yaml @@ -1,13 +1,13 @@ services: spire-server: - image: ghcr.io/spiffe/spire-server:1.7.0 + image: ghcr.io/spiffe/spire-server:1.11.0 hostname: spire-server volumes: - ./spire/server:/opt/spire/conf/server command: ["-config", "/opt/spire/conf/server/server.conf"] spire-agent: - image: ghcr.io/spiffe/spire-agent:1.7.0 + image: ghcr.io/spiffe/spire-agent:1.11.0 depends_on: ["spire-server"] hostname: spire-agent volumes: From b642967140c0e3a031bfd827685510b6af13fa18 Mon Sep 17 00:00:00 2001 From: Faisal Memon Date: Sun, 10 Nov 2024 23:31:27 -0800 Subject: [PATCH 2/6] Exit on failure Signed-off-by: Faisal Memon --- .github/tests/it/build.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/tests/it/build.sh b/.github/tests/it/build.sh index d2249ab7..1a4fcc56 100755 --- a/.github/tests/it/build.sh +++ b/.github/tests/it/build.sh @@ -1,4 +1,5 @@ #!/bin/bash +set -e fingerprint () { # calculate the SHA1 digest of the DER bytes of the certificate using the From bd5555ad2e823fdde1bd5175a259e5667b4801a6 Mon Sep 17 00:00:00 2001 From: Faisal Memon Date: Sun, 10 Nov 2024 23:35:13 -0800 Subject: [PATCH 3/6] Fix cli Signed-off-by: Faisal Memon --- .github/tests/it/build.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/tests/it/build.sh b/.github/tests/it/build.sh index 1a4fcc56..66893c23 100755 --- a/.github/tests/it/build.sh +++ b/.github/tests/it/build.sh @@ -31,27 +31,27 @@ docker compose exec spire-server ./bin/spire-server entry create \ -parentID "spiffe://example.org/spire/agent/x509pop/${FINGERPRINT}" \ -spiffeID spiffe://example.org/postgres-db \ -selector unix:uid:70 \ - -ttl 60 + -x509SVIDTTLttl 60 docker compose exec spire-server ./bin/spire-server entry create \ - -parentID "spiffe://example.org/spire/agent/x509pop/${FINGERPRINT}" \ + -parentID "spiffe://example.org/spire/agent/x509pop/${FINGERPRINT}" \ -spiffeID spiffe://example.org/mysql-db \ -selector unix:uid:0 \ - -ttl 60 + -x509SVIDTTLttl 60 docker compose exec spire-server ./bin/spire-server entry create \ -parentID "spiffe://example.org/spire/agent/x509pop/${FINGERPRINT}" \ -spiffeID spiffe://example.org/client \ -selector unix:uid:72 \ - -dns client \ - -ttl 100 + -dns client \ + -x509SVIDTTL 100 docker compose exec spire-server ./bin/spire-server entry create \ -parentID "spiffe://example.org/spire/agent/x509pop/${FINGERPRINT}" \ -spiffeID spiffe://example.org/go-server \ -selector unix:uid:73 \ - -dns go-server \ - -ttl 3600 + -dns go-server \ + -x509SVIDTTLttl 3600 # set ups spire agent docker compose up spire-agent -d From 1b3df91ad323431f4dc0110e13656a48f821d881 Mon Sep 17 00:00:00 2001 From: Faisal Memon Date: Sun, 10 Nov 2024 23:38:47 -0800 Subject: [PATCH 4/6] typo Signed-off-by: Faisal Memon --- .github/tests/it/build.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/tests/it/build.sh b/.github/tests/it/build.sh index 66893c23..dbd6dd02 100755 --- a/.github/tests/it/build.sh +++ b/.github/tests/it/build.sh @@ -31,13 +31,13 @@ docker compose exec spire-server ./bin/spire-server entry create \ -parentID "spiffe://example.org/spire/agent/x509pop/${FINGERPRINT}" \ -spiffeID spiffe://example.org/postgres-db \ -selector unix:uid:70 \ - -x509SVIDTTLttl 60 + -x509SVIDTTL 60 docker compose exec spire-server ./bin/spire-server entry create \ -parentID "spiffe://example.org/spire/agent/x509pop/${FINGERPRINT}" \ -spiffeID spiffe://example.org/mysql-db \ -selector unix:uid:0 \ - -x509SVIDTTLttl 60 + -x509SVIDTTL 60 docker compose exec spire-server ./bin/spire-server entry create \ -parentID "spiffe://example.org/spire/agent/x509pop/${FINGERPRINT}" \ @@ -51,7 +51,7 @@ docker compose exec spire-server ./bin/spire-server entry create \ -spiffeID spiffe://example.org/go-server \ -selector unix:uid:73 \ -dns go-server \ - -x509SVIDTTLttl 3600 + -x509SVIDTTL 3600 # set ups spire agent docker compose up spire-agent -d From 21bc8fbbf1b3737b86c4d1318d37196f4833dde5 Mon Sep 17 00:00:00 2001 From: Faisal Memon Date: Sun, 10 Nov 2024 23:44:50 -0800 Subject: [PATCH 5/6] Fix cli Signed-off-by: Faisal Memon --- .github/tests/it/change-entry-client-test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/tests/it/change-entry-client-test.sh b/.github/tests/it/change-entry-client-test.sh index f2c598e9..aaf5267c 100755 --- a/.github/tests/it/change-entry-client-test.sh +++ b/.github/tests/it/change-entry-client-test.sh @@ -15,7 +15,7 @@ restore-entry(){ -parentID $PARENTID \ -spiffeID spiffe://example.org/client \ -selector unix:uid:72 \ - -ttl 100 \ + -x509SVIDTTL 100 \ -dns client echo "Entry restored" @@ -54,7 +54,7 @@ bad-entry(){ -parentID $PARENTID \ -spiffeID spiffe://example.org/client \ -selector unix:uid:72 \ - -ttl 100 \ + -x509SVIDTTL 100 \ -dns testuser1 echo "Entry changed, now with dns=testuser1" From 7155edf7c36678ded3b46d01eadb884fa7d56470 Mon Sep 17 00:00:00 2001 From: Faisal Memon Date: Sun, 10 Nov 2024 23:57:25 -0800 Subject: [PATCH 6/6] Print output Signed-off-by: Faisal Memon --- .github/tests/it/run-mysql-test.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/tests/it/run-mysql-test.sh b/.github/tests/it/run-mysql-test.sh index 6d6a4b2f..19d5dcde 100644 --- a/.github/tests/it/run-mysql-test.sh +++ b/.github/tests/it/run-mysql-test.sh @@ -19,6 +19,7 @@ fail(){ testWithParameter(){ var=$(docker compose exec client su client -c "/run/client/mysql-connect.sh \"$1\"") + echo $var if echo "$var" | grep -q "test@user.com"; then if [ "$2" -eq 1 ]; then