Skip to content

Commit dfb36d8

Browse files
author
Stepan Blyschak
committed
[reload config] use /bin/bash as shell for config reload
This change was introduced in sonic-net#1687 to fix connection reset caused by 'config reload'. The fix was to redirect output to /dev/null. Shell will interpret 'config reload -y &> /dev/null' as request to run the command in the background instead of redirecting stdout/stderr to /dev/null. It looks like not the redirection fixed the issue but the fact that it was running in background. However, it introduced another issue because config reload takes ~1.5m so that 90/120 sec wait time is not enough time waiting for system to become ready. Change-Id: I9d44c0a55e4fa016bbe177524891c9b14302c761 Signed-off-by: Stepan Blyschak <[email protected]>
1 parent b175f8f commit dfb36d8

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

tests/common/config_reload.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ def config_reload(duthost, config_source='config_db', wait=120):
2424
logger.info('reloading {}'.format(config_source))
2525

2626
if config_source == 'minigraph':
27-
duthost.shell('config load_minigraph -y &>/dev/null')
27+
duthost.shell('config load_minigraph -y &>/dev/null', executable="/bin/bash")
2828
duthost.shell('config save -y')
2929

3030
if config_source == 'config_db':
31-
duthost.shell('config reload -y &>/dev/null')
31+
duthost.shell('config reload -y &>/dev/null', executable="/bin/bash")
3232

3333
time.sleep(wait)

tests/platform_tests/test_reload_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_reload_configuration(duthost, conn_graph_facts):
2727
asic_type = duthost.facts["asic_type"]
2828

2929
logging.info("Reload configuration")
30-
duthost.shell("sudo config reload -y &>/dev/null")
30+
duthost.shell("sudo config reload -y &>/dev/null", executable="/bin/bash")
3131

3232
logging.info("Wait until all critical services are fully started")
3333
check_critical_services(duthost)

tests/vlan/test_vlan.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ def tearDown(vlan_ports_list, duthost, ptfhost, vlan_intfs_list, portchannel_int
184184
except RunAnsibleModuleFail as e:
185185
logger.error(e)
186186

187-
duthost.shell("config reload -y &>/dev/null")
187+
duthost.shell("config reload -y &>/dev/null", executable="/bin/bash")
188188

189189
# make sure Portchannels go up for post-test link sanity
190190
time.sleep(90)

0 commit comments

Comments
 (0)