Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions symbols.example.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
---

bigip_netloc: "localhost"
bigip_port: 10445
bigip_username: "admin"
bigip_password: "admin"
modules:
gtm: false
ltm: true
36 changes: 22 additions & 14 deletions test/functional/tm/gtm/test_datacenter.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,16 @@

from f5.bigip.resource import MissingRequiredCreationParameter
from f5.bigip.tm.gtm.datacenter import Datacenter
from pytest import symbols
from requests.exceptions import HTTPError

pytestmark = pytest.mark.skipif(
symbols
and hasattr(symbols, 'modules')
and not symbols.modules['gtm'],
reason='The modules symbol for GTM is set to False.'
)


def delete_dc(mgmt_root, name, partition):
try:
Expand Down Expand Up @@ -73,7 +81,7 @@ def test_create_optional_args(self, request, mgmt_root):
contact="admin@root.local",
description="A datacenter is fine too",
location="Between the earth and the moon")
assert False == dc1.enabled
assert dc1.enabled is False
assert "admin@root.local" == dc1.contact
assert "A datacenter is fine too" == dc1.description
assert "Between the earth and the moon" == dc1.location
Expand All @@ -93,15 +101,15 @@ def test_refresh(self, request, mgmt_root):
name='dc1', partition='Common')
d2 = mgmt_root.tm.gtm.datacenters.datacenter.load(
name='dc1', partition='Common')
assert True == d1.enabled
assert True == d2.enabled
assert d1.enabled is True
assert d2.enabled is True

d2.update(enabled=False)
assert False == d2.enabled
assert True == d1.enabled
assert d2.enabled is False
assert d1.enabled is True

d1.refresh()
assert False == d1.enabled
assert d1.enabled is False


class TestLoad(object):
Expand All @@ -115,27 +123,27 @@ def test_load(self, request, mgmt_root):
setup_basic_test(request, mgmt_root, 'dc1', 'Common')
dc1 = mgmt_root.tm.gtm.datacenters.datacenter.load(
name='dc1', partition='Common')
assert True == dc1.enabled
assert dc1.enabled is True
dc1.update(enabled=False)
dc2 = mgmt_root.tm.gtm.datacenters.datacenter.load(
name='dc1', partition='Common')
assert False == dc1.enabled
assert False == dc2.enabled
assert dc1.enabled is False
assert dc2.enabled is False


class TestUpdate(object):
def test_update(self, request, mgmt_root):
dc1 = setup_basic_test(request, mgmt_root, 'dc1', 'Common')
assert True == dc1.enabled
assert False == dc1.disabled
assert dc1.enabled is True
assert dc1.disabled is False
dc1.update(enabled=False)
assert False == dc1.enabled
assert True == dc1.disabled
assert dc1.enabled is False
assert dc1.disabled is True

def test_update_samevalue(self, request, mgmt_root):
dc1 = setup_basic_test(request, mgmt_root, 'dc1', 'Common')
dc1.update(enabled=True)
assert False != dc1.enabled
assert dc1.enabled is True


class TestDelete(object):
Expand Down
8 changes: 8 additions & 0 deletions test/functional/tm/gtm/test_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,16 @@

from f5.bigip.resource import MissingRequiredCreationParameter
from f5.bigip.tm.gtm.rule import Rule
from pytest import symbols
from requests.exceptions import HTTPError

pytestmark = pytest.mark.skipif(
symbols
and hasattr(symbols, 'modules')
and not symbols.modules['gtm'],
reason='The modules symbol for GTM is set to False.'
)


RULE = '''when LB_SELECTED {
set wipHost [LB::server addr]
Expand Down