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

stepler.neutron.conftest.neutron_2_servers_2_projects_with_shared_net(request, public_network, conntrack_cirros_image, public_flavor, create_project, create_user, create_network, create_subnet, create_router, port_steps, role_steps, router_steps, get_server_steps, get_neutron_security_group_steps, get_neutron_security_group_rule_steps, get_floating_ip_steps)[source]

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.steps.NeutronSecurityGroupSteps

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.port_steps(neutron_client)[source]

Fixture to get port steps.

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 alive
  • AssertionError – if check failed
check_alive(agents, must_alive=True, timeout=0)[source]

Verify step to check agents aliveness 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:

list

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:

list

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:

list

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:

list

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

delete(floating_ip, check=True)[source]

Step to delete floating_ip.

Parameters:
  • floating_ip (dict) – floating_ip
  • check (bool) – flag whether to check step or not
Raises:

AssertionError – if check failed

detach_floating_ip(floating_ip, check=True)[source]

Step to detach floating IP from server with neutron.

Parameters:
  • floating_ip (dict) – floating ip
  • check (bool, optional) – flag whether to check this step or not
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:

list

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:

list

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:

list

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:

list

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:

list

Raises:

AssertionError – if check failed

get_public_network(check=True)[source]

Step to get public network.

Parameters:check (bool, optional) – flag whether to check step or not
Returns:network
Return type:dict
Raises:AssertionError – if check failed
update(network, check=True, **kwargs)[source]

Step to update network.

Parameters:
  • network (dict) – network
  • check (bool) – flag whether to check step or not
  • **kwargs – other arguments to pass to API
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:
  • ports_1 (list) – first list of ports for comparing
  • ports_2 (list) – second list of ports for comparing
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:
  • ports_before (list) – first list of ports for comparing bindings
  • ports_after (list) – second list of ports for comparing bindings
  • expected_removed_count (int) – expected count of removed ports bindings
  • expected_added_count (int) – expected count of new ports bindings
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:
  • ports_1 (list) – first list of ports for comparing ids
  • ports_2 (list) – second list of ports for comparing ids
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 found
  • AssertionError – if port attributes are wrong
get_ports(check=True, **kwargs)[source]

Step to retrieve all ports in current project.

Parameters:
  • check (bool) – flag whether to check step or not
  • **kwargs – params to list ports
Returns:

list of ports

Return type:

list

Raises:

AssertionError – if list of ports is empty

update(port, check=True, **kwargs)[source]

Step to update port attributes.

Parameters:
  • port (dict) – port dict
  • check (bool) – flag whether to check step or not
  • **kwargs – attributes to pass to API
Raises:

AssertionError – if check failed

class stepler.neutron.steps.QuotaSteps(client)[source]

Neutron quota steps.

get(project, check=True)[source]

Step to retrieve quota.

Parameters:
  • project (obj) – project object
  • check (bool|True) – flag whether to check step or not
Returns:

neutron quota values

Return type:

dict

Raises:

AssertionError – if check failed

update(project, values, check=True)[source]

Step to update quota.

Parameters:
  • project (obj) – project object
  • values (dict) – new quota values mapping
  • check (bool|True) – flag whether to check step or not
Raises:

AssertionError – if check was failed

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
set_gateway(router, network, check=True)[source]

Step to set router gateway.

Parameters:
  • router (dict) – router
  • network (dict) – network
  • check (bool) – flag whether to check step or not
update_router(router, check=True, **kwargs)[source]

Step to update router attributes.

Parameters:
  • router (dict) – router dict
  • check (bool) – flag whether to check step or not
  • **kwargs – attributes to pass to API
Raises:

AssertionError – if check failed

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

delete(subnet, check=True)[source]

Step to delete subnet.

Parameters:
  • subnet (dict) – subnet
  • check (bool) – flag whether to check step or not
get_available_fixed_ips(subnet)[source]

Step to get available fixed ips from subnet.

Parameters:subnet (obj) – subnet
Yields:str – available ip address
Raises:StopIteration – if there are no free ip addresses on subnet

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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network_1 with subnet_1 and router_1
  5. Create server_1
  6. Create network_2 with subnet_2
  7. Create server_2 on another compute and connect it to network_2
  8. Assign floating ips to servers

Steps:

  1. Check that ping from server_1 to server_2 with floating ips
    and 8.8.8.8 is successful
  2. Check that there is no ping between server_1 and server_2 via
    internal ips.
  3. Get node with l3 agent for router_1
  4. Ban l3 agent for the node with pcs
  5. Wait for l3 agent becoming dead
  6. Check that router_1 was rescheduled
  7. Repeat last 3 steps for all l3 agents except for one
  8. Ban the remaining l3 agent
  9. Wait for l3 agent becoming dead if agent_number is not 0
  10. Clear the first/last banned l3 agent
  11. Wait for l3 agent becoming active
  12. Boot server_3 in network_1
  13. Associate floating ip for server_3
  14. Ping server_1 and server_3 from each other with both ips
  15. Ping server_2 and server_3 from each other with floating ip
  16. Check that ping from server_1 to 8.8.8.8 is successful
  17. Check that ping from server_3 to 8.8.8.8 is successful

Teardown:

  1. Delete servers
  2. Delete networks, subnets, routers
  3. Delete floating IPs
  4. Delete security group
  5. Delete cirros image
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network_1 with subnet_1 and router_1
  5. Create server_1
  6. Create network_2 with subnet_2
  7. Create server_2 on another compute and connect it to network_2
  8. Assign floating ips to servers

Steps:

  1. Ping server_1 and server_2 from each other with floatings ip
  2. Ban all l3 agents except for one
  3. Ban active l3 agent
  4. Wait for l3 agent becoming dead
  5. Clear l3 agent from the previous step
  6. Wait for l3 agent becoming active
  7. Repeat last 4 steps 40 times
  8. Boot server_3 in network_1
  9. Associate floating ip for server_3
  10. Ping server_1 and server_3 from each other with both ips
  11. Ping server_2 and server_3 from each other with floating ip
  12. Check that ping from server_1 to 8.8.8.8 is successful
  13. Check that ping from server_3 to 8.8.8.8 is successful

Teardown:

  1. Delete servers
  2. Delete networks, subnets, routers
  3. Delete floating IPs
  4. Delete security group
  5. Delete cirros image
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network_1 with subnet_1 and router1
  5. Create server_1
  6. Create network_2 with subnet_2
  7. Create server_2 on another compute and connect it to network_2
  8. Assign floating ips to servers

Steps:

  1. Ping server_1 and server_2 from each other with floatings ip
  2. Get node with l3 agent for router_1
  3. Ban l3 agent for the node with pcs
  4. Wait for l3 agent becoming dead
  5. Check that router_1 was rescheduled
  6. Repeat last 4 steps if ban_count is 2
  7. Boot server_3 in network_1
  8. Associate floating ip for server_3
  9. Ping server_1 and server_3 from each other with internal ip
  10. Ping server_2 and server_1 from each other with floating ip
  11. Ping server_2 and server_3 from each other with floating ip

Teardown:

  1. Delete servers
  2. Delete networks, subnets, routers
  3. Delete floating IPs
  4. Delete security group
  5. Delete cirros image
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network_1 with subnet_1 and router_1
  5. Create server_1
  6. Create network_2 with subnet_2
  7. Create server_2 on another compute and connect it to network_2
  8. Assign floating ips to servers

Steps:

  1. Get primary/non-primary controller
  2. Get L3 agent for primary/non-primary controller node
  3. Reschedule router_1 to L3 agent on primary/non-primary
    controller if it is not there yet
  4. Ping server_1 and server_2 from each other with floatings ip
  5. Check that ping from server_1 and server_2 to 8.8.8.8 is successful
  6. Destroy primary/non-primary controller
  7. Wait for neutron availability
  8. Wait for L3 agent becoming dead
  9. Check that all routers rescheduled from primary/non-primary controller
  10. Boot server_3 in network_1
  11. Associate floating ip for server_3
  12. Ping server_1 and server_3 from each other with both ips
  13. Ping server_2 and server_3 from each other with floating ip
  14. Check that ping from server_1 to 8.8.8.8 is successful
  15. Check that ping from server_3 to 8.8.8.8 is successful

Teardown:

  1. Delete servers
  2. Delete networks, subnets, routers
  3. Delete floating IPs
  4. Delete security group
  5. Delete cirros image
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network_1 with subnet_1 and router_1
  5. Create server_1
  6. Create network_2 with subnet_2
  7. Create server_2 on another compute and connect it to network_2
  8. Assign floating ips to servers

Steps:

  1. Get primary controller
  2. Get L3 agent for primary controller node
  3. Reschedule router_1 to L3 agent on primary controller
    if it is not there yet
  4. Ping server_1 and server_2 from each other with floatings ip
  5. Check that ping from server_1 and server_2 to 8.8.8.8 is successful
  6. Reset or reboot primary controller
  7. Wait for neutron availability
  8. Wait for L3 agent becoming dead
  9. Check that all routers rescheduled from primary controller
  10. Boot server_3 in network_1
  11. Associate floating ip for server_3
  12. Ping server_1 and server_3 from each other with both ips
  13. Ping server_2 and server_3 from each other with floating ip
  14. Check that ping from server_1 to 8.8.8.8 is successful
  15. Check that ping from server_3 to 8.8.8.8 is successful

Teardown:

  1. Delete servers
  2. Delete networks, subnets, routers
  3. Delete floating IPs
  4. Delete security group
  5. Delete cirros image
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network_1 with subnet_1 and router1
  5. Create server_1
  6. Create network_2 with subnet_2
  7. Create server_2 on another compute and connect it to network_2
  8. Assign floating ips to servers

Steps:

  1. Ping server_1 and server_2 from each other with floatings ip
  2. Get node with l3 agent for router_1
  3. Get PID of l3 agent process
  4. Send SIGKILL to the process
  5. Wait for l3 agent becoming active
  6. Boot server_3 in network_1
  7. Associate floating ip for server_3
  8. Ping server_1 and server_3 from each other with internal ip
  9. Ping server_2 and server_1 from each other with floating ip
  10. Ping server_2 and server_3 from each other with floating ip

Teardown:

  1. Delete servers
  2. Delete networks, subnets, routers
  3. Delete floating IPs
  4. Delete security group
  5. Delete cirros image
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network_1 with subnet_1 and router_1
  5. Create server_1
  6. Create network_2 with subnet_2
  7. Create server_2 on another compute and connect it to network_2
  8. Assign floating ips to servers

Steps:

  1. Ping server_1 and server_2 from each other with floatings ip
  2. Get node with l3 agent for router_1
  3. Drop rabbit’s port 5673 using iptables
  4. Wait for l3 agent becoming dead
  5. Check that router_1 was rescheduled
  6. Ping server_1 and server_2 from each other with floatings ip
  7. Remove rule for dropping port using iptables
  8. Wait for l3 agent becoming active

Teardown:

  1. Delete servers
  2. Delete networks, subnets, routers
  3. Delete floating IPs
  4. Delete security group
  5. Delete cirros image
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and router
  5. Create floating ip
  6. Create server

Steps:

  1. Assign floating ip to server
  2. Check DHCP with cirros-dhcpc command on server with sudo
  3. Get free DHCP agents
  4. Get nodes with free DHCP agents
  5. Ban all free DHCP agents for nodes with pcs
  6. Kill all dnsmasq processes for nodes
  7. Wait for DHCP agents becoming dead
  8. Get 2 nodes with DHCP agents for network
  9. Ban 2 DHCP agents for nodes with pcs
  10. Kill all dnsmasq processes for nodes
  11. Wait for DHCP agents becoming dead
  12. Get node for the first banned dhcp-agent
  13. Clear the first banned dhcp-agent
  14. Check that cleared dhcp-agent is active
  15. Check that all dhcp-agents except for the first banned
    don’t in dhcp-agents list for network
  16. Check that network is on the dhcp-agent which has been cleared
  17. Check that all networks except for external are
    on the cleared dhcp-agent
  18. Check DHCP with cirros-dhcpc command on server with sudo

Teardown:

  1. Delete server
  2. Delete floating ip
  3. Delete network, subnet, router
  4. Delete security group
  5. Delete flavor
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and router
  5. Create floating ip
  6. Create server

Steps:

  1. Assign floating ip to server
  2. Check DHCP with cirros-dhcpc command on server with sudo
  3. Get all existing DHCP agents
  4. Get 2 nodes with DHCP agents for network
  5. Ban 2 DHCP agents for nodes with pcs
  6. Wait for DHCP agents becoming dead
  7. Check that banned dhcp-agents don’t in dhcp-agents list
    for network
  8. Get new node with DHCP agent for network
  9. Ban DHCP agent for node with pcs
  10. Wait for DHCP agent becoming dead
  11. Check that banned dhcp-agent is dead
  12. Repeat last 4 steps for all active DHCP agents
  13. Clear the last banned dhcp-agent
  14. Check that cleared dhcp-agent is active
  15. Check that network is on the dhcp-agent which has been cleared
  16. Check DHCP with cirros-dhcpc command on server with sudo
  17. Check that all networks except for external are
    on the cleared dhcp-agent

Teardown:

  1. Delete server
  2. Delete floating ip
  3. Delete network, subnet, router
  4. Delete security group
  5. Delete flavor
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and router
  5. Create floating ip
  6. Create server

Steps:

  1. Assign floating ip to server
  2. Check DHCP with cirros-dhcpc command on server with sudo
  3. Get nodes with DHCP agents not hosting network
  4. Ban all DHCP agents not hosting network
  5. Wait for banned DHCP agents becoming dead
  6. Get node with DHCP agent for network
  7. Ban DHCP agent for network with pcs
  8. Clear DHCP agent for network with pcs
  9. Repeat last 2 steps 40 times
  10. Check that neutron agent from the previous step is alive
  11. Check that network is on 2 health DHCP-agents
  12. Check DHCP with cirros-dhcpc command on server with sudo

Teardown:

  1. Delete server
  2. Delete floating ip
  3. Delete network, subnet, router
  4. Delete security group
  5. Delete flavor
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and router
  5. Create floating ip
  6. Create server

Steps:

  1. Assign floating ip to server
  2. Check DHCP with cirros-dhcpc command on server with sudo
  3. Get node with DHCP agent for network
  4. Ban DHCP agent for the node with pcs
  5. Wait for DHCP agent becoming dead
  6. Check that killed dhcp-agent does not in dhcp-agents list
    for network
  7. Repeat last 4 steps if ban_count is 2
  8. Check that this network is on another health dhcp-agent
  9. Check DHCP with cirros-dhcpc command on server with sudo

Teardown:

  1. Delete server
  2. Delete floating ip
  3. Delete network, subnet, router
  4. Delete security group
  5. Delete flavor
  6. 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:

  1. Increase neutron quotas
  2. Create cirros image
  3. Create flavor
  4. Create security group

Steps:

  1. Get all controllers
  2. Get the last line number for neutron server log for all controllers
  3. Create max possible count of networks, connect all networks
    to router with external network
  4. Create and delete server for each network
  5. Get nodes with DHCP agents for network
  6. Ban DHCP agents for nodes with pcs
  7. Wait for DHCP agents becoming dead
  8. Check that banned dhcp-agents don’t in dhcp-agents list
    for network
  9. Get node with l3 agent for router
  10. Ban l3 agent for the node with pcs
  11. Wait for l3 agent becoming dead
  12. Repeat last 3 steps once
  13. Check that router rescheduled from l3 agents
  14. Check there are no new ERROR logs in neutron-server log files

Teardown:

  1. Delete all created networks, subnets and router
  2. Delete security group
  3. Delete flavor
  4. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and router
  5. Create floating ip
  6. Create server

Steps:

  1. Assign floating ip to server
  2. Check DHCP with cirros-dhcpc command on server with sudo
  3. Check that agents count is the same as expected
  4. Get all DHCP agents count
  5. Get node with DHCP agent for network
  6. Ban DHCP agent for node with pcs
  7. Wait for DHCP agent becoming dead
  8. Check that banned dhcp-agent doesn’t in dhcp-agents list
    for network
  9. Check that agents count equals to the value from config or to
    free agents count
  10. Repeat last 5 steps for all active DHCP agents except for one
  11. Get node with DHCP agent for network
  12. Ban DHCP agent for node with pcs
  13. Wait for DHCP agent becoming dead
  14. Clear the last banned dhcp-agent
  15. Check that cleared dhcp-agent is active
  16. Check that network is on the one dhcp-agent which has been cleared
  17. Check DHCP with cirros-dhcpc command on server with sudo

Teardown:

  1. Delete server
  2. Delete floating ip
  3. Delete network, subnet, router
  4. Delete security group
  5. Delete flavor
  6. 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:

  1. Increase neutron quotas
  2. Create cirros image
  3. Create flavor
  4. Create security group

Steps:

  1. Create max possible count of networks, connect all networks
    to router with external network
  2. Create and delete server for each network
  3. Check DHCP agents count for the first network
  4. Get all nodes with DHCP agents
  5. Disable all DHCP agents
  6. Wait for DHCP agents becoming dead
  7. Enable all DHCP agents
  8. Wait for DHCP agents becoming alive
  9. Check that DHCP agents count for the first network is the same
    as before restart

Teardown:

  1. Delete all created networks, subnets and router
  2. Delete security group
  3. Delete flavor
  4. 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:

  1. Increase neutron quotas
  2. Create cirros image
  3. Create flavor
  4. Create security group

Steps:

  1. Create max possible count of networks, connect all networks
    to router with external network
  2. Create and delete server for each network
  3. Check that quantity of nets on DHCP agents is nearly the same

Teardown:

  1. Delete all created networks, subnets and router
  2. Delete security group
  3. Delete flavor
  4. 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:

  1. Increase neutron quotas
  2. Create cirros image
  3. Create flavor
  4. Create security group

Steps:

  1. Create max possible count of networks, connect all networks
    to router with external network
  2. Create and delete server for each network
  3. Check ports on the first network
  4. Check host binding for all ports
  5. Get DHCP agent for the first network
  6. Get node with DHCP agent for network
  7. Destroy node with DHCP agent
  8. Wait for neutron availability
  9. Wait for DHCP agent becoming dead
  10. Start node with DHCP agent
  11. Wait for DHCP agent becoming alive
  12. Check ports on network
  13. Check that ports ids are the same as before destroying node
  14. Check that network rescheduled from one DHCP agent to another
    and only one host binding changed after restart.

Teardown:

  1. Delete all created networks, subnets and router
  2. Delete security group
  3. Delete flavor
  4. 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:

  1. Increase neutron quotas
  2. Create cirros image
  3. Create flavor
  4. Create security group

Steps:

  1. Create max possible count of networks, connect all networks
    to router with external network
  2. Create and delete server for each network
  3. Get all DHCP ports
  4. Get all nodes with DHCP agents
  5. Disable all DHCP agents
  6. Wait for DHCP agents becoming dead
  7. Make all DHCP ports ‘reserved_dhcp_port’
  8. Enable all DHCP agents
  9. Wait for DHCP agents becoming alive
  10. Check all taps ids are unique for all networks on all controllers

Teardown:

  1. Delete all created networks, subnets and router
  2. Delete security group
  3. Delete flavor
  4. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and router
  5. Create floating ip
  6. Create server

Steps:

  1. Assign floating ip to server
  2. Get primary/non-primary controller
  3. Get DHCP agent for primary/non-primary controller node
  4. Reschedule network to DHCP agent on primary/non-primary
    controller if it is not there yet
  5. Check DHCP with cirros-dhcpc command on server with sudo
  6. Destroy primary/non-primary controller
  7. Wait for neutron availability
  8. Wait for primary/non-primary controller’s DHCP agent becoming dead
  9. Check that dhcp-agent does not in dhcp-agents list for network
  10. Check that network is on 2 healthy agents
  11. Check that all networks rescheduled from primary/non-primary
    controller
  12. Check DHCP with cirros-dhcpc command on server with sudo

Teardown:

  1. Delete server
  2. Delete floating ip
  3. Delete network, subnet, router
  4. Delete security group
  5. Delete flavor
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and router
  5. Create floating ip
  6. Create server

Steps:

  1. Assign floating ip to server
  2. Check DHCP with cirros-dhcpc command on server with sudo
  3. Get node with DHCP agent for network
  4. Drop rabbit’s port 5673 using iptables for node from the previous step
  5. Wait for DHCP agent becoming dead
  6. Check that dhcp-agent does not in dhcp-agents list for network
  7. Check that network is on 2 health DHCP-agents
  8. Check DHCP with cirros-dhcpc command on server with sudo
  9. Remove rule for dropping port using iptables
  10. Check that all neutron agents are alive

Teardown:

  1. Delete server
  2. Delete floating ip
  3. Delete network, subnet, router
  4. Delete security group
  5. Delete flavor
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and router
  5. Create floating ip
  6. Create server

Steps:

  1. Assign floating ip to server
  2. Get primary controller
  3. Get DHCP agent for primary controller node
  4. Reschedule network to DHCP agent on primary controller
    if it is not there yet
  5. Check DHCP with cirros-dhcpc command on server with sudo
  6. Reset primary controller
  7. Wait for neutron availability
  8. Wait for primary controller’s DHCP agent becoming dead
  9. Check that dhcp-agent does not in dhcp-agents list for network
  10. Check that all networks rescheduled from primary controller
  11. Check DHCP with cirros-dhcpc command on server with sudo

Teardown:

  1. Delete server
  2. Delete floating ip
  3. Delete network, subnet, router
  4. Delete security group
  5. Delete flavor
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and router
  5. Create floating ip
  6. Create server

Steps:

  1. Assign floating ip to server
  2. Check DHCP on cirros-dhcpc command on server with sudo
  3. Get node with DHCP agent for network
  4. Kill dhcp-agent process
  5. Wait and check that dhcp agent has status active
  6. Check that network is on the health dhcp-agents
  7. Check DHCP on cirros-dhcpc command on server with sudo

Teardown:

  1. Delete server
  2. Delete floating ip
  3. Delete network, subnet, router
  4. Delete security group
  5. Delete flavor
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and router
  5. Create floating ip
  6. Create server

Steps:

  1. Assign floating ip to server
  2. Check DHCP on cirros-dhcpc command on server with sudo
  3. Get node with DHCP agent for network
  4. Check ports on net
  5. Reschedule network from DHCP agent
  6. Check that the network is moved from this dhcp-agent
  7. Set network to another dhcp-agent
  8. Check that the network moved to this dhcp-agent
  9. Check that ports haven’t been changed

Teardown:

  1. Delete server
  2. Delete floating ip
  3. Delete network, subnet, router
  4. Delete security group
  5. Delete flavor
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network_1 with subnet_1 and router_1
  5. Create network_2 with subnet_2 and router_2
  6. Create server_1
  7. Create server_2 on another compute and connect it to network_2
  8. Create floating ip

Steps:

  1. Attach floating IP to server_1
  2. Check that there is no ping between server_1 and server_2
  3. Restart ovs-agents
  4. Check that there is no ping between server_1 and server_2 during restart

Teardown:

  1. Delete servers
  2. Delete networks, subnets, routers
  3. Delete floating IP
  4. Delete security group
  5. Delete cirros image
  6. Delete flavor
stepler.neutron.tests.test_ovs_restart.test_port_tags_immutable_after_restart(os_faults_steps)[source]

Check that ports tags are the same after ovs-agents restart.

Steps:

  1. Collect ovs-vsctl tags before restart
  2. Restart ovs-agents
  3. Collect ovs-vsctl tags after restart
  4. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and router
  5. Create server

Steps:

  1. Get list of flows for br_int on server’s compute
  2. Check that all cookies for flows is same
  3. Restart ovs-agents
  4. Get list of flows for br_int on server’s compute
  5. Check that all cookies are changed

Teardown:

  1. Delete servers
  2. Delete network, subnet, router
  3. Delete floating IP
  4. Delete security group
  5. Delete cirros image
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network_1 with subnet_1 and router
  5. Create server_1
  6. Create floating ip
  7. Create network_2 with subnet_2
  8. Add network_2 interface to router
  9. Create server_2 on another compute and connect it to network_2

Steps:

  1. Attach floating IP to server_1
  2. Start ping from server_1 to server_2
  3. Restart ovs-agents
  4. Check that ping loss is not more than 2
  5. Repeat last 3 steps 40 times

Teardown:

  1. Delete servers
  2. Delete networks, subnets, router
  3. Delete floating IP
  4. Delete security group
  5. Delete cirros image
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and router
  5. Create server_1
  6. Create floating ip
  7. Create server_2 on same compute as server_1 and connect it to network

Steps:

  1. Attach floating IP to server_1
  2. Start arping from server_1 to server_2
  3. Restart ovs-agents
  4. Check that ping loss is not more than 50

Teardown:

  1. Delete servers
  2. Delete network, subnet, router
  3. Delete floating IP
  4. Delete security group
  5. Delete cirros image
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and router
  5. Create server_1
  6. Create floating ip
  7. Create server_2 on another compute and connect it to network

Steps:

  1. Attach floating IP to server_1
  2. Start arping from server_1 to server_2
  3. Restart ovs-agents
  4. Check that ping loss is not more than 50

Teardown:

  1. Delete servers
  2. Delete network, subnet, router
  3. Delete floating IP
  4. Delete security group
  5. Delete cirros image
  6. 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:

  1. Create ubuntu image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and router
  5. Create network_2 with subnet_2
  6. Create server_1
  7. Create server_2 on another compute and connect it to network
  8. Create floating ip

Steps:

  1. Attach floating IP to server_1
  2. Start iperf traffic from server_1 to server_2, wait it done
  3. Check that iperf loss is close to 0
  4. Start iperf traffic from server_1 to server_2
  5. Restart ovs-agents
  6. Check that iperf loss is not more than 10%

Teardown:

  1. Delete servers
  2. Delete network, subnet, router
  3. Delete floating IP
  4. Delete security group
  5. Delete ubuntu image
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network_1 with subnet_1 and router
  5. Create server_1
  6. Create floating ip
  7. Create network_2 with subnet_2
  8. Add network_2 interface to router
  9. Create server_2 on another compute and connect it to network_2

Steps:

  1. Attach floating IP to server_1
  2. Check ping from server_1 to server_2
  3. Restart ovs-agents with pcs ban/clear on controllers
  4. Check ping from server_1 to server_2

Teardown:

  1. Delete servers
  2. Delete networks, subnets, router
  3. Delete floating IP
  4. Delete security group
  5. Delete cirros image
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network_1 with subnet_1 and router
  5. Create server_1
  6. Create floating ip
  7. Create network_2 with subnet_2
  8. Add network_2 interface to router
  9. Create server_2 on another compute and connect it to network_2

Steps:

  1. Attach floating IP to server_1
  2. Check ping from server_1 to server_2
  3. Restart ovs-agents with pcs enable/disable on controllers
  4. Check ping from server_1 to server_2

Teardown:

  1. Delete servers
  2. Delete networks, subnets, router
  3. Delete floating IP
  4. Delete security group
  5. Delete cirros image
  6. 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:

  1. Create network with subnet
  2. Create port

Steps:

  1. Get current sizes of neutron log files on controllers
  2. Create router of distributed type
  3. Add port interface to router
  4. Wait for 30 seconds
  5. Check that message ‘Could not retrieve gateway port for subnet’
    did not appear in log files

Teardown:

  1. Delete port interface
  2. Delete port
  3. Delete router
  4. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and DVR
  5. Add network interface to router
  6. Create server

Steps:

  1. Assign floating ip to server
  2. Check that ping from server to 8.8.8.8 is successful
  3. Restart L3 service on compute with server
  4. Boot server_2 on the compute where the l3-agent has been restarted
  5. Assign floating ip to server_2
  6. Check pings between server and server_2 via floating ip

Teardown:

  1. Delete servers
  2. Delete cirros image
  3. Delete security group
  4. Delete flavor
  5. Delete router
  6. Delete subnet
  7. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and DVR
  5. Add network interface to router
  6. Create server

Steps:

  1. Check that ping from server to 8.8.8.8 is successful
  2. Find node with SNAT for router and ban L3 agent on it
  3. Wait for another L3 agent becomes ACTIVE
  4. Repeat last 2 steps ban_count times
  5. Check that ping from server to 8.8.8.8 is successful

Teardown:

  1. Delete server
  2. Delete cirros image
  3. Delete security group
  4. Delete flavor
  5. Delete router
  6. Delete subnet
  7. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and DVR
  5. Add network interface to router
  6. Create server

Steps:

  1. Check that ping from server to 8.8.8.8 is successful
  2. Find node with snat for router and ban L3 agent on it
  3. Wait for another L3 agent becomes ACTIVE
  4. Repeat last 2 steps while no L3 agents will be ACTIVE
  5. Clear the first/last banned L3 agent
  6. Wait for L3 agent becomes ACTIVE
  7. Check that ping from server to 8.8.8.8 is successful

Teardown:

  1. Delete server
  2. Delete cirros image
  3. Delete security group
  4. Delete flavor
  5. Delete router
  6. Delete subnet
  7. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and DVR
  5. Add network interface to router
  6. Create server

Steps:

  1. Assign floating ip to server
  2. Check that ping from server to 8.8.8.8 is successful

Teardown:

  1. Delete server
  2. Delete cirros image
  3. Delete security group
  4. Delete flavor
  5. Delete router
  6. Delete subnet
  7. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network_1 with subnet_1 and DVR
  5. Create server_1
  6. Create network_2 with subnet_2
  7. Add network_2 interface to router
  8. Create server_2 and connect it to network_2

Steps:

  1. Assign floating ip to server_1
  2. Check that ping from server_1 to server_2 is successful

Teardown:

  1. Delete servers
  2. Delete cirros image
  3. Delete security group
  4. Delete flavor
  5. Delete router
  6. Delete subnets
  7. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and DVR
  5. Add network interface to router
  6. Create server

Steps:

  1. Check that router namespace is on compute node where server is hosted
  2. Delete server
  3. Check that router namespace is deleted

Teardown:

  1. Delete server (if it was not removed)
  2. Delete cirros image
  3. Delete security group
  4. Delete flavor
  5. Delete router
  6. Delete subnet
  7. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and DVR
  5. Add network interface to router

Steps:

  1. Get current sizes of log files of L3 agent on all computes
  2. Create server
  3. Assign floating ip to server
  4. Delete floating ip from server
  5. Check that 3 notifications have appeared in log of L3 agent on compute
    with server
  6. Check that no notifications have appeared in log of L3 agent on other
    computes

Teardown:

  1. Delete server
  2. Delete cirros image
  3. Delete security group
  4. Delete flavor
  5. Delete router
  6. Delete subnet
  7. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and centralized router.
  5. Add network interface to router
  6. Create server

Steps:

  1. Check that ping from server to 8.8.8.8 is successful
  2. Find node with SNAT for router
  3. Ban all L3 agents on other controller
  4. Ban and clear L3 agent on controller with snat 40 times
  5. Wait for L3 agent becomes ACTIVE
  6. Check that ping from server to 8.8.8.8 is successful

Teardown:

  1. Delete server
  2. Delete cirros image
  3. Delete security group
  4. Delete flavor
  5. Delete router
  6. Delete subnet
  7. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network_1 with subnet_1 and DVR
  5. Create server_1
  6. Create network_2 with subnet_2
  7. Add network_2 interface to router
  8. Create server_2 and connect it to network_2

Steps:

  1. Terminate l3-service on the compute with server_1
  2. Start l3-service on the compute with server_1
  3. Check that ping from server_1 to server_2 by internal ip is successful

Teardown:

  1. Delete servers
  2. Delete cirros image
  3. Delete security group
  4. Delete flavor
  5. Delete router
  6. Delete subnets
  7. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network_1 with subnet_1 and DVR
  5. Create server_1
  6. Create network_2 with subnet_2
  7. Add network_2 interface to router
  8. Create server_2 and connect it to network_2

Steps:

  1. Check that ping from server_1 to server_2 by internal ip is successful
  2. Destroy any controller
  3. Check that ping from server_2 to server_1 by internal ip is successful

Teardown:

  1. Delete servers
  2. Delete cirros image
  3. Delete security group
  4. Delete flavor
  5. Delete router
  6. Delete subnets
  7. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network_1 with subnet_1 and DVR
  5. Create server_1
  6. Create network_2 with subnet_2
  7. Add network_2 interface to router
  8. Create server_2 and connect it to network_2

Steps:

  1. Check that ping from server_1 to server_2 by internal ip is successful
  2. Destroy computes where servers are hosted
  3. Start computes where servers are hosted
  4. Check that ping from server_2 to server_1 by internal ip is successful

Teardown:

  1. Delete servers
  2. Delete cirros image
  3. Delete security group
  4. Delete flavor
  5. Delete router
  6. Delete subnets
  7. 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:

  1. Increase neutron quotas
  2. Create cirros image
  3. Create security group

Steps:

  1. Create 10 networks, subnets and routers
  2. Create 10 servers on one compute
  3. For each server, create floating ip and attach it to server
  4. Check that ping from one server to 8.8.8.8 is successful
  5. Restart L3 agent on compute 60 times
  6. Check that ping from all servers to 8.8.8.8 are successful

Teardown:

  1. Delete servers
  2. Delete floating IPs
  3. Delete networks, subnets, routers
  4. Delete security group
  5. Delete cirros image
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and DVR
  5. Add network interface to router
  6. Create server

Steps:

  1. Assign floating ip to server
  2. Check that ping from server to 8.8.8.8 is successful
  3. Terminate L3 service on compute with server
  4. Start L3 service on compute with server
  5. Check that ping from server to 8.8.8.8 is successful

Teardown:

  1. Delete server
  2. Delete cirros image
  3. Delete security group
  4. Delete flavor
  5. Delete router
  6. Delete subnet
  7. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and DVR
  5. Add network interface to router
  6. Create server

Steps:

  1. Check that ping from server to 8.8.8.8 is successful
  2. Find controller with SNAT for router
  3. Reschedule router if controller with SNAT is not primary controller
  4. Reset primary controller
  5. Wait for another L3 agent becomes ACTIVE
  6. Check that ping from server to 8.8.8.8 is successful

Teardown:

  1. Delete server
  2. Delete cirros image
  3. Delete security group
  4. Delete flavor
  5. Delete router
  6. Delete subnet
  7. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and DVR
  5. Add network interface to router
  6. Create server

Steps:

  1. Assign floating ip to server
  2. Check that ping from server to 8.8.8.8 is successful
  3. Destroy compute with server
  4. Start compute with server
  5. Check that ping from server to 8.8.8.8 is successful

Teardown:

  1. Delete server
  2. Delete cirros image
  3. Delete security group
  4. Delete flavor
  5. Delete router
  6. Delete subnet
  7. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and DVR
  5. Add network interface to router
  6. Create server

Steps:

  1. Check that ping from server to 8.8.8.8 is successful

Teardown:

  1. Delete server
  2. Delete cirros image
  3. Delete security group
  4. Delete flavor
  5. Delete router
  6. Delete subnet
  7. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and DVR
  5. Add network interface to router
  6. Create server

Steps:

  1. Assign floating ip to server
  2. Check that ping from server to 8.8.8.8 is successful
  3. Shut down br-ex on all controllers
  4. Connect to server using floating IP and check that ping from server to
    8.8.8.8 is successful

Teardown:

  1. Delete server
  2. Delete cirros image
  3. Delete security group
  4. Delete flavor
  5. Delete router
  6. Delete subnet
  7. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and DVR
  5. Add network interface to router
  6. Create server

Steps:

  1. Assign floating ip to server
  2. Find controller with SNAT for router
  3. Reschedule router to another controller
  4. Wait for another L3 agent becomes ACTIVE
  5. Check that ping from server to 8.8.8.8 is successful

Teardown:

  1. Delete server
  2. Delete cirros image
  3. Delete security group
  4. Delete flavor
  5. Delete router
  6. Delete subnet
  7. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and DVR
  5. Add network interface to router
  6. Create server

Steps:

  1. Assign floating ip to server
  2. Find controller with SNAT for router
  3. Destroy controller
  4. Wait for SNAT reschedule to another controller
  5. Wait for L3 agent becomes ACTIVE
  6. Check that ping from server to 8.8.8.8 is successful

Teardown:

  1. Delete server
  2. Delete cirros image
  3. Delete security group
  4. Delete flavor
  5. Delete router
  6. Delete subnet
  7. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and centralized router.
  5. Add network interface to router
  6. Create server

Steps:

  1. Assign floating ip to server
  2. Try to update router type to distributed while router is in active state
    and check that BadRequest with correct exception message occurs
  3. Set admin state for router to down
  4. Update router type to distributed
  5. Set admin state for router to up
  6. Check that namespace for router appeared on compute with server
  7. Check that ping from server to 8.8.8.8 is successful

Teardown:

  1. Delete server
  2. Delete cirros image
  3. Delete security group
  4. Delete flavor
  5. Delete router
  6. Delete subnet
  7. 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:

  1. Create distributed router

Steps:

  1. Try to update router type to centralized and check that BadRequest with
    correct exception message occurs

Teardown:

  1. 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:

  1. Find a controller or gtw node with running neutron agent
  2. Get PID of agent process
  3. Send SIGHUP to process and wait for 10 seconds
  4. Check state of agent
  5. Check that pid is not changed
  6. Check that no new ERROR and TRACE messages appear in log
  7. 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:

  1. Find a compute with running l3 agent
  2. Get PID of l3 agent process
  3. Send SIGHUP to process and wait for 10 seconds
  4. Check state of agent
  5. Check that pid is not changed
  6. Check that no new ERROR and TRACE messages appear in log
  7. 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:

  1. Find a compute with running metadata agent
  2. Get PID of metadata agent process (parent or child)
  3. Send SIGHUP to process and wait for 10 seconds
  4. Check state of agent
  5. Check that pid is not changed
  6. Check that no new ERROR and TRACE messages appear in log
  7. 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:

  1. Find a controller or gtw node with running metadata agent
  2. Get PID of metadata agent process (parent or child)
  3. Send SIGHUP to process and wait for 10 seconds
  4. Check state of agent
  5. Check that pid is not changed
  6. Check that no new ERROR and TRACE messages appear in log
  7. 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:

  1. Find a controller with running metadata agent
  2. Get PID of neutron server process (parent or child)
  3. Send SIGHUP to process and wait for 10 seconds
  4. Check state of agent
  5. Check that pid is not changed
  6. Check that no new ERROR and TRACE messages appear in log
  7. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network_1 with subnet_1 and router
  5. Create network_2 with subnet_2
  6. Create server_1
  7. Create server_3 on another compute and connect it to network_2
  8. Create and attach floating IP for each server

Steps:

  1. Create server_2 on same compute as server_3 and connect it to network_1
  2. Start arping from server_1 to server_2
  3. Start tcpdump on compute with server_2 with server_2 port tap device
  4. Stop tcpdump
  5. Check that there are some ARP packets from server_1 on pcap file
  6. Start tcpdump on compute with server_2 with server_3 port tap device
  7. Stop tcpdump
  8. Check that there are no ARP packets from server_1 on pcap file

Teardown:

  1. Delete servers
  2. Delete floating IPs
  3. Delete networks, subnets, router
  4. Delete security group
  5. Delete flavor
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and router
  5. Create server_1

Steps:

  1. Check that compute_1 has tunnels to controllers
  2. Check that compute_1 has no tunnels to other computes
  3. Check that other computes have no tunnels to compute_1
  4. Boot server on compute_2
  5. Check that compute_2 has tunnels to controllers and compute_1
  6. Check that compute_1 has tunnel to compute_2
  7. Check that other computes have no tunnels to compute_1, compute_2 and
    controllers
  8. Boot server on compute_3
  9. Check that compute_3 has tunnels to controllers, compute_1 and compute_2
  10. Check that compute_1 has tunnel to compute_3
  11. Check that compute_2 has tunnel to compute_3

Teardown:

  1. Delete servers
  2. Delete network, subnet, router
  3. Delete security group
  4. Delete flavor
  5. 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:

  1. Increase neutron quotas
  2. Create cirros image
  3. Create flavor
  4. Create security group
  5. Create network_1 with subnet_1 and router_1
  6. Create network_2 with subnet_2
  7. Create server_1
  8. Create server_2 on another compute and connect it to network_2
  9. Create and attach floating IP for each server

Steps:

  1. Create 20 networks, subnets, routers
  2. Get L3 agent with ACTIVE ha_state for router_1
  3. Start ping between servers with floating IP
  4. Ban ACTIVE L3 agent
  5. Wait for another L3 agent becomes ACTIVE
  6. Check that ping loss is not more than 10 packets

Teardown:

  1. Delete servers
  2. Delete floating IPs
  3. Delete networks, subnets, router
  4. Delete security group
  5. Delete flavor
  6. Delete cirros image
  7. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network_1 with subnet_1 and router_1
  5. Create network_2 with subnet_2 and router_2
  6. Create server_1
  7. Create server_2 on another compute and connect it to network_2

Steps:

  1. Create and attach floating IP for each server
  2. Get L3 agent with ACTIVE ha_state for router_1
  3. Start ping between servers with floating IP
  4. Ban ACTIVE L3 agent
  5. Wait for another L3 agent becomes ACTIVE
  6. Repeat last 2 steps ban_count times
  7. Check that ping loss is not more than 10 * ban_count packets

Teardown:

  1. Delete servers
  2. Delete networks, subnets, router
  3. Delete floating IPs
  4. Delete security group
  5. Delete cirros image
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and router
  5. Create server
  6. Create floating ip

Steps:

  1. Attach floating IP to server
  2. Get L3 agent with ACTIVE ha_state for router
  3. Start ping from server to public ip
  4. Ban ACTIVE L3 agent
  5. Wait for another L3 agent becomes ACTIVE
  6. Check that ping loss is not more than 40 packets

Teardown:

  1. Delete server
  2. Delete network, subnet, router
  3. Delete floating IP
  4. Delete security group
  5. Delete cirros image
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and router
  5. Create server
  6. Create floating ip

Steps:

  1. Attach floating IP to server
  2. Get L3 agent with ACTIVE ha_state for router
  3. Start ping from server to public ip
  4. Delete router namespace on node with active L3 agent
  5. Check that ping loss is not more than 40 packets

Teardown:

  1. Delete server
  2. Delete network, subnet, router
  3. Delete floating IP
  4. Delete security group
  5. Delete cirros image
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network_1 with subnet_1 and router_1
  5. Create network_2 with subnet_2 and router_2
  6. Create server_1
  7. Create server_2 on another compute and connect it to network_2

Steps:

  1. Create and attach floating IP for each server
  2. Get L3 agent with ACTIVE ha_state for router_1
  3. Get primary controller
  4. Reschedule router’s active L3 agent to non primary controller
  5. Start ping between servers with floating IP
  6. Destroy node with L3 agent for router_1 with ACTIVE ha_state
  7. Check that ping loss is not more than 40 packets

Teardown:

  1. Delete servers
  2. Delete networks, subnets, router
  3. Delete floating IPs
  4. Delete security group
  5. Delete cirros image
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network_1 with subnet_1 and router_1
  5. Create network_2 with subnet_2 and router_2
  6. Create server_1
  7. Create server_2 on another compute and connect it to network_2

Steps:

  1. Create and attach floating IP for each server
  2. Get L3 agent with ACTIVE ha_state for router_1
  3. Get primary controller
  4. Reschedule router’s active L3 agent to primary controller
  5. Start ping between servers with floating IP
  6. Destroy primary controller
  7. Check that ping loss is not more than 40 packets

Teardown:

  1. Delete servers
  2. Delete networks, subnets, router
  3. Delete floating IPs
  4. Delete security group
  5. Delete cirros image
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network_1 with subnet_1 and router_1
  5. Create network_2 with subnet_2 and router_2
  6. Create server_1
  7. Create server_2 on another compute and connect it to network_2
  8. Create and attach floating IP for each server

Steps:

  1. Start ping between servers with floating IP
  2. Ban all L3 agents
  3. Wait for all L3 agents to be died
  4. Clear all L3 agents
  5. Wait for all L3 agents to be alive
  6. Check that ping loss is not more than 100 packets

Teardown:

  1. Delete servers
  2. Delete floating IPs
  3. Delete networks, subnets, router
  4. Delete security group
  5. Delete flavor
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and router
  5. Create server
  6. Create floating ip

Steps:

  1. Attach floating IP to server
  2. Get L3 agent with ACTIVE ha_state for router
  3. Start ping server’s floating ip
  4. Move router HA interface to down state
  5. Wait for another L3 agent becomes ACTIVE
  6. Check that ping loss is not more than 10 packets

Teardown:

  1. Delete server
  2. Delete network, subnet, router
  3. Delete floating IP
  4. Delete security group
  5. Delete flavor
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and router
  5. Create server
  6. Create floating ip

Steps:

  1. Attach floating IP to server
  2. Get L3 agent with ACTIVE ha_state for router
  3. Start tcpdump on each controller
  4. Start ping to server’s floating ip
  5. Ban ACTIVE L3 agent
  6. Wait for another L3 agent to become ACTIVE
  7. Check that icmp traffic disappeared on old active l3 agent host and
    appeared on new active l3 agent host

Teardown:

  1. Delete server
  2. Delete network, subnet, router
  3. Delete floating IP
  4. Delete security group
  5. Delete flavor
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network_1 with subnet_1 and router_1
  5. Create network_2 with subnet_2 and router_2
  6. Create server_1
  7. Create server_2 on another compute and connect it to network_2

Steps:

  1. Create and attach floating IP for each server
  2. Get L3 agent with ACTIVE ha_state for router_1
  3. Get primary controller
  4. Reschedule router’s active L3 agent to primary controller
  5. Start ping between servers with floating IP
  6. Reset primary controller
  7. Check that ping loss is not more than 40 packets

Teardown:

  1. Delete servers
  2. Delete networks, subnets, router
  3. Delete floating IPs
  4. Delete security group
  5. Delete cirros image
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network_1 with subnet_1 and router
  5. Create network_2 with subnet_2
  6. Create server_1
  7. Create server_2 on another compute and connect it to network_2
  8. Create and attach floating IP for each server

Steps:

  1. Start tcpdump on compute with server_2
  2. Run arping from server_1 to server_2
  3. Run ping from server_1 to server_2
  4. Stop tcpdump
  5. Check that there are no ARP packets from server_1 on pcap file
  6. Check that VXLAN packets with ICMP from server_1 are on pcap file

Teardown:

  1. Delete servers
  2. Delete floating IPs
  3. Delete networks, subnets, router
  4. Delete security group
  5. Delete flavor
  6. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network with subnet and router
  5. Create server

Steps:

  1. Get L3 agent with ACTIVE ha_state for router
  2. Check that vxlan is enabled on node with L3 agent
  3. Check that vxlan is enabled on server’s compute
  4. Start tcpdump on compute
  5. Ping server’s fixed ip from L3 agent node with qrouter namespace
  6. Stop tcpdump
  7. Check that VXLAN packets has same VNI that network segmentation_id

Teardown:

  1. Delete server
  2. Delete network, subnet, router
  3. Delete security group
  4. Delete flavor
  5. 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:

  1. Create cirros image
  2. Create flavor
  3. Create security group
  4. Create network_1 with subnet_1 and router_1
  5. Create network_2 with subnet_2 and router_2
  6. Create server_1
  7. Create server_2 on another compute and connect it to network_2
  8. Create and attach floating IP for each server

Steps:

  1. Start tcpdump on computes
  2. Ping each server’s fixed ip from other servers
  3. Stop tcpdump
  4. Check that VXLAN packets has same VNI value that corresponding server
    network’s segmentation_id

Teardown:

  1. Delete servers
  2. Delete floating IPs
  3. Delete networks, subnets, router
  4. Delete security group
  5. Delete flavor
  6. 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:

  1. Get list of neutron agents
  2. 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:

  1. 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:

  1. Increase neutron quota for floating ips

Steps:

  1. Create max possible count of floating ips
  2. Check that unable to create extra floating ip

Teardown:

  1. Delete floating ips
  2. 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:

  1. Increase neutron quota for networks

Steps:

  1. Create max possible count of networks
  2. Check that unable to create extra network

Teardown:

  1. Delete networks
  2. 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:

  1. Increase neutron quota for ports
  2. Create network

Steps:

  1. Create max possible count of ports for network
  2. Check that unable to create extra ports

Teardown:

  1. Delete ports
  2. Delete network
  3. 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:

  1. Increase neutron quota for routers

Steps:

  1. Create max possible count of routers
  2. Check that unable to create extra router

Teardown:

  1. Delete routers
  2. 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:

  1. Increase neutron quota for security group rules

Steps:

  1. Create security group to add rules
  2. Get count of security group rules for project to calculate
  3. Create security group rules in order to have max possible count
  4. Check that unable to create extra security group rule

Teardown:

  1. Delete security group with rules
  2. 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:

  1. Increase neutron quota for security groups

Steps:

  1. Create max possible count of security groups
  2. Check that unable to create extra security group

Teardown:

  1. Delete security groups
  2. 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:

  1. Increase neutron quota for subnets
  2. Create network

Steps:

  1. Create max possible count of subnets for network
  2. Check that unable to create extra subnet

Teardown:

  1. Delete subnets
  2. Delete network
  3. Restore original quota