コード例 #1
0
ファイル: test_utils.py プロジェクト: igordcard/neutron
    def test_validate_rp_bandwidth_with_device_names(self):
        try:
            utils.validate_rp_bandwidth(self.valid_rp_bandwidths,
                                        self.device_name_set)
        except ValueError:
            self.fail("validate_rp_bandwidth failed to validate %s" %
                      self.valid_rp_bandwidths)

        self.assertRaises(ValueError, utils.validate_rp_bandwidth,
                          self.not_valid_rp_bandwidth, self.device_name_set)
コード例 #2
0
ファイル: test_utils.py プロジェクト: FieldTech/neutron
    def test_validate_rp_bandwidth_with_device_names(self):
        try:
            utils.validate_rp_bandwidth(self.valid_rp_bandwidths,
                                        self.device_name_set)
        except ValueError:
            self.fail("validate_rp_bandwidth failed to validate %s" %
                      self.valid_rp_bandwidths)

        self.assertRaises(ValueError, utils.validate_rp_bandwidth,
                          self.not_valid_rp_bandwidth, self.device_name_set)
コード例 #3
0
ファイル: sriov_nic_agent.py プロジェクト: stackhpc/neutron
    def _validate(self):
        """Validate configuration.

        Validate that network_device in excluded_device
        exists in device mappings.
        Validate that network_device in resource_provider_bandwidths
        exists in device mappings.
        """
        dev_net_set = set(itertools.chain.from_iterable(
            self.device_mappings.values()))
        for dev_name in self.exclude_devices.keys():
            if dev_name not in dev_net_set:
                raise ValueError(_(
                    "Invalid exclude_devices: "
                    "Device name %(dev_name)s is missing from "
                    "physical_device_mappings") % {'dev_name': dev_name})
        n_utils.validate_rp_bandwidth(self.rp_bandwidths, dev_net_set)
コード例 #4
0
    def _validate(self):
        """Validate configuration.

        Validate that network_device in excluded_device
        exists in device mappings.
        Validate that network_device in resource_provider_bandwidths
        exists in device mappings.
        """
        dev_net_set = set(itertools.chain.from_iterable(
                          six.itervalues(self.device_mappings)))
        for dev_name in self.exclude_devices.keys():
            if dev_name not in dev_net_set:
                raise ValueError(_(
                    "Invalid exclude_devices: "
                    "Device name %(dev_name)s is missing from "
                    "physical_device_mappings") % {'dev_name': dev_name})
        n_utils.validate_rp_bandwidth(self.rp_bandwidths, dev_net_set)