@@ -77,9 +77,12 @@ func TestHarnessAddEntry(t *testing.T) {
7777 uuid := getUUIDFromUploadOutput (t , out )
7878 logIndex := getLogIndexFromUploadOutput (t , out )
7979
80- // Now we should be able to verify it.
81- out = runCli (t , "verify" , "--type=hashedrekord" , "--pki-format=x509" , "--artifact-hash" , dataSHA , "--signature" , sigPath , "--public-key" , pubPath )
82- outputContains (t , out , "Inclusion Proof:" )
80+ if ! rekorCLIIncompatible () {
81+ // Now we should be able to verify it.
82+ out = runCli (t , "verify" , "--type=hashedrekord" , "--pki-format=x509" , "--artifact-hash" , dataSHA , "--signature" , sigPath , "--public-key" , pubPath )
83+ outputContains (t , out , "Inclusion Proof:" )
84+ }
85+
8386 saveEntry (t , logIndex , StoredEntry {UUID : uuid })
8487}
8588
@@ -155,7 +158,7 @@ func TestHarnessAddIntoto(t *testing.T) {
155158 uuid := getUUIDFromUploadOutput (t , out )
156159 logIndex := getLogIndexFromUploadOutput (t , out )
157160
158- out = runCli (t , "get" , "--uuid " , uuid , "--format=json" )
161+ out = runCli (t , "get" , "--log-index " , fmt . Sprintf ( "%d" , logIndex ) , "--format=json" )
159162 g := getOut {}
160163 if err := json .Unmarshal ([]byte (out ), & g ); err != nil {
161164 t .Fatal (err )
@@ -265,11 +268,16 @@ func TestHarnessGetAllEntriesLogIndex(t *testing.T) {
265268}
266269
267270func TestHarnessGetAllEntriesUUID (t * testing.T ) {
271+ if rekorCLIIncompatible () {
272+ t .Skipf ("Skipping getting entries by UUID, old rekor-cli version %s is incompatible with server version %s" , os .Getenv ("CLI_VERSION" ), os .Getenv ("SERVER_VERSION" ))
273+ }
274+
268275 treeSize := activeTreeSize (t )
269276 if treeSize == 0 {
270277 t .Fatal ("There are 0 entries in the log, there should be at least 2" )
271278 }
272279 _ , entries := getEntries (t )
280+
273281 for _ , e := range entries {
274282 outUUID := runCli (t , "get" , "--uuid" , e .UUID , "--format" , "json" )
275283 outEntryID := runCli (t , "get" , "--uuid" , entryID (t , e .UUID ), "--format" , "json" )
@@ -294,6 +302,9 @@ func TestHarnessGetAllEntriesUUID(t *testing.T) {
294302}
295303
296304func entryID (t * testing.T , uuid string ) string {
305+ if sharding .ValidateEntryID (uuid ) == nil {
306+ return uuid
307+ }
297308 treeID , err := strconv .Atoi (os .Getenv ("TREE_ID" ))
298309 if err != nil {
299310 t .Fatal (err )
@@ -317,3 +328,14 @@ func activeTreeSize(t *testing.T) int {
317328 }
318329 return s .ActiveTreeSize
319330}
331+
332+ // Check if we have a new server version and an old CLI version
333+ // since the new server returns an EntryID but the old CLI version expects a UUID
334+ func rekorCLIIncompatible () bool {
335+ if sv := os .Getenv ("SERVER_VERSION" ); sv != "v0.10.0" && sv != "v0.11.0" {
336+ if cv := os .Getenv ("CLI_VERSION" ); cv == "v0.10.0" || cv == "v0.11.0" {
337+ return true
338+ }
339+ }
340+ return false
341+ }
0 commit comments