Neutron¶
Neutron conftest¶
-
stepler.neutron.conftest.add_router_interfaces(router_steps)[source]¶ Fixture to add interfaces to router.
Can be called several times during a test.
Parameters: router_steps (object) – instantiated router steps Returns: function to add interfaces to router Return type: function
-
stepler.neutron.conftest.agent_steps(get_agent_steps)[source]¶ Function fixture to get agent steps.
Parameters: get_agent_steps (function) – function to get instantiated agent steps Returns: instantiated agent steps Return type: stepler.neutron.steps.AgentSteps
-
stepler.neutron.conftest.baremetal_network(network_steps)[source]¶ Function fixture to find baremetal network before test.
- Args:
- network_steps (object): instantiated network steps
Returns: baremetal network Return type: object
-
stepler.neutron.conftest.change_neutron_quota(request, current_project, neutron_quota_steps)[source]¶ Function fixture to change neutron quota values for test.
After test all neutron quota values will be restored with original values.
Note
This fixture should be parametrized.
Example
@pytest.mark.parametrize('change_neutron_quota', [{ 'network': 30, 'router': 30, 'subnet': 30, 'port': 90} ], indirect=True) def test_foo(change_neutron_quota): # test logic
Parameters: - request (obj) – py.test’s SubRequest
- current_project (obj) – current project
- neutron_quota_steps (obj) – instantiated neutron quota steps
Yields: dict – dict with new quota values
-
stepler.neutron.conftest.create_floating_ip(floating_ip_steps, public_network)[source]¶ Fixture to create floating_ip with options.
Can be called several times during a test. After the test it destroys all created floating_ips.
Parameters: - floating_ip_steps (object) – instantiated floating ip steps
- public_network (obj) – public network
Returns: function to create floating_ip as batch with options
Return type: function
-
stepler.neutron.conftest.create_max_networks_with_instances(cirros_image, flavor, security_group, sorted_hypervisors, create_network, create_subnet, current_project, router_steps, neutron_quota_steps, hypervisor_steps, server_steps)[source]¶ Callable fixture to create max networks, boot and delete servers.
This fixture returns fuction to create max count of networks, subnet for each network, connect networks to router, boot nova server with cirros on each network and then delete created servers.
Parameters: - cirros_image (obj) – cirros image
- flavor (obj) – nova flavor
- security_group (obj) – nova security group
- sorted_hypervisors (list) – nova hypervisors list
- create_network (function) – function to create network
- create_subnet (function) – function to create subnet with options
- current_project (obj) – current project
- router_steps (obj) – instantiated router steps
- neutron_quota_steps (obj) – instantiated neutron quota steps
- hypervisor_steps (obj) – instantiated nova hypervisor steps
- server_steps (obj) – instantiated nova server steps
Returns: function to create max count of networks
Return type: function
-
stepler.neutron.conftest.create_network(network_steps)[source]¶ Callable fixture to create network with default options.
Can be called several times during test.
Parameters: network_steps (object) – instantiated network steps Yields: function – function to create network with default options
-
stepler.neutron.conftest.create_port(port_steps)[source]¶ Function fixture to create port with options.
Can be called several times during a test. After the test it destroys all created ports.
Parameters: port_steps (object) – instantiated neutron steps Returns: function to create port as batch with options Return type: function
-
stepler.neutron.conftest.create_port(port_steps)[source] Function fixture to create port with options.
Can be called several times during a test. After the test it destroys all created ports.
Parameters: port_steps (object) – instantiated neutron steps Returns: function to create port as batch with options Return type: function
-
stepler.neutron.conftest.create_router(router_steps)[source]¶ Fixture to create router with options.
Can be called several times during a test. After the test it destroys all created routers.
Parameters: router_steps (object) – instantiated neutron steps Returns: function to create router as batch with options Return type: function
-
stepler.neutron.conftest.create_subnet(subnet_steps)[source]¶ Fixture to create subnet with options.
Can be called several times during a test. After the test it destroys all created subnets.
Parameters: subnet_steps (object) – instantiated neutron steps Returns: function to create subnet as batch with options Return type: function
-
stepler.neutron.conftest.floating_ip(create_floating_ip)[source]¶ Fixture to create floating_ip with default options before test.
Parameters: create_floating_ip (function) – function to create floating_ip with options Returns: floating_ip Return type: dict
-
stepler.neutron.conftest.floating_ip_steps(get_floating_ip_steps)[source]¶ Function fixture to get floating_ip steps.
Parameters: get_floating_ip_steps (function) – function to get instantiated floating_ip steps Returns: instantiated floating_ip steps Return type: stepler.neutron.steps.SubnetSteps
-
stepler.neutron.conftest.get_agent_steps(get_neutron_client)[source]¶ Callable session fixture to get agent steps.
Parameters: get_neutron_client (function) – function to get instantiated neutron client Returns: function to get instantiated agent steps Return type: function
-
stepler.neutron.conftest.get_floating_ip_steps(get_neutron_client)[source]¶ Callable session fixture to get router steps.
Parameters: get_neutron_client (function) – function to get instantiated neutron client Returns: function to get instantiated floating_ip steps Return type: function
-
stepler.neutron.conftest.get_network_steps(get_neutron_client)[source]¶ Callable session fixture to get network steps.
Parameters: get_neutron_client (function) – function to get instantiated neutron client Returns: function to get instantiated network steps Return type: function
-
stepler.neutron.conftest.get_neutron_client(get_session)[source]¶ Callable session fixture to get neutron client wrapper.
Parameters: get_session (function) – function to get authenticated keystone session Returns: function to get instantiated neutron client wrapper Return type: function
-
stepler.neutron.conftest.get_neutron_quota_steps(get_neutron_client)[source]¶ Callable session fixture to get neutron quota steps.
Parameters: get_neutron_client (function) – function to get instantiated neutron client Returns: function to get instantiated neutron quota steps Return type: function
-
stepler.neutron.conftest.get_neutron_security_group_rule_steps(get_neutron_client)[source]¶ Callable session fixture to get security group rules steps.
Parameters: get_neutron_client (function) – function to get instantiated neutron client Returns: function to get instantiated security group rules steps Return type: function
-
stepler.neutron.conftest.get_neutron_security_group_steps(get_neutron_client)[source]¶ Callable session fixture to get neutron security group steps.
Parameters: get_neutron_client (function) – function to get instantiated neutron client Returns: function to get instantiated neutron security group steps Return type: function
-
stepler.neutron.conftest.get_router_steps(get_neutron_client)[source]¶ Callable session fixture to get router steps.
Parameters: get_neutron_client (function) – function to get instantiated neutron client Returns: function to get instantiated router steps Return type: function
-
stepler.neutron.conftest.get_subnet_steps(get_neutron_client)[source]¶ Callable session fixture to get router steps.
Parameters: get_neutron_client (function) – function to get instantiated neutron client Returns: function to get instantiated subnet steps Return type: function
-
stepler.neutron.conftest.net_subnet_router(network, subnet, router, router_steps)[source]¶ Function fixture to create net, subnet, router and link them.
It deletes all created resources after test.
Parameters: - network (obj) – network object
- subnet (obj) – subnet object
- router (obj) – router object
- router_steps (obj) – instantiated router steps
Returns: network, subnet, router objects
Return type: tuple
-
stepler.neutron.conftest.network(network_steps)[source]¶ Function fixture to create network with default options before test.
Parameters: network_steps (object) – instantiated network steps Returns: network Return type: object
-
stepler.neutron.conftest.network_steps(get_network_steps, uncleanable)[source]¶ Function fixture to get network steps.
Parameters: - get_network_steps (function) – function to get instantiated network steps
- uncleanable (AttrDict) – data structure with skipped resources
Yields: stepler.neutron.steps.NetworkSteps – instantiated network steps
-
stepler.neutron.conftest.neutron_2_networks(request, net_subnet_router, public_network, create_network, create_subnet, create_router, router_steps)[source]¶ Function fixture to prepare environment with 2 networks.
This fixture creates router(s), 2 networks and 2 subnets and connects networks to router(s). By default, both networks will be connected to single router.
All created resources are to be deleted after test.
Can be parametrized with ‘different_routers’ to create 2 routers and connect each of networks to different router.
Example
- @pytest.mark.parametrize(‘neutron_2_networks’,
- [‘different_routers’], indirect=True)
- def test_foo(neutron_2_networks):
- # Will be created 2 routers, each of them will be linked with one # of the subnets.
Parameters: - request (obj) – py.test SubRequest
- net_subnet_router (tuple) – network, subnet, router
- public_network (dict) – neutron public network
- create_network (function) – function to create network
- create_subnet (function) – function to create subnet
- create_router (function) – function to create router
- router_steps (obj) – instantiated router steps
Returns: created resources
Return type: attrdict.AttrDict
-
stepler.neutron.conftest.neutron_2_servers_2_nets_diff_projects(request, neutron_nets_for_projects, sorted_hypervisors, cirros_image, public_flavor, public_network, get_neutron_security_group_steps, get_neutron_security_group_rule_steps, get_server_steps, get_floating_ip_steps, port_steps)[source]¶ Function fixture to prepare environment for different projects tests.
This fixture:
- creates 2 projects;
- creates net, subnet, router in each project;
- creates security groups in each project;
- add ping + ssh rules for each security group;
- create server in each project;
- add floating ips for servers in each project.
All created resources are to be deleted after test.
Parameters: - request (obj) – py.test SubRequest
- neutron_nets_for_projects (AttrDict) – neutron networks, subnets, router(s) resources AttrDict instance
- sorted_hypervisors (list) – sorted hypervisors
- cirros_image (obj) – glance image
- public_flavor (obj) – nova flavor with is_public=True attribute
- public_network (obj) – public network
- get_neutron_security_group_steps (function) – function to get security group steps
- get_neutron_security_group_rule_steps (function) – function to get security group rules steps
- get_server_steps (function) – function to get server steps
- get_floating_ip_steps (function) – function to get floating ip steps
- port_steps (obj) – instantiated port steps
Returns: created resources
Return type: attrdict.AttrDict
Function fixture to prepare environment for different projects tests.
This fixture:
- creates 2 projects: admin and non-admin
- creates security groups in each project;
- add ping + ssh rules for each security group;
- creates shared net with subnet and router in admin project;
- create server in each project;
- add floating ips for servers in each project.
All created resources are to be deleted after test.
Parameters: - request (obj) – py.test SubRequest
- public_network (dict) – neutron public network
- conntrack_cirros_image (obj) – glance image with public visibility
- public_flavor (obj) – nova flavor with is_public=True attribute
- create_project (function) – function to create project
- create_user (function) – function to create user
- create_network (function) – function to create network
- create_subnet (function) – function to create subnet
- create_router (function) – function to create router
- port_steps (obj) – instantiated port steps
- role_steps (obj) – instantiated role steps
- router_steps (obj) – instantiated router steps
- get_server_steps (function) – function to get server steps
- get_neutron_security_group_steps (function) – function to get security group steps
- get_neutron_security_group_rule_steps (function) – function to get security group rules steps
- get_floating_ip_steps (function) – function to get floating ip steps
Returns: created resources
Return type: attrdict.AttrDict
-
stepler.neutron.conftest.neutron_2_servers_diff_nets_with_floating(neutron_2_servers_different_networks, create_floating_ip, server_steps)[source]¶ Function fixture to prepare environment with 2 servers.
This fixture creates resources using neutron_2_servers_different_networks fixture, creates and attaches floating ips for all servers.
All created resources are to be deleted after test.
Parameters: - neutron_2_servers_different_networks (AttrDict) – neutron networks, subnets, router(s) and servers resources AttrDict instance
- create_floating_ip (function) – function to create floating IP
- server_steps (obj) – instantiated nova server steps
Returns: created resources
Return type: attrdict.AttrDict
-
stepler.neutron.conftest.neutron_2_servers_different_networks(request, cirros_image, flavor, security_group, sorted_hypervisors, neutron_2_networks, hypervisor_steps, server_steps)[source]¶ Function fixture to prepare environment with 2 servers.
This fixture creates router, 2 networks and 2 subnets, connects networks to router, boot nova server on each network on different computes.
All created resources are to be deleted after test.
Can be parametrized with ‘same_host’.
Example
- @pytest.mark.parametrize(‘neutron_2_servers_different_networks’,
- [‘same_host’], indirect=True)
- def test_foo(neutron_2_servers_different_networks):
- # Instances will be created on the same compute
Parameters: - request (obj) – py.test SubRequest
- cirros_image (obj) – cirros image
- flavor (obj) – nova flavor
- security_group (obj) – nova security group
- sorted_hypervisors (list) – available hypervisors
- neutron_2_networks (obj) – neutron networks, subnets, router(s) resources AttrDict instance
- hypervisor_steps (obj) – instantiated nova hypervisor steps
- server_steps (obj) – instantiated nova server steps
Returns: created resources
Return type: attrdict.AttrDict
-
stepler.neutron.conftest.neutron_2_servers_different_subnets(cirros_image, flavor, security_group, net_subnet_router, server, create_subnet, router_steps, subnet_steps, server_steps)[source]¶ Function fixture to prepare environment with 2 servers.
This fixture creates router, network and 2 subnets, connects subnets to router, boot 2 nova servers on different subnets and on the same compute.
All created resources are to be deleted after test.
Parameters: - cirros_image (obj) – cirros image
- flavor (obj) – nova flavor
- security_group (obj) – nova security group
- net_subnet_router (tuple) – network, subnet, router
- server (obj) – nova server
- create_subnet (function) – function to create subnet
- router_steps (function) – instantiated neutron subnet steps
- subnet_steps (obj) – instantiated neutron subnet steps
- server_steps (obj) – instantiated nova server steps
Returns: created resources
Return type: attrdict.AttrDict
-
stepler.neutron.conftest.neutron_2_servers_iperf_different_networks(ubuntu_image, flavor, keypair, security_group, neutron_2_networks, hypervisor_steps, neutron_security_group_rule_steps, server_steps)[source]¶ Function fixture to prepare environment with 2 ubuntu servers.
This fixture creates router, 2 networks and 2 subnets, connects networks to router, boots nova server with ubuntu on each network on different computes, installs iperf to both servers, starts TCP and UDP iperf servers.
All created resources are to be deleted after test.
Parameters: - ubuntu_image (obj) – ubuntu image
- flavor (obj) – nova flavor
- keypair (obj) – nova server keypair
- security_group (obj) – nova security group
- neutron_2_networks (obj) – neutron networks, subnets, router(s) resources AttrDict instance
- hypervisor_steps (obj) – instantiated nova hypervisor steps
- neutron_security_group_rule_steps (obj) – instantiated neutron security group rules steps
- server_steps (obj) – instantiated nova server steps
Returns: created resources
Return type: attrdict.AttrDict
-
stepler.neutron.conftest.neutron_2_servers_same_network(request, cirros_image, flavor, security_group, net_subnet_router, server, hypervisor_steps, server_steps)[source]¶ Function fixture to prepare environment with 2 servers.
This fixture creates router, network and subnet, connects network to router, boot 2 nova servers on different computes.
All created resources are to be deleted after test.
Can be parametrized with ‘same_host’.
Example
- @pytest.mark.parametrize(‘neutron_2_servers_same_network’,
- [‘same_host’], indirect=True)
- def test_foo(neutron_2_servers_same_network):
- # Instances will be created on the same compute
Parameters: - request (obj) – py.test SubRequest
- cirros_image (obj) – cirros image
- flavor (obj) – nova flavor
- security_group (obj) – nova security group
- net_subnet_router (tuple) – network, subnet, router
- server (obj) – nova server
- hypervisor_steps (obj) – instantiated nova hypervisor steps
- server_steps (obj) – instantiated nova server steps
Returns: created resources
Return type: attrdict.AttrDict
-
stepler.neutron.conftest.neutron_client(get_neutron_client)[source]¶ Function fixture to get neutron client wrapper.
Parameters: get_neutron_client (function) – function to get instantiated neutron client wrapper
-
stepler.neutron.conftest.neutron_conntrack_2_projects_resources(request, neutron_nets_for_projects, conntrack_cirros_image, public_flavor, sorted_hypervisors, hypervisor_steps, port_steps, create_floating_ip, get_neutron_security_group_steps, get_neutron_security_group_rule_steps, get_server_steps)[source]¶ Function fixture to prepare environment for conntrack tests.
This fixture:
- creates 2 projects;
- creates net, subnet, router in each project;
- creates security groups in each project;
- add ping + ssh rules for 1’st project’s security group;
- add ssh rules for 2’nd project security group;
- creates 2 servers in 1’st project;
- creates 2 servers in 2’nd project with same fixed ip as for 1’st
- project;
- add floating ips for one of servers in each project.
All created resources are to be deleted after test.
Parameters: - request (obj) – py.test SubRequest
- neutron_nets_for_projects (AttrDict) – neutron networks, subnets, router(s) resources AttrDict instance
- conntrack_cirros_image (obj) – glance image for conntrack tests
- public_flavor (obj) – nova flavor with is_public=True attribute
- sorted_hypervisors (list) – sorted hypervisors
- hypervisor_steps (obj) – instantiated nova hypervisor steps
- port_steps (obj) – instantiated port steps
- create_floating_ip (function) – function to create floating ip
- get_neutron_security_group_steps (function) – function to get security group steps
- get_neutron_security_group_rule_steps (function) – function to get security group rule steps
- get_server_steps (function) – function to get server steps
Returns: created resources
Return type: attrdict.AttrDict
-
stepler.neutron.conftest.neutron_create_security_group(neutron_security_group_steps)[source]¶ Callable function fixture to create security group with options.
Can be called several times during test. After the test it destroys all created security groups
Parameters: neutron_security_group_steps (object) – instantiated security groups steps Returns: function to create security group Return type: function
-
stepler.neutron.conftest.neutron_nets_for_projects(request, projects, create_network, create_subnet, create_router, router_steps, public_network)[source]¶ Function fixture to prepare environment for different projects tests.
- This fixture:
- creates net, subnet, router in each project;
- count of resources equal to count of projects;
All created resources are to be deleted after test.
Parameters: - projects (obj) – fixture of keystone projects
- create_network (function) – function to create network
- create_subnet (function) – function to create subnet
- create_router (function) – function to create router
- router_steps (obj) – instantiated router steps
- public_network (dict) – neutron public network
Returns: created resources
Return type: attrdict.AttrDict
-
stepler.neutron.conftest.neutron_quota_steps(get_neutron_quota_steps)[source]¶ Function fixture to get neutron quota steps.
Parameters: get_neutron_quota_steps (function) – function to get instantiated neutron quota steps Returns: instantiated neutron quota steps Return type: stepler.neutron.steps.QuotaSteps
-
stepler.neutron.conftest.neutron_security_group(neutron_create_security_group, neutron_security_group_rule_steps)[source]¶ Function fixture to create security group before test.
Can be called several times during test. After the test it destroys all created security groups
Parameters: - neutron_create_security_group (function) – function to create security group with options
- neutron_security_group_rule_steps (object) – instantiated security groups rules steps
Returns: security group
Return type: dict
-
stepler.neutron.conftest.neutron_security_group_rule_steps(get_neutron_security_group_rule_steps)[source]¶ Function fixture to get security group rule steps.
Parameters: get_neutron_security_group_rule_steps (function) – function to get instantiated security group rules steps Returns: - instantiated
- security group rules steps
Return type: stepler.neutron.steps.NeutronSecurityGroupRuleSteps
-
stepler.neutron.conftest.neutron_security_group_steps(get_neutron_security_group_steps, neutron_security_groups_cleanup)[source]¶ Function fixture to get neutron security group steps.
Parameters: - get_neutron_security_group_steps (function) – function to get instantiated neutron security group steps
- neutron_security_groups_cleanup (function) – function to cleanup created security groups
Returns: - instantiated neutron
security group steps
Return type:
-
stepler.neutron.conftest.neutron_security_groups_cleanup(get_neutron_security_group_steps)[source]¶ Function fixture to cleanup security groups after test.
Parameters: get_neutron_security_group_steps (function) – function to get instantiated neutron security group steps
-
stepler.neutron.conftest.port(network, subnet, create_port)[source]¶ Fixture to create port with default options before test.
-
stepler.neutron.conftest.public_network(network_steps)[source]¶ Function fixture to return public network.
Parameters: network_steps (object) – instantiated network steps Returns: public network Return type: dict
-
stepler.neutron.conftest.reschedule_router_active_l3_agent(agent_steps)[source]¶ Callable function fixture to reschedule router’s active L3 agent.
Parameters: agent_steps (obj) – instantiated neutron agent steps Returns: function to reschedule router Return type: function
-
stepler.neutron.conftest.router(request, router_steps, create_router, public_network)[source]¶ Fixture to create router with default options before test.
Parameters: - request (obj) – py.test SubRequest
- router_steps (object) – instantiated neutron steps
- create_router (function) – function to create router with options
- public_network (dict) – public network
Returns: router
Return type: dict
-
stepler.neutron.conftest.router_steps(get_router_steps)[source]¶ Function fixture to get router steps.
Parameters: get_router_steps (function) – function to get instantiated router steps Returns: instantiated router steps Return type: stepler.neutron.steps.RouterSteps
-
stepler.neutron.conftest.routers_cleanup(router_steps)[source]¶ Fixture to clear created routers after test.
It stores ids of all routers before test and removes all new routers after test.
Parameters: router_steps (obj) – instantiated neutron routers steps
-
stepler.neutron.conftest.set_dhcp_agents_count_for_net(request, get_neutron_client, os_faults_steps, patch_ini_file_and_restart_services)[source]¶ Function fixture to set DHCP agents count for network.
This fixture must be parametrized with DHCP agents count for each network.
Example
- @pytest.mark.parametrize(‘set_dhcp_agents_count_for_net’,
- [1], indirect=True)
- def test_foo(set_dhcp_agents_count_for_net):
- # Will be set 1 DHCP agent for network
Parameters: - request (obj) – py.test SubRequest
- get_neutron_client (function) – function to get instantiated neutron client wrapper
- os_faults_steps (object) – instantiated os_faults steps
- patch_ini_file_and_restart_services (function) – callable fixture to patch ini file and restart services
-
stepler.neutron.conftest.subnet(create_subnet, network)[source]¶ Fixture to create subnet with default options before test.
Parameters: - create_subnet (function) – function to create subnet with options
- network (dict) – network
Returns: subnet
Return type: dict
-
stepler.neutron.conftest.subnet_steps(get_subnet_steps)[source]¶ Function fixture to get subnet steps.
Parameters: get_subnet_steps (function) – function to get instantiated subnet steps Returns: instantiated subnet steps Return type: stepler.neutron.steps.SubnetSteps
Neutron steps¶
-
class
stepler.neutron.steps.AgentSteps(client)[source]¶ Agent steps.
-
add_network_to_dhcp_agent(dhcp_agent, network, timeout=0, check=True)[source]¶ Step to add network to DHCP agent.
Parameters: - dhcp_agent (dict) – DHCP agent to add network to
- network (dict) – network to add to DHCP agent
- timeout (int) – seconds to wait a result of check
- check (bool, optional) – flag whether to check step or not
Raises: TimeoutExpired– if check failed after timeout
-
add_router_to_l3_agent(l3_agent, router, timeout=0, check=True)[source]¶ Step to add router to L3 agent.
Parameters: - l3_agent (dict) – L3 agent to add router to
- router (dict) – router to add to L3 agent
- timeout (int) – seconds to wait a result of check
- check (bool, optional) – flag whether to check step or not
Raises: TimeoutExpired– if check failed after timeout
-
check_agents_count_for_net(network, expected_count, timeout=0)[source]¶ Step to check DHCP agents count for network.
Parameters: - network (dict) – network to check
- expected_count (int) – expected DHCP agents count for network
- timeout (int) – seconds to wait a result of check
Raises: TimeoutExpired– if agents are not aliveAssertionError– if check failed
-
check_alive(agents, must_alive=True, timeout=0)[source]¶ Verify step to check
agentsaliveness status.Parameters: - agents (list) – neutron agents to check status
- must_alive (bool, optional) – flag whether all agents should be alive or not
- timeout (int) – seconds to wait a result of check
Raises: TimeoutExpired– if check failed after timeout
-
check_l3_ha_router_rescheduled(router, old_l3_agent, timeout=0)[source]¶ Verify step to check that l3 ha router was rescheduled.
Parameters: - router (obj) – router to check
- old_l3_agent (dict) – l3 agent before rescheduling
- timeout (int) – seconds to wait a result of check
Raises: TimeoutExpired– if check failed after timeout
-
check_network_is_on_agent(network, dhcp_agent, timeout=0)[source]¶ Step to check that network is on DHCP agent.
Parameters: - network (dict) – network to check
- dhcp_agent (dict) – DHCP agent to check
- timeout (int) – seconds to wait a result of check
Raises: TimeoutExpired– if check failed after timeout
-
check_network_rescheduled(network, old_dhcp_agent, timeout=0)[source]¶ Step to check that network was rescheduled.
Parameters: - network (dict) – network to check
- old_dhcp_agent (dict) – DHCP agent before rescheduling
- timeout (int) – seconds to wait a result of check
Raises: TimeoutExpired– if check failed after timeout
-
check_router_is_on_agent(router, l3_agent, timeout=0)[source]¶ Step to check that router is on L3 agent.
Parameters: - router (dict) – router to check
- l3_agent (dict) – L3 agent to check
- timeout (int) – seconds to wait a result of check
Raises: TimeoutExpired– if check failed after timeout
-
check_router_rescheduled(router, old_l3_agent, timeout=0)[source]¶ Verify step to check that router was rescheduled.
Parameters: - router (dict) – router to check
- old_l3_agent (dict) – L3 agent before rescheduling
- timeout (int) – seconds to wait a result of check
Raises: TimeoutExpired– if check failed after timeout
-
get_agents(node=None, check=True, **kwargs)[source]¶ Step to get agents by params in ‘**kwargs’.
Parameters: - node (obj) – NodeCollection instance to get agents. If node parameter is defined, ‘host’ parameter can’t be used in **kwargs
- check (bool, optional) – flag whether to check step or not
- **kwargs – additional arguments to pass to API
Returns: neutron agents
Return type: Raises: AssertionError– if list of agents is empty
-
get_dhcp_agents_for_net(network, filter_attrs=None, check=True)[source]¶ Step to retrieve network DHCP agents dicts list.
Parameters: - network (dict) – network to get DHCP agents
- filter_attrs (dict, optional) – filter attrs dict to return only matched dhcp_agents
- check (bool, optional) – flag whether to check step or not
Returns: list of DHCP agents dicts for network
Return type: Raises: AssertionError– if list of agents is empty
-
get_dhcp_agents_not_hosting_net(network, check=True)[source]¶ Step to retrieve DHCP agents which are not hosting network.
Parameters: - network (dict) – network to get DHCP agents which can’t be used
- check (bool, optional) – flag whether to check step or not
Returns: list of DHCP agents which are not hosting network
Return type: Raises: AssertionError– if list of agents is empty
-
get_l3_agents_for_router(router, filter_attrs=None, check=True, timeout=0)[source]¶ Step to retrieve router L3 agents dicts list.
Parameters: - router (dict) – router to get L3 agents
- filter_attrs (dict, optional) – filter attrs dict to return only matched l3_agents
- check (bool, optional) – flag whether to check step or not
- timeout (int) – seconds to wait a result of check
Returns: list of L3 agents dicts for router
Return type: Raises: AssertionError– if list of agents is empty
-
remove_network_from_dhcp_agent(dhcp_agent, network, timeout=0, check=True)[source]¶ Step to remove network from DHCP agent.
Parameters: - dhcp_agent (dict) – DHCP agent to remove network from
- network (dict) – network to remove from DHCP agent
- timeout (int) – seconds to wait a result of check
- check (bool, optional) – flag whether to check step or not
Raises: TimeoutExpired– if check failed after timeout
-
remove_router_from_l3_agent(l3_agent, router, timeout=0, check=True)[source]¶ Step to remove router from L3 agent.
Parameters: - l3_agent (dict) – L3 agent to remove router from
- router (dict) – router to remove from L3 agent
- timeout (int) – seconds to wait a result of check
- check (bool, optional) – flag whether to check step or not
Raises: TimeoutExpired– if check failed after timeout
-
reschedule_network_to_dhcp_agent(target_dhcp_agent, network, timeout=0, check=True)[source]¶ Step to reschedule network’s active DHCP agent.
Parameters: - target_dhcp_agent (dict) – DHCP agent to reschedule network to
- network (dict) – network to be rescheduled
- timeout (int) – seconds to wait a result of check
- check (bool, optional) – flag whether to check step or not
Raises: TimeoutExpired– if check failed after timeout
-
reschedule_router_to_l3_agent(target_l3_agent, router, timeout=0, check=True)[source]¶ Step to reschedule router’s active L3 agent.
Parameters: - target_l3_agent (dict) – L3 agent to reschedule router to
- router (dict) – router to be rescheduled
- timeout (int) – seconds to wait a result of check
- check (bool, optional) – flag whether to check step or not
Raises: TimeoutExpired– if check failed after timeout
-
-
class
stepler.neutron.steps.FloatingIPSteps(client)[source]¶ Floating IP steps.
-
attach_floating_ip(floating_ip, port, check=True)[source]¶ Step to attach floating IP to server with neutron.
Parameters: - floating_ip (dict) – floating ip
- port (dict) – server port to attach floating ip to
- check (bool, optional) – flag whether to check this step or not
Raises: AssertionError– if check failed
-
check_negative_create_extra_floating_ip(network)[source]¶ Step to check that unable to create floating ips more than quota.
Parameters: network (obj) – network Raises: AssertionError– if no OverQuotaClient exception occurs or exception message is not expected
-
check_presence(floating_ip, must_present=True, timeout=0)[source]¶ Verify step to check floating_ip is present.
Parameters: - floating_ip (dict) – floating_ip to check presence status
- must_present (bool) – flag whether floating_ip must present or not
- timeout (int) – seconds to wait a result of check
Raises: TimeoutExpired– if check failed after timeout
-
create(network, port=None, check=True, **kwargs)[source]¶ Step to create floating_ip.
Parameters: - network (dict) – external network to create floating_ip on
- port (dict, optional) – port to associate floating ip with it. By default created floating ip is not associated with any port.
- check (bool) – flag whether to check step or not
- **kwargs – other arguments to pass to API
Returns: floating_ip
Return type: dict
Raises: AssertionError– if check failed
-
-
class
stepler.neutron.steps.NeutronSecurityGroupRuleSteps(client)[source]¶ Security group rules steps.
-
add_rule_to_group(group_id, check=True, **rule_params)[source]¶ Step to add rule to security group.
Parameters: - group_id (str) – id of security group
- check (bool) – flag whether to check step or not
- **rule_params (dict, optional) –
could be:
- direction (str): ‘egress’ or ‘ingress’
- ethertype (str): ‘IPv4’ or ‘IPv6’
- protocol (str): icmp, icmpv6, tcp, udp
- port_range_min (int|None): starting port range
- port_range_max (int|None): ending port range
- remote_ip_prefix (str): cidr
- remote-group-id (str): id or name of the remote security
- group
Raises: AssertionError– if check failed
-
add_rules_to_group(group_id, rules_params, check=True)[source]¶ Step to add rules to security group.
Parameters: - group_id (str) – id of security group
- rules_params (list of dict) – params for each rule
- check (bool) – flag whether to check step or not
Returns: security group rules
Return type: Raises: AssertionError– if check failed
-
check_negative_create_extra_group_rule(group_id, **rule_params)[source]¶ Step to check that unable to add group rules more than quota allows.
Parameters: - group_id (str) – id of security group
- **rule_params (dict, optional) – rule parameters
Raises: AssertionError– if no OverQuotaClient exception occurs or exception message is not expected
-
check_rule_presence(rule_id, group_id, must_present=True)[source]¶ Step to check rule presence for security group.
Parameters: - rule_id (str) – id of security group rule
- group_id (str) – id of security group
- must_present (bool) – flag whether rule must present or not
Raises: AssertionError– if check failed after timeout
-
delete_rule_from_group(rule_id, group_id, check=True)[source]¶ Step to delete rule from security group.
Parameters: - rule_id (str) – id of security group rule
- group_id (str) – id of security group
- check (bool) – flag whether to check step or not
Raises: AssertionError– if check failed
-
get_rules(check=True, **kwargs)[source]¶ Step to get security group rules.
Parameters: - check (bool) – flag whether to check step or not
- **kwargs – params to list security group rules
Returns: security group rules
Return type: Raises: AssertionError– if no rules found or rule belongs to unexpected security group
-
-
class
stepler.neutron.steps.NeutronSecurityGroupSteps(client)[source]¶ Neutron security group steps.
-
check_negative_create_extra_security_group()[source]¶ Step to check that unable to create security groups more than quota.
Raises: AssertionError– if no OverQuotaClient exception occurs or exception message is not expected
-
check_presence(group, must_present=True, timeout=0)[source]¶ Verify step to check security group is present.
Parameters: - group (dict) – security group to check presence status
- must_present (bool) – flag whether group must present or not
- timeout (int) – seconds to wait a result of check
Raises: TimeoutExpired– if check failed after timeout
-
create(group_name=None, description=None, check=True)[source]¶ Step to create security group.
Parameters: - group_name (str) – security group name
- description (str) – security group description
- check (bool) – flag whether to check step or not
Returns: security group
Return type: dict
-
delete(group, check=True)[source]¶ Step to delete security group.
Parameters: - group (dict) – security group
- check (bool) – flag whether to check step or not
-
get_security_groups(check=True, **kwargs)[source]¶ Step to get all security groups.
Parameters: - check (bool) – flag whether to check step or not
- **kwargs – params to list security groups
Returns: security groups
Return type: Raises: AssertionError– if group list is empty or doesn’t correspond to given filter
-
-
class
stepler.neutron.steps.NetworkSteps(client)[source]¶ Network steps.
-
check_negative_create_extra_network()[source]¶ Step to check that unable to create networks more than quota.
Raises: AssertionError– if no OverQuotaClient exception occurs or exception message is not expected
-
check_nets_count_difference_for_agents(dhcp_agents, max_difference_in_percent)[source]¶ Step to check networks count for DHCP agent.
This step verifies that the difference between max and min networks count for all DHCP agents is less than max allowed percent. Max networks count is considered to be 100%.
Parameters: - dhcp_agents (list) – list of neutron agents dicts
- max_percentage_difference (int) – max allowed percentage for difference between max and min nets counts for agents
Raises: AssertionError– if check failed
-
check_nets_count_for_agent(agent, expected_count, timeout=0)[source]¶ Step to check networks count for DHCP agent.
Parameters: - agent (dict) – neutron agent dict to check status
- expected_count (int) – expected networks count for DHCP agents
- timeout (int) – seconds to wait for a result of check
Raises: TimeoutExpired– if check failed after timeout
-
check_presence(network, must_present=True, timeout=0)[source]¶ Verify step to check network is present.
Parameters: - network (dict) – network to check presence status
- must_present (bool) – flag whether network must present or not
- timeout (int) – seconds to wait a result of check
Raises: TimeoutExpired– if check failed after timeout
-
create(network_name, check=True, **kwargs)[source]¶ Step to create network.
Parameters: - network_name (str) – network name
- check (bool) – flag whether to check step or not
- **kwargs – other arguments to pass to API
Returns: network
Return type: dict
-
delete(network, check=True)[source]¶ Step to delete network.
Parameters: - network (dict) – network
- check (bool) – flag whether to check step or not
-
get_network(check=True, **kwargs)[source]¶ Step to get network by params in ‘**kwargs’.
Parameters: - check (bool) – flag whether to check step or not
- kwargs (dict) – Params. Like: {‘router:external’: True, ‘status’: ‘ACTIVE’}
Returns: network
Return type: dict
-
get_network_by_name(name, **kwargs)[source]¶ Step to get network by name.
Parameters: - name (str) – network name
- **kwargs – other arguments to pass to API
Returns: network
Return type: dict
Raises: LookupError– if zero or more than one networks found
-
get_network_id_by_mac(mac)[source]¶ Step to get network ID by server MAC.
Parameters: mac (string) – mac address Returns: network ID Return type: string
-
get_networks(check=True, **kwargs)[source]¶ Step to get networks by params in ‘**kwargs’.
Parameters: - check (bool, optional) – flag whether to check step or not
- **kwargs – additional arguments to pass to API
Returns: neutron networks
Return type: Raises: AssertionError– if list of networks is empty
-
get_networks_for_dhcp_agent(agent, check=True)[source]¶ Step to get networks list for DHCP agent.
Parameters: - agent (dict) – neutron agent dict to check status
- check (bool, optional) – flag whether to check step or not
Returns: list of networks for agent
Return type: Raises: AssertionError– if check failed
-
-
class
stepler.neutron.steps.PortSteps(client)[source]¶ Port steps.
-
check_equal_ports(ports_1, ports_2)[source]¶ Step for comparing ports.
Parameters: Raises: AssertionError– if lists are not equal
-
check_negative_create_extra_port(network)[source]¶ Step to check that unable to create ports more than quota.
Parameters: network (obj) – network Raises: AssertionError– if no OverQuotaClient exception occurs or exception message is not expected
-
check_ports_binding_difference(ports_before, ports_after, expected_removed_count=None, expected_added_count=None)[source]¶ Step for comparing ports bindings.
Parameters: Raises: AssertionError– if actual removed or added count of bindings doesn’t equal to their expected values
-
check_ports_ids_equal(ports_1, ports_2)[source]¶ Step for comparing ports ids.
Parameters: Raises: AssertionError– if ports ids of two lists are not equal
-
check_presence(port, must_present=True, timeout=0)[source]¶ Verify step to check port is present.
Parameters: - port (dict) – neutron port to check presence status
- must_present (bool) – flag whether port must present or not
- timeout (int) – seconds to wait a result of check
Raises: TimeoutExpired– if check failed after timeout
-
create(network, check=True, **kwargs)[source]¶ Step to create port.
Parameters: - network (dict) – network to create port on
- check (bool) – flag whether to check step or not
- **kwargs – other arguments to pass to API
Returns: port
Return type: dict
-
delete(port, check=True)[source]¶ Step to delete port.
Parameters: - port (dict) – port to delete
- check (bool) – flag whether to check step or not
-
get_port(check=True, **kwargs)[source]¶ Step to get port by params in ‘**kwargs’.
Parameters: - check (bool) – flag whether to check step or not
- **kwargs – params to filter port
Returns: port
Return type: dict
Raises: LookupError– if zero or more than one networks foundAssertionError– if port attributes are wrong
-
-
class
stepler.neutron.steps.QuotaSteps(client)[source]¶ Neutron quota steps.
-
class
stepler.neutron.steps.RouterSteps(client)[source]¶ Router steps.
-
add_port_interface(router, port, check=True)[source]¶ Step to add router port interface.
Parameters: - router (dict) – router
- port (dict) – port
- check (bool) – flag whether to check step or not
-
add_subnet_interface(router, subnet, check=True)[source]¶ Step to add router to subnet interface.
Parameters: - router (dict) – router
- subnet (dict) – subnet
- check (bool) – flag whether to check step or not
-
check_gateway_presence(router, must_present=True, timeout=0)[source]¶ Verify step to check router gateway is present.
Parameters: - router (dict) – router to check gateway presence status
- must_present (bool) – flag whether router must present or not
- timeout (int) – seconds to wait a result of check
Raises: TimeoutExpired– if check failed after timeout
-
check_negative_create_extra_router()[source]¶ Step to check that unable to create routers more than quota.
Raises: AssertionError– if no OverQuotaClient exception occurs or exception message is not expected
-
check_port_interface_presence(router, port, must_present=True, timeout=0)[source]¶ Verify step to check port is in router interfaces.
Parameters: - router (dict) – router to check
- port (dict) – port to be found in router interfaces
- must_present (bool) – flag whether router should contain interface to port or not
- timeout (int) – seconds to wait a result of check
Raises: TimeoutExpired– if check failed after timeout
-
check_presence(router, must_present=True, timeout=0)[source]¶ Verify step to check router is present.
Parameters: - router (dict) – router to check presence status
- must_present (bool) – flag whether router must present or not
- timeout (int) – seconds to wait a result of check
Raises: TimeoutExpired– if check failed after timeout
-
check_router_attrs(router, **kwargs)[source]¶ Step to check whether router has expected attributes or not.
Parameters: - router (dict) – router dict
- **kwargs – attributes to check
Raises: AssertionError– if check failed
-
check_router_type_not_changed_to_centralized(router)[source]¶ Step to check router is not updated from distributed to centralized.
Parameters: router (dict) – router dict Raises: AssertionError– if BadRequest is not appeared or exception message is unexpected.
-
check_routers_count_for_agent(agent, expected_count, timeout=0)[source]¶ Step to check routers count for L3 agent.
Parameters: - agent (dict) – neutron agent dict to check routers count
- expected_count (int) – expected routers count for L3 agent
- timeout (int) – seconds to wait a result of check
Raises: AssertionError– if check failed
-
check_subnet_interface_presence(router, subnet, must_present=True, timeout=0)[source]¶ Verify step to check subnet is in router interfaces.
Parameters: - router (dict) – router to check
- subnet (dict) – subnet to be found in router interfaces
- must_present (bool) – flag whether router should contain interface to subnet or not
- timeout (int) – seconds to wait a result of check
Raises: TimeoutExpired– if check failed after timeout
-
check_type_unchangeable_for_active_router(router)[source]¶ Step to check that router type can’t be changed for active router.
Parameters: router (dict) – router dict Raises: AssertionError– if BadRequest is not appeared or exception message is unexpected.
-
clear_gateway(router, check=True)[source]¶ Step to clear router gateway.
Parameters: - router (dict) – router
- check (bool) – flag whether to check step or not
-
create(router_name, distributed=None, check=True, **kwargs)[source]¶ Step to create router.
Parameters: - router_name (str) – router name
- distributed (bool) – should router be distributed
- check (bool) – flag whether to check step or not
- **kwargs – other arguments to pass to API
Returns: router
Return type: dict
-
delete(router, check=True)[source]¶ Step to delete router.
Parameters: - router (dict) – router
- check (bool) – flag whether to check step or not
-
get_router(**kwargs)[source]¶ Step to get router.
Parameters: **kwargs – filter to match router Returns: router Return type: dict Raises: LookupError– if zero or more than one routers found
-
get_routers(check=True)[source]¶ Step to retrieve all routers in current project.
Parameters: check (bool) – flag whether to check step or not Returns: list of retrieved routers Return type: list
-
remove_port_interface(router, port, check=True)[source]¶ Step to remove router port interface.
After this, port can be also deleted.
Parameters: - router (dict) – router
- port (dict) – port
- check (bool) – flag whether to check step or not
-
remove_subnet_interface(router, subnet, check=True)[source]¶ Step to remove router to subnet interface.
Parameters: - router (dict) – router
- subnet (dict) – subnet
- check (bool, optional) – flag whether to check step or not
-
-
class
stepler.neutron.steps.SubnetSteps(client)[source]¶ Subnet steps.
-
check_negative_create_extra_subnet(network)[source]¶ Step to check that unable to create subnets more than quota.
Parameters: network (obj) – network Raises: AssertionError– if no OverQuotaClient exception occurs or exception message is not expected
-
check_presence(subnet, must_present=True, timeout=0)[source]¶ Verify step to check subnet is present.
Parameters: - subnet (dict) – subnet to check presence status
- must_present (bool) – flag whether subnet must present or not
- timeout (int) – seconds to wait a result of check
Raises: TimeoutExpired– if check failed after timeout
-
create(subnet_name, network, cidr, check=True, **kwargs)[source]¶ Step to create subnet.
Parameters: - subnet_name (str) – subnet name
- network (dict) – network to create subnet on
- cidr (str) – cidr for subnet (like 192.168.1.0/24””)
- check (bool) – flag whether to check step or not
- **kwargs – other arguments to pass to API
Returns: subnet
Return type: dict
-
Neutron tests¶
Neutron l3 agent tests¶
-
stepler.neutron.tests.test_l3_agent.test_ban_all_l3_agents_restart_one(cirros_image, flavor, security_group, neutron_2_servers_diff_nets_with_floating, floating_ip, server_steps, os_faults_steps, agent_steps, agent_number)[source]¶ Scenario: Ban all l3-agent agents and restart one.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network_1 with subnet_1 and router_1
- Create server_1
- Create network_2 with subnet_2
- Create server_2 on another compute and connect it to network_2
- Assign floating ips to servers
Steps:
- Check that ping from server_1 to server_2 with floating ips
- and 8.8.8.8 is successful
- Check that there is no ping between server_1 and server_2 via
- internal ips.
- Get node with l3 agent for router_1
- Ban l3 agent for the node with pcs
- Wait for l3 agent becoming dead
- Check that router_1 was rescheduled
- Repeat last 3 steps for all l3 agents except for one
- Ban the remaining l3 agent
- Wait for l3 agent becoming dead if agent_number is not 0
- Clear the first/last banned l3 agent
- Wait for l3 agent becoming active
- Boot server_3 in network_1
- Associate floating ip for server_3
- Ping server_1 and server_3 from each other with both ips
- Ping server_2 and server_3 from each other with floating ip
- Check that ping from server_1 to 8.8.8.8 is successful
- Check that ping from server_3 to 8.8.8.8 is successful
Teardown:
- Delete servers
- Delete networks, subnets, routers
- Delete floating IPs
- Delete security group
- Delete cirros image
- Delete flavor
-
stepler.neutron.tests.test_l3_agent.test_ban_l3_agent_many_times(cirros_image, flavor, security_group, floating_ip, neutron_2_servers_diff_nets_with_floating, server_steps, os_faults_steps, agent_steps)[source]¶ Scenario: Ban l3-agent many times.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network_1 with subnet_1 and router_1
- Create server_1
- Create network_2 with subnet_2
- Create server_2 on another compute and connect it to network_2
- Assign floating ips to servers
Steps:
- Ping server_1 and server_2 from each other with floatings ip
- Ban all l3 agents except for one
- Ban active l3 agent
- Wait for l3 agent becoming dead
- Clear l3 agent from the previous step
- Wait for l3 agent becoming active
- Repeat last 4 steps 40 times
- Boot server_3 in network_1
- Associate floating ip for server_3
- Ping server_1 and server_3 from each other with both ips
- Ping server_2 and server_3 from each other with floating ip
- Check that ping from server_1 to 8.8.8.8 is successful
- Check that ping from server_3 to 8.8.8.8 is successful
Teardown:
- Delete servers
- Delete networks, subnets, routers
- Delete floating IPs
- Delete security group
- Delete cirros image
- Delete flavor
-
stepler.neutron.tests.test_l3_agent.test_ban_some_l3_agents(cirros_image, flavor, security_group, neutron_2_servers_diff_nets_with_floating, floating_ip, server_steps, os_faults_steps, agent_steps, ban_count)[source]¶ Scenario: Ban l3-agent and check that ping is available.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network_1 with subnet_1 and router1
- Create server_1
- Create network_2 with subnet_2
- Create server_2 on another compute and connect it to network_2
- Assign floating ips to servers
Steps:
- Ping server_1 and server_2 from each other with floatings ip
- Get node with l3 agent for router_1
- Ban l3 agent for the node with pcs
- Wait for l3 agent becoming dead
- Check that router_1 was rescheduled
- Repeat last 4 steps if ban_count is 2
- Boot server_3 in network_1
- Associate floating ip for server_3
- Ping server_1 and server_3 from each other with internal ip
- Ping server_2 and server_1 from each other with floating ip
- Ping server_2 and server_3 from each other with floating ip
Teardown:
- Delete servers
- Delete networks, subnets, routers
- Delete floating IPs
- Delete security group
- Delete cirros image
- Delete flavor
-
stepler.neutron.tests.test_l3_agent.test_check_l3_agent_after_destroy_controller(cirros_image, flavor, security_group, floating_ip, neutron_2_servers_diff_nets_with_floating, get_neutron_client, os_faults_steps, agent_steps, router_steps, server_steps, controller_cmd)[source]¶ Scenario: Destroy controller and check L3 agent is alive.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network_1 with subnet_1 and router_1
- Create server_1
- Create network_2 with subnet_2
- Create server_2 on another compute and connect it to network_2
- Assign floating ips to servers
Steps:
- Get primary/non-primary controller
- Get L3 agent for primary/non-primary controller node
- Reschedule router_1 to L3 agent on primary/non-primary
- controller if it is not there yet
- Ping server_1 and server_2 from each other with floatings ip
- Check that ping from server_1 and server_2 to 8.8.8.8 is successful
- Destroy primary/non-primary controller
- Wait for neutron availability
- Wait for L3 agent becoming dead
- Check that all routers rescheduled from primary/non-primary controller
- Boot server_3 in network_1
- Associate floating ip for server_3
- Ping server_1 and server_3 from each other with both ips
- Ping server_2 and server_3 from each other with floating ip
- Check that ping from server_1 to 8.8.8.8 is successful
- Check that ping from server_3 to 8.8.8.8 is successful
Teardown:
- Delete servers
- Delete networks, subnets, routers
- Delete floating IPs
- Delete security group
- Delete cirros image
- Delete flavor
-
stepler.neutron.tests.test_l3_agent.test_check_l3_agent_after_reset_primary_controller(cirros_image, flavor, security_group, floating_ip, neutron_2_servers_diff_nets_with_floating, get_neutron_client, os_faults_steps, agent_steps, router_steps, server_steps)[source]¶ Scenario: Reset controller and check L3 agent is alive.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network_1 with subnet_1 and router_1
- Create server_1
- Create network_2 with subnet_2
- Create server_2 on another compute and connect it to network_2
- Assign floating ips to servers
Steps:
- Get primary controller
- Get L3 agent for primary controller node
- Reschedule router_1 to L3 agent on primary controller
- if it is not there yet
- Ping server_1 and server_2 from each other with floatings ip
- Check that ping from server_1 and server_2 to 8.8.8.8 is successful
- Reset or reboot primary controller
- Wait for neutron availability
- Wait for L3 agent becoming dead
- Check that all routers rescheduled from primary controller
- Boot server_3 in network_1
- Associate floating ip for server_3
- Ping server_1 and server_3 from each other with both ips
- Ping server_2 and server_3 from each other with floating ip
- Check that ping from server_1 to 8.8.8.8 is successful
- Check that ping from server_3 to 8.8.8.8 is successful
Teardown:
- Delete servers
- Delete networks, subnets, routers
- Delete floating IPs
- Delete security group
- Delete cirros image
- Delete flavor
-
stepler.neutron.tests.test_l3_agent.test_kill_l3_agent_process(cirros_image, flavor, security_group, floating_ip, neutron_2_servers_diff_nets_with_floating, server_steps, os_faults_steps, agent_steps)[source]¶ Scenario: Kill l3-agent process and check that ping is available.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network_1 with subnet_1 and router1
- Create server_1
- Create network_2 with subnet_2
- Create server_2 on another compute and connect it to network_2
- Assign floating ips to servers
Steps:
- Ping server_1 and server_2 from each other with floatings ip
- Get node with l3 agent for router_1
- Get PID of l3 agent process
- Send SIGKILL to the process
- Wait for l3 agent becoming active
- Boot server_3 in network_1
- Associate floating ip for server_3
- Ping server_1 and server_3 from each other with internal ip
- Ping server_2 and server_1 from each other with floating ip
- Ping server_2 and server_3 from each other with floating ip
Teardown:
- Delete servers
- Delete networks, subnets, routers
- Delete floating IPs
- Delete security group
- Delete cirros image
- Delete flavor
-
stepler.neutron.tests.test_l3_agent.test_l3_agent_after_drop_rabbit_port(neutron_2_servers_diff_nets_with_floating, server_steps, os_faults_steps, agent_steps)[source]¶ Scenario: Drop rabbit port and check l3-agent work.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network_1 with subnet_1 and router_1
- Create server_1
- Create network_2 with subnet_2
- Create server_2 on another compute and connect it to network_2
- Assign floating ips to servers
Steps:
- Ping server_1 and server_2 from each other with floatings ip
- Get node with l3 agent for router_1
- Drop rabbit’s port 5673 using iptables
- Wait for l3 agent becoming dead
- Check that router_1 was rescheduled
- Ping server_1 and server_2 from each other with floatings ip
- Remove rule for dropping port using iptables
- Wait for l3 agent becoming active
Teardown:
- Delete servers
- Delete networks, subnets, routers
- Delete floating IPs
- Delete security group
- Delete cirros image
- Delete flavor
Neutron DHCP agent tests¶
-
stepler.neutron.tests.test_dhcp_agent.test_ban_all_dhcp_agents_restart_first(network, floating_ip, server, server_steps, os_faults_steps, agent_steps, network_steps)[source]¶ Scenario: Ban all DHCP agents and restart the first banned.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and router
- Create floating ip
- Create server
Steps:
- Assign floating ip to server
- Check DHCP with cirros-dhcpc command on server with sudo
- Get free DHCP agents
- Get nodes with free DHCP agents
- Ban all free DHCP agents for nodes with pcs
- Kill all dnsmasq processes for nodes
- Wait for DHCP agents becoming dead
- Get 2 nodes with DHCP agents for network
- Ban 2 DHCP agents for nodes with pcs
- Kill all dnsmasq processes for nodes
- Wait for DHCP agents becoming dead
- Get node for the first banned dhcp-agent
- Clear the first banned dhcp-agent
- Check that cleared dhcp-agent is active
- Check that all dhcp-agents except for the first banned
- don’t in dhcp-agents list for network
- Check that network is on the dhcp-agent which has been cleared
- Check that all networks except for external are
- on the cleared dhcp-agent
- Check DHCP with cirros-dhcpc command on server with sudo
Teardown:
- Delete server
- Delete floating ip
- Delete network, subnet, router
- Delete security group
- Delete flavor
- Delete cirros image
-
stepler.neutron.tests.test_dhcp_agent.test_ban_all_dhcp_agents_restart_one(network, floating_ip, server, server_steps, os_faults_steps, agent_steps, network_steps)[source]¶ Scenario: Ban all DHCP agents and restart the last banned.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and router
- Create floating ip
- Create server
Steps:
- Assign floating ip to server
- Check DHCP with cirros-dhcpc command on server with sudo
- Get all existing DHCP agents
- Get 2 nodes with DHCP agents for network
- Ban 2 DHCP agents for nodes with pcs
- Wait for DHCP agents becoming dead
- Check that banned dhcp-agents don’t in dhcp-agents list
- for network
- Get new node with DHCP agent for network
- Ban DHCP agent for node with pcs
- Wait for DHCP agent becoming dead
- Check that banned dhcp-agent is dead
- Repeat last 4 steps for all active DHCP agents
- Clear the last banned dhcp-agent
- Check that cleared dhcp-agent is active
- Check that network is on the dhcp-agent which has been cleared
- Check DHCP with cirros-dhcpc command on server with sudo
- Check that all networks except for external are
- on the cleared dhcp-agent
Teardown:
- Delete server
- Delete floating ip
- Delete network, subnet, router
- Delete security group
- Delete flavor
- Delete cirros image
-
stepler.neutron.tests.test_dhcp_agent.test_ban_dhcp_agent_many_times(network, floating_ip, server, server_steps, os_faults_steps, agent_steps)[source]¶ Scenario: Ban dhcp-agent many times.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and router
- Create floating ip
- Create server
Steps:
- Assign floating ip to server
- Check DHCP with cirros-dhcpc command on server with sudo
- Get nodes with DHCP agents not hosting network
- Ban all DHCP agents not hosting network
- Wait for banned DHCP agents becoming dead
- Get node with DHCP agent for network
- Ban DHCP agent for network with pcs
- Clear DHCP agent for network with pcs
- Repeat last 2 steps 40 times
- Check that neutron agent from the previous step is alive
- Check that network is on 2 health DHCP-agents
- Check DHCP with cirros-dhcpc command on server with sudo
Teardown:
- Delete server
- Delete floating ip
- Delete network, subnet, router
- Delete security group
- Delete flavor
- Delete cirros image
-
stepler.neutron.tests.test_dhcp_agent.test_ban_some_dhcp_agents(network, floating_ip, server, server_steps, os_faults_steps, agent_steps, ban_count)[source]¶ Scenario: Ban dhcp-agent and check cirros-dhcpc command on server.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and router
- Create floating ip
- Create server
Steps:
- Assign floating ip to server
- Check DHCP with cirros-dhcpc command on server with sudo
- Get node with DHCP agent for network
- Ban DHCP agent for the node with pcs
- Wait for DHCP agent becoming dead
- Check that killed dhcp-agent does not in dhcp-agents list
- for network
- Repeat last 4 steps if ban_count is 2
- Check that this network is on another health dhcp-agent
- Check DHCP with cirros-dhcpc command on server with sudo
Teardown:
- Delete server
- Delete floating ip
- Delete network, subnet, router
- Delete security group
- Delete flavor
- Delete cirros image
-
stepler.neutron.tests.test_dhcp_agent.test_ban_two_dhcp_and_two_l3_agents(router, create_max_networks_with_instances, agent_steps, os_faults_steps)[source]¶ Scenario: Ban two DHCP and L3 agents and check logs.
- Note:
- This test verifies bug #1493754 and #1651442
Setup:
- Increase neutron quotas
- Create cirros image
- Create flavor
- Create security group
Steps:
- Get all controllers
- Get the last line number for neutron server log for all controllers
- Create max possible count of networks, connect all networks
- to router with external network
- Create and delete server for each network
- Get nodes with DHCP agents for network
- Ban DHCP agents for nodes with pcs
- Wait for DHCP agents becoming dead
- Check that banned dhcp-agents don’t in dhcp-agents list
- for network
- Get node with l3 agent for router
- Ban l3 agent for the node with pcs
- Wait for l3 agent becoming dead
- Repeat last 3 steps once
- Check that router rescheduled from l3 agents
- Check there are no new ERROR logs in neutron-server log files
Teardown:
- Delete all created networks, subnets and router
- Delete security group
- Delete flavor
- Delete cirros image
-
stepler.neutron.tests.test_dhcp_agent.test_change_default_dhcp_agents_count_for_net(network, server, floating_ip, server_steps, os_faults_steps, agent_steps, agents_count_for_net)[source]¶ Scenario: Change default DHCP agents count for network.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and router
- Create floating ip
- Create server
Steps:
- Assign floating ip to server
- Check DHCP with cirros-dhcpc command on server with sudo
- Check that agents count is the same as expected
- Get all DHCP agents count
- Get node with DHCP agent for network
- Ban DHCP agent for node with pcs
- Wait for DHCP agent becoming dead
- Check that banned dhcp-agent doesn’t in dhcp-agents list
- for network
- Check that agents count equals to the value from config or to
- free agents count
- Repeat last 5 steps for all active DHCP agents except for one
- Get node with DHCP agent for network
- Ban DHCP agent for node with pcs
- Wait for DHCP agent becoming dead
- Clear the last banned dhcp-agent
- Check that cleared dhcp-agent is active
- Check that network is on the one dhcp-agent which has been cleared
- Check DHCP with cirros-dhcpc command on server with sudo
Teardown:
- Delete server
- Delete floating ip
- Delete network, subnet, router
- Delete security group
- Delete flavor
- Delete cirros image
-
stepler.neutron.tests.test_dhcp_agent.test_check_dhcp_agents_for_net_after_restart(router, create_max_networks_with_instances, agent_steps, os_faults_steps)[source]¶ Scenario: Check dhcp-agents assinged to network after restart.
- Note:
- This test verifies bug #1506198
Setup:
- Increase neutron quotas
- Create cirros image
- Create flavor
- Create security group
Steps:
- Create max possible count of networks, connect all networks
- to router with external network
- Create and delete server for each network
- Check DHCP agents count for the first network
- Get all nodes with DHCP agents
- Disable all DHCP agents
- Wait for DHCP agents becoming dead
- Enable all DHCP agents
- Wait for DHCP agents becoming alive
- Check that DHCP agents count for the first network is the same
- as before restart
Teardown:
- Delete all created networks, subnets and router
- Delete security group
- Delete flavor
- Delete cirros image
-
stepler.neutron.tests.test_dhcp_agent.test_check_nets_count_for_agents_nearly_equals(router, create_max_networks_with_instances, network_steps, agent_steps)[source]¶ Scenario: Check that nets count for DHCP agents nearly equals.
Setup:
- Increase neutron quotas
- Create cirros image
- Create flavor
- Create security group
Steps:
- Create max possible count of networks, connect all networks
- to router with external network
- Create and delete server for each network
- Check that quantity of nets on DHCP agents is nearly the same
Teardown:
- Delete all created networks, subnets and router
- Delete security group
- Delete flavor
- Delete cirros image
-
stepler.neutron.tests.test_dhcp_agent.test_check_port_binding_after_node_restart(router, create_max_networks_with_instances, get_neutron_client, port_steps, agent_steps, os_faults_steps)[source]¶ Scenario: Check port binding after node restart.
- Note:
- This test verifies bug #1501070
Setup:
- Increase neutron quotas
- Create cirros image
- Create flavor
- Create security group
Steps:
- Create max possible count of networks, connect all networks
- to router with external network
- Create and delete server for each network
- Check ports on the first network
- Check host binding for all ports
- Get DHCP agent for the first network
- Get node with DHCP agent for network
- Destroy node with DHCP agent
- Wait for neutron availability
- Wait for DHCP agent becoming dead
- Start node with DHCP agent
- Wait for DHCP agent becoming alive
- Check ports on network
- Check that ports ids are the same as before destroying node
- Check that network rescheduled from one DHCP agent to another
- and only one host binding changed after restart.
Teardown:
- Delete all created networks, subnets and router
- Delete security group
- Delete flavor
- Delete cirros image
-
stepler.neutron.tests.test_dhcp_agent.test_check_tap_interfaces_for_net_after_restart(router, create_max_networks_with_instances, port_steps, agent_steps, os_faults_steps)[source]¶ Scenario: Check all taps ids are unique after DHCP agents restart.
- Note:
- This test verifies bug #1499914
Setup:
- Increase neutron quotas
- Create cirros image
- Create flavor
- Create security group
Steps:
- Create max possible count of networks, connect all networks
- to router with external network
- Create and delete server for each network
- Get all DHCP ports
- Get all nodes with DHCP agents
- Disable all DHCP agents
- Wait for DHCP agents becoming dead
- Make all DHCP ports ‘reserved_dhcp_port’
- Enable all DHCP agents
- Wait for DHCP agents becoming alive
- Check all taps ids are unique for all networks on all controllers
Teardown:
- Delete all created networks, subnets and router
- Delete security group
- Delete flavor
- Delete cirros image
-
stepler.neutron.tests.test_dhcp_agent.test_destroy_controller_check_dhcp(network, server, floating_ip, get_network_steps, server_steps, os_faults_steps, agent_steps, controller_cmd)[source]¶ Scenario: Destroy controller and check DHCP.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and router
- Create floating ip
- Create server
Steps:
- Assign floating ip to server
- Get primary/non-primary controller
- Get DHCP agent for primary/non-primary controller node
- Reschedule network to DHCP agent on primary/non-primary
- controller if it is not there yet
- Check DHCP with cirros-dhcpc command on server with sudo
- Destroy primary/non-primary controller
- Wait for neutron availability
- Wait for primary/non-primary controller’s DHCP agent becoming dead
- Check that dhcp-agent does not in dhcp-agents list for network
- Check that network is on 2 healthy agents
- Check that all networks rescheduled from primary/non-primary
- controller
- Check DHCP with cirros-dhcpc command on server with sudo
Teardown:
- Delete server
- Delete floating ip
- Delete network, subnet, router
- Delete security group
- Delete flavor
- Delete cirros image
-
stepler.neutron.tests.test_dhcp_agent.test_dhcp_agent_after_drop_rabbit_port(network, floating_ip, server, server_steps, os_faults_steps, agent_steps)[source]¶ Scenario: Drop rabbit port and check dhcp-agent work.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and router
- Create floating ip
- Create server
Steps:
- Assign floating ip to server
- Check DHCP with cirros-dhcpc command on server with sudo
- Get node with DHCP agent for network
- Drop rabbit’s port 5673 using iptables for node from the previous step
- Wait for DHCP agent becoming dead
- Check that dhcp-agent does not in dhcp-agents list for network
- Check that network is on 2 health DHCP-agents
- Check DHCP with cirros-dhcpc command on server with sudo
- Remove rule for dropping port using iptables
- Check that all neutron agents are alive
Teardown:
- Delete server
- Delete floating ip
- Delete network, subnet, router
- Delete security group
- Delete flavor
- Delete cirros image
-
stepler.neutron.tests.test_dhcp_agent.test_dhcp_alive_after_primary_controller_reset(network, server, floating_ip, get_network_steps, server_steps, os_faults_steps, agent_steps)[source]¶ Scenario: Reset primary controller and check DHCP is alive.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and router
- Create floating ip
- Create server
Steps:
- Assign floating ip to server
- Get primary controller
- Get DHCP agent for primary controller node
- Reschedule network to DHCP agent on primary controller
- if it is not there yet
- Check DHCP with cirros-dhcpc command on server with sudo
- Reset primary controller
- Wait for neutron availability
- Wait for primary controller’s DHCP agent becoming dead
- Check that dhcp-agent does not in dhcp-agents list for network
- Check that all networks rescheduled from primary controller
- Check DHCP with cirros-dhcpc command on server with sudo
Teardown:
- Delete server
- Delete floating ip
- Delete network, subnet, router
- Delete security group
- Delete flavor
- Delete cirros image
-
stepler.neutron.tests.test_dhcp_agent.test_kill_check_dhcp_agents(network, floating_ip, server, server_steps, os_faults_steps, agent_steps)[source]¶ Scenario: Kill process and check dhcp-agents.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and router
- Create floating ip
- Create server
Steps:
- Assign floating ip to server
- Check DHCP on cirros-dhcpc command on server with sudo
- Get node with DHCP agent for network
- Kill dhcp-agent process
- Wait and check that dhcp agent has status active
- Check that network is on the health dhcp-agents
- Check DHCP on cirros-dhcpc command on server with sudo
Teardown:
- Delete server
- Delete floating ip
- Delete network, subnet, router
- Delete security group
- Delete flavor
- Delete cirros image
-
stepler.neutron.tests.test_dhcp_agent.test_manually_rescheduling_dhcp_agent(network, floating_ip, server, server_steps, port_steps, agent_steps)[source]¶ Scenario: Manually reschedule dhcp-agent.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and router
- Create floating ip
- Create server
Steps:
- Assign floating ip to server
- Check DHCP on cirros-dhcpc command on server with sudo
- Get node with DHCP agent for network
- Check ports on net
- Reschedule network from DHCP agent
- Check that the network is moved from this dhcp-agent
- Set network to another dhcp-agent
- Check that the network moved to this dhcp-agent
- Check that ports haven’t been changed
Teardown:
- Delete server
- Delete floating ip
- Delete network, subnet, router
- Delete security group
- Delete flavor
- Delete cirros image
Neutron OVS restart tests¶
-
stepler.neutron.tests.test_ovs_restart.test_no_connectivity_with_different_routers_during_restart(neutron_2_servers_different_networks, floating_ip, server_steps, os_faults_steps, agent_steps)[source]¶ Scenario: Check connectivity between networks on different routers.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network_1 with subnet_1 and router_1
- Create network_2 with subnet_2 and router_2
- Create server_1
- Create server_2 on another compute and connect it to network_2
- Create floating ip
Steps:
- Attach floating IP to server_1
- Check that there is no ping between server_1 and server_2
- Restart ovs-agents
- Check that there is no ping between server_1 and server_2 during restart
Teardown:
- Delete servers
- Delete networks, subnets, routers
- Delete floating IP
- Delete security group
- Delete cirros image
- Delete flavor
Check that ports tags are the same after ovs-agents restart.
Steps:
- Collect ovs-vsctl tags before restart
- Restart ovs-agents
- Collect ovs-vsctl tags after restart
- Check that values of the tag parameter for every port remain the same
-
stepler.neutron.tests.test_ovs_restart.test_restart_adds_new_flows(server, os_faults_steps, agent_steps)[source]¶ Scenario: Check that new flows are added after OVS-agents restart.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and router
- Create server
Steps:
- Get list of flows for br_int on server’s compute
- Check that all cookies for flows is same
- Restart ovs-agents
- Get list of flows for br_int on server’s compute
- Check that all cookies are changed
Teardown:
- Delete servers
- Delete network, subnet, router
- Delete floating IP
- Delete security group
- Delete cirros image
- Delete flavor
-
stepler.neutron.tests.test_ovs_restart.test_restart_many_times(neutron_2_servers_different_networks, floating_ip, server_steps, os_faults_steps, agent_steps)[source]¶ Scenario: Restart OVS-agents many times.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network_1 with subnet_1 and router
- Create server_1
- Create floating ip
- Create network_2 with subnet_2
- Add network_2 interface to router
- Create server_2 on another compute and connect it to network_2
Steps:
- Attach floating IP to server_1
- Start ping from server_1 to server_2
- Restart ovs-agents
- Check that ping loss is not more than 2
- Repeat last 3 steps 40 times
Teardown:
- Delete servers
- Delete networks, subnets, router
- Delete floating IP
- Delete security group
- Delete cirros image
- Delete flavor
-
stepler.neutron.tests.test_ovs_restart.test_restart_servers_on_single_compute(neutron_2_servers_same_network, floating_ip, server_steps, os_faults_steps, agent_steps)[source]¶ Scenario: Check connectivity for same host servers and one network.
This test checks connectivity for instances scheduled on a single compute in a single private network during OVS-agents restating.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and router
- Create server_1
- Create floating ip
- Create server_2 on same compute as server_1 and connect it to network
Steps:
- Attach floating IP to server_1
- Start arping from server_1 to server_2
- Restart ovs-agents
- Check that ping loss is not more than 50
Teardown:
- Delete servers
- Delete network, subnet, router
- Delete floating IP
- Delete security group
- Delete cirros image
- Delete flavor
-
stepler.neutron.tests.test_ovs_restart.test_restart_with_broadcast_traffic(neutron_2_servers_same_network, floating_ip, server_steps, os_faults_steps, agent_steps)[source]¶ Scenario: Restart OVS-agents with broadcast traffic on background.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and router
- Create server_1
- Create floating ip
- Create server_2 on another compute and connect it to network
Steps:
- Attach floating IP to server_1
- Start arping from server_1 to server_2
- Restart ovs-agents
- Check that ping loss is not more than 50
Teardown:
- Delete servers
- Delete network, subnet, router
- Delete floating IP
- Delete security group
- Delete cirros image
- Delete flavor
-
stepler.neutron.tests.test_ovs_restart.test_restart_with_iperf_traffic(neutron_2_servers_iperf_different_networks, floating_ip, server_steps, os_faults_steps, agent_steps)[source]¶ Scenario: Restart OVS-agents with broadcast traffic on background.
Setup:
- Create ubuntu image
- Create flavor
- Create security group
- Create network with subnet and router
- Create network_2 with subnet_2
- Create server_1
- Create server_2 on another compute and connect it to network
- Create floating ip
Steps:
- Attach floating IP to server_1
- Start iperf traffic from server_1 to server_2, wait it done
- Check that iperf loss is close to 0
- Start iperf traffic from server_1 to server_2
- Restart ovs-agents
- Check that iperf loss is not more than 10%
Teardown:
- Delete servers
- Delete network, subnet, router
- Delete floating IP
- Delete security group
- Delete ubuntu image
- Delete flavor
-
stepler.neutron.tests.test_ovs_restart.test_restart_with_pcs_ban_clear(neutron_2_servers_different_networks, floating_ip, server_steps, os_faults_steps)[source]¶ Scenario: Restart OVS-agents with pcs ban/clear on controllers.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network_1 with subnet_1 and router
- Create server_1
- Create floating ip
- Create network_2 with subnet_2
- Add network_2 interface to router
- Create server_2 on another compute and connect it to network_2
Steps:
- Attach floating IP to server_1
- Check ping from server_1 to server_2
- Restart ovs-agents with pcs ban/clear on controllers
- Check ping from server_1 to server_2
Teardown:
- Delete servers
- Delete networks, subnets, router
- Delete floating IP
- Delete security group
- Delete cirros image
- Delete flavor
-
stepler.neutron.tests.test_ovs_restart.test_restart_with_pcs_disable_enable(neutron_2_servers_different_networks, floating_ip, server_steps, os_faults_steps)[source]¶ Scenario: Restart OVS-agents with pcs disable/enable on controllers.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network_1 with subnet_1 and router
- Create server_1
- Create floating ip
- Create network_2 with subnet_2
- Add network_2 interface to router
- Create server_2 on another compute and connect it to network_2
Steps:
- Attach floating IP to server_1
- Check ping from server_1 to server_2
- Restart ovs-agents with pcs enable/disable on controllers
- Check ping from server_1 to server_2
Teardown:
- Delete servers
- Delete networks, subnets, router
- Delete floating IP
- Delete security group
- Delete cirros image
- Delete flavor
Neutron DVR tests¶
-
stepler.neutron.tests.test_dvr.test_add_router_interface_with_port_id(create_router, port, router_steps, os_faults_steps)[source]¶ Scenario: Add router interface with port_id parameter.
This test checks that there are no error messages in logs when adding router interface with port_id parameter.
Setup:
- Create network with subnet
- Create port
Steps:
- Get current sizes of neutron log files on controllers
- Create router of distributed type
- Add port interface to router
- Wait for 30 seconds
- Check that message ‘Could not retrieve gateway port for subnet’
- did not appear in log files
Teardown:
- Delete port interface
- Delete port
- Delete router
- Delete subnet and network
-
stepler.neutron.tests.test_dvr.test_associate_floating_ip_after_restart_l3_on_compute(cirros_image, flavor, security_group, net_subnet_router, server, floating_ip, create_floating_ip, os_faults_steps, server_steps)[source]¶ Scenario: Check floating ip association after restart l3 agent.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and DVR
- Add network interface to router
- Create server
Steps:
- Assign floating ip to server
- Check that ping from server to 8.8.8.8 is successful
- Restart L3 service on compute with server
- Boot server_2 on the compute where the l3-agent has been restarted
- Assign floating ip to server_2
- Check pings between server and server_2 via floating ip
Teardown:
- Delete servers
- Delete cirros image
- Delete security group
- Delete flavor
- Delete router
- Delete subnet
- Delete network
-
stepler.neutron.tests.test_dvr.test_check_ban_l3_agent_on_node_with_snat(net_subnet_router, server, get_ssh_proxy_cmd, agent_steps, os_faults_steps, server_steps, ban_count)[source]¶ Scenario: Check North-South after ban L3 agent on node with SNAT.
- This test checks North-South connectivity without floating after ban L3
- agent on node with SNAT.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and DVR
- Add network interface to router
- Create server
Steps:
- Check that ping from server to 8.8.8.8 is successful
- Find node with SNAT for router and ban L3 agent on it
- Wait for another L3 agent becomes ACTIVE
- Repeat last 2 steps
ban_counttimes - Check that ping from server to 8.8.8.8 is successful
Teardown:
- Delete server
- Delete cirros image
- Delete security group
- Delete flavor
- Delete router
- Delete subnet
- Delete network
-
stepler.neutron.tests.test_dvr.test_check_ban_l3_agents_and_clear_one(net_subnet_router, server, get_ssh_proxy_cmd, agent_steps, os_faults_steps, server_steps, agent_number)[source]¶ Scenario: Check North-South after ban L3 agent on node with SNAT.
- This test checks North-South connectivity without floating after ban all
- L3 agents on nodes with SNAT and clear the first/last one.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and DVR
- Add network interface to router
- Create server
Steps:
- Check that ping from server to 8.8.8.8 is successful
- Find node with snat for router and ban L3 agent on it
- Wait for another L3 agent becomes ACTIVE
- Repeat last 2 steps while no L3 agents will be ACTIVE
- Clear the first/last banned L3 agent
- Wait for L3 agent becomes ACTIVE
- Check that ping from server to 8.8.8.8 is successful
Teardown:
- Delete server
- Delete cirros image
- Delete security group
- Delete flavor
- Delete router
- Delete subnet
- Delete network
-
stepler.neutron.tests.test_dvr.test_check_connectivity_to_north_south_routing(server, floating_ip, server_steps)[source]¶ Scenario: Check connectivity to North-South-Routing.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and DVR
- Add network interface to router
- Create server
Steps:
- Assign floating ip to server
- Check that ping from server to 8.8.8.8 is successful
Teardown:
- Delete server
- Delete cirros image
- Delete security group
- Delete flavor
- Delete router
- Delete subnet
- Delete network
-
stepler.neutron.tests.test_dvr.test_check_east_west_connectivity_between_instances(neutron_2_servers_different_networks, floating_ip, server_steps)[source]¶ Scenario: Check east-west connectivity between instances.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network_1 with subnet_1 and DVR
- Create server_1
- Create network_2 with subnet_2
- Add network_2 interface to router
- Create server_2 and connect it to network_2
Steps:
- Assign floating ip to server_1
- Check that ping from server_1 to server_2 is successful
Teardown:
- Delete servers
- Delete cirros image
- Delete security group
- Delete flavor
- Delete router
- Delete subnets
- Delete networks
-
stepler.neutron.tests.test_dvr.test_check_router_namespace_on_compute_node(net_subnet_router, server, os_faults_steps, server_steps)[source]¶ Scenario: Check router namespace with server and without it.
- This test check router namespace on compute node with server and after
- server deletion.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and DVR
- Add network interface to router
- Create server
Steps:
- Check that router namespace is on compute node where server is hosted
- Delete server
- Check that router namespace is deleted
Teardown:
- Delete server (if it was not removed)
- Delete cirros image
- Delete security group
- Delete flavor
- Delete router
- Delete subnet
- Delete network
-
stepler.neutron.tests.test_dvr.test_check_router_update_notification_for_l3_agents(cirros_image, flavor, security_group, net_subnet_router, floating_ip, server_steps, host_steps, os_faults_steps)[source]¶ Scenario: Check router update notifications for L3 agent.
This test checks that router update notification appear in log of L3 agent after server creation and assigning/deleting floating ip but only in log on compute node where server is hosted.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and DVR
- Add network interface to router
Steps:
- Get current sizes of log files of L3 agent on all computes
- Create server
- Assign floating ip to server
- Delete floating ip from server
- Check that 3 notifications have appeared in log of L3 agent on compute
- with server
- Check that no notifications have appeared in log of L3 agent on other
- computes
Teardown:
- Delete server
- Delete cirros image
- Delete security group
- Delete flavor
- Delete router
- Delete subnet
- Delete network
-
stepler.neutron.tests.test_dvr.test_connectivity_after_ban_l3_agent_many_times(net_subnet_router, server, get_ssh_proxy_cmd, agent_steps, os_faults_steps, server_steps)[source]¶ Scenario: Check North-South after ban/clear L3 agent on controller.
- This test checks North-South connectivity without floating IP after ban and
- clear L3 agent on controller with SNAT many times.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and centralized router.
- Add network interface to router
- Create server
Steps:
- Check that ping from server to 8.8.8.8 is successful
- Find node with SNAT for router
- Ban all L3 agents on other controller
- Ban and clear L3 agent on controller with snat 40 times
- Wait for L3 agent becomes ACTIVE
- Check that ping from server to 8.8.8.8 is successful
Teardown:
- Delete server
- Delete cirros image
- Delete security group
- Delete flavor
- Delete router
- Delete subnet
- Delete network
-
stepler.neutron.tests.test_dvr.test_east_west_connectivity_after_ban_clear_l3_on_compute(neutron_2_servers_different_networks, get_ssh_proxy_cmd, os_faults_steps, server_steps)[source]¶ Scenario: Check east-west connectivity after ban/clear l3 agent.
- This test checks east-west connectivity between instances on different
- computes after ban and clear l3 agent on one of them.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network_1 with subnet_1 and DVR
- Create server_1
- Create network_2 with subnet_2
- Add network_2 interface to router
- Create server_2 and connect it to network_2
Steps:
- Terminate l3-service on the compute with server_1
- Start l3-service on the compute with server_1
- Check that ping from server_1 to server_2 by internal ip is successful
Teardown:
- Delete servers
- Delete cirros image
- Delete security group
- Delete flavor
- Delete router
- Delete subnets
- Delete networks
-
stepler.neutron.tests.test_dvr.test_east_west_connectivity_after_destroy_controller(neutron_2_servers_different_networks, get_ssh_proxy_cmd, os_faults_steps, server_steps)[source]¶ Scenario: Check east-west connectivity after destroy controller.
- This test checks east-west connectivity between instances on different
- hosts after destroy of controller.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network_1 with subnet_1 and DVR
- Create server_1
- Create network_2 with subnet_2
- Add network_2 interface to router
- Create server_2 and connect it to network_2
Steps:
- Check that ping from server_1 to server_2 by internal ip is successful
- Destroy any controller
- Check that ping from server_2 to server_1 by internal ip is successful
Teardown:
- Delete servers
- Delete cirros image
- Delete security group
- Delete flavor
- Delete router
- Delete subnets
- Delete networks
-
stepler.neutron.tests.test_dvr.test_east_west_connectivity_after_reset_computes(neutron_2_servers_different_networks, get_ssh_proxy_cmd, os_faults_steps, server_steps)[source]¶ Scenario: Check east-west connectivity after reset computes.
- This test checks east-west connectivity between instances on different
- hosts after reset of computes.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network_1 with subnet_1 and DVR
- Create server_1
- Create network_2 with subnet_2
- Add network_2 interface to router
- Create server_2 and connect it to network_2
Steps:
- Check that ping from server_1 to server_2 by internal ip is successful
- Destroy computes where servers are hosted
- Start computes where servers are hosted
- Check that ping from server_2 to server_1 by internal ip is successful
Teardown:
- Delete servers
- Delete cirros image
- Delete security group
- Delete flavor
- Delete router
- Delete subnets
- Delete networks
-
stepler.neutron.tests.test_dvr.test_instance_connectivity_after_l3_agent_restart(cirros_image, flavor, security_group, public_network, create_network, create_subnet, create_router, create_floating_ip, router_steps, server_steps, hypervisor_steps, host_steps, os_faults_steps, agent_steps)[source]¶ Scenario: Check instances connectivity after restarting l3 agent.
Setup:
- Increase neutron quotas
- Create cirros image
- Create security group
Steps:
- Create 10 networks, subnets and routers
- Create 10 servers on one compute
- For each server, create floating ip and attach it to server
- Check that ping from one server to 8.8.8.8 is successful
- Restart L3 agent on compute 60 times
- Check that ping from all servers to 8.8.8.8 are successful
Teardown:
- Delete servers
- Delete floating IPs
- Delete networks, subnets, routers
- Delete security group
- Delete cirros image
- Restore original neutron quotas
-
stepler.neutron.tests.test_dvr.test_north_south_connectivity_after_ban_clear_l3_on_compute(server, floating_ip, os_faults_steps, server_steps)[source]¶ Scenario: Check North-South connectivity after ban/clear l3 agent.
- This test checks connectivity to North-South-Routing after ban and clear
- L3 agent on compute.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and DVR
- Add network interface to router
- Create server
Steps:
- Assign floating ip to server
- Check that ping from server to 8.8.8.8 is successful
- Terminate L3 service on compute with server
- Start L3 service on compute with server
- Check that ping from server to 8.8.8.8 is successful
Teardown:
- Delete server
- Delete cirros image
- Delete security group
- Delete flavor
- Delete router
- Delete subnet
- Delete network
-
stepler.neutron.tests.test_dvr.test_north_south_connectivity_after_primary_controller_reset(net_subnet_router, server, get_ssh_proxy_cmd, agent_steps, os_faults_steps, server_steps)[source]¶ Scenario: Check North-South after reset primary controller.
- This test checks connectivity to North-South-Routing without floating
- after reset of primary controller with SNAT.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and DVR
- Add network interface to router
- Create server
Steps:
- Check that ping from server to 8.8.8.8 is successful
- Find controller with SNAT for router
- Reschedule router if controller with SNAT is not primary controller
- Reset primary controller
- Wait for another L3 agent becomes ACTIVE
- Check that ping from server to 8.8.8.8 is successful
Teardown:
- Delete server
- Delete cirros image
- Delete security group
- Delete flavor
- Delete router
- Delete subnet
- Delete network
-
stepler.neutron.tests.test_dvr.test_north_south_connectivity_after_reset_compute(server, floating_ip, os_faults_steps, server_steps)[source]¶ Scenario: Check North-South connectivity after reset compute.
- This test checks connectivity to North-South-Routing reset of compute
- where vm hosted.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and DVR
- Add network interface to router
- Create server
Steps:
- Assign floating ip to server
- Check that ping from server to 8.8.8.8 is successful
- Destroy compute with server
- Start compute with server
- Check that ping from server to 8.8.8.8 is successful
Teardown:
- Delete server
- Delete cirros image
- Delete security group
- Delete flavor
- Delete router
- Delete subnet
- Delete network
-
stepler.neutron.tests.test_dvr.test_north_south_connectivity_without_floating(server, get_ssh_proxy_cmd, server_steps)[source]¶ Scenario: Check connectivity to North-South-Routing.
- This test checks connectivity to North-South-Routing in case of
- centralized of distributed router without floating ip assigning.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and DVR
- Add network interface to router
- Create server
Steps:
- Check that ping from server to 8.8.8.8 is successful
Teardown:
- Delete server
- Delete cirros image
- Delete security group
- Delete flavor
- Delete router
- Delete subnet
- Delete network
-
stepler.neutron.tests.test_dvr.test_north_south_floating_ip_shut_down_br_ex_on_controllers(server, floating_ip, os_faults_steps, server_steps)[source]¶ Scenario: Check North-South connectivity after shut-downing br-ex.
- This test checks North-South connectivity with floating IP after
- shut-downing br-ex on all controllers.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and DVR
- Add network interface to router
- Create server
Steps:
- Assign floating ip to server
- Check that ping from server to 8.8.8.8 is successful
- Shut down br-ex on all controllers
- Connect to server using floating IP and check that ping from server to
- 8.8.8.8 is successful
Teardown:
- Delete server
- Delete cirros image
- Delete security group
- Delete flavor
- Delete router
- Delete subnet
- Delete network
-
stepler.neutron.tests.test_dvr.test_reschedule_router_from_snat_controller(net_subnet_router, server, floating_ip, agent_steps, os_faults_steps, server_steps)[source]¶ Scenario: Check manually reschedule router from SNAT controller.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and DVR
- Add network interface to router
- Create server
Steps:
- Assign floating ip to server
- Find controller with SNAT for router
- Reschedule router to another controller
- Wait for another L3 agent becomes ACTIVE
- Check that ping from server to 8.8.8.8 is successful
Teardown:
- Delete server
- Delete cirros image
- Delete security group
- Delete flavor
- Delete router
- Delete subnet
- Delete network
-
stepler.neutron.tests.test_dvr.test_shutdown_controller_with_snat(net_subnet_router, server, floating_ip, agent_steps, os_faults_steps, server_steps)[source]¶ Scenario: Check reschedule router after shutdown controller.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and DVR
- Add network interface to router
- Create server
Steps:
- Assign floating ip to server
- Find controller with SNAT for router
- Destroy controller
- Wait for SNAT reschedule to another controller
- Wait for L3 agent becomes ACTIVE
- Check that ping from server to 8.8.8.8 is successful
Teardown:
- Delete server
- Delete cirros image
- Delete security group
- Delete flavor
- Delete router
- Delete subnet
- Delete network
-
stepler.neutron.tests.test_dvr.test_update_router_from_centralized_to_distributed(net_subnet_router, server, floating_ip, os_faults_steps, router_steps, server_steps)[source]¶ Scenario: Check update router type from centralized to distributed.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and centralized router.
- Add network interface to router
- Create server
Steps:
- Assign floating ip to server
- Try to update router type to distributed while router is in active state
- and check that BadRequest with correct exception message occurs
- Set admin state for router to down
- Update router type to distributed
- Set admin state for router to up
- Check that namespace for router appeared on compute with server
- Check that ping from server to 8.8.8.8 is successful
Teardown:
- Delete server
- Delete cirros image
- Delete security group
- Delete flavor
- Delete router
- Delete subnet
- Delete network
-
stepler.neutron.tests.test_dvr.test_update_router_from_distributed_to_centralized(router, router_steps)[source]¶ Scenario: Check update router type from distributed to centralized.
- This test checks that it’s not possible to update distributed router to
- centralized.
Setup:
- Create distributed router
Steps:
- Try to update router type to centralized and check that BadRequest with
- correct exception message occurs
Teardown:
- Delete router
Neutron SIGHUP tests¶
-
stepler.neutron.tests.test_sighup.test_restart_agent_controller_with_sighup(agent_steps, os_faults_steps, agent_name)[source]¶ Scenario: Restart neutron agent with kill SIGHUP command.
Steps:
- Find a controller or gtw node with running neutron agent
- Get PID of agent process
- Send SIGHUP to process and wait for 10 seconds
- Check state of agent
- Check that pid is not changed
- Check that no new ERROR and TRACE messages appear in log
- Check that only one SIGHUP message appear in log
-
stepler.neutron.tests.test_sighup.test_restart_l3_agent_compute_with_sighup(agent_steps, os_faults_steps)[source]¶ Scenario: Restart l3 agent with SIGHUP on compute.
Steps:
- Find a compute with running l3 agent
- Get PID of l3 agent process
- Send SIGHUP to process and wait for 10 seconds
- Check state of agent
- Check that pid is not changed
- Check that no new ERROR and TRACE messages appear in log
- Check that only one SIGHUP message appear in log
-
stepler.neutron.tests.test_sighup.test_restart_metadata_agent_compute_with_sighup(agent_steps, os_faults_steps, is_parent)[source]¶ Scenario: Restart metadata agent (parent or child) with SIGHUP.
Steps:
- Find a compute with running metadata agent
- Get PID of metadata agent process (parent or child)
- Send SIGHUP to process and wait for 10 seconds
- Check state of agent
- Check that pid is not changed
- Check that no new ERROR and TRACE messages appear in log
- Check that only one SIGHUP message appear in log
-
stepler.neutron.tests.test_sighup.test_restart_metadata_agent_controller_with_sighup(agent_steps, os_faults_steps, is_parent)[source]¶ Scenario: Restart metadata agent (parent or child) with SIGHUP.
Steps:
- Find a controller or gtw node with running metadata agent
- Get PID of metadata agent process (parent or child)
- Send SIGHUP to process and wait for 10 seconds
- Check state of agent
- Check that pid is not changed
- Check that no new ERROR and TRACE messages appear in log
- Check that only one SIGHUP message appear in log
-
stepler.neutron.tests.test_sighup.test_restart_neutron_server_with_sighup(os_faults_steps, is_parent)[source]¶ Scenario: Restart neutron server (parent or child) with SIGHUP.
Steps:
- Find a controller with running metadata agent
- Get PID of neutron server process (parent or child)
- Send SIGHUP to process and wait for 10 seconds
- Check state of agent
- Check that pid is not changed
- Check that no new ERROR and TRACE messages appear in log
- Check that only one SIGHUP message appear in log
Neutron L2 population tests¶
-
stepler.neutron.tests.test_l2pop.test_broadcast_traffic_for_single_network(cirros_image, flavor, neutron_2_servers_diff_nets_with_floating, server_steps, port_steps, os_faults_steps)[source]¶ Scenario: Check broadcast traffic for single network.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network_1 with subnet_1 and router
- Create network_2 with subnet_2
- Create server_1
- Create server_3 on another compute and connect it to network_2
- Create and attach floating IP for each server
Steps:
- Create server_2 on same compute as server_3 and connect it to network_1
- Start arping from server_1 to server_2
- Start tcpdump on compute with server_2 with server_2 port tap device
- Stop tcpdump
- Check that there are some ARP packets from server_1 on pcap file
- Start tcpdump on compute with server_2 with server_3 port tap device
- Stop tcpdump
- Check that there are no ARP packets from server_1 on pcap file
Teardown:
- Delete servers
- Delete floating IPs
- Delete networks, subnets, router
- Delete security group
- Delete flavor
- Delete cirros image
-
stepler.neutron.tests.test_l2pop.test_tunnels_establishing(cirros_image, flavor, network, server, server_steps, agent_steps, hypervisor_steps, os_faults_steps)[source]¶ Scenario: Check tunnels establishing between nodes.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and router
- Create server_1
Steps:
- Check that compute_1 has tunnels to controllers
- Check that compute_1 has no tunnels to other computes
- Check that other computes have no tunnels to compute_1
- Boot server on compute_2
- Check that compute_2 has tunnels to controllers and compute_1
- Check that compute_1 has tunnel to compute_2
- Check that other computes have no tunnels to compute_1, compute_2 and
- controllers
- Boot server on compute_3
- Check that compute_3 has tunnels to controllers, compute_1 and compute_2
- Check that compute_1 has tunnel to compute_3
- Check that compute_2 has tunnel to compute_3
Teardown:
- Delete servers
- Delete network, subnet, router
- Delete security group
- Delete flavor
- Delete cirros image
Neutron L3 HA tests¶
-
stepler.neutron.tests.test_l3_ha.test_ban_l3_agent_for_many_routers(neutron_2_servers_diff_nets_with_floating, public_network, create_network, create_subnet, create_router, router_steps, server_steps, agent_steps, os_faults_steps)[source]¶ Scenario: Ban l3-agent for many routers.
Setup:
- Increase neutron quotas
- Create cirros image
- Create flavor
- Create security group
- Create network_1 with subnet_1 and router_1
- Create network_2 with subnet_2
- Create server_1
- Create server_2 on another compute and connect it to network_2
- Create and attach floating IP for each server
Steps:
- Create 20 networks, subnets, routers
- Get L3 agent with ACTIVE ha_state for router_1
- Start ping between servers with floating IP
- Ban ACTIVE L3 agent
- Wait for another L3 agent becomes ACTIVE
- Check that ping loss is not more than 10 packets
Teardown:
- Delete servers
- Delete floating IPs
- Delete networks, subnets, router
- Delete security group
- Delete flavor
- Delete cirros image
- Restore original neutron quotas
-
stepler.neutron.tests.test_l3_ha.test_ban_l3_agent_with_active_ha_state_for_router(neutron_2_servers_different_networks, create_floating_ip, server_steps, agent_steps, os_faults_steps, ban_count)[source]¶ Scenario: Ban l3-agent with ACTIVE ha_state for router.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network_1 with subnet_1 and router_1
- Create network_2 with subnet_2 and router_2
- Create server_1
- Create server_2 on another compute and connect it to network_2
Steps:
- Create and attach floating IP for each server
- Get L3 agent with ACTIVE ha_state for router_1
- Start ping between servers with floating IP
- Ban ACTIVE L3 agent
- Wait for another L3 agent becomes ACTIVE
- Repeat last 2 steps
ban_counttimes - Check that ping loss is not more than 10 *
ban_countpackets
Teardown:
- Delete servers
- Delete networks, subnets, router
- Delete floating IPs
- Delete security group
- Delete cirros image
- Delete flavor
-
stepler.neutron.tests.test_l3_ha.test_ban_l3_agent_with_ping_public_ip(router, server, floating_ip, server_steps, agent_steps, os_faults_steps)[source]¶ Scenario: Ban l3-agent with ACTIVE ha_state for router during ping.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and router
- Create server
- Create floating ip
Steps:
- Attach floating IP to server
- Get L3 agent with ACTIVE ha_state for router
- Start ping from server to public ip
- Ban ACTIVE L3 agent
- Wait for another L3 agent becomes ACTIVE
- Check that ping loss is not more than 40 packets
Teardown:
- Delete server
- Delete network, subnet, router
- Delete floating IP
- Delete security group
- Delete cirros image
- Delete flavor
-
stepler.neutron.tests.test_l3_ha.test_delete_ns_for_router_on_node_with_active_ha_state(router, server, floating_ip, server_steps, agent_steps, os_faults_steps)[source]¶ Scenario: Delete namespace for router on node with ACTIVE ha_state.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and router
- Create server
- Create floating ip
Steps:
- Attach floating IP to server
- Get L3 agent with ACTIVE ha_state for router
- Start ping from server to public ip
- Delete router namespace on node with active L3 agent
- Check that ping loss is not more than 40 packets
Teardown:
- Delete server
- Delete network, subnet, router
- Delete floating IP
- Delete security group
- Delete cirros image
- Delete flavor
-
stepler.neutron.tests.test_l3_ha.test_destroy_non_primary_controller(neutron_2_servers_different_networks, create_floating_ip, reschedule_router_active_l3_agent, server_steps, agent_steps, os_faults_steps)[source]¶ Scenario: Destroy non primary controller.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network_1 with subnet_1 and router_1
- Create network_2 with subnet_2 and router_2
- Create server_1
- Create server_2 on another compute and connect it to network_2
Steps:
- Create and attach floating IP for each server
- Get L3 agent with ACTIVE ha_state for router_1
- Get primary controller
- Reschedule router’s active L3 agent to non primary controller
- Start ping between servers with floating IP
- Destroy node with L3 agent for router_1 with ACTIVE ha_state
- Check that ping loss is not more than 40 packets
Teardown:
- Delete servers
- Delete networks, subnets, router
- Delete floating IPs
- Delete security group
- Delete cirros image
- Delete flavor
-
stepler.neutron.tests.test_l3_ha.test_destroy_primary_controller(neutron_2_servers_different_networks, create_floating_ip, reschedule_router_active_l3_agent, server_steps, agent_steps, os_faults_steps)[source]¶ Scenario: Destroy primary controller.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network_1 with subnet_1 and router_1
- Create network_2 with subnet_2 and router_2
- Create server_1
- Create server_2 on another compute and connect it to network_2
Steps:
- Create and attach floating IP for each server
- Get L3 agent with ACTIVE ha_state for router_1
- Get primary controller
- Reschedule router’s active L3 agent to primary controller
- Start ping between servers with floating IP
- Destroy primary controller
- Check that ping loss is not more than 40 packets
Teardown:
- Delete servers
- Delete networks, subnets, router
- Delete floating IPs
- Delete security group
- Delete cirros image
- Delete flavor
-
stepler.neutron.tests.test_l3_ha.test_disable_all_l3_agents_and_enable_them(neutron_2_servers_diff_nets_with_floating, server_steps, agent_steps, os_faults_steps)[source]¶ Scenario: Disable all l3 agents and enable them.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network_1 with subnet_1 and router_1
- Create network_2 with subnet_2 and router_2
- Create server_1
- Create server_2 on another compute and connect it to network_2
- Create and attach floating IP for each server
Steps:
- Start ping between servers with floating IP
- Ban all L3 agents
- Wait for all L3 agents to be died
- Clear all L3 agents
- Wait for all L3 agents to be alive
- Check that ping loss is not more than 100 packets
Teardown:
- Delete servers
- Delete floating IPs
- Delete networks, subnets, router
- Delete security group
- Delete flavor
- Delete cirros image
-
stepler.neutron.tests.test_l3_ha.test_move_router_ha_interface_to_down_state(router, server, floating_ip, server_steps, port_steps, agent_steps, os_faults_steps)[source]¶ Scenario: Move router HA interface to down state.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and router
- Create server
- Create floating ip
Steps:
- Attach floating IP to server
- Get L3 agent with ACTIVE ha_state for router
- Start ping server’s floating ip
- Move router HA interface to down state
- Wait for another L3 agent becomes ACTIVE
- Check that ping loss is not more than 10 packets
Teardown:
- Delete server
- Delete network, subnet, router
- Delete floating IP
- Delete security group
- Delete flavor
- Delete cirros image
-
stepler.neutron.tests.test_l3_ha.test_ping_routing_during_l3_agent_ban(router, server, floating_ip, server_steps, port_steps, agent_steps, os_faults_steps)[source]¶ Scenario: Check ping from server with tcpdump during banning agent.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and router
- Create server
- Create floating ip
Steps:
- Attach floating IP to server
- Get L3 agent with ACTIVE ha_state for router
- Start tcpdump on each controller
- Start ping to server’s floating ip
- Ban ACTIVE L3 agent
- Wait for another L3 agent to become ACTIVE
- Check that icmp traffic disappeared on old active l3 agent host and
- appeared on new active l3 agent host
Teardown:
- Delete server
- Delete network, subnet, router
- Delete floating IP
- Delete security group
- Delete flavor
- Delete cirros image
-
stepler.neutron.tests.test_l3_ha.test_reset_primary_controller(neutron_2_servers_different_networks, create_floating_ip, reschedule_router_active_l3_agent, server_steps, agent_steps, os_faults_steps)[source]¶ Scenario: Reset primary controller.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network_1 with subnet_1 and router_1
- Create network_2 with subnet_2 and router_2
- Create server_1
- Create server_2 on another compute and connect it to network_2
Steps:
- Create and attach floating IP for each server
- Get L3 agent with ACTIVE ha_state for router_1
- Get primary controller
- Reschedule router’s active L3 agent to primary controller
- Start ping between servers with floating IP
- Reset primary controller
- Check that ping loss is not more than 40 packets
Teardown:
- Delete servers
- Delete networks, subnets, router
- Delete floating IPs
- Delete security group
- Delete cirros image
- Delete flavor
Neutron VxLAN tests¶
-
stepler.neutron.tests.test_vxlan.test_broadcast_traffic_propagation_with_l2pop(neutron_2_servers_diff_nets_with_floating, server_steps, os_faults_steps)[source]¶ Scenario: Check broadcast traffic propagation with l2pop driver.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network_1 with subnet_1 and router
- Create network_2 with subnet_2
- Create server_1
- Create server_2 on another compute and connect it to network_2
- Create and attach floating IP for each server
Steps:
- Start tcpdump on compute with server_2
- Run arping from server_1 to server_2
- Run ping from server_1 to server_2
- Stop tcpdump
- Check that there are no ARP packets from server_1 on pcap file
- Check that VXLAN packets with ICMP from server_1 are on pcap file
Teardown:
- Delete servers
- Delete floating IPs
- Delete networks, subnets, router
- Delete security group
- Delete flavor
- Delete cirros image
-
stepler.neutron.tests.test_vxlan.test_vni_matching_network_segmentation_id(network, router, server, server_steps, port_steps, agent_steps, os_faults_steps)[source]¶ Scenario: Check that VNI matching the segmentation_id of a network.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network with subnet and router
- Create server
Steps:
- Get L3 agent with ACTIVE ha_state for router
- Check that vxlan is enabled on node with L3 agent
- Check that vxlan is enabled on server’s compute
- Start tcpdump on compute
- Ping server’s fixed ip from L3 agent node with qrouter namespace
- Stop tcpdump
- Check that VXLAN packets has same VNI that network segmentation_id
Teardown:
- Delete server
- Delete network, subnet, router
- Delete security group
- Delete flavor
- Delete cirros image
-
stepler.neutron.tests.test_vxlan.test_vni_matching_network_segmentation_id_for_different_computes(neutron_2_servers_diff_nets_with_floating, server_steps, port_steps, agent_steps, os_faults_steps)[source]¶ Scenario: Check that VNI matching the segmentation_id of a networks.
Setup:
- Create cirros image
- Create flavor
- Create security group
- Create network_1 with subnet_1 and router_1
- Create network_2 with subnet_2 and router_2
- Create server_1
- Create server_2 on another compute and connect it to network_2
- Create and attach floating IP for each server
Steps:
- Start tcpdump on computes
- Ping each server’s fixed ip from other servers
- Stop tcpdump
- Check that VXLAN packets has same VNI value that corresponding server
- network’s segmentation_id
Teardown:
- Delete servers
- Delete floating IPs
- Delete networks, subnets, router
- Delete security group
- Delete flavor
- Delete cirros image
Neutron basic verification tests¶
-
stepler.neutron.tests.test_basic_verification.test_agents_list(agent_steps)[source]¶ Scenario: Request list of neutron agents.
Steps:
- Get list of neutron agents
- Check that all agents are up and running
-
stepler.neutron.tests.test_basic_verification.test_networks_list(network_steps, network)[source]¶ Scenario: Request list of networks.
Steps:
- Get list of networks
-
stepler.neutron.tests.test_basic_verification.test_neutron_floating_ips_quota(public_network, create_floating_ip, floating_ip_steps, change_neutron_quota)[source]¶ Scenario: Negative create of floating ips more than quota allows.
Setup:
- Increase neutron quota for floating ips
Steps:
- Create max possible count of floating ips
- Check that unable to create extra floating ip
Teardown:
- Delete floating ips
- Restore original quota
-
stepler.neutron.tests.test_basic_verification.test_neutron_networks_quota(create_network, network_steps, change_neutron_quota)[source]¶ Scenario: Negative create of networks more than quota allows.
Setup:
- Increase neutron quota for networks
Steps:
- Create max possible count of networks
- Check that unable to create extra network
Teardown:
- Delete networks
- Restore original quota
-
stepler.neutron.tests.test_basic_verification.test_neutron_ports_quota(network, port_steps, create_port, change_neutron_quota)[source]¶ Scenario: Negative create of ports more than quota allows.
Setup:
- Increase neutron quota for ports
- Create network
Steps:
- Create max possible count of ports for network
- Check that unable to create extra ports
Teardown:
- Delete ports
- Delete network
- Restore original quota
-
stepler.neutron.tests.test_basic_verification.test_neutron_routers_quota(create_router, router_steps, change_neutron_quota)[source]¶ Scenario: Negative create of routers more than quota allows.
Setup:
- Increase neutron quota for routers
Steps:
- Create max possible count of routers
- Check that unable to create extra router
Teardown:
- Delete routers
- Restore original quota
-
stepler.neutron.tests.test_basic_verification.test_neutron_sec_group_rules_quota(current_project, neutron_security_group_steps, neutron_security_group_rule_steps, neutron_create_security_group, change_neutron_quota)[source]¶ Scenario: Negative create of security group rules more than quota.
Setup:
- Increase neutron quota for security group rules
Steps:
- Create security group to add rules
- Get count of security group rules for project to calculate
- Create security group rules in order to have max possible count
- Check that unable to create extra security group rule
Teardown:
- Delete security group with rules
- Restore original quota
-
stepler.neutron.tests.test_basic_verification.test_neutron_security_groups_quota(current_project, neutron_security_group_steps, change_neutron_quota)[source]¶ Scenario: Negative create of security groups more than quota allows.
Setup:
- Increase neutron quota for security groups
Steps:
- Create max possible count of security groups
- Check that unable to create extra security group
Teardown:
- Delete security groups
- Restore original quota
-
stepler.neutron.tests.test_basic_verification.test_neutron_subnets_quota(network, create_subnet, subnet_steps, change_neutron_quota)[source]¶ Scenario: Negative create of subnets more than quota allows.
Setup:
- Increase neutron quota for subnets
- Create network
Steps:
- Create max possible count of subnets for network
- Check that unable to create extra subnet
Teardown:
- Delete subnets
- Delete network
- Restore original quota