aboutsummaryrefslogtreecommitdiffstats
path: root/resources/libraries/python/PapiExecutor.py
diff options
context:
space:
mode:
authorVratko Polak <vrpolak@cisco.com>2019-09-05 16:15:19 +0200
committerVratko Polak <vrpolak@cisco.com>2019-09-06 08:46:09 +0000
commite310a40eab90bb5ecd8471dbbccc1d02daf2dea3 (patch)
tree7d5e8d06d52d8942243ef8a0926e04a651b43ef4 /resources/libraries/python/PapiExecutor.py
parent1c77031813057a50781784fc8e34019805d222b8 (diff)
Read environment variables in Constants.py
Instead of using EnsureGlobalVariable, which is clunky to use from Python. As a consequence, all caps variables from Constants.py are used directly and tests/__init__.robot and robot_enhancements.robot are deleted. + Rename the CRC global kill switch based on ci-man review. Change-Id: I10723792475bc83352bf8c3b7f7946ecf885a194 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Diffstat (limited to 'resources/libraries/python/PapiExecutor.py')
-rw-r--r--resources/libraries/python/PapiExecutor.py15
1 files changed, 1 insertions, 14 deletions
diff --git a/resources/libraries/python/PapiExecutor.py b/resources/libraries/python/PapiExecutor.py
index 0a714c182c..74ff7a0f9b 100644
--- a/resources/libraries/python/PapiExecutor.py
+++ b/resources/libraries/python/PapiExecutor.py
@@ -166,18 +166,6 @@ class PapiSocketExecutor(object):
if self.vpp_instance:
return
cls = self.__class__ # Shorthand for setting class fields.
- fail_on_mismatch = Constants.CRC_MISMATCH_FAILS_TEST
- try:
- from robot.libraries.BuiltIn import BuiltIn
- from_robot = BuiltIn().get_variable_value(
- "\${crc_mismatch_fails}", None)
- if from_robot is not None:
- # Robot interprets env vars as strings.
- fail_on_mismatch = not from_robot.lower() in ("false", "n", "0")
- except (ImportError, AttributeError):
- # If robot is not installed or not running, or value is not string,
- # the Constants value applies.
- pass
package_path = None
tmp_dir = tempfile.mkdtemp(dir="/tmp")
try:
@@ -199,8 +187,7 @@ class PapiSocketExecutor(object):
api_json_directory = tmp_dir + "/usr/share/vpp/api"
# Perform initial checks before .api.json files are gone,
# by creating the checker instance.
- cls.crc_checker = VppApiCrcChecker(
- api_json_directory, fail_on_mismatch=fail_on_mismatch)
+ cls.crc_checker = VppApiCrcChecker(api_json_directory)
# When present locally, we finally can find the installation path.
package_path = glob.glob(tmp_dir + installed_papi_glob)[0]
# Package path has to be one level above the vpp_papi directory.