[SWDEV-451960] [WIP] Add Pytest
Updates: - Added pytest to shared/pytest folder - User can execute tests: [pytest] python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/pytest/unit_tests.py -s -v python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/pytest/integration_test.py -s -v [unittest] /opt/rocm/share/amd_smi/tests/pytest/unit_tests.py -v /opt/rocm/share/amd_smi/tests/pytest/integration_test.py -v - Automatically installs pytest Change-Id: Ia3281a9608aeeb803b91f8b83f87ff84b01037f4 Signed-off-by: Charis Poag <Charis.Poag@amd.com>
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
do_updatepciids() {
|
||||
update-pciids >/dev/null 2>&1 || true
|
||||
return
|
||||
}
|
||||
|
||||
do_configureLogrotate() {
|
||||
@@ -187,9 +188,22 @@ do_install_amdsmi_python_lib() {
|
||||
fi
|
||||
}
|
||||
|
||||
do_install_amdsmi_pytest() {
|
||||
echo -n "Installing pytest... "
|
||||
pip install -U pytest >/dev/null 2>&1
|
||||
if [ $? -ne 0 ]; then
|
||||
echo "[WARNING] Detected pytest could not be installed. Running pytest may not work as documented."
|
||||
else
|
||||
echo -n "[SUCCESS]"
|
||||
echo ""
|
||||
fi
|
||||
return
|
||||
}
|
||||
|
||||
case "$1" in
|
||||
( configure )
|
||||
do_install_amdsmi_python_lib
|
||||
do_install_amdsmi_pytest
|
||||
do_ldconfig
|
||||
do_updatepciids
|
||||
do_configureLogrotate || exit 0
|
||||
|
||||
Reference in New Issue
Block a user