Пример #1
0
 def setUp(self):
     """Establish a clean test environment"""
     super(TestRegistryV2Client, self).setUp()
     db_api.get_engine()
     self.context = context.RequestContext(is_admin=True)
     uuid1_time = timeutils.utcnow()
     uuid2_time = uuid1_time + datetime.timedelta(seconds=5)
     self.FIXTURES = [
         self.get_extra_fixture(
             id=UUID1,
             name='fake image #1',
             is_public=False,
             disk_format='ami',
             container_format='ami',
             size=13,
             virtual_size=26,
             properties={'type': 'kernel'},
             location="swift://*****:*****@acct/container/obj.tar.0",
             created_at=uuid1_time),
         self.get_extra_fixture(id=UUID2,
                                name='fake image #2',
                                properties={},
                                size=19,
                                virtual_size=38,
                                location="file:///tmp/glance-tests/2",
                                created_at=uuid2_time)
     ]
     self.destroy_fixtures()
     self.create_fixtures()
     self.client = rclient.RegistryClient("0.0.0.0")
Пример #2
0
    def setUp(self):
        """Establish a clean test environment"""
        super(TestRegistryV2Client, self).setUp()
        db_api.setup_db_env()
        db_api.get_engine()
        self.context = context.RequestContext(is_admin=True)

        self.FIXTURES = [
            self.get_extra_fixture(
                id=UUID1,
                name='fake image #1',
                is_public=False,
                disk_format='ami',
                container_format='ami',
                size=13,
                location="swift://*****:*****@acct/container/obj.tar.0",
                properties={'type': 'kernel'}),
            self.get_extra_fixture(id=UUID2,
                                   name='fake image #2',
                                   properties={},
                                   size=19,
                                   location="file:///tmp/glance-tests/2")
        ]
        self.destroy_fixtures()
        self.create_fixtures()
        self.client = rclient.RegistryClient("0.0.0.0")
Пример #3
0
 def setUp(self):
     """Establish a clean test environment"""
     super(TestRegistryV2Client, self).setUp()
     db_api.setup_db_env()
     db_api.get_engine()
     self.context = context.RequestContext(is_admin=True)
     self.FIXTURES = [{
         'id': UUID1,
         'name': 'fake image #1',
         'status': 'active',
         'disk_format': 'ami',
         'container_format': 'ami',
         'is_public': False,
         'created_at': timeutils.utcnow(),
         'updated_at': timeutils.utcnow(),
         'deleted_at': None,
         'deleted': False,
         'checksum': None,
         'size': 13,
         'location': "swift://*****:*****@acct/container/obj.tar.0",
         'properties': {
             'type': 'kernel'
         }
     }, {
         'id': UUID2,
         'name': 'fake image #2',
         'status': 'active',
         'disk_format': 'vhd',
         'container_format': 'ovf',
         'is_public': True,
         'created_at': timeutils.utcnow(),
         'updated_at': timeutils.utcnow(),
         'deleted_at': None,
         'deleted': False,
         'checksum': None,
         'size': 19,
         'location': "file:///tmp/glance-tests/2",
         'properties': {}
     }]
     self.destroy_fixtures()
     self.create_fixtures()
     self.client = rclient.RegistryClient("0.0.0.0")