diff --git a/src/sonic-config-engine/minigraph.py b/src/sonic-config-engine/minigraph.py index fb815ba80d1b..453c406e3626 100644 --- a/src/sonic-config-engine/minigraph.py +++ b/src/sonic-config-engine/minigraph.py @@ -2611,7 +2611,7 @@ def parse_xml(filename, platform=None, port_config_file=None, asic_name=None, hw results['SYSLOG_SERVER'] = dict((item, {}) for item in syslog_servers) results['DHCP_SERVER'] = dict((item, {}) for item in dhcp_servers) results['DHCP_RELAY'] = dhcp_relay_table - results['NTP_SERVER'] = dict((item, {}) for item in ntp_servers) + results['NTP_SERVER'] = dict((item, {'iburst': 'on'}) for item in ntp_servers) # Set default DNS nameserver from dns.j2 results['DNS_NAMESERVER'] = {} if os.environ.get("CFGGEN_UNIT_TESTING", "0") == "2": diff --git a/src/sonic-config-engine/tests/test_cfggen.py b/src/sonic-config-engine/tests/test_cfggen.py index 6126522bb6dd..19e0af5cd4dd 100644 --- a/src/sonic-config-engine/tests/test_cfggen.py +++ b/src/sonic-config-engine/tests/test_cfggen.py @@ -696,7 +696,7 @@ def test_metadata_tacacs(self): def test_metadata_ntp(self): argument = ['-m', self.sample_graph_metadata, '-p', self.port_config, '-v', "NTP_SERVER"] output = self.run_script(argument) - self.assertEqual(utils.to_dict(output.strip()), utils.to_dict("{'10.0.10.1': {}, '10.0.10.2': {}}")) + self.assertEqual(utils.to_dict(output.strip()), utils.to_dict("{'10.0.10.1': {'iburst': 'on'}, '10.0.10.2': {'iburst': 'on'}}")) def test_dns_nameserver(self): argument = ['-m', self.sample_graph_metadata, '-p', self.port_config, '-v', "DNS_NAMESERVER"] diff --git a/src/sonic-config-engine/tests/test_chassis_cfggen.py b/src/sonic-config-engine/tests/test_chassis_cfggen.py index a2be6ed6b8ce..c5f1e148e9f1 100644 --- a/src/sonic-config-engine/tests/test_chassis_cfggen.py +++ b/src/sonic-config-engine/tests/test_chassis_cfggen.py @@ -104,7 +104,7 @@ def test_ntp(self): argument = ['-m', self.sample_graph, '-p', self.sample_port_config, '--var-json', 'NTP_SERVER'] output = json.loads(self.run_script(argument)) - self.assertDictEqual(output, {'17.39.1.130': {}, '17.39.1.129': {}}) + self.assertDictEqual(output, {'17.39.1.130': {'iburst': 'on'}, '17.39.1.129': {'iburst': 'on'}}) # NTP data is present only in the host config argument = ['-m', self.sample_graph, '--var-json', 'NTP_SERVER'] @@ -416,7 +416,7 @@ def test_ntp(self): argument = ['-m', self.sample_graph, '-p', self.sample_port_config, '--var-json', 'NTP_SERVER'] output = json.loads(self.run_script(argument)) - self.assertDictEqual(output, {'17.39.1.130': {}, '17.39.1.129': {}}) + self.assertDictEqual(output, {'17.39.1.130': {'iburst': 'on'}, '17.39.1.129': {'iburst': 'on'}}) # NTP data is present only in the host config argument = ['-m', self.sample_graph, '--var-json', 'NTP_SERVER'] @@ -884,7 +884,7 @@ def test_ntp(self): '--var-json', 'NTP_SERVER' ] output = json.loads(self.run_script(argument)) - self.assertDictEqual(output, {'17.39.1.130': {}, '17.39.1.129': {}}) + self.assertDictEqual(output, {'17.39.1.130': {'iburst': 'on'}, '17.39.1.129': {'iburst': 'on'}}) def test_mgmt_port(self): @@ -1019,7 +1019,7 @@ def test_ntp(self): '--var-json', 'NTP_SERVER' ] output = json.loads(self.run_script(argument)) - self.assertDictEqual(output, {'17.39.1.130': {}, '17.39.1.129': {}}) + self.assertDictEqual(output, {'17.39.1.130': {'iburst': 'on'}, '17.39.1.129': {'iburst': 'on'}}) # NTP data is present only in the host config argument = ['-m', self.sample_graph, '--var-json', 'NTP_SERVER'] diff --git a/src/sonic-config-engine/tests/test_minigraph_case.py b/src/sonic-config-engine/tests/test_minigraph_case.py index a5578b841df4..9e19fbdaeaff 100644 --- a/src/sonic-config-engine/tests/test_minigraph_case.py +++ b/src/sonic-config-engine/tests/test_minigraph_case.py @@ -283,7 +283,7 @@ def test_minigraph_mgmt_port(self): def test_metadata_ntp(self): argument = ['-m', self.sample_graph, '-p', self.port_config, '-v', "NTP_SERVER"] output = self.run_script(argument) - self.assertEqual(output.strip(), "{'10.0.10.1': {}, '10.0.10.2': {}}") + self.assertEqual(output.strip(), "{'10.0.10.1': {'iburst': 'on'}, '10.0.10.2': {'iburst': 'on'}}") def test_minigraph_vnet(self): argument = ['-m', self.sample_graph, '-p', self.port_config, '-v', "VNET"] diff --git a/src/sonic-config-engine/tests/test_multinpu_cfggen.py b/src/sonic-config-engine/tests/test_multinpu_cfggen.py index bba0adeae752..5f7646f48f1c 100644 --- a/src/sonic-config-engine/tests/test_multinpu_cfggen.py +++ b/src/sonic-config-engine/tests/test_multinpu_cfggen.py @@ -151,7 +151,7 @@ def test_metadata_tacacs(self): def test_metadata_ntp(self): argument = ['-m', self.sample_graph, '-p', self.sample_port_config, '--var-json', "NTP_SERVER"] output = json.loads(self.run_script(argument)) - self.assertDictEqual(output, {'17.39.1.130': {}, '17.39.1.129': {}}) + self.assertDictEqual(output, {'17.39.1.130': {'iburst': 'on'}, '17.39.1.129': {'iburst': 'on'}}) #NTP data is present only in the host config argument = ['-m', self.sample_graph, '--var-json', "NTP_SERVER"] for asic in range(NUM_ASIC):