From 02e4223a8468aa7f934514ae088a608cc06955e5 Mon Sep 17 00:00:00 2001 From: Bob Callaway Date: Fri, 19 Jul 2024 17:43:47 -0400 Subject: [PATCH] fix failing sharding test Signed-off-by: Bob Callaway --- tests/sharding-e2e-test.sh | 12 +++++------ tests/test_file.sig | Bin 0 -> 461 bytes tests/test_file.txt | 1 + tests/test_public_key.key | 41 +++++++++++++++++++++++++++++++++++++ 4 files changed, 47 insertions(+), 7 deletions(-) create mode 100644 tests/test_file.sig create mode 100644 tests/test_file.txt create mode 100644 tests/test_public_key.key diff --git a/tests/sharding-e2e-test.sh b/tests/sharding-e2e-test.sh index 700f4ad2a..7e7e0c694 100755 --- a/tests/sharding-e2e-test.sh +++ b/tests/sharding-e2e-test.sh @@ -25,14 +25,12 @@ echo "Installing createtree..." go install github.com/google/trillian/cmd/createtree@latest echo "starting services" -docker-compose up -d +docker-compose up -d --build rm ~/.rekor/state.json || true -echo "building CLI and server" +echo "building CLI" go build -o rekor-cli ./cmd/rekor-cli REKOR_CLI=$(pwd)/rekor-cli -go build -o rekor-server ./cmd/rekor-server - function check_log_index () { logIndex=$1 @@ -94,7 +92,7 @@ function collectLogsOnFailure () { fi exit 0 } -trap "collectLogsOnFailure $?" EXIT +trap "collectLogsOnFailure \$?" EXIT echo "Waiting for rekor server to come up..." waitForRekorServer @@ -265,13 +263,13 @@ NUM_ELEMENTS=$(curl -f -H "Content-Type: application/json" --data '{"logIndexes" stringsMatch $NUM_ELEMENTS "2" # Make sure we get the expected LogIndex in the response when calling /retrieve endpoint -RETRIEVE_LOGINDEX1=$(curl -f http://localhost:3000/api/v1/log/entries/retrieve -H "Content-Type: application/json" -H "Accept: application/json" -d "{ \"logIndexes\": [1]}" | jq '.[0]' | jq -r .$UUID1.logIndex) +RETRIEVE_LOGINDEX1=$(curl -f http://localhost:3000/api/v1/log/entries/retrieve -H "Content-Type: application/json" -H "Accept: application/json" -d "{ \"logIndexes\": [1]}" | jq '.[0]' | jq -r "with_entries(select(.key|test(\"^"$ENTRY_ID_1"$\"))) | .[].logIndex") stringsMatch $RETRIEVE_LOGINDEX1 "1" # Make sure that verification succeeds via UUID echo echo "Testing rekor-cli verification via UUID..." -$REKOR_CLI verify --uuid $UUID1 --rekor_server http://localhost:3000 +$REKOR_CLI verify --uuid $ENTRY_ID_1 --rekor_server http://localhost:3000 # Make sure that verification succeeds via Entry ID (Tree ID in hex + UUID) echo diff --git a/tests/test_file.sig b/tests/test_file.sig new file mode 100644 index 0000000000000000000000000000000000000000..3adcf93a1101c36024a3e67d1e7a817a081531cd GIT binary patch literal 461 zcmV;;0W$uH0m=jb0SEvz79j+30F+#A{At+wgk=dPx51#DIHY<70$;r892OjGXlZU_ zb3kx%Z**^NZDDC_E@N+P0162ZCbz+$oj9a=HwO#!v1hhY9Pb5Zb*Fw)1?3Ku%0 zU=X1$s+0R43;#yEUJeViNXw(JF2Ci+AsKAr_MQeKhx<7yGO>l6fTs)~*K+1@wzC>_ z+}uw3C!R~8H}Ihry?*LP{LY6Xo|P1=C%fPqFx9oQ;LPK?`-_>#H=-BzLn#gI!S!_1 zP`BUzBUHad?Ojim0skj-U2xZ4*i~#_@j2A|b+2E(6h#Bg`pmA%qQ5llN7Sf6RXp4w zhj|~V3A=qXjtK+GoU*A3UH+0-R|no>$HFB6uFfq<(3!SWlTzZQs3 zIx2t-Vx&%KZtkihepL3IZDn3Jrp%=h9TKlTG^7TV>QV_Bn~_*JRH2SO0C$I#n`6~A zJ5f~*b@I2l7IZ_zW-wRzUIS|jA-vbQER3ojm`T+GKo#8-O4^D--vm*g-~!YlT_Kyq z%|Hr<3-os7DQ;W(NdKa8poQrLpeg`<6EH;@k>(H6OY_{@{O!Sn$hsO(LGu^RB