コード例 #1
0
 def cb():
   for tc in tc_tarballs:
     tc = tc.split(':')
     prebuilt._GsUpload(
         tc[1],
         ('gs://chromiumos-sdk/' + tc_upload_path) % {'target': tc[0]},
         self.acl)
 def testSuccessfulGsUpload(self):
   uploads = {'/packages/private.tbz2': 'gs://foo/private.tbz2'}
   self.mox.StubOutWithMock(prebuilt, 'GenerateUploadDict')
   prebuilt.GenerateUploadDict('/packages', 'gs://foo/suffix',
       PRIVATE_PACKAGES).AndReturn(uploads)
   uploads = uploads.copy()
   uploads['fake'] = 'gs://foo/suffix/Packages'
   acl = 'public-read'
   prebuilt.RemoteUpload(mox.IgnoreArg(), acl, uploads)
   prebuilt._GsUpload(mox.IgnoreArg(), mox.IgnoreArg(),
                      mox.IgnoreArg(), mox.IgnoreArg())
   self.mox.ReplayAll()
   uri = self.pkgindex.header['URI']
   uploader = prebuilt.PrebuiltUploader('gs://foo', acl, uri, [], '/', [],
                                        False, 'foo', False, 'x86-foo', [], '')
   uploader._UploadPrebuilt('/packages', 'suffix')
コード例 #3
0
  def testSdkUpload(self, cb=lambda:None, tc_tarballs=(),
                    tc_upload_path=None):
    """Make sure we can upload just an SDK tarball"""
    tar = 'sdk.tar.xz'
    ver = '1234'
    vtar = 'cros-sdk-%s.tar.xz' % ver

    prebuilt._GsUpload('%s.Manifest' % tar,
                       'gs://chromiumos-sdk/%s.Manifest' % vtar, self.acl)
    prebuilt._GsUpload(tar, 'gs://chromiumos-sdk/%s' % vtar, self.acl)
    cb()
    prebuilt._GsUpload(mox.IgnoreArg(),
                       'gs://chromiumos-sdk/cros-sdk-latest.conf', self.acl)
    self.mox.ReplayAll()

    self.uploader._UploadSdkTarball('amd64-host', '', 'chroot-%s' % ver,
                                    tar, tc_tarballs, tc_upload_path)