def setUp(self):
        super(TestShowNetworkQosDSCPMarking, 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.qos_policy.rules = [self.new_rule]
        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.get_qos_dscp_marking_rule = mock.Mock(
            return_value=self.new_rule)

        # Get the command object to test
        self.cmd = network_qos_rule.ShowNetworkQosRule(self.app,
                                                       self.namespace)
    def setUp(self):
        super(TestShowNetworkQosRuleMinimumBandwidth, 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.qos_policy.rules = [self.new_rule]
        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.get_qos_minimum_bandwidth_rule = mock.Mock(
            return_value=self.new_rule)

        # Get the command object to test
        self.cmd = network_qos_rule.ShowNetworkQosRule(self.app,
                                                       self.namespace)
Esempio n. 3
0
    def setUp(self):
        super(TestShowNetworkQosBandwidthLimit, 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.qos_policy.rules = [self.new_rule]
        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.get_qos_bandwidth_limit_rule = mock.Mock(
            return_value=self.new_rule)

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