From 0d22328f7ff085dccaa32299d8939ad40d8be3c0 Mon Sep 17 00:00:00 2001 From: Aniket Sahu Date: Mon, 22 Jun 2026 13:10:08 +0530 Subject: [PATCH] virsh_cmd: Change boot time fetching function The --since arg for uptime is not part of the basic package shipped with SLES releases. This caused the test to fail silently. This change uses /proc/stat to get boot time which will be present in every linux distro, thus making the test distro-independent --- libvirt/tests/src/virsh_cmd/domain/virsh_reboot.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libvirt/tests/src/virsh_cmd/domain/virsh_reboot.py b/libvirt/tests/src/virsh_cmd/domain/virsh_reboot.py index 3a4748893b9..3271486362d 100644 --- a/libvirt/tests/src/virsh_cmd/domain/virsh_reboot.py +++ b/libvirt/tests/src/virsh_cmd/domain/virsh_reboot.py @@ -45,7 +45,8 @@ def get_boot_time(): """ boot_time = None try: - boot_time = session.cmd_output("uptime --since") + boot_time = \ + session.cmd_output("grep btime /proc/stat | awk '{print $2}'") except (aexpect.ShellStatusError, aexpect.ShellProcessTerminatedError) as e: logging.error("Get boot_time error:%s" % e) return boot_time