Skip to content

Commit 8759b08

Browse files
Increase GCUTIMEOUT value for nokia-armhf platforms (sonic-net#17420)
Summary: generic_config_updater/test_dynamic_acl.py::test_gcu_acl_scale_rules testcase fails for nokia-armhf platforms as it requires longer timer to scale acl rules due to the limited CPU computing power of ARM32 CPU. So , increased the GCUTIMEOUT value to wait for applying the patch to 1200 seconds. What is the motivation for this PR? Fix failure of test_gcu_acl_scale_rules test by increasing timeout for apply-patch for nokia-armhf platforms How did you do it? Added platform specific check and modification of value for nokia-armhf platforms How did you verify/test it? Run generic_config_updater/test_dynamic_acl.py::test_gcu_acl_scale_rules on M0 topo on nokia-armhf platforms
1 parent 0b2f188 commit 8759b08

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

tests/common/gu_utils.py

+7-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
DEFAULT_CHECKPOINT_NAME = "test"
1616
GCU_FIELD_OPERATION_CONF_FILE = "gcu_field_operation_validators.conf.json"
1717
GET_HWSKU_CMD = "sonic-cfggen -d -v DEVICE_METADATA.localhost.hwsku"
18-
GCUTIMEOUT = 600
18+
GCUTIMEOUT_MAP = {'armhf-nokia_ixs7215_52x-r0': 1200}
1919

2020
BASE_DIR = os.path.dirname(os.path.realpath(__file__))
2121
FILES_DIR = os.path.join(BASE_DIR, "files")
@@ -125,7 +125,8 @@ def apply_patch(duthost, json_data, dest_file):
125125
start_time = time.time()
126126
output = duthost.shell(cmds, module_ignore_errors=True)
127127
elapsed_time = time.time() - start_time
128-
if elapsed_time > GCUTIMEOUT:
128+
gcu_timeout = get_gcu_timeout(duthost)
129+
if elapsed_time > gcu_timeout:
129130
logger.error("Command took too long: {} seconds".format(elapsed_time))
130131
raise TimeoutError("Command execution timeout: {} seconds".format(elapsed_time))
131132

@@ -576,3 +577,7 @@ def get_bgp_speaker_runningconfig(duthost):
576577
bgp_speaker_pattern = r"\s+neighbor.*update-source.*|\s+bgp listen range.*"
577578
bgp_speaker_config = re.findall(bgp_speaker_pattern, output['stdout'])
578579
return bgp_speaker_config
580+
581+
582+
def get_gcu_timeout(duthost):
583+
return GCUTIMEOUT_MAP.get(duthost.facts['platform'], 600)

0 commit comments

Comments
 (0)