17217: Add signatures test for groups/contents.
authorTom Clegg <tom@curii.com>
Thu, 26 Aug 2021 04:04:30 +0000 (00:04 -0400)
committerTom Clegg <tom@curii.com>
Thu, 26 Aug 2021 04:05:56 +0000 (00:05 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

lib/controller/localdb/collection_test.go

index d75ca3c40694283b4be651a5bbce38db6f617778..78a1f4cb6932fd1694866bf543f81be82b0aab1b 100644 (file)
@@ -77,4 +77,17 @@ func (s *CollectionSuite) TestSignatures(c *check.C) {
                c.Check(lresp.Items[0].ManifestText, check.Equals, "")
                c.Check(lresp.Items[0].UnsignedManifestText, check.Matches, `(?ms).* acbd[^ ]*\+3 0:.*`)
        }
+
+       // Make sure groups/contents doesn't return manifest_text with
+       // collections (if it did, we'd need to sign it).
+       gresp, err := s.localdb.GroupContents(ctx, arvados.GroupContentsOptions{
+               Limit:   -1,
+               Filters: []arvados.Filter{{"uuid", "=", arvadostest.FooCollection}},
+               Select:  []string{"uuid", "manifest_text"},
+       })
+       c.Check(err, check.IsNil)
+       if c.Check(gresp.Items, check.HasLen, 1) {
+               c.Check(gresp.Items[0].(map[string]interface{})["uuid"], check.Equals, arvadostest.FooCollection)
+               c.Check(gresp.Items[0].(map[string]interface{})["manifest_text"], check.Equals, nil)
+       }
 }