Beispiel #1
0
    def setUp(self):
        super(SecurityGroupsViewTests, self).setUp()

        sg1 = api.SecurityGroup(None)
        sg1.id = 1
        sg1.name = 'default'

        sg2 = api.SecurityGroup(None)
        sg2.id = 2
        sg2.name = 'group_2'

        rule = {
            'id': 1,
            'ip_protocol': u"tcp",
            'from_port': "80",
            'to_port': "80",
            'parent_group_id': "2",
            'ip_range': {
                'cidr': "0.0.0.0/32"
            }
        }
        manager = nova_rules.SecurityGroupRuleManager
        rule_obj = nova_rules.SecurityGroupRule(manager, rule)
        self.rules = [rule_obj]
        sg1.rules = self.rules
        sg2.rules = self.rules

        self.security_groups = (sg1, sg2)
Beispiel #2
0
    def setUp(self):
        super(ImageViewTests, self).setUp()
        image_dict = {'name': 'visibleImage',
                      'container_format': 'novaImage'}
        self.visibleImage = api.Image(image_dict)
        self.visibleImage.id = '1'

        image_dict = {'name': 'invisibleImage',
                      'container_format': 'aki'}
        self.invisibleImage = api.Image(image_dict)
        self.invisibleImage.id = '2'

        self.images = (self.visibleImage, self.invisibleImage)

        flavor = api.Flavor(None)
        flavor.id = 1
        flavor.name = 'm1.massive'
        flavor.vcpus = 1000
        flavor.disk = 1024
        flavor.ram = 10000
        self.flavors = (flavor,)

        keypair = api.KeyPair(None)
        keypair.name = 'keyName'
        self.keypairs = (keypair,)

        security_group = api.SecurityGroup(None)
        security_group.name = 'default'
        self.security_groups = (security_group,)
Beispiel #3
0
    def setUp(self):
        super(SecurityGroupsViewTests, self).setUp()

        security_group = api.SecurityGroup(None)
        security_group.id = '1'
        security_group.name = 'default'
        self.security_groups = (security_group, )
Beispiel #4
0
    def setUp(self):
        super(AccessAndSecurityTests, self).setUp()
        keypair = api.KeyPair(None)
        keypair.name = 'keyName'
        self.keypairs = (keypair, )

        server = api.Server(None, self.request)
        server.id = 1
        server.name = 'serverName'
        self.server = server
        self.servers = (server, )

        floating_ip = api.FloatingIp(None)
        floating_ip.id = 1
        floating_ip.fixed_ip = '10.0.0.4'
        floating_ip.instance_id = 1
        floating_ip.ip = '58.58.58.58'

        self.floating_ip = floating_ip
        self.floating_ips = [
            floating_ip,
        ]

        security_group = api.SecurityGroup(None)
        security_group.id = '1'
        security_group.name = 'default'
        self.security_groups = (security_group, )
Beispiel #5
0
    def setUp(self):
        super(ImagesAndSnapshotsTests, self).setUp()
        snapshot_properties = api.glance.ImageProperties(None)
        snapshot_properties.image_type = u'snapshot'

        snapshot_dict = {
            'name': u'snapshot',
            'container_format': u'ami',
            'id': 3
        }
        snapshot = api.glance.Image(snapshot_dict)
        snapshot.properties = snapshot_properties
        self.snapshots = [snapshot]

        image_properties = api.glance.ImageProperties(None)
        image_properties.image_type = u'image'

        image_dict = {
            'name': u'visibleImage',
            'container_format': u'novaImage'
        }
        self.visibleImage = api.glance.Image(image_dict)
        self.visibleImage.id = '1'
        self.visibleImage.properties = image_properties

        image_dict = {'name': 'invisibleImage', 'container_format': 'aki'}
        self.invisibleImage = api.Image(image_dict)
        self.invisibleImage.id = '2'

        flavor = api.Flavor(None)
        flavor.id = 1
        flavor.name = 'm1.massive'
        flavor.vcpus = 1000
        flavor.disk = 1024
        flavor.ram = 10000
        self.flavors = (flavor, )

        self.images = (self.visibleImage, self.invisibleImage)

        keypair = api.KeyPair(None)
        keypair.name = 'keyName'
        self.keypairs = (keypair, )

        security_group = api.SecurityGroup(None)
        security_group.name = 'default'
        self.security_groups = (security_group, )
Beispiel #6
0
    def setUp(self):
        super(ImageViewTests, self).setUp()
        image_dict = {'name': 'visibleImage',
                      'container_format': 'novaImage'}
        self.visibleImage = api.Image(image_dict)
        self.visibleImage.id = 1

        image_dict = {'name': 'invisibleImage',
                      'container_format': 'aki'}
        self.invisibleImage = api.Image(image_dict)
        self.invisibleImage.id = 2

        self.images = (self.visibleImage, self.invisibleImage)

        flavor = api.Flavor(None)
        flavor.id = 1
        flavor.name = 'm1.massive'
        flavor.vcpus = 1000
        flavor.disk = 1024
        flavor.ram = 10000
        self.flavors = (flavor,)

        keypair = api.KeyPair(None)
        keypair.name = 'keyName'
        self.keypairs = (keypair,)

        security_group = api.SecurityGroup(None)
        security_group.name = 'default'
        self.security_groups = (security_group,)

        volume = api.Volume(None)
        volume.id = 1
        volume.name = 'vol'
        volume.status = 'available'
        volume.size = 40
        volume.displayName = ''
        self.volumes = (volume,)
Beispiel #7
0
    def setUp(self):
        super(SnapshotsViewTests, self).setUp()
        image_dict = {
            'name': 'snapshot',
            'container_format': 'novaImage',
            'id': 3
        }
        self.images = [image_dict]

        server = api.Server(None, self.request)
        server.id = 1
        server.status = 'ACTIVE'
        server.name = 'sgoody'
        self.good_server = server

        server = api.Server(None, self.request)
        server.id = 2
        server.status = 'BUILD'
        server.name = 'baddy'
        self.bad_server = server

        flavor = api.Flavor(None)
        flavor.id = 1
        flavor.name = 'm1.massive'
        flavor.vcpus = 1000
        flavor.disk = 1024
        flavor.ram = 10000
        self.flavors = (flavor, )

        keypair = api.KeyPair(None)
        keypair.name = 'keyName'
        self.keypairs = (keypair, )

        security_group = api.SecurityGroup(None)
        security_group.name = 'default'
        self.security_groups = (security_group, )