Exemple #1
0
 def setUp(self):
     super(TestNodesResourceClassOldApi, self).setUp()
     self.useFixture(
         api_microversion_fixture.APIMicroversionFixture(
             TestNodesResourceClassOldApi.old_microversion))
     _, self.chassis = self.create_chassis()
     _, self.node = self.create_node(self.chassis['uuid'])
Exemple #2
0
    def test_vif_on_port(self):
        """Test attachment and detachment of VIFs on the node with port.

        Test steps:
        1) Create chassis and node in setUp.
        2) Create port for the node.
        3) Attach VIF to the node.
        4) Check VIF info in VIFs list and port internal_info.
        5) Detach VIF from the node.
        6) Check that no more VIF info in VIFs list and port internal_info.
        """
        self.useFixture(
            api_microversion_fixture.APIMicroversionFixture('1.28'))
        _, self.port = self.create_port(self.node['uuid'],
                                        data_utils.rand_mac_address())
        self.client.vif_attach(self.node['uuid'], self.nport_id)
        _, body = self.client.vif_list(self.node['uuid'])
        self.assertEqual({'vifs': [{'id': self.nport_id}]}, body)
        _, port = self.client.show_port(self.port['uuid'])
        self.assertEqual(self.nport_id,
                         port['internal_info']['tenant_vif_port_id'])
        self.client.vif_detach(self.node['uuid'], self.nport_id)
        _, body = self.client.vif_list(self.node['uuid'])
        self.assertEqual({'vifs': []}, body)
        _, port = self.client.show_port(self.port['uuid'])
        self.assertNotIn('tenant_vif_port_id', port['internal_info'])
    def test_api_versions(self):
        self.useFixture(api_microversion_fixture.APIMicroversionFixture(None))
        _, descr = self.client.get_api_description()
        expected_versions = ('v1', )
        versions = [version['id'] for version in descr['versions']]

        for v in expected_versions:
            self.assertIn(v, versions)
    def setUp(self):
        super(TestPortsWithPhysicalNetwork, self).setUp()

        self.useFixture(
            api_microversion_fixture.APIMicroversionFixture(
                TestPortsWithPhysicalNetwork.min_microversion))
        _, self.chassis = self.create_chassis()
        _, self.node = self.create_node(self.chassis['uuid'])
Exemple #5
0
 def setUp(self):
     super(TestPortGroups, self).setUp()
     self.useFixture(
         api_microversion_fixture.APIMicroversionFixture('1.25'))
     _, self.chassis = self.create_chassis()
     _, self.node = self.create_node(self.chassis['uuid'])
     _, self.portgroup = self.create_portgroup(
         self.node['uuid'], address=data_utils.rand_mac_address())
 def test_vifs(self):
     self.useFixture(
         api_microversion_fixture.APIMicroversionFixture('1.28'))
     _, self.port = self.create_port(self.node['uuid'],
                                     data_utils.rand_mac_address())
     self.client.vif_attach(self.node['uuid'], 'test-vif')
     _, body = self.client.vif_list(self.node['uuid'])
     self.assertEqual(body, {'vifs': [{'id': 'test-vif'}]})
     self.client.vif_detach(self.node['uuid'], 'test-vif')
 def setUp(self):
     super(TestNodesResourceClass, self).setUp()
     self.useFixture(
         api_microversion_fixture.APIMicroversionFixture(
             TestNodesResourceClass.min_microversion))
     _, self.chassis = self.create_chassis()
     self.resource_class = data_utils.rand_name(name='Resource_Class')
     _, self.node = self.create_node(self.chassis['uuid'],
                                     resource_class=self.resource_class)
Exemple #8
0
 def setUp(self):
     super(TestNodesTraits, self).setUp()
     self.useFixture(
         api_microversion_fixture.APIMicroversionFixture(
             TestNodesTraits.min_microversion))
     _, self.chassis = self.create_chassis()
     # One standard trait & one custom trait.
     self.traits = ['CUSTOM_TRAIT1', 'HW_CPU_X86_VMX']
     _, self.node = self.create_node(self.chassis['uuid'])
Exemple #9
0
 def setUp(self):
     super(TestVolumeConnector, self).setUp()
     self.useFixture(
         api_microversion_fixture.APIMicroversionFixture(
             self.min_microversion))
     _, self.chassis = self.create_chassis()
     _, self.node = self.create_node(self.chassis['uuid'])
     _, self.volume_connector = self.create_volume_connector(
         self.node['uuid'], type='iqn',
         connector_id=data_utils.rand_name('connector_id'),
         extra=self.extra)
 def setUp(self):
     super(TestVolumeTarget, self).setUp()
     self.useFixture(
         api_microversion_fixture.APIMicroversionFixture(
             self.min_microversion))
     _, self.chassis = self.create_chassis()
     _, self.node = self.create_node(self.chassis['uuid'])
     _, self.volume_target = self.create_volume_target(
         self.node['uuid'], volume_type=data_utils.rand_name('volume_type'),
         volume_id=data_utils.rand_name('volume_id'),
         boot_index=10,
         extra=self.extra)
Exemple #11
0
    def test_vif_already_set(self):
        self.useFixture(
            api_microversion_fixture.APIMicroversionFixture('1.28'))
        _, self.port = self.create_port(self.node['uuid'],
                                        data_utils.rand_mac_address())
        self.client.vif_attach(self.node['uuid'], self.nport_id)
        _, body = self.client.vif_list(self.node['uuid'])
        self.assertEqual({'vifs': [{'id': self.nport_id}]}, body)

        self.assertRaises(lib_exc.Conflict, self.client.vif_attach,
                          self.node['uuid'], self.nport_id)

        self.client.vif_detach(self.node['uuid'], self.nport_id)
Exemple #12
0
    def test_vif_already_set_on_extra(self):
        self.useFixture(
            api_microversion_fixture.APIMicroversionFixture('1.28'))
        _, self.port = self.create_port(self.node['uuid'],
                                        data_utils.rand_mac_address())
        patch = [{'path': '/extra/vif_port_id',
                  'op': 'add',
                  'value': self.nport_id}]
        self.client.update_port(self.port['uuid'], patch)

        _, body = self.client.vif_list(self.node['uuid'])
        self.assertEqual({'vifs': [{'id': self.nport_id}]}, body)

        self.assertRaises(lib_exc.Conflict, self.client.vif_attach,
                          self.node['uuid'], self.nport_id)

        self.client.vif_detach(self.node['uuid'], self.nport_id)
    def test_vif_on_portgroup(self):
        """Test attachment and detachment of VIFs on the node with port group.

        Test steps:
        1) Create chassis and node in setUp.
        2) Create port for the node.
        3) Create port group for the node.
        4) Plug port into port group.
        5) Attach VIF to the node.
        6) Check VIF info in VIFs list and port group internal_info, but
           not in port internal_info.
        7) Detach VIF from the node.
        8) Check that no VIF info in VIFs list and port group internal_info.
        """
        self.useFixture(
            api_microversion_fixture.APIMicroversionFixture('1.28'))
        _, self.port = self.create_port(self.node['uuid'],
                                        data_utils.rand_mac_address())
        _, self.portgroup = self.create_portgroup(
            self.node['uuid'], address=data_utils.rand_mac_address())

        patch = [{
            'path': '/portgroup_uuid',
            'op': 'add',
            'value': self.portgroup['uuid']
        }]
        self.client.update_port(self.port['uuid'], patch)

        self.client.vif_attach(self.node['uuid'], 'test-vif')
        _, body = self.client.vif_list(self.node['uuid'])
        self.assertEqual({'vifs': [{'id': 'test-vif'}]}, body)

        _, port = self.client.show_port(self.port['uuid'])
        self.assertNotIn('tenant_vif_port_id', port['internal_info'])
        _, portgroup = self.client.show_portgroup(self.portgroup['uuid'])
        self.assertEqual('test-vif',
                         portgroup['internal_info']['tenant_vif_port_id'])

        self.client.vif_detach(self.node['uuid'], 'test-vif')
        _, body = self.client.vif_list(self.node['uuid'])
        self.assertEqual({'vifs': []}, body)
        _, portgroup = self.client.show_portgroup(self.portgroup['uuid'])
        self.assertNotIn('tenant_vif_port_id', portgroup['internal_info'])
Exemple #14
0
 def setUp(self):
     super(TestNodeStatesV1_2, self).setUp()
     self.useFixture(api_microversion_fixture.APIMicroversionFixture('1.2'))
 def setUp(self):
     super(TestDeployTemplatesNegative, self).setUp()
     self.useFixture(
         api_microversion_fixture.APIMicroversionFixture(
             self.min_microversion))
     self.steps = EXAMPLE_STEPS
 def test_default_version(self):
     self.useFixture(api_microversion_fixture.APIMicroversionFixture(None))
     _, descr = self.client.get_api_description()
     default_version = descr['default_version']
     self.assertEqual('v1', default_version['id'])
Exemple #17
0
 def test_driver_logical_disk_properties(self):
     self.useFixture(
         api_microversion_fixture.APIMicroversionFixture('1.12'))
     _, properties = self.client.get_driver_logical_disk_properties(
         self.driver_name)
     self.assertNotEmpty(properties)
 def setUp(self):
     super(BaseBaremetalTest, self).setUp()
     self.useFixture(
         api_microversion_fixture.APIMicroversionFixture(
             self.request_microversion))