From ed8f90dfc02e30ae6bf1be124b3f346ab2bce50f Mon Sep 17 00:00:00 2001 From: Dmitriy Zayakin Date: Mon, 20 Nov 2023 15:53:30 +0300 Subject: [PATCH] Change output time format to unix Signed-off-by: Dmitriy Zayakin --- .../storage/controllers/cluster_state_controller.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/frostfs_testlib/storage/controllers/cluster_state_controller.py b/src/frostfs_testlib/storage/controllers/cluster_state_controller.py index 27fa034..825f2ac 100644 --- a/src/frostfs_testlib/storage/controllers/cluster_state_controller.py +++ b/src/frostfs_testlib/storage/controllers/cluster_state_controller.py @@ -410,8 +410,8 @@ class ClusterStateController: @reporter.step_deco("Set node time to {in_date}") def change_node_date(self, node: ClusterNode, in_date: datetime) -> None: shell = node.host.get_shell() - shell.exec(f"hwclock --set --date='{in_date}'") - shell.exec("hwclock --hctosys") + shell.exec(f"date -s @{time.mktime(in_date.timetuple())}") + shell.exec("hwclock --systohc") node_time = self.get_node_date(node) with reporter.step(f"Verify difference between {node_time} and {in_date} is less than a minute"): assert (self.get_node_date(node) - in_date) < datetime.timedelta(minutes=1) @@ -421,8 +421,8 @@ class ClusterStateController: shell = node.host.get_shell() now_time = datetime.datetime.now(datetime.timezone.utc) with reporter.step(f"Set {now_time} time"): - shell.exec(f"hwclock --set --date='{now_time}'") - shell.exec("hwclock --hctosys") + shell.exec(f"date -s @{time.mktime(now_time.timetuple())}") + shell.exec("hwclock --systohc") @reporter.step_deco("Change the synchronizer status to {status}") def set_sync_date_all_nodes(self, status: str): -- 2.45.2