Skip to content

Added test to build, compile and run secvarctl test. #892

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Krishan-Saraswat
Copy link

Added test to build, compile, run secvarctl and generate keys/auth files.

Ran 1 test in 164.866s

OK

Generating XML reports...
Generated XML report: /home/op-test/test-reports/test-run-20250710081144/TEST-testcases.OpTestSecvarctl.SecvarctlTest-20250710081144.xml

Added test to build, compile, run secvarctl and generate
keys/auth files.

Signed-off-by: Krishan Gopal Saraswat <krishang@linux.ibm.com>
@@ -0,0 +1,92 @@
import unittest
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please have a header added .. you can inspire from other test

if self.distro_name == 'rhel':
self.cv_HOST.host_run_command(f"{self.installer} {pkg} -y")
elif self.distro_name == 'sles':
self.cv_HOST.host_run_command(f"{self.installer} -y {pkg}")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please move this logic in utils . and we can drive that from test like just passing package name


self.build_path = os.path.join(self.home, "secvarctl")
self.connection.run_command("cd {} && mkdir -p build && cd build".format(self.build_path))
self.connection.run_command("cmake ../")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If make or other build commands fail, we should not jump in the next step .. is except is able to catch these scenario

@abdhaleegit abdhaleegit self-assigned this Jul 14, 2025
@abdhaleegit abdhaleegit self-requested a review July 14, 2025 04:58
Copy link
Collaborator

@abdhaleegit abdhaleegit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Krishan-Saraswat @PraveenPenguin just curious why this test in op-test and not in avocado misc ?



class SecvarctlTest(unittest.TestCase):
def setUp(self):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

some doc string to explain what test does

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants