Skip to content

Commit

Permalink
fix failing sharding test
Browse files Browse the repository at this point in the history
Signed-off-by: Bob Callaway <[email protected]>
  • Loading branch information
bobcallaway authored and cpanato committed Jul 20, 2024
1 parent fe71501 commit 02e4223
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 7 deletions.
12 changes: 5 additions & 7 deletions tests/sharding-e2e-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -94,7 +92,7 @@ function collectLogsOnFailure () {
fi
exit 0
}
trap "collectLogsOnFailure $?" EXIT
trap "collectLogsOnFailure \$?" EXIT

echo "Waiting for rekor server to come up..."
waitForRekorServer
Expand Down Expand Up @@ -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
Expand Down
Binary file added tests/test_file.sig
Binary file not shown.
1 change: 1 addition & 0 deletions tests/test_file.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
hello rekor
41 changes: 41 additions & 0 deletions tests/test_public_key.key
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
-----BEGIN PGP PUBLIC KEY BLOCK-----

mQGNBF+cIM0BDACa8G7RD2v3miwMtxVaZi3JBVueVAqHKC4eKoMS5HMCRo+HZVRA
70XmsTpX1Z1gZQuuC0GDY26hBhejAq3hx2rv6/8q90BvWGH9tVeGpL1saIm52gER
XyVggz5kAC0S6vMn7dr2etBkWWP+Oj05S02YZBTYgxpObyecUScqKNTjslZQBH2d
SHuk3o2Z7hM49U0l7zbWw4oIT+lARcsajQTwWjliaPD/HRjT2nROhIhited/wgyz
ydIq5e6s18VLcT75qWnrZXNPWFwf25RXY3utkW+GW5nQeN80Q2kREgkxFs5Ad5WZ
vE7t8/hx5zmslZ4tfF4si3QZeIQBacYbwxMPSDf9oFGxdGFT889wJLGgWmr1TkPM
cN06wxARGtxN0z61FJTijLWRbjW3unI9hcQcUlN/Q+16otHpeKVg4oW00CrvWOD6
qkLcMD49yUD8fSGB+REniBa89C9kQU4SKdgsLL/Q+JK+Sy9KmIDrm1a4DfP1psfe
LjarzsVZfKUHfwcAEQEAAbQiTHVrZSBIaW5kcyA8bGhpbmRzQHByb3Rvbm1haWwu
Y29tPokB1AQTAQgAPhYhBHIAlFxu/GnY+oRlCSa3waCdOKR6BQJfnCDNAhsDBQkD
wmcABQsJCAcCBhUKCQgLAgQWAgMBAh4BAheAAAoJECa3waCdOKR6Z1kL/1IK0vde
ZX5r5SebNxTINSAAvYkrKRyJ5f7lOM9gLGIuc2FoNUnjVQT0rIG9019h48pCy91f
XjDDRMY9gzFWWCgGnXh1hWI3M7BJF6YE6u6DXGsvuUpGrNeZ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