This repository has been archived by the owner on Apr 7, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added invalid cidr/ip tests for floating_ip_add and subnet_add
- Loading branch information
Matous Mojzis
committed
Apr 7, 2020
1 parent
9ce2cc7
commit 601268d
Showing
4 changed files
with
156 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import pytest | ||
|
||
from cfme import test_requirements | ||
from cfme.cloud.provider.openstack import OpenStackProvider | ||
from cfme.networks.views import FloatingIpView | ||
|
||
pytestmark = [ | ||
test_requirements.sdn, | ||
pytest.mark.usefixtures('setup_provider'), | ||
pytest.mark.provider([OpenStackProvider], scope="module") | ||
] | ||
|
||
|
||
@pytest.fixture() | ||
def network_manager(appliance, provider): | ||
network_manager, = appliance.collections.network_providers.filter({"provider": provider}).all() | ||
yield network_manager | ||
|
||
|
||
@pytest.mark.meta(automates=[1652501]) | ||
def test_network_ip_address_invalid_address(appliance, provider, network_manager, setup_provider): | ||
""" | ||
Bugzilla: 1652501 | ||
Polarion: | ||
assignee: mmojzis | ||
casecomponent: Cloud | ||
caseimportance: medium | ||
initialEstimate: 1/10h | ||
""" | ||
subnets_collection = appliance.collections.network_floating_ips | ||
invalid_address = 'test' | ||
|
||
with pytest.raises(AssertionError): | ||
subnets_collection.create(network_manager=network_manager.name, | ||
network_name=provider.data['public_network'], | ||
tenant=provider.data['tenant'], provider=provider, | ||
floating_ip_address=invalid_address) | ||
|
||
view = subnets_collection.create_view(FloatingIpView) | ||
view.flash.assert_message( | ||
f"Unable to create Floating IP \"{invalid_address}\": Invalid input for floating_ip_address" | ||
f". Reason: \'{invalid_address}\' is not a valid IP address.") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import pytest | ||
|
||
from cfme import test_requirements | ||
from cfme.cloud.provider.openstack import OpenStackProvider | ||
from cfme.networks.views import SubnetView | ||
|
||
pytestmark = [ | ||
test_requirements.sdn, | ||
pytest.mark.usefixtures('setup_provider'), | ||
pytest.mark.provider([OpenStackProvider], scope="module") | ||
] | ||
|
||
|
||
@pytest.fixture() | ||
def network_manager(appliance, provider): | ||
network_manager, = appliance.collections.network_providers.filter({"provider": provider}).all() | ||
yield network_manager | ||
|
||
|
||
@pytest.mark.meta(automates=[1652515]) | ||
def test_network_subnet_invalid_cidr(appliance, provider, network_manager, setup_provider): | ||
""" | ||
Bugzilla: 1652515 | ||
Polarion: | ||
assignee: mmojzis | ||
casecomponent: Cloud | ||
caseimportance: medium | ||
initialEstimate: 1/10h | ||
""" | ||
subnets_collection = appliance.collections.network_subnets | ||
invalid_cidr = 'test' | ||
|
||
with pytest.raises(AssertionError): | ||
subnets_collection.create(network_manager=network_manager.name, | ||
network_name=provider.data['public_network'], | ||
tenant=provider.data['tenant'], cidr=invalid_cidr, | ||
name='test_subnet', provider=provider) | ||
|
||
view = subnets_collection.create_view(SubnetView) | ||
view.flash.assert_message( | ||
f"Unable to create Cloud Subnet: Invalid input for cidr. Reason: '{invalid_cidr}' is not a" | ||
" valid IP subnet.") |