-
Notifications
You must be signed in to change notification settings - Fork 85
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
testcases/OpTestKexec.py: add new test cases with -s and -c options #816
Conversation
self.skipTest("Can not create unsigned binary. Using- %s" | ||
% cmd) | ||
cmd = "kexec -s -l %s.unsigned" % self.kernel_image | ||
ret = self.execute_kexec_cmd(cmd) |
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.
execute_kexec_cmd () will attempt to perform kexec reboot correct? If so is the test here to actually attempt to perform kexec with unsigned image or just an attempt to load an unsigned image. If its the later then can't we use load_kexec_kernel() instead?
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.
This function creates the unsigned kernel image from the existing signed kernel image and tries to load when guest secure boot is enabled.
test_binaries/extract-module-sig.pl
Outdated
@@ -0,0 +1,138 @@ | |||
#!/usr/bin/env perl | |||
# SPDX-License-Identifier: GPL-2.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.
This license is different from what op-test uses. Is this okay?
Is it possible to download this file at runtime?
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.
Yes agree with sachin , please use this link https://raw.githubusercontent.com/torvalds/linux/master/scripts/extract-module-sig.pl , may have wget
in test itself as we don't have any API in op-test to perform wget
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.
Ok, will change.
test_binaries/extract-module-sig.pl
Outdated
@@ -0,0 +1,138 @@ | |||
#!/usr/bin/env perl | |||
# SPDX-License-Identifier: GPL-2.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.
Yes agree with sachin , please use this link https://raw.githubusercontent.com/torvalds/linux/master/scripts/extract-module-sig.pl , may have wget
in test itself as we don't have any API in op-test to perform wget
|
||
kexec_exec_cmd = self.get_kexec_exec_command(exec_opt=True) | ||
ret = self.execute_kexec_cmd(kexec_exec_cmd, raw_pty_console=True) | ||
self.assertTrue(ret, "kexec exec failed: " + kexec_exec_cmd) |
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 %s
to concatenate string
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 address this style issue and where ever it required
50013b3
to
f729383
Compare
Add new test cases with -s and -c options. test case with -c option should fail when secure boot is enabled Signed-off-by: R Nageswara Sastry <rnsastry@linux.ibm.com>
Add unsigned kernel test when secure boot enabled. Add additional file ie extract-module-sig.pl, taken from linux kernel source. This file helps in extracting an unsigned kernel from signed kernel. Signed-off-by: R Nageswara Sastry <rnsastry@linux.ibm.com>
f729383
to
ec1c45f
Compare
Addressed all the comments and pushed the code. Thank You. |
Add new test cases with -s and -c options.
test case with -c option should fail when secure boot is enabled