@@ -241,6 +241,7 @@ def get_parser():
241
241
bmcgroup .add_argument ("--bmc-password" , help = "SSH password for BMC" )
242
242
bmcgroup .add_argument ("--bmc-usernameipmi" , help = "IPMI username for BMC" )
243
243
bmcgroup .add_argument ("--bmc-passwordipmi" , help = "IPMI password for BMC" )
244
+ bmcgroup .add_argument ("--bmc-ntp-server" , help = "NTP Server for OpenBMC" )
244
245
bmcgroup .add_argument ("--bmc-prompt" , default = "#" ,
245
246
help = "Prompt for BMC ssh session" )
246
247
bmcgroup .add_argument ("--smc-presshipmicmd" )
@@ -832,6 +833,22 @@ def objs(self):
832
833
conf = self ,
833
834
)
834
835
bmc .set_system (self .op_system )
836
+ try :
837
+ if self .args .bmc_ntp_server in [None , "" ]:
838
+ self .args .bmc_ntp_server = "216.239.35.4"
839
+ bmc .run_command ("busctl set-property xyz.openbmc_project.Network "
840
+ "/xyz/openbmc_project/network/eth0 "
841
+ "xyz.openbmc_project.Network.EthernetInterface NTPServers as 1 {}"
842
+ .format (self .args .bmc_ntp_server ), retry = 10 )
843
+ OpTestLogger .optest_logger_glob .optest_logger .debug ("Set Network for OpenBMC NTP server" )
844
+ bmc .run_command ("busctl set-property xyz.openbmc_project.Settings "
845
+ "/xyz/openbmc_project/time/sync_method "
846
+ "xyz.openbmc_project.Time.Synchronization TimeSyncMethod s "
847
+ "xyz.openbmc_project.Time.Synchronization.Method.NTP" , retry = 10 )
848
+ OpTestLogger .optest_logger_glob .optest_logger .debug ("Set TimeSync for OpenBMC NTP server" )
849
+ except Exception as e :
850
+ OpTestLogger .optest_logger_glob .optest_logger .debug ("Problem encountered with setting OpenBMC NTP server,"
851
+ "Exception {}" .format (e ))
835
852
elif self .args .bmc_type in ['qemu' ]:
836
853
print ((repr (self .args )))
837
854
bmc = OpTestQemu (conf = self ,
0 commit comments