You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by dm...@apache.org on 2014/12/24 20:30:42 UTC
ambari git commit: AMBARI-8910. Fix agent unittests to run with
python2.6 (dlysnichenko)
Repository: ambari
Updated Branches:
refs/heads/trunk 3eb7ebda1 -> edce91c3e
AMBARI-8910. Fix agent unittests to run with python2.6 (dlysnichenko)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/edce91c3
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/edce91c3
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/edce91c3
Branch: refs/heads/trunk
Commit: edce91c3e59177c465420675b56f8c178326686e
Parents: 3eb7ebd
Author: Lisnichenko Dmitro <dl...@hortonworks.com>
Authored: Wed Dec 24 21:29:43 2014 +0200
Committer: Lisnichenko Dmitro <dl...@hortonworks.com>
Committed: Wed Dec 24 21:29:43 2014 +0200
----------------------------------------------------------------------
.../resource_management/TestSecurityCommons.py | 40 ++++++++++----------
1 file changed, 20 insertions(+), 20 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/edce91c3/ambari-agent/src/test/python/resource_management/TestSecurityCommons.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/resource_management/TestSecurityCommons.py b/ambari-agent/src/test/python/resource_management/TestSecurityCommons.py
index 1658609..c1a7d69 100644
--- a/ambari-agent/src/test/python/resource_management/TestSecurityCommons.py
+++ b/ambari-agent/src/test/python/resource_management/TestSecurityCommons.py
@@ -29,18 +29,18 @@ class TestSecurityCommons(TestCase):
# Testing with correct values_checks
params = {}
params["config_file"] = {}
- params["config_file"]["property1"] = {"firstCase"}
- params["config_file"]["property2"] = {"secondCase"}
- params["config_file"]["property3"] = {"thirdCase"}
- params["config_file"]["property4"] = {"fourthCase"}
- params["config_file"]["property5"] = {"fifthCase"}
- params["config_file"]["property6"] = {"sixthCase"}
+ params["config_file"]["property1"] = ["firstCase"]
+ params["config_file"]["property2"] = ["secondCase"]
+ params["config_file"]["property3"] = ["thirdCase"]
+ params["config_file"]["property4"] = ["fourthCase"]
+ params["config_file"]["property5"] = ["fifthCase"]
+ params["config_file"]["property6"] = ["sixthCase"]
configuration_rules = {}
configuration_rules["config_file"] = {}
configuration_rules["config_file"]["value_checks"] = {}
- configuration_rules["config_file"]["value_checks"]["property1"] = {"firstCase"}
- configuration_rules["config_file"]["value_checks"]["property2"] = {"secondCase"}
+ configuration_rules["config_file"]["value_checks"]["property1"] = ["firstCase"]
+ configuration_rules["config_file"]["value_checks"]["property2"] = ["secondCase"]
self.assertEquals(not validate_security_config_properties(params, configuration_rules),
True) # issues is empty
@@ -59,14 +59,14 @@ class TestSecurityCommons(TestCase):
True) # issues is empty
# Testing with wrong values_checks
- configuration_rules["config_file"]["value_checks"]["property1"] = {"failCase"}
- configuration_rules["config_file"]["value_checks"]["property2"] = {"failCase2"}
+ configuration_rules["config_file"]["value_checks"]["property1"] = ["failCase"]
+ configuration_rules["config_file"]["value_checks"]["property2"] = ["failCase2"]
self.assertEquals(not validate_security_config_properties(params, configuration_rules),
False) # Doesn't return an empty issues
- configuration_rules["config_file"]["value_checks"]["property1"] = {"firstCase"}
- configuration_rules["config_file"]["value_checks"]["property2"] = {"secondCase"}
+ configuration_rules["config_file"]["value_checks"]["property1"] = ["firstCase"]
+ configuration_rules["config_file"]["value_checks"]["property2"] = ["secondCase"]
# Testing with a property which doesn't exist in params
configuration_rules["config_file"]["empty_checks"].append("property7")
@@ -85,12 +85,12 @@ class TestSecurityCommons(TestCase):
configuration_rules["config_file"]["read_checks"].remove("property8")
#Testing empty_checks and read_checks with an empty params[config_file][property]
- params["config_file"]["property1"] = {""}
- params["config_file"]["property2"] = {""}
- params["config_file"]["property3"] = {""}
- params["config_file"]["property4"] = {""}
- params["config_file"]["property5"] = {""}
- params["config_file"]["property6"] = {""}
+ params["config_file"]["property1"] = [""]
+ params["config_file"]["property2"] = [""]
+ params["config_file"]["property3"] = [""]
+ params["config_file"]["property4"] = [""]
+ params["config_file"]["property5"] = [""]
+ params["config_file"]["property6"] = [""]
self.assertEquals(not validate_security_config_properties(params, configuration_rules),
False) # Doesn't return an empty list
@@ -101,8 +101,8 @@ class TestSecurityCommons(TestCase):
config_file = 'config_file'
value_checks = {}
- value_checks["property1"] = {"value1"}
- value_checks["property2"] = {"value2"}
+ value_checks["property1"] = ["value1"]
+ value_checks["property2"] = ["value2"]
empty_checks = ["property3", "property4"]