virsh_cmd: Change boot time fetching function#6905
Conversation
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
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
WalkthroughIn Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Before: 08:22:57 INFO : Running: /usr/local/bin/avocado run --vt-type libvirt --vt-config /home/stuff/tests/data/avocado-vt/backends/libvirt/cfg/backuprestore.cfg --force-job-id 4b0f7b7a93c2a59a2d5c34c56c9d17bbef45595a --job-results-dir /home/stuff/tests/results --vt-only-filter "virtio_scsi virtio_net qcow2 SLES.16.1.ppc64le" RESULTS : PASS 0 | ERROR 0 | FAIL 1 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0 After: |
|
The code itself is ok ad make sense. even improving functionality as the returned comparision is beteween timestamp not the datetime string but when introducing new code it will be better to refactor this 7y old approach. it would be possible to remove the get_boot_time and reuse vm.uptime() instead. (and probably would be good to rename in such case variables to [second | first] _uptime |
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
Summary by CodeRabbit