def setUp(self):
        super(TestCreateNetworkQosRuleMinimumBandwidth, self).setUp()
        attrs = {
            'qos_policy_id': self.qos_policy.id,
            'type': RULE_TYPE_MINIMUM_BANDWIDTH
        }
        self.new_rule = network_fakes.FakeNetworkQosRule.create_one_qos_rule(
            attrs)
        self.columns = ('direction', 'id', 'min_kbps', 'project_id',
                        'qos_policy_id', 'type')

        self.data = (
            self.new_rule.direction,
            self.new_rule.id,
            self.new_rule.min_kbps,
            self.new_rule.project_id,
            self.new_rule.qos_policy_id,
            self.new_rule.type,
        )
        self.network.create_qos_minimum_bandwidth_rule = mock.Mock(
            return_value=self.new_rule)

        # Get the command object to test
        self.cmd = network_qos_rule.CreateNetworkQosRule(
            self.app, self.namespace)
Exemple #2
0
    def setUp(self):
        super(TestCreateNetworkQosRuleBandwidtLimit, self).setUp()
        attrs = {
            'qos_policy_id': self.qos_policy.id,
            'type': RULE_TYPE_BANDWIDTH_LIMIT
        }
        self.new_rule = network_fakes.FakeNetworkQosRule.create_one_qos_rule(
            attrs)
        self.columns = ('id', 'max_burst_kbits', 'max_kbps', 'project_id',
                        'qos_policy_id', 'type')

        self.data = (
            self.new_rule.id,
            self.new_rule.max_burst_kbits,
            self.new_rule.max_kbps,
            self.new_rule.project_id,
            self.new_rule.qos_policy_id,
            self.new_rule.type,
        )
        self.network.create_qos_bandwidth_limit_rule = mock.Mock(
            return_value=self.new_rule)

        # Get the command object to test
        self.cmd = network_qos_rule.CreateNetworkQosRule(
            self.app, self.namespace)
    def setUp(self):
        super(TestCreateNetworkQosRuleDSCPMarking, self).setUp()
        attrs = {
            'qos_policy_id': self.qos_policy.id,
            'type': RULE_TYPE_DSCP_MARKING
        }
        self.new_rule = network_fakes.FakeNetworkQosRule.create_one_qos_rule(
            attrs)
        self.columns = ('dscp_mark', 'id', 'project_id', 'qos_policy_id',
                        'type')

        self.data = (
            self.new_rule.dscp_mark,
            self.new_rule.id,
            self.new_rule.project_id,
            self.new_rule.qos_policy_id,
            self.new_rule.type,
        )
        self.network.create_qos_dscp_marking_rule = mock.Mock(
            return_value=self.new_rule)

        # Get the command object to test
        self.cmd = network_qos_rule.CreateNetworkQosRule(
            self.app, self.namespace)