33c68ce6e3a56e5c171aa3944bf2dff5aea110b3
[arvados.git] / lib / controller / integration_test.go
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 package controller
6
7 import (
8         "bytes"
9         "encoding/json"
10         "fmt"
11         "io"
12         "io/ioutil"
13         "math"
14         "net"
15         "net/http"
16         "os"
17         "os/exec"
18         "path/filepath"
19         "strconv"
20         "strings"
21
22         "git.arvados.org/arvados.git/sdk/go/arvados"
23         "git.arvados.org/arvados.git/sdk/go/arvadostest"
24         check "gopkg.in/check.v1"
25 )
26
27 var _ = check.Suite(&IntegrationSuite{})
28
29 type IntegrationSuite struct {
30         testClusters map[string]*arvadostest.TestCluster
31         oidcprovider *arvadostest.OIDCProvider
32 }
33
34 func (s *IntegrationSuite) SetUpSuite(c *check.C) {
35         if forceLegacyAPI14 {
36                 c.Skip("heavy integration tests don't run with forceLegacyAPI14")
37                 return
38         }
39
40         cwd, _ := os.Getwd()
41
42         s.oidcprovider = arvadostest.NewOIDCProvider(c)
43         s.oidcprovider.AuthEmail = "user@example.com"
44         s.oidcprovider.AuthEmailVerified = true
45         s.oidcprovider.AuthName = "Example User"
46         s.oidcprovider.ValidClientID = "clientid"
47         s.oidcprovider.ValidClientSecret = "clientsecret"
48
49         s.testClusters = map[string]*arvadostest.TestCluster{
50                 "z1111": nil,
51                 "z2222": nil,
52                 "z3333": nil,
53         }
54         hostport := map[string]string{}
55         for id := range s.testClusters {
56                 hostport[id] = func() string {
57                         // TODO: Instead of expecting random ports on
58                         // 127.0.0.11, 22, 33 to be race-safe, try
59                         // different 127.x.y.z until finding one that
60                         // isn't in use.
61                         ln, err := net.Listen("tcp", ":0")
62                         c.Assert(err, check.IsNil)
63                         ln.Close()
64                         _, port, err := net.SplitHostPort(ln.Addr().String())
65                         c.Assert(err, check.IsNil)
66                         return "127.0.0." + id[3:] + ":" + port
67                 }()
68         }
69         for id := range s.testClusters {
70                 yaml := `Clusters:
71   ` + id + `:
72     Services:
73       Controller:
74         ExternalURL: https://` + hostport[id] + `
75     TLS:
76       Insecure: true
77     Login:
78       LoginCluster: z1111
79     SystemLogs:
80       Format: text
81     RemoteClusters:
82       z1111:
83         Host: ` + hostport["z1111"] + `
84         Scheme: https
85         Insecure: true
86         Proxy: true
87         ActivateUsers: true
88 `
89                 if id != "z2222" {
90                         yaml += `      z2222:
91         Host: ` + hostport["z2222"] + `
92         Scheme: https
93         Insecure: true
94         Proxy: true
95         ActivateUsers: true
96 `
97                 }
98                 if id != "z3333" {
99                         yaml += `      z3333:
100         Host: ` + hostport["z3333"] + `
101         Scheme: https
102         Insecure: true
103         Proxy: true
104         ActivateUsers: true
105 `
106                 }
107                 if id == "z1111" {
108                         yaml += `
109     Login:
110       LoginCluster: z1111
111       OpenIDConnect:
112         Enable: true
113         Issuer: ` + s.oidcprovider.Issuer.URL + `
114         ClientID: ` + s.oidcprovider.ValidClientID + `
115         ClientSecret: ` + s.oidcprovider.ValidClientSecret + `
116         EmailClaim: email
117         EmailVerifiedClaim: email_verified
118 `
119                 } else {
120                         yaml += `
121     Login:
122       LoginCluster: z1111
123 `
124                 }
125
126                 tc, err := arvadostest.NewTestCluster(
127                         filepath.Join(cwd, "..", ".."),
128                         id, yaml, "127.0.0."+id[3:], c.Log)
129                 c.Assert(err, check.IsNil)
130                 s.testClusters[id] = tc
131                 s.testClusters[id].Start()
132         }
133         for _, tc := range s.testClusters {
134                 ok := tc.WaitReady()
135                 c.Assert(ok, check.Equals, true)
136         }
137 }
138
139 func (s *IntegrationSuite) TearDownSuite(c *check.C) {
140         for _, c := range s.testClusters {
141                 c.Super.Stop()
142         }
143 }
144
145 func (s *IntegrationSuite) TestGetCollectionByPDH(c *check.C) {
146         conn1 := s.testClusters["z1111"].Conn()
147         rootctx1, _, _ := s.testClusters["z1111"].RootClients()
148         conn3 := s.testClusters["z3333"].Conn()
149         userctx1, ac1, kc1, _ := s.testClusters["z1111"].UserClients(rootctx1, c, conn1, s.oidcprovider.AuthEmail, true)
150
151         // Create the collection to find its PDH (but don't save it
152         // anywhere yet)
153         var coll1 arvados.Collection
154         fs1, err := coll1.FileSystem(ac1, kc1)
155         c.Assert(err, check.IsNil)
156         f, err := fs1.OpenFile("test.txt", os.O_CREATE|os.O_RDWR, 0777)
157         c.Assert(err, check.IsNil)
158         _, err = io.WriteString(f, "IntegrationSuite.TestGetCollectionByPDH")
159         c.Assert(err, check.IsNil)
160         err = f.Close()
161         c.Assert(err, check.IsNil)
162         mtxt, err := fs1.MarshalManifest(".")
163         c.Assert(err, check.IsNil)
164         pdh := arvados.PortableDataHash(mtxt)
165
166         // Looking up the PDH before saving returns 404 if cycle
167         // detection is working.
168         _, err = conn1.CollectionGet(userctx1, arvados.GetOptions{UUID: pdh})
169         c.Assert(err, check.ErrorMatches, `.*404 Not Found.*`)
170
171         // Save the collection on cluster z1111.
172         coll1, err = conn1.CollectionCreate(userctx1, arvados.CreateOptions{Attrs: map[string]interface{}{
173                 "manifest_text": mtxt,
174         }})
175         c.Assert(err, check.IsNil)
176
177         // Retrieve the collection from cluster z3333.
178         coll, err := conn3.CollectionGet(userctx1, arvados.GetOptions{UUID: pdh})
179         c.Check(err, check.IsNil)
180         c.Check(coll.PortableDataHash, check.Equals, pdh)
181 }
182
183 func (s *IntegrationSuite) TestS3WithFederatedToken(c *check.C) {
184         if _, err := exec.LookPath("s3cmd"); err != nil {
185                 c.Skip("s3cmd not in PATH")
186                 return
187         }
188
189         testText := "IntegrationSuite.TestS3WithFederatedToken"
190
191         conn1 := s.testClusters["z1111"].Conn()
192         rootctx1, _, _ := s.testClusters["z1111"].RootClients()
193         userctx1, ac1, _, _ := s.testClusters["z1111"].UserClients(rootctx1, c, conn1, s.oidcprovider.AuthEmail, true)
194         conn3 := s.testClusters["z3333"].Conn()
195
196         createColl := func(clusterID string) arvados.Collection {
197                 _, ac, kc := s.testClusters[clusterID].ClientsWithToken(ac1.AuthToken)
198                 var coll arvados.Collection
199                 fs, err := coll.FileSystem(ac, kc)
200                 c.Assert(err, check.IsNil)
201                 f, err := fs.OpenFile("test.txt", os.O_CREATE|os.O_RDWR, 0777)
202                 c.Assert(err, check.IsNil)
203                 _, err = io.WriteString(f, testText)
204                 c.Assert(err, check.IsNil)
205                 err = f.Close()
206                 c.Assert(err, check.IsNil)
207                 mtxt, err := fs.MarshalManifest(".")
208                 c.Assert(err, check.IsNil)
209                 coll, err = s.testClusters[clusterID].Conn().CollectionCreate(userctx1, arvados.CreateOptions{Attrs: map[string]interface{}{
210                         "manifest_text": mtxt,
211                 }})
212                 c.Assert(err, check.IsNil)
213                 return coll
214         }
215
216         for _, trial := range []struct {
217                 clusterID string // create the collection on this cluster (then use z3333 to access it)
218                 token     string
219         }{
220                 // Try the hardest test first: z3333 hasn't seen
221                 // z1111's token yet, and we're just passing the
222                 // opaque secret part, so z3333 has to guess that it
223                 // belongs to z1111.
224                 {"z1111", strings.Split(ac1.AuthToken, "/")[2]},
225                 {"z3333", strings.Split(ac1.AuthToken, "/")[2]},
226                 {"z1111", strings.Replace(ac1.AuthToken, "/", "_", -1)},
227                 {"z3333", strings.Replace(ac1.AuthToken, "/", "_", -1)},
228         } {
229                 c.Logf("================ %v", trial)
230                 coll := createColl(trial.clusterID)
231
232                 cfgjson, err := conn3.ConfigGet(userctx1)
233                 c.Assert(err, check.IsNil)
234                 var cluster arvados.Cluster
235                 err = json.Unmarshal(cfgjson, &cluster)
236                 c.Assert(err, check.IsNil)
237
238                 c.Logf("TokenV2 is %s", ac1.AuthToken)
239                 host := cluster.Services.WebDAV.ExternalURL.Host
240                 s3args := []string{
241                         "--ssl", "--no-check-certificate",
242                         "--host=" + host, "--host-bucket=" + host,
243                         "--access_key=" + trial.token, "--secret_key=" + trial.token,
244                 }
245                 buf, err := exec.Command("s3cmd", append(s3args, "ls", "s3://"+coll.UUID)...).CombinedOutput()
246                 c.Check(err, check.IsNil)
247                 c.Check(string(buf), check.Matches, `.* `+fmt.Sprintf("%d", len(testText))+` +s3://`+coll.UUID+`/test.txt\n`)
248
249                 buf, _ = exec.Command("s3cmd", append(s3args, "get", "s3://"+coll.UUID+"/test.txt", c.MkDir()+"/tmpfile")...).CombinedOutput()
250                 // Command fails because we don't return Etag header.
251                 flen := strconv.Itoa(len(testText))
252                 c.Check(string(buf), check.Matches, `(?ms).*`+flen+` (bytes in|of `+flen+`).*`)
253         }
254 }
255
256 func (s *IntegrationSuite) TestGetCollectionAsAnonymous(c *check.C) {
257         conn1 := s.testClusters["z1111"].Conn()
258         conn3 := s.testClusters["z3333"].Conn()
259         rootctx1, rootac1, rootkc1 := s.testClusters["z1111"].RootClients()
260         anonctx3, anonac3, _ := s.testClusters["z3333"].AnonymousClients()
261
262         // Make sure anonymous token was set
263         c.Assert(anonac3.AuthToken, check.Not(check.Equals), "")
264
265         // Create the collection to find its PDH (but don't save it
266         // anywhere yet)
267         var coll1 arvados.Collection
268         fs1, err := coll1.FileSystem(rootac1, rootkc1)
269         c.Assert(err, check.IsNil)
270         f, err := fs1.OpenFile("test.txt", os.O_CREATE|os.O_RDWR, 0777)
271         c.Assert(err, check.IsNil)
272         _, err = io.WriteString(f, "IntegrationSuite.TestGetCollectionAsAnonymous")
273         c.Assert(err, check.IsNil)
274         err = f.Close()
275         c.Assert(err, check.IsNil)
276         mtxt, err := fs1.MarshalManifest(".")
277         c.Assert(err, check.IsNil)
278         pdh := arvados.PortableDataHash(mtxt)
279
280         // Save the collection on cluster z1111.
281         coll1, err = conn1.CollectionCreate(rootctx1, arvados.CreateOptions{Attrs: map[string]interface{}{
282                 "manifest_text": mtxt,
283         }})
284         c.Assert(err, check.IsNil)
285
286         // Share it with the anonymous users group.
287         var outLink arvados.Link
288         err = rootac1.RequestAndDecode(&outLink, "POST", "/arvados/v1/links", nil,
289                 map[string]interface{}{"link": map[string]interface{}{
290                         "link_class": "permission",
291                         "name":       "can_read",
292                         "tail_uuid":  "z1111-j7d0g-anonymouspublic",
293                         "head_uuid":  coll1.UUID,
294                 },
295                 })
296         c.Check(err, check.IsNil)
297
298         // Current user should be z3 anonymous user
299         outUser, err := anonac3.CurrentUser()
300         c.Check(err, check.IsNil)
301         c.Check(outUser.UUID, check.Equals, "z3333-tpzed-anonymouspublic")
302
303         // Get the token uuid
304         var outAuth arvados.APIClientAuthorization
305         err = anonac3.RequestAndDecode(&outAuth, "GET", "/arvados/v1/api_client_authorizations/current", nil, nil)
306         c.Check(err, check.IsNil)
307
308         // Make a v2 token of the z3 anonymous user, and use it on z1
309         _, anonac1, _ := s.testClusters["z1111"].ClientsWithToken(outAuth.TokenV2())
310         outUser2, err := anonac1.CurrentUser()
311         c.Check(err, check.IsNil)
312         // z3 anonymous user will be mapped to the z1 anonymous user
313         c.Check(outUser2.UUID, check.Equals, "z1111-tpzed-anonymouspublic")
314
315         // Retrieve the collection (which is on z1) using anonymous from cluster z3333.
316         coll, err := conn3.CollectionGet(anonctx3, arvados.GetOptions{UUID: coll1.UUID})
317         c.Check(err, check.IsNil)
318         c.Check(coll.PortableDataHash, check.Equals, pdh)
319 }
320
321 // Get a token from the login cluster (z1111), use it to submit a
322 // container request on z2222.
323 func (s *IntegrationSuite) TestCreateContainerRequestWithFedToken(c *check.C) {
324         conn1 := s.testClusters["z1111"].Conn()
325         rootctx1, _, _ := s.testClusters["z1111"].RootClients()
326         _, ac1, _, _ := s.testClusters["z1111"].UserClients(rootctx1, c, conn1, s.oidcprovider.AuthEmail, true)
327
328         // Use ac2 to get the discovery doc with a blank token, so the
329         // SDK doesn't magically pass the z1111 token to z2222 before
330         // we're ready to start our test.
331         _, ac2, _ := s.testClusters["z2222"].ClientsWithToken("")
332         var dd map[string]interface{}
333         err := ac2.RequestAndDecode(&dd, "GET", "discovery/v1/apis/arvados/v1/rest", nil, nil)
334         c.Assert(err, check.IsNil)
335
336         var (
337                 body bytes.Buffer
338                 req  *http.Request
339                 resp *http.Response
340                 u    arvados.User
341                 cr   arvados.ContainerRequest
342         )
343         json.NewEncoder(&body).Encode(map[string]interface{}{
344                 "container_request": map[string]interface{}{
345                         "command":         []string{"echo"},
346                         "container_image": "d41d8cd98f00b204e9800998ecf8427e+0",
347                         "cwd":             "/",
348                         "output_path":     "/",
349                 },
350         })
351         ac2.AuthToken = ac1.AuthToken
352
353         c.Log("...post CR with good (but not yet cached) token")
354         cr = arvados.ContainerRequest{}
355         req, err = http.NewRequest("POST", "https://"+ac2.APIHost+"/arvados/v1/container_requests", bytes.NewReader(body.Bytes()))
356         c.Assert(err, check.IsNil)
357         req.Header.Set("Content-Type", "application/json")
358         err = ac2.DoAndDecode(&cr, req)
359         c.Logf("err == %#v", err)
360
361         c.Log("...get user with good token")
362         u = arvados.User{}
363         req, err = http.NewRequest("GET", "https://"+ac2.APIHost+"/arvados/v1/users/current", nil)
364         c.Assert(err, check.IsNil)
365         err = ac2.DoAndDecode(&u, req)
366         c.Check(err, check.IsNil)
367         c.Check(u.UUID, check.Matches, "z1111-tpzed-.*")
368
369         c.Log("...post CR with good cached token")
370         cr = arvados.ContainerRequest{}
371         req, err = http.NewRequest("POST", "https://"+ac2.APIHost+"/arvados/v1/container_requests", bytes.NewReader(body.Bytes()))
372         c.Assert(err, check.IsNil)
373         req.Header.Set("Content-Type", "application/json")
374         err = ac2.DoAndDecode(&cr, req)
375         c.Check(err, check.IsNil)
376         c.Check(cr.UUID, check.Matches, "z2222-.*")
377
378         c.Log("...post with good cached token ('OAuth2 ...')")
379         cr = arvados.ContainerRequest{}
380         req, err = http.NewRequest("POST", "https://"+ac2.APIHost+"/arvados/v1/container_requests", bytes.NewReader(body.Bytes()))
381         c.Assert(err, check.IsNil)
382         req.Header.Set("Content-Type", "application/json")
383         req.Header.Set("Authorization", "OAuth2 "+ac2.AuthToken)
384         resp, err = arvados.InsecureHTTPClient.Do(req)
385         if c.Check(err, check.IsNil) {
386                 err = json.NewDecoder(resp.Body).Decode(&cr)
387                 c.Check(err, check.IsNil)
388                 c.Check(cr.UUID, check.Matches, "z2222-.*")
389         }
390 }
391
392 // Test for bug #16263
393 func (s *IntegrationSuite) TestListUsers(c *check.C) {
394         rootctx1, _, _ := s.testClusters["z1111"].RootClients()
395         conn1 := s.testClusters["z1111"].Conn()
396         conn3 := s.testClusters["z3333"].Conn()
397         userctx1, _, _, _ := s.testClusters["z1111"].UserClients(rootctx1, c, conn1, s.oidcprovider.AuthEmail, true)
398
399         // Make sure LoginCluster is properly configured
400         for cls := range s.testClusters {
401                 c.Check(
402                         s.testClusters[cls].Config.Clusters[cls].Login.LoginCluster,
403                         check.Equals, "z1111",
404                         check.Commentf("incorrect LoginCluster config on cluster %q", cls))
405         }
406         // Make sure z1111 has users with NULL usernames
407         lst, err := conn1.UserList(rootctx1, arvados.ListOptions{
408                 Limit: math.MaxInt64, // check that large limit works (see #16263)
409         })
410         nullUsername := false
411         c.Assert(err, check.IsNil)
412         c.Assert(len(lst.Items), check.Not(check.Equals), 0)
413         for _, user := range lst.Items {
414                 if user.Username == "" {
415                         nullUsername = true
416                 }
417         }
418         c.Assert(nullUsername, check.Equals, true)
419
420         user1, err := conn1.UserGetCurrent(userctx1, arvados.GetOptions{})
421         c.Assert(err, check.IsNil)
422         c.Check(user1.IsActive, check.Equals, true)
423
424         // Ask for the user list on z3333 using z1111's system root token
425         lst, err = conn3.UserList(rootctx1, arvados.ListOptions{Limit: -1})
426         c.Assert(err, check.IsNil)
427         found := false
428         for _, user := range lst.Items {
429                 if user.UUID == user1.UUID {
430                         c.Check(user.IsActive, check.Equals, true)
431                         found = true
432                         break
433                 }
434         }
435         c.Check(found, check.Equals, true)
436
437         // Deactivate user acct on z1111
438         _, err = conn1.UserUnsetup(rootctx1, arvados.GetOptions{UUID: user1.UUID})
439         c.Assert(err, check.IsNil)
440
441         // Get user list from z3333, check the returned z1111 user is
442         // deactivated
443         lst, err = conn3.UserList(rootctx1, arvados.ListOptions{Limit: -1})
444         c.Assert(err, check.IsNil)
445         found = false
446         for _, user := range lst.Items {
447                 if user.UUID == user1.UUID {
448                         c.Check(user.IsActive, check.Equals, false)
449                         found = true
450                         break
451                 }
452         }
453         c.Check(found, check.Equals, true)
454
455         // Deactivated user can see is_active==false via "get current
456         // user" API
457         user1, err = conn3.UserGetCurrent(userctx1, arvados.GetOptions{})
458         c.Assert(err, check.IsNil)
459         c.Check(user1.IsActive, check.Equals, false)
460 }
461
462 func (s *IntegrationSuite) TestSetupUserWithVM(c *check.C) {
463         conn1 := s.testClusters["z1111"].Conn()
464         conn3 := s.testClusters["z3333"].Conn()
465         rootctx1, rootac1, _ := s.testClusters["z1111"].RootClients()
466
467         // Create user on LoginCluster z1111
468         _, _, _, user := s.testClusters["z1111"].UserClients(rootctx1, c, conn1, s.oidcprovider.AuthEmail, true)
469
470         // Make a new root token (because rootClients() uses SystemRootToken)
471         var outAuth arvados.APIClientAuthorization
472         err := rootac1.RequestAndDecode(&outAuth, "POST", "/arvados/v1/api_client_authorizations", nil, nil)
473         c.Check(err, check.IsNil)
474
475         // Make a v2 root token to communicate with z3333
476         rootctx3, rootac3, _ := s.testClusters["z3333"].ClientsWithToken(outAuth.TokenV2())
477
478         // Create VM on z3333
479         var outVM arvados.VirtualMachine
480         err = rootac3.RequestAndDecode(&outVM, "POST", "/arvados/v1/virtual_machines", nil,
481                 map[string]interface{}{"virtual_machine": map[string]interface{}{
482                         "hostname": "example",
483                 },
484                 })
485         c.Check(outVM.UUID[0:5], check.Equals, "z3333")
486         c.Check(err, check.IsNil)
487
488         // Make sure z3333 user list is up to date
489         _, err = conn3.UserList(rootctx3, arvados.ListOptions{Limit: 1000})
490         c.Check(err, check.IsNil)
491
492         // Try to set up user on z3333 with the VM
493         _, err = conn3.UserSetup(rootctx3, arvados.UserSetupOptions{UUID: user.UUID, VMUUID: outVM.UUID})
494         c.Check(err, check.IsNil)
495
496         var outLinks arvados.LinkList
497         err = rootac3.RequestAndDecode(&outLinks, "GET", "/arvados/v1/links", nil,
498                 arvados.ListOptions{
499                         Limit: 1000,
500                         Filters: []arvados.Filter{
501                                 {
502                                         Attr:     "tail_uuid",
503                                         Operator: "=",
504                                         Operand:  user.UUID,
505                                 },
506                                 {
507                                         Attr:     "head_uuid",
508                                         Operator: "=",
509                                         Operand:  outVM.UUID,
510                                 },
511                                 {
512                                         Attr:     "name",
513                                         Operator: "=",
514                                         Operand:  "can_login",
515                                 },
516                                 {
517                                         Attr:     "link_class",
518                                         Operator: "=",
519                                         Operand:  "permission",
520                                 }}})
521         c.Check(err, check.IsNil)
522
523         c.Check(len(outLinks.Items), check.Equals, 1)
524 }
525
526 func (s *IntegrationSuite) TestOIDCAccessTokenAuth(c *check.C) {
527         conn1 := s.testClusters["z1111"].Conn()
528         rootctx1, _, _ := s.testClusters["z1111"].RootClients()
529         s.testClusters["z1111"].UserClients(rootctx1, c, conn1, s.oidcprovider.AuthEmail, true)
530
531         accesstoken := s.oidcprovider.ValidAccessToken()
532
533         for _, clusterID := range []string{"z1111", "z2222"} {
534                 c.Logf("trying clusterid %s", clusterID)
535
536                 conn := s.testClusters[clusterID].Conn()
537                 ctx, ac, kc := s.testClusters[clusterID].ClientsWithToken(accesstoken)
538
539                 var coll arvados.Collection
540
541                 // Write some file data and create a collection
542                 {
543                         fs, err := coll.FileSystem(ac, kc)
544                         c.Assert(err, check.IsNil)
545                         f, err := fs.OpenFile("test.txt", os.O_CREATE|os.O_RDWR, 0777)
546                         c.Assert(err, check.IsNil)
547                         _, err = io.WriteString(f, "IntegrationSuite.TestOIDCAccessTokenAuth")
548                         c.Assert(err, check.IsNil)
549                         err = f.Close()
550                         c.Assert(err, check.IsNil)
551                         mtxt, err := fs.MarshalManifest(".")
552                         c.Assert(err, check.IsNil)
553                         coll, err = conn.CollectionCreate(ctx, arvados.CreateOptions{Attrs: map[string]interface{}{
554                                 "manifest_text": mtxt,
555                         }})
556                         c.Assert(err, check.IsNil)
557                 }
558
559                 // Read the collection & file data
560                 {
561                         user, err := conn.UserGetCurrent(ctx, arvados.GetOptions{})
562                         c.Assert(err, check.IsNil)
563                         c.Check(user.FullName, check.Equals, "Example User")
564                         coll, err = conn.CollectionGet(ctx, arvados.GetOptions{UUID: coll.UUID})
565                         c.Assert(err, check.IsNil)
566                         c.Check(coll.ManifestText, check.Not(check.Equals), "")
567                         fs, err := coll.FileSystem(ac, kc)
568                         c.Assert(err, check.IsNil)
569                         f, err := fs.Open("test.txt")
570                         c.Assert(err, check.IsNil)
571                         buf, err := ioutil.ReadAll(f)
572                         c.Assert(err, check.IsNil)
573                         c.Check(buf, check.DeepEquals, []byte("IntegrationSuite.TestOIDCAccessTokenAuth"))
574                 }
575         }
576 }