manticore: added sanity tests for manticore driver#4320
manticore: added sanity tests for manticore driver#4320sidchintamaneni wants to merge 1 commit intomicrosoft:mainfrom
Conversation
|
|
Agreed with all your points. This PR is created to initiate a conversation with LISA team.
|
There was a problem hiding this comment.
Pull request overview
This PR adds a new LISA test suite that validates the manticore-hwe RPM packaging for the azihsm out-of-tree kernel module on Azure Linux (CBL-Mariner), covering install, module load/unload behavior, and uninstall cleanup.
Changes:
- Adds a new
AziHsmRpmTestsuite with phased test cases (installation, modinfo/load cycles, uninstallation). - Adds helpers to locate the RPM on-node (env var, URL tarball download+extract, fallback globs) and parse module/kernel metadata from the RPM contents.
- Adds optional kernel-hwe installation + reboot flow when the running kernel doesn’t match the module’s target kernel.
You can also share your feedback on Copilot code review. Take the survey.
| # Unload module first if loaded (pre-uninstall safety) | ||
| node.execute( | ||
| "modprobe -r azihsm", sudo=True, no_error_log=True | ||
| ) | ||
| node.execute( | ||
| f"rpm -evh {self.PKG_NAME}", sudo=True, no_error_log=True | ||
| ) |
| result = node.execute( | ||
| f"rpm -qp --queryformat '%{{VERSION}} %{{RELEASE}}' {rpm_path}", | ||
| sudo=True, |
| result = node.execute( | ||
| f"rpm -qpl {rpm_path} | grep '\\.ko$'", | ||
| sudo=True, | ||
| shell=True, | ||
| ) |
| result = node.execute( | ||
| f"test -f {env_path}", sudo=True, no_error_log=True | ||
| ) |
| # Clear dmesg | ||
| node.execute("dmesg -c", sudo=True) | ||
|
|
| ) | ||
| def verify_azihsm_rpm_installation( | ||
| self, node: Node, log: Logger | ||
| ) -> None: |
There was a problem hiding this comment.
Add a parameter variable: Dict[str, Any], and make all os environment variables be set from runbook. Then get the value in below way.
oot_source_url = variables.get("LISA_OOT_SOURCE_URL", "")
|
|
||
| # Test 1 - RPM installs without errors | ||
| self._install_rpm(node, log, rpm_path) | ||
|
|
There was a problem hiding this comment.
Add all common code into one method, then reuse it.
| expected_exit_code=0, | ||
| ) | ||
| pkg_full = result.stdout.strip() | ||
| log.info(f"Package in RPM DB: {pkg_full}") |
There was a problem hiding this comment.
Use rpm tool to install the package
rpm_tool = node.tools[Rpm]
rpm_tool.is_valid_package
rpm_tool.install_local_package
| time.sleep(1) | ||
|
|
||
| # Clear dmesg | ||
| node.execute("dmesg -c", sudo=True) |
|
Note, the code I am working on for the functional tests is using the distro agnostic package_install API instead of calling rpm directly. This will make it more portable in the long run. |
can you cite your work here and close this PR in favor of that |
|
I will do that, but I want to incorporate the tests here into my code before I offer a replacement PR to make sure they do not get lost. |
Tested by running the following command on a VM