-
Notifications
You must be signed in to change notification settings - Fork 125
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
Added test to run grub unit test cases. #2906
base: master
Are you sure you want to change the base?
Added test to run grub unit test cases. #2906
Conversation
Grub unit test cases are present as a testsuite, after build and compile we can run all test at once and compare result at end. Signed-off-by: Krishan Gopal Saraswat <[email protected]>
Added test to compile, build and run all grub unit test cases. Signed-off-by: Krishan Gopal Saraswat <[email protected]>
from avocado.utils.software_manager.manager import SoftwareManager | ||
|
||
|
||
class UnitTestCases(Test): |
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.
Class name seems confusing, can you rename like GrubUnitTestCases
# Setup Qemu | ||
qemu_version = process.run("qemu-system-ppc --version", | ||
ignore_status=True, sudo=True, shell=True) | ||
if qemu_version.exit_status != 0: |
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.
if qemu_version.exit_status: has same effect and other places as well
ignore_status=True, sudo=True, shell=True) | ||
if qemu_version.exit_status != 0: | ||
qemu_url = "https://github.com/qemu/qemu.git" | ||
process.run("git clone %s" % qemu_url) |
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.
Please use avocado git API
process.run("git clone %s" % qemu_url) | ||
# build qemu | ||
cwd = os.getcwd() | ||
self.sourcedir_qemu = os.path.join(cwd, "qemu") |
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.
What about just
self.sourcedir_qemu = os.path.join(os.getcwd(), "qemu") it will help to eliminate extra variable and other places as well
self.sourcedir_qemu = os.path.join(cwd, "qemu") | ||
os.chdir(self.sourcedir_qemu) | ||
commands = ["./configure --target-list=ppc-softmmu", | ||
"make", "make install"] |
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.
what about using avocado build utility for make and make install ?
Added test to run grub unit test cases.
Added test to compile, build and run all grub unit test cases.
[root@ grub]# cat nohup.out
JOB ID : c0a134ed61d1ae843bbdd4a3a388587bf0bf79f2
JOB LOG : /home/avocado-fvt-wrapper/results/job-2024-10-09T00.59-c0a134e/job.log
(1/1) grub_unit_test.py:UnitTestCases.test_grub_unit_testcases: STARTED
(1/1) grub_unit_test.py:UnitTestCases.test_grub_unit_testcases: FAIL: Total test fail are 3, please check the logs (4206.35 s)
RESULTS : PASS 0 | ERROR 0 | FAIL 1 | SKIP 0 | WARN 0 | INTERRUPT 0 | CANCEL 0
JOB HTML : /home/avocado-fvt-wrapper/results/job-2024-10-09T00.59-c0a134e/results.html
JOB TIME : 4221.00 s
Test summary:
1-grub_unit_test.py:UnitTestCases.test_grub_unit_testcases: FAIL
[stdout] Testsuite summary for GRUB 2.13
[stdlog] 2024-10-09 02:10:01,758 avocado.utils.process process L0472 DEBUG| [stdout] ============================================================================
[stdlog] 2024-10-09 02:10:01,758 avocado.utils.process process L0472 DEBUG| [stdout] # TOTAL: 86
[stdlog] 2024-10-09 02:10:01,758 avocado.utils.process process L0472 DEBUG| [stdout] # PASS: 49
[stdlog] 2024-10-09 02:10:01,758 avocado.utils.process process L0472 DEBUG| [stdout] # SKIP: 9
[stdlog] 2024-10-09 02:10:01,758 avocado.utils.process process L0472 DEBUG| [stdout] # XFAIL: 0
[stdlog] 2024-10-09 02:10:01,758 avocado.utils.process process L0472 DEBUG| [stdout] # FAIL: 3
[stdlog] 2024-10-09 02:10:01,758 avocado.utils.process process L0472 DEBUG| [stdout] # XPASS: 0
[stdlog] 2024-10-09 02:10:01,758 avocado.utils.process process L0472 DEBUG| [stdout] # ERROR: 25
[stdlog] 2024-10-09 02:10:01,758 avocado.utils.process process L0472 DEBUG| [stdout] ============================================================================