-
Notifications
You must be signed in to change notification settings - Fork 88
Added grub.py that will help to automate grub test cases. #884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Added measure_boot_time function that will measure boot timing from reboot to grub menu and from grub menu to kernel loading. Signed-off-by: Krishan Gopal Saraswat <krishang@linux.ibm.com>
''' | ||
log.info("Starting boot time measurement test") | ||
boot_times = self.measure_boot_time() | ||
# Print results |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please remove this comment, even wherever possible, if required, push as a logger, or method doc string
except pexpect.TIMEOUT: | ||
log.error("Timeout waiting for boot sequence") | ||
log.error("Last console output: %s" % self.console.pty.before) | ||
raise OpTestError("Boot sequence timeout") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of Error out, can we able to recover the system using test ? or it kept manual
raise OpTestError("Boot sequence timeout") | ||
except Exception as e: | ||
log.error("Unexpected error during boot sequence: %s" % str(e)) | ||
raise |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
raising any error?
|
||
class Grub(unittest.TestCase): | ||
''' | ||
Test case to measure boot timing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we reword like
Test case to measure system boot timing
|
||
def measure_boot_time(self): | ||
''' | ||
Measure boot timing from reboot to grub menu and from grub menu to kernel loading |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here as well
#!/usr/bin/env python3 | ||
# OpenPOWER Automated Test Project | ||
# | ||
# Contributors Listed Below - COPYRIGHT 2017 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2025
self.cv_HOST = self.conf.host() | ||
self.console = self.cv_SYSTEM.console | ||
|
||
def measure_boot_time(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we pick another name to convey the exact use case? boot_time is very generic.
@Krishan-Saraswat Please have a look at the review comments |
Added measure_boot_time function that will measure boot timing from reboot to grub menu and from grub menu to kernel loading.
output snippet of running this test:-
2025-05-20 15:47:11,332:op-test.testcases.grub:runTest:INFO:Boot Time Results:
2025-05-20 15:47:11,332:op-test.testcases.grub:runTest:INFO:-----------------
2025-05-20 15:47:11,333:op-test.testcases.grub:runTest:INFO:Reboot to GRUB menu: 14.84 seconds
2025-05-20 15:47:11,333:op-test.testcases.grub:runTest:INFO:GRUB menu to kernel loading: 8.92 seconds
2025-05-20 15:47:11,333:op-test.testcases.grub:runTest:INFO:Total boot time: 23.76 seconds