summaryrefslogtreecommitdiff
path: root/test/units/modules
diff options
context:
space:
mode:
authorTim Rupp <caphrim007@gmail.com>2017-11-01 21:47:56 -0700
committerGitHub <noreply@github.com>2017-11-01 21:47:56 -0700
commit015baf51494f7d26db2ecf3ef4f8aab9d16a105c (patch)
tree1b06d1a763d131a7b029e93c8aa337655dde44e8 /test/units/modules
parent60281b85fe09e1213ce531c314a898b4dc24da57 (diff)
downloadansible-015baf51494f7d26db2ecf3ef4f8aab9d16a105c.tar.gz
Removes bigip_iapp_service from skip list (#32482)
Diffstat (limited to 'test/units/modules')
-rw-r--r--test/units/modules/network/f5/test_bigip_iapp_service.py88
1 files changed, 70 insertions, 18 deletions
diff --git a/test/units/modules/network/f5/test_bigip_iapp_service.py b/test/units/modules/network/f5/test_bigip_iapp_service.py
index 64090c731a..8f7fd425c4 100644
--- a/test/units/modules/network/f5/test_bigip_iapp_service.py
+++ b/test/units/modules/network/f5/test_bigip_iapp_service.py
@@ -1,21 +1,7 @@
# -*- coding: utf-8 -*-
#
-# Copyright 2017 F5 Networks Inc.
-#
-# This file is part of Ansible
-#
-# Ansible is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, either version 3 of the License, or
-# (at your option) any later version.
-#
-# Ansible is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Ansible. If not, see <http://www.gnu.org/licenses/>.
+# Copyright (c) 2017 F5 Networks Inc.
+# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
@@ -38,11 +24,13 @@ try:
from library.bigip_iapp_service import Parameters
from library.bigip_iapp_service import ModuleManager
from library.bigip_iapp_service import ArgumentSpec
+ from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
except ImportError:
try:
from ansible.modules.network.f5.bigip_iapp_service import Parameters
from ansible.modules.network.f5.bigip_iapp_service import ModuleManager
from ansible.modules.network.f5.bigip_iapp_service import ArgumentSpec
+ from ansible.module_utils.f5_utils import iControlUnexpectedHTTPError
except ImportError:
raise SkipTest("F5 Ansible modules require the f5-sdk Python library")
@@ -86,7 +74,7 @@ class TestParameters(unittest.TestCase):
assert p.deviceGroup == 'none'
assert p.inheritedTrafficGroup == 'true'
assert p.inheritedDevicegroup == 'true'
- assert p.trafficGroup == '/Common/traffic-group-local-only'
+ assert p.traffic_group == '/Common/traffic-group-local-only'
def test_module_parameters_lists(self):
args = load_fixture('create_iapp_service_parameters_f5_http.json')
@@ -150,6 +138,70 @@ class TestParameters(unittest.TestCase):
assert p.variables[1]['name'] == 'afm__policy'
assert p.variables[1]['value'] == '/#do_not_use#'
+ def test_module_strict_updates_from_top_level(self):
+ # Assumes the user did not provide any parameters
+
+ args = dict(
+ strict_updates=True
+ )
+ p = Parameters(args)
+ assert p.strict_updates == 'enabled'
+
+ args = dict(
+ strict_updates=False
+ )
+ p = Parameters(args)
+ assert p.strict_updates == 'disabled'
+
+ def test_module_strict_updates_override_from_top_level(self):
+ args = dict(
+ strict_updates=True,
+ parameters=dict(
+ strictUpdates='disabled'
+ )
+ )
+ p = Parameters(args)
+ assert p.strict_updates == 'enabled'
+
+ args = dict(
+ strict_updates=False,
+ parameters=dict(
+ strictUpdates='enabled'
+ )
+ )
+ p = Parameters(args)
+ assert p.strict_updates == 'disabled'
+
+ def test_module_strict_updates_only_parameters(self):
+ args = dict(
+ parameters=dict(
+ strictUpdates='disabled'
+ )
+ )
+ p = Parameters(args)
+ assert p.strict_updates == 'disabled'
+
+ args = dict(
+ parameters=dict(
+ strictUpdates='enabled'
+ )
+ )
+ p = Parameters(args)
+ assert p.strict_updates == 'enabled'
+
+ def test_api_strict_updates_from_top_level(self):
+ args = dict(
+ strictUpdates='enabled'
+ )
+ p = Parameters(args)
+ assert p.strict_updates == 'enabled'
+
+ args = dict(
+ strictUpdates='disabled'
+ )
+ p = Parameters(args)
+ assert p.strict_updates == 'disabled'
+
def test_api_parameters_variables(self):
args = dict(
variables=[
@@ -227,7 +279,7 @@ class TestParameters(unittest.TestCase):
trafficGroup='/Common/traffic-group-local-only'
)
p = Parameters(args)
- assert p.trafficGroup == '/Common/traffic-group-local-only'
+ assert p.traffic_group == '/Common/traffic-group-local-only'
def test_module_template_same_partition(self):
args = dict(