Rebase network proxy to proxy2
Change-Id: Id0b11cd98c332582cec3017a1237ad54cbcc41ac
This commit is contained in:
parent
076ec4adc8
commit
28922b3c28
File diff suppressed because it is too large
Load Diff
@ -40,4 +40,4 @@ class Flavor(resource.Resource):
|
|||||||
#: Service type to which the flavor applies
|
#: Service type to which the flavor applies
|
||||||
service_type = resource.Body('service_type')
|
service_type = resource.Body('service_type')
|
||||||
#: IDs of service profiles associated with this flavor
|
#: IDs of service profiles associated with this flavor
|
||||||
service_profile_ids = resource.Body('service_profiles')
|
service_profile_ids = resource.Body('service_profiles', type=list)
|
||||||
|
@ -32,8 +32,7 @@ class FloatingIP(resource.Resource):
|
|||||||
_query_mapping = resource.QueryParameters(
|
_query_mapping = resource.QueryParameters(
|
||||||
'description', 'fixed_ip_address', 'floating_ip_address',
|
'description', 'fixed_ip_address', 'floating_ip_address',
|
||||||
'floating_network_id', 'port_id', 'router_id', 'status',
|
'floating_network_id', 'port_id', 'router_id', 'status',
|
||||||
project_id='tenant_id',
|
project_id='tenant_id')
|
||||||
revision_number='revision')
|
|
||||||
|
|
||||||
# Properties
|
# Properties
|
||||||
#: Timestamp at which the floating IP was created.
|
#: Timestamp at which the floating IP was created.
|
||||||
|
@ -29,13 +29,15 @@ class Network(resource.Resource):
|
|||||||
|
|
||||||
# NOTE: We don't support query on list or datetime fields yet
|
# NOTE: We don't support query on list or datetime fields yet
|
||||||
_query_mapping = resource.QueryParameters(
|
_query_mapping = resource.QueryParameters(
|
||||||
'description', 'name', 'status',
|
'description', 'name', 'project_id', 'status',
|
||||||
ipv4_address_scope_id='ipv4_address_scope',
|
ipv4_address_scope_id='ipv4_address_scope',
|
||||||
ipv6_address_scope_id='ipv6_address_scope',
|
ipv6_address_scope_id='ipv6_address_scope',
|
||||||
is_admin_state_up='admin_state_up',
|
is_admin_state_up='admin_state_up',
|
||||||
is_port_security_enabled='port_security_enabled',
|
is_port_security_enabled='port_security_enabled',
|
||||||
is_shared='shared',
|
is_shared='shared',
|
||||||
revision_number='revision',
|
provider_network_type='provider:network_type',
|
||||||
|
provider_physical_network='provider:physical_network',
|
||||||
|
provider_segmentation_id='provider:segmentation_id',
|
||||||
)
|
)
|
||||||
|
|
||||||
# Properties
|
# Properties
|
||||||
|
@ -28,8 +28,8 @@ class Pool(resource.Resource):
|
|||||||
allow_list = True
|
allow_list = True
|
||||||
|
|
||||||
_query_mapping = resource.QueryParameters(
|
_query_mapping = resource.QueryParameters(
|
||||||
'description', 'health_monitor_id', 'lb_algorithm', 'name',
|
'description', 'lb_algorithm', 'name',
|
||||||
'protocol', 'provider', 'subnet_id', 'vip_id',
|
'protocol', 'provider', 'subnet_id', 'virtual_ip_id',
|
||||||
is_admin_state_up='admin_state_up',
|
is_admin_state_up='admin_state_up',
|
||||||
project_id='tenant_id',
|
project_id='tenant_id',
|
||||||
)
|
)
|
||||||
@ -69,7 +69,7 @@ class Pool(resource.Resource):
|
|||||||
status = resource.Body('status')
|
status = resource.Body('status')
|
||||||
#: The status of the network.
|
#: The status of the network.
|
||||||
status_description = resource.Body('status_description')
|
status_description = resource.Body('status_description')
|
||||||
#: The subnet on whic the members of the pool will be located.
|
#: The subnet on which the members of the pool will be located.
|
||||||
subnet_id = resource.Body('subnet_id')
|
subnet_id = resource.Body('subnet_id')
|
||||||
#: Session persistence algorithm that should be used (if any).
|
#: Session persistence algorithm that should be used (if any).
|
||||||
#: *Type: dict with keys ``type`` and ``cookie_name``*
|
#: *Type: dict with keys ``type`` and ``cookie_name``*
|
||||||
|
@ -27,6 +27,12 @@ class QoSPolicy(resource.Resource):
|
|||||||
allow_delete = True
|
allow_delete = True
|
||||||
allow_list = True
|
allow_list = True
|
||||||
|
|
||||||
|
_query_mapping = resource.QueryParameters(
|
||||||
|
'name', 'description',
|
||||||
|
project_id='tenant_id',
|
||||||
|
is_shared='shared'
|
||||||
|
)
|
||||||
|
|
||||||
# Properties
|
# Properties
|
||||||
#: QoS policy name.
|
#: QoS policy name.
|
||||||
name = resource.Body('name')
|
name = resource.Body('name')
|
||||||
|
@ -27,6 +27,8 @@ class QoSRuleType(resource.Resource):
|
|||||||
allow_delete = False
|
allow_delete = False
|
||||||
allow_list = True
|
allow_list = True
|
||||||
|
|
||||||
|
_query_mapping = resource.QueryParameters('type')
|
||||||
|
|
||||||
# Properties
|
# Properties
|
||||||
#: QoS rule type name.
|
#: QoS rule type name.
|
||||||
type = resource.Body('type')
|
type = resource.Body('type')
|
||||||
|
@ -27,7 +27,10 @@ class RBACPolicy(resource.Resource):
|
|||||||
allow_delete = True
|
allow_delete = True
|
||||||
allow_list = True
|
allow_list = True
|
||||||
|
|
||||||
# NOTE: This resource doesn't support query parameters
|
_query_mapping = resource.QueryParameters(
|
||||||
|
'action', 'object_id', 'object_type', 'project_id',
|
||||||
|
'target_project_id',
|
||||||
|
)
|
||||||
|
|
||||||
# Properties
|
# Properties
|
||||||
#: ID of the object that this RBAC policy affects.
|
#: ID of the object that this RBAC policy affects.
|
||||||
|
@ -28,9 +28,11 @@ class SecurityGroupRule(resource.Resource):
|
|||||||
allow_list = True
|
allow_list = True
|
||||||
|
|
||||||
_query_mapping = resource.QueryParameters(
|
_query_mapping = resource.QueryParameters(
|
||||||
'description', 'direction', 'ethertype', 'protocol',
|
'description', 'direction', 'protocol',
|
||||||
'remote_group_id', 'security_group_id',
|
'remote_group_id', 'security_group_id',
|
||||||
|
ether_type='ethertype',
|
||||||
project_id='tenant_id',
|
project_id='tenant_id',
|
||||||
|
|
||||||
)
|
)
|
||||||
|
|
||||||
# Properties
|
# Properties
|
||||||
|
@ -35,7 +35,7 @@ class ServiceProfile(resource.Resource):
|
|||||||
# Properties
|
# Properties
|
||||||
#: Description of the service flavor profile.
|
#: Description of the service flavor profile.
|
||||||
description = resource.Body('description')
|
description = resource.Body('description')
|
||||||
#: Provider Driver for the service flavor profile
|
#: Provider driver for the service flavor profile
|
||||||
driver = resource.Body('driver')
|
driver = resource.Body('driver')
|
||||||
#: Sets enabled flag
|
#: Sets enabled flag
|
||||||
is_enabled = resource.Body('enabled', type=bool)
|
is_enabled = resource.Body('enabled', type=bool)
|
||||||
|
@ -47,7 +47,8 @@ from openstack.network.v2 import service_provider
|
|||||||
from openstack.network.v2 import subnet
|
from openstack.network.v2 import subnet
|
||||||
from openstack.network.v2 import subnet_pool
|
from openstack.network.v2 import subnet_pool
|
||||||
from openstack.network.v2 import vpn_service
|
from openstack.network.v2 import vpn_service
|
||||||
from openstack.tests.unit import test_proxy_base
|
from openstack import proxy2 as proxy_base2
|
||||||
|
from openstack.tests.unit import test_proxy_base2
|
||||||
|
|
||||||
|
|
||||||
QOS_POLICY_ID = 'qos-policy-id-' + uuid.uuid4().hex
|
QOS_POLICY_ID = 'qos-policy-id-' + uuid.uuid4().hex
|
||||||
@ -56,7 +57,7 @@ NETWORK_ID = 'network-id-' + uuid.uuid4().hex
|
|||||||
AGENT_ID = 'agent-id-' + uuid.uuid4().hex
|
AGENT_ID = 'agent-id-' + uuid.uuid4().hex
|
||||||
|
|
||||||
|
|
||||||
class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
class TestNetworkProxy(test_proxy_base2.TestProxyBase):
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
super(TestNetworkProxy, self).setUp()
|
super(TestNetworkProxy, self).setUp()
|
||||||
self.proxy = _proxy.Proxy(self.session)
|
self.proxy = _proxy.Proxy(self.session)
|
||||||
@ -116,7 +117,7 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
agent.DHCPAgentHostingNetwork,
|
agent.DHCPAgentHostingNetwork,
|
||||||
paginated=False,
|
paginated=False,
|
||||||
method_kwargs={'agent': AGENT_ID},
|
method_kwargs={'agent': AGENT_ID},
|
||||||
expected_kwargs={'path_args': {'agent_id': AGENT_ID}},
|
expected_kwargs={'agent_id': AGENT_ID}
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_network_hosting_dhcp_agents(self):
|
def test_network_hosting_dhcp_agents(self):
|
||||||
@ -125,7 +126,7 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
network.NetworkHostingDHCPAgent,
|
network.NetworkHostingDHCPAgent,
|
||||||
paginated=False,
|
paginated=False,
|
||||||
method_kwargs={'network': NETWORK_ID},
|
method_kwargs={'network': NETWORK_ID},
|
||||||
expected_kwargs={'path_args': {'network_id': NETWORK_ID}},
|
expected_kwargs={'network_id': NETWORK_ID}
|
||||||
)
|
)
|
||||||
|
|
||||||
def test_extension_find(self):
|
def test_extension_find(self):
|
||||||
@ -380,8 +381,7 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
self.verify_create(self.proxy.create_pool_member,
|
self.verify_create(self.proxy.create_pool_member,
|
||||||
pool_member.PoolMember,
|
pool_member.PoolMember,
|
||||||
method_kwargs={"pool": "test_id"},
|
method_kwargs={"pool": "test_id"},
|
||||||
expected_kwargs={"path_args": {
|
expected_kwargs={"pool_id": "test_id"})
|
||||||
"pool_id": "test_id"}})
|
|
||||||
|
|
||||||
def test_pool_member_delete(self):
|
def test_pool_member_delete(self):
|
||||||
self.verify_delete(self.proxy.delete_pool_member,
|
self.verify_delete(self.proxy.delete_pool_member,
|
||||||
@ -394,28 +394,31 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
{"pool": "test_id"}, {"pool_id": "test_id"})
|
{"pool": "test_id"}, {"pool_id": "test_id"})
|
||||||
|
|
||||||
def test_pool_member_find(self):
|
def test_pool_member_find(self):
|
||||||
self.verify_find(self.proxy.find_pool_member,
|
self._verify2('openstack.proxy2.BaseProxy._find',
|
||||||
pool_member.PoolMember,
|
self.proxy.find_pool_member,
|
||||||
path_args={"pool_id": "test_id"})
|
method_args=["MEMBER", "POOL"],
|
||||||
|
expected_args=[pool_member.PoolMember, "MEMBER"],
|
||||||
|
expected_kwargs={"pool_id": "POOL",
|
||||||
|
"ignore_missing": True})
|
||||||
|
|
||||||
def test_pool_member_get(self):
|
def test_pool_member_get(self):
|
||||||
self._verify2('openstack.proxy.BaseProxy._get',
|
self._verify2('openstack.proxy2.BaseProxy._get',
|
||||||
self.proxy.get_pool_member,
|
self.proxy.get_pool_member,
|
||||||
method_args=["resource_or_id", "test_id"],
|
method_args=["MEMBER", "POOL"],
|
||||||
expected_args=[pool_member.PoolMember,
|
expected_args=[pool_member.PoolMember, "MEMBER"],
|
||||||
"resource_or_id"],
|
expected_kwargs={"pool_id": "POOL"})
|
||||||
expected_kwargs={"path_args": {"pool_id": "test_id"}})
|
|
||||||
|
|
||||||
def test_pool_members(self):
|
def test_pool_members(self):
|
||||||
self.verify_list(self.proxy.pool_members, pool_member.PoolMember,
|
self.verify_list(self.proxy.pool_members, pool_member.PoolMember,
|
||||||
paginated=False, method_args=["test_id"],
|
paginated=False, method_args=["test_id"],
|
||||||
expected_kwargs={"path_args": {
|
expected_kwargs={"pool_id": "test_id"})
|
||||||
"pool_id": "test_id"}})
|
|
||||||
|
|
||||||
def test_pool_member_update(self):
|
def test_pool_member_update(self):
|
||||||
self.verify_update(self.proxy.update_pool_member,
|
self._verify2("openstack.proxy2.BaseProxy._update",
|
||||||
pool_member.PoolMember,
|
self.proxy.update_pool_member,
|
||||||
path_args={"pool_id": "test_id"})
|
method_args=["MEMBER", "POOL"],
|
||||||
|
expected_args=[pool_member.PoolMember, "MEMBER"],
|
||||||
|
expected_kwargs={"pool_id": "POOL"})
|
||||||
|
|
||||||
def test_pool_create_attrs(self):
|
def test_pool_create_attrs(self):
|
||||||
self.verify_create(self.proxy.create_pool, pool.Pool)
|
self.verify_create(self.proxy.create_pool, pool.Pool)
|
||||||
@ -464,33 +467,39 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
self.proxy.create_qos_bandwidth_limit_rule,
|
self.proxy.create_qos_bandwidth_limit_rule,
|
||||||
qos_bandwidth_limit_rule.QoSBandwidthLimitRule,
|
qos_bandwidth_limit_rule.QoSBandwidthLimitRule,
|
||||||
method_kwargs={'qos_policy': QOS_POLICY_ID},
|
method_kwargs={'qos_policy': QOS_POLICY_ID},
|
||||||
expected_kwargs={'path_args': {'qos_policy_id': QOS_POLICY_ID}})
|
expected_kwargs={'qos_policy_id': QOS_POLICY_ID})
|
||||||
|
|
||||||
def test_qos_bandwidth_limit_rule_delete(self):
|
def test_qos_bandwidth_limit_rule_delete(self):
|
||||||
self.verify_delete(
|
self.verify_delete(
|
||||||
self.proxy.delete_qos_bandwidth_limit_rule,
|
self.proxy.delete_qos_bandwidth_limit_rule,
|
||||||
qos_bandwidth_limit_rule.QoSBandwidthLimitRule,
|
qos_bandwidth_limit_rule.QoSBandwidthLimitRule,
|
||||||
False, input_path_args=["resource_or_id", QOS_POLICY_ID],
|
False, input_path_args=["resource_or_id", QOS_POLICY_ID],
|
||||||
expected_path_args={'qos_policy_id': QOS_POLICY_ID},)
|
expected_kwargs={'qos_policy_id': QOS_POLICY_ID})
|
||||||
|
|
||||||
def test_qos_bandwidth_limit_rule_delete_ignore(self):
|
def test_qos_bandwidth_limit_rule_delete_ignore(self):
|
||||||
self.verify_delete(
|
self.verify_delete(
|
||||||
self.proxy.delete_qos_bandwidth_limit_rule,
|
self.proxy.delete_qos_bandwidth_limit_rule,
|
||||||
qos_bandwidth_limit_rule.QoSBandwidthLimitRule,
|
qos_bandwidth_limit_rule.QoSBandwidthLimitRule,
|
||||||
True, input_path_args=["resource_or_id", QOS_POLICY_ID],
|
True, input_path_args=["resource_or_id", QOS_POLICY_ID],
|
||||||
expected_path_args={'qos_policy_id': QOS_POLICY_ID}, )
|
expected_kwargs={'qos_policy_id': QOS_POLICY_ID})
|
||||||
|
|
||||||
def test_qos_bandwidth_limit_rule_find(self):
|
def test_qos_bandwidth_limit_rule_find(self):
|
||||||
self.verify_find(self.proxy.find_qos_bandwidth_limit_rule,
|
policy = qos_policy.QoSPolicy.new(id=QOS_POLICY_ID)
|
||||||
qos_bandwidth_limit_rule.QoSBandwidthLimitRule,
|
self._verify2('openstack.proxy2.BaseProxy._find',
|
||||||
path_args={'qos_policy_id': QOS_POLICY_ID})
|
self.proxy.find_qos_bandwidth_limit_rule,
|
||||||
|
method_args=['rule_id', policy],
|
||||||
|
expected_args=[
|
||||||
|
qos_bandwidth_limit_rule.QoSBandwidthLimitRule,
|
||||||
|
'rule_id'],
|
||||||
|
expected_kwargs={'ignore_missing': True,
|
||||||
|
'qos_policy_id': QOS_POLICY_ID})
|
||||||
|
|
||||||
def test_qos_bandwidth_limit_rule_get(self):
|
def test_qos_bandwidth_limit_rule_get(self):
|
||||||
self.verify_get(
|
self.verify_get(
|
||||||
self.proxy.get_qos_bandwidth_limit_rule,
|
self.proxy.get_qos_bandwidth_limit_rule,
|
||||||
qos_bandwidth_limit_rule.QoSBandwidthLimitRule,
|
qos_bandwidth_limit_rule.QoSBandwidthLimitRule,
|
||||||
method_kwargs={'qos_policy': QOS_POLICY_ID},
|
method_kwargs={'qos_policy': QOS_POLICY_ID},
|
||||||
expected_kwargs={'path_args': {'qos_policy_id': QOS_POLICY_ID}})
|
expected_kwargs={'qos_policy_id': QOS_POLICY_ID})
|
||||||
|
|
||||||
def test_qos_bandwidth_limit_rules(self):
|
def test_qos_bandwidth_limit_rules(self):
|
||||||
self.verify_list(
|
self.verify_list(
|
||||||
@ -498,20 +507,26 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
qos_bandwidth_limit_rule.QoSBandwidthLimitRule,
|
qos_bandwidth_limit_rule.QoSBandwidthLimitRule,
|
||||||
paginated=False,
|
paginated=False,
|
||||||
method_kwargs={'qos_policy': QOS_POLICY_ID},
|
method_kwargs={'qos_policy': QOS_POLICY_ID},
|
||||||
expected_kwargs={'path_args': {'qos_policy_id': QOS_POLICY_ID}})
|
expected_kwargs={'qos_policy_id': QOS_POLICY_ID})
|
||||||
|
|
||||||
def test_qos_bandwidth_limit_rule_update(self):
|
def test_qos_bandwidth_limit_rule_update(self):
|
||||||
self.verify_update(
|
policy = qos_policy.QoSPolicy.new(id=QOS_POLICY_ID)
|
||||||
self.proxy.update_qos_bandwidth_limit_rule,
|
self._verify2('openstack.proxy2.BaseProxy._update',
|
||||||
qos_bandwidth_limit_rule.QoSBandwidthLimitRule,
|
self.proxy.update_qos_bandwidth_limit_rule,
|
||||||
path_args={'qos_policy_id': QOS_POLICY_ID})
|
method_args=['rule_id', policy],
|
||||||
|
method_kwargs={'foo': 'bar'},
|
||||||
|
expected_args=[
|
||||||
|
qos_bandwidth_limit_rule.QoSBandwidthLimitRule,
|
||||||
|
'rule_id'],
|
||||||
|
expected_kwargs={'qos_policy_id': QOS_POLICY_ID,
|
||||||
|
'foo': 'bar'})
|
||||||
|
|
||||||
def test_qos_dscp_marking_rule_create_attrs(self):
|
def test_qos_dscp_marking_rule_create_attrs(self):
|
||||||
self.verify_create(
|
self.verify_create(
|
||||||
self.proxy.create_qos_dscp_marking_rule,
|
self.proxy.create_qos_dscp_marking_rule,
|
||||||
qos_dscp_marking_rule.QoSDSCPMarkingRule,
|
qos_dscp_marking_rule.QoSDSCPMarkingRule,
|
||||||
method_kwargs={'qos_policy': QOS_POLICY_ID},
|
method_kwargs={'qos_policy': QOS_POLICY_ID},
|
||||||
expected_kwargs={'path_args': {'qos_policy_id': QOS_POLICY_ID}})
|
expected_kwargs={'qos_policy_id': QOS_POLICY_ID})
|
||||||
|
|
||||||
def test_qos_dscp_marking_rule_delete(self):
|
def test_qos_dscp_marking_rule_delete(self):
|
||||||
self.verify_delete(
|
self.verify_delete(
|
||||||
@ -528,16 +543,21 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_path_args={'qos_policy_id': QOS_POLICY_ID}, )
|
expected_path_args={'qos_policy_id': QOS_POLICY_ID}, )
|
||||||
|
|
||||||
def test_qos_dscp_marking_rule_find(self):
|
def test_qos_dscp_marking_rule_find(self):
|
||||||
self.verify_find(self.proxy.find_qos_dscp_marking_rule,
|
policy = qos_policy.QoSPolicy.new(id=QOS_POLICY_ID)
|
||||||
qos_dscp_marking_rule.QoSDSCPMarkingRule,
|
self._verify2('openstack.proxy2.BaseProxy._find',
|
||||||
path_args={'qos_policy_id': QOS_POLICY_ID})
|
self.proxy.find_qos_dscp_marking_rule,
|
||||||
|
method_args=['rule_id', policy],
|
||||||
|
expected_args=[qos_dscp_marking_rule.QoSDSCPMarkingRule,
|
||||||
|
'rule_id'],
|
||||||
|
expected_kwargs={'ignore_missing': True,
|
||||||
|
'qos_policy_id': QOS_POLICY_ID})
|
||||||
|
|
||||||
def test_qos_dscp_marking_rule_get(self):
|
def test_qos_dscp_marking_rule_get(self):
|
||||||
self.verify_get(
|
self.verify_get(
|
||||||
self.proxy.get_qos_dscp_marking_rule,
|
self.proxy.get_qos_dscp_marking_rule,
|
||||||
qos_dscp_marking_rule.QoSDSCPMarkingRule,
|
qos_dscp_marking_rule.QoSDSCPMarkingRule,
|
||||||
method_kwargs={'qos_policy': QOS_POLICY_ID},
|
method_kwargs={'qos_policy': QOS_POLICY_ID},
|
||||||
expected_kwargs={'path_args': {'qos_policy_id': QOS_POLICY_ID}})
|
expected_kwargs={'qos_policy_id': QOS_POLICY_ID})
|
||||||
|
|
||||||
def test_qos_dscp_marking_rules(self):
|
def test_qos_dscp_marking_rules(self):
|
||||||
self.verify_list(
|
self.verify_list(
|
||||||
@ -545,20 +565,26 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
qos_dscp_marking_rule.QoSDSCPMarkingRule,
|
qos_dscp_marking_rule.QoSDSCPMarkingRule,
|
||||||
paginated=False,
|
paginated=False,
|
||||||
method_kwargs={'qos_policy': QOS_POLICY_ID},
|
method_kwargs={'qos_policy': QOS_POLICY_ID},
|
||||||
expected_kwargs={'path_args': {'qos_policy_id': QOS_POLICY_ID}})
|
expected_kwargs={'qos_policy_id': QOS_POLICY_ID})
|
||||||
|
|
||||||
def test_qos_dscp_marking_rule_update(self):
|
def test_qos_dscp_marking_rule_update(self):
|
||||||
self.verify_update(
|
policy = qos_policy.QoSPolicy.new(id=QOS_POLICY_ID)
|
||||||
self.proxy.update_qos_dscp_marking_rule,
|
self._verify2('openstack.proxy2.BaseProxy._update',
|
||||||
qos_dscp_marking_rule.QoSDSCPMarkingRule,
|
self.proxy.update_qos_dscp_marking_rule,
|
||||||
path_args={'qos_policy_id': QOS_POLICY_ID})
|
method_args=['rule_id', policy],
|
||||||
|
method_kwargs={'foo': 'bar'},
|
||||||
|
expected_args=[
|
||||||
|
qos_dscp_marking_rule.QoSDSCPMarkingRule,
|
||||||
|
'rule_id'],
|
||||||
|
expected_kwargs={'qos_policy_id': QOS_POLICY_ID,
|
||||||
|
'foo': 'bar'})
|
||||||
|
|
||||||
def test_qos_minimum_bandwidth_rule_create_attrs(self):
|
def test_qos_minimum_bandwidth_rule_create_attrs(self):
|
||||||
self.verify_create(
|
self.verify_create(
|
||||||
self.proxy.create_qos_minimum_bandwidth_rule,
|
self.proxy.create_qos_minimum_bandwidth_rule,
|
||||||
qos_minimum_bandwidth_rule.QoSMinimumBandwidthRule,
|
qos_minimum_bandwidth_rule.QoSMinimumBandwidthRule,
|
||||||
method_kwargs={'qos_policy': QOS_POLICY_ID},
|
method_kwargs={'qos_policy': QOS_POLICY_ID},
|
||||||
expected_kwargs={'path_args': {'qos_policy_id': QOS_POLICY_ID}})
|
expected_kwargs={'qos_policy_id': QOS_POLICY_ID})
|
||||||
|
|
||||||
def test_qos_minimum_bandwidth_rule_delete(self):
|
def test_qos_minimum_bandwidth_rule_delete(self):
|
||||||
self.verify_delete(
|
self.verify_delete(
|
||||||
@ -575,16 +601,22 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
expected_path_args={'qos_policy_id': QOS_POLICY_ID}, )
|
expected_path_args={'qos_policy_id': QOS_POLICY_ID}, )
|
||||||
|
|
||||||
def test_qos_minimum_bandwidth_rule_find(self):
|
def test_qos_minimum_bandwidth_rule_find(self):
|
||||||
self.verify_find(self.proxy.find_qos_minimum_bandwidth_rule,
|
policy = qos_policy.QoSPolicy.new(id=QOS_POLICY_ID)
|
||||||
qos_minimum_bandwidth_rule.QoSMinimumBandwidthRule,
|
self._verify2('openstack.proxy2.BaseProxy._find',
|
||||||
path_args={'qos_policy_id': QOS_POLICY_ID})
|
self.proxy.find_qos_minimum_bandwidth_rule,
|
||||||
|
method_args=['rule_id', policy],
|
||||||
|
expected_args=[
|
||||||
|
qos_minimum_bandwidth_rule.QoSMinimumBandwidthRule,
|
||||||
|
'rule_id'],
|
||||||
|
expected_kwargs={'ignore_missing': True,
|
||||||
|
'qos_policy_id': QOS_POLICY_ID})
|
||||||
|
|
||||||
def test_qos_minimum_bandwidth_rule_get(self):
|
def test_qos_minimum_bandwidth_rule_get(self):
|
||||||
self.verify_get(
|
self.verify_get(
|
||||||
self.proxy.get_qos_minimum_bandwidth_rule,
|
self.proxy.get_qos_minimum_bandwidth_rule,
|
||||||
qos_minimum_bandwidth_rule.QoSMinimumBandwidthRule,
|
qos_minimum_bandwidth_rule.QoSMinimumBandwidthRule,
|
||||||
method_kwargs={'qos_policy': QOS_POLICY_ID},
|
method_kwargs={'qos_policy': QOS_POLICY_ID},
|
||||||
expected_kwargs={'path_args': {'qos_policy_id': QOS_POLICY_ID}})
|
expected_kwargs={'qos_policy_id': QOS_POLICY_ID})
|
||||||
|
|
||||||
def test_qos_minimum_bandwidth_rules(self):
|
def test_qos_minimum_bandwidth_rules(self):
|
||||||
self.verify_list(
|
self.verify_list(
|
||||||
@ -592,13 +624,19 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
qos_minimum_bandwidth_rule.QoSMinimumBandwidthRule,
|
qos_minimum_bandwidth_rule.QoSMinimumBandwidthRule,
|
||||||
paginated=False,
|
paginated=False,
|
||||||
method_kwargs={'qos_policy': QOS_POLICY_ID},
|
method_kwargs={'qos_policy': QOS_POLICY_ID},
|
||||||
expected_kwargs={'path_args': {'qos_policy_id': QOS_POLICY_ID}})
|
expected_kwargs={'qos_policy_id': QOS_POLICY_ID})
|
||||||
|
|
||||||
def test_qos_minimum_bandwidth_rule_update(self):
|
def test_qos_minimum_bandwidth_rule_update(self):
|
||||||
self.verify_update(
|
policy = qos_policy.QoSPolicy.new(id=QOS_POLICY_ID)
|
||||||
self.proxy.update_qos_minimum_bandwidth_rule,
|
self._verify2('openstack.proxy2.BaseProxy._update',
|
||||||
qos_minimum_bandwidth_rule.QoSMinimumBandwidthRule,
|
self.proxy.update_qos_minimum_bandwidth_rule,
|
||||||
path_args={'qos_policy_id': QOS_POLICY_ID})
|
method_args=['rule_id', policy],
|
||||||
|
method_kwargs={'foo': 'bar'},
|
||||||
|
expected_args=[
|
||||||
|
qos_minimum_bandwidth_rule.QoSMinimumBandwidthRule,
|
||||||
|
'rule_id'],
|
||||||
|
expected_kwargs={'qos_policy_id': QOS_POLICY_ID,
|
||||||
|
'foo': 'bar'})
|
||||||
|
|
||||||
def test_qos_policy_create_attrs(self):
|
def test_qos_policy_create_attrs(self):
|
||||||
self.verify_create(self.proxy.create_qos_policy, qos_policy.QoSPolicy)
|
self.verify_create(self.proxy.create_qos_policy, qos_policy.QoSPolicy)
|
||||||
@ -637,12 +675,16 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
def test_quota_get(self):
|
def test_quota_get(self):
|
||||||
self.verify_get(self.proxy.get_quota, quota.Quota)
|
self.verify_get(self.proxy.get_quota, quota.Quota)
|
||||||
|
|
||||||
def test_quota_default_get(self):
|
@mock.patch.object(proxy_base2.BaseProxy, "_get_resource")
|
||||||
self.verify_get(self.proxy.get_quota_default, quota.QuotaDefault,
|
def test_quota_default_get(self, mock_get):
|
||||||
value=[mock.sentinel.project_id],
|
fake_quota = mock.Mock(project_id='PROJECT')
|
||||||
expected_args=[quota.QuotaDefault],
|
mock_get.return_value = fake_quota
|
||||||
expected_kwargs={"path_args": {
|
self._verify2("openstack.proxy2.BaseProxy._get",
|
||||||
"project": mock.sentinel.project_id}})
|
self.proxy.get_quota_default,
|
||||||
|
method_args=['QUOTA_ID'],
|
||||||
|
expected_args=[quota.QuotaDefault],
|
||||||
|
expected_kwargs={'project': "PROJECT"})
|
||||||
|
mock_get.assert_called_once_with(quota.Quota, 'QUOTA_ID')
|
||||||
|
|
||||||
def test_quotas(self):
|
def test_quotas(self):
|
||||||
self.verify_list(self.proxy.quotas, quota.Quota, paginated=False)
|
self.verify_list(self.proxy.quotas, quota.Quota, paginated=False)
|
||||||
@ -915,5 +957,4 @@ class TestNetworkProxy(test_proxy_base.TestProxyBase):
|
|||||||
value=[mock.sentinel.project_id],
|
value=[mock.sentinel.project_id],
|
||||||
expected_args=[
|
expected_args=[
|
||||||
auto_allocated_topology.ValidateTopology],
|
auto_allocated_topology.ValidateTopology],
|
||||||
expected_kwargs={"path_args": {
|
expected_kwargs={"project": mock.sentinel.project_id})
|
||||||
"project": mock.sentinel.project_id}})
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user