Skip to content

Add software manager support to install packages#911

Merged
abdhaleegit merged 1 commit intoopen-power:masterfrom
vaishnavibhat:pkg_manager
Nov 27, 2025
Merged

Add software manager support to install packages#911
abdhaleegit merged 1 commit intoopen-power:masterfrom
vaishnavibhat:pkg_manager

Conversation

@vaishnavibhat
Copy link
Contributor

Add a function install_distro_packages() that will check for the distro and install the packages based on the version.

@vaishnavibhat vaishnavibhat force-pushed the pkg_manager branch 9 times, most recently from eb13bf2 to e37ca8e Compare September 26, 2025 10:15
@vaishnavibhat
Copy link
Contributor Author

vaishnavibhat commented Sep 26, 2025

Using the install_distro_packages() in testcases/OpTestLPM.py

[console-expect]#rpm -q DynamicRM
rpm -q DynamicRM
DynamicRM-2.0.7-7.ppc64le
[console-expect]#echo $?
echo $?
0
[console-expect]#rpm -q stress-ng
rpm -q stress-ng
package stress-ng is not installed
[console-expect]#echo $?
echo $?
1
[console-expect]#cat /etc/os-release
cat /etc/os-release
NAME="SLES"
VERSION="15-SP7"
VERSION_ID="15.7"
PRETTY_NAME="SUSE Linux Enterprise Server 15 SP7"
ID="sles"
ID_LIKE="suse"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:suse:sles:15:sp7"
DOCUMENTATION_URL="https://documentation.suse.com/"
[console-expect]#echo $?
echo $?
0
[console-expect]#zypper --non-interactive install -y stress-ng ;echo $?
zypper --non-interactive install -y stress-ng ;echo $?
^[[22;27;39;49mLoading repository data...^[[0m
^[[22;27;39;49mReading installed packages...^[[0m
^[[22;27;39;49m'stress-ng' not found in package names. Trying capabilities.^[[0m
^[[22;27;31;49mNo provider of 'stress-ng' found.^[[0m
104
[console-expect]#echo $?
echo $?
0
ERROR

======================================================================
ERROR: runTest (testcases.OpTestLPM.OpTestLPM_LocalHMC.runTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/vaishnavi/Documents/Work/op-test/testcases/OpTestLPM.py", line 385, in runTest
    self.check_pkg_installation()
  File "/Users/vaishnavi/Documents/Work/op-test/testcases/OpTestLPM.py", line 150, in check_pkg_installation
    self.util.install_distro_packages(pkg_notfound)
  File "/Users/vaishnavi/Documents/Work/op-test/common/OpTestUtil.py", line 2302, in install_distro_packages
    raise OpTestError(f"Unable to install package: {packages}")
common.OpTestError.OpTestError: Unable to install package: ['stress-ng']

----------------------------------------------------------------------
Ran 1 test in 22.378s

FAILED (errors=1)
2025-09-26 15:51:04,974:op-test:<module>:INFO:Exit with Result errors="1" and failures="0"
2025-09-26 15:51:04,975:op-test.common.OpTestUtil:cleanup:INFO:OpTestSystem Starting to Gather ESEL's
2025-09-26 15:51:04,975:op-test.common.OpTestUtil:dump_versions:INFO:Log Location: /Users/vaishnavi/Documents/Work/op-test/test-reports/test-run-20250926154656/*debug*
2025-09-26 15:51:04,975:op-test.common.OpTestUtil:dump_versions:INFO:
----------------------------------------------------------
OpTestSystem Firmware Versions Tested
(if flashed things like skiboot.lid, may not be accurate)
----------------------------------------------------------
Firmware Versions Unavailable
----------------------------------------------------------
----------------------------------------------------------

[console-expect]#%

pkg_manager_log.txt

@abdhaleegit
Copy link
Collaborator

@vaishnavibhat

  1. rename to install_package
  2. make sure you also add check_package
  3. alos uninstall_package
  4. make sure they are refelected in other test cases like OptestkernelTest, InstallUpstream...

@vaishnavibhat vaishnavibhat force-pushed the pkg_manager branch 2 times, most recently from bab52d9 to 3ff6b46 Compare November 6, 2025 05:36
Add a function install_distro_packages() that will check for the distro and install the packages based on the version.

Signed-off-by: Vaishnavi Bhat <vaishnavi@linux.vnet.ibm.com>
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.

check_package is basically a utility to called in test before install or uninstall..

so check_package should return true if already installed, false if not installed.

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.

LGTM

@abdhaleegit abdhaleegit merged commit 63a61af into open-power:master Nov 27, 2025
1 check passed
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.

2 participants