[SWDEV-482966/ SWDEV-482967] Removing pytest dependency + install path change
Signed-off-by: Juan Castillo <juan.castillo@amd.com>
Change-Id: I7aace93fcad18d67443e6849c10a1fbbc65d0fa8
Signed-off-by: Juan Castillo <juan.castillo@amd.com>
[ROCm/amdsmi commit: ac593f9fa0]
This commit is contained in:
کامیت شده توسط
Maisam Arif
والد
d04eadec17
کامیت
487fd5e1fd
@@ -7,6 +7,10 @@ Full documentation for amd_smi_lib is available at [https://rocm.docs.amd.com/pr
|
||||
## amd_smi_lib for ROCm 6.3.0
|
||||
|
||||
### Changes
|
||||
- **Moved python tests directory path install location.**
|
||||
- `/opt/<rocm-path>/share/amd_smi/pytest/.. to /opt/<rocm-path>/share/amd_smi/tests/python_unittest/..`
|
||||
- **On amd-smi-lib-tests uninstall, the amd_smi tests folder is removed.**
|
||||
- **Removed pytest dependency, our python testing depends only on unittest framework.**
|
||||
|
||||
- **Added more supported utilization count types to `amdsmi_get_utilization_count()`**.
|
||||
|
||||
|
||||
@@ -185,12 +185,12 @@ if(BUILD_TESTS)
|
||||
set(TESTS_COMPONENT "tests")
|
||||
#add_subdirectory("tests/rocm_smi_test")
|
||||
add_subdirectory("tests/amd_smi_test")
|
||||
add_subdirectory("tests/python_unittest")
|
||||
endif()
|
||||
|
||||
# python interface, CLI, and py-test depend on shared libraries
|
||||
if(BUILD_SHARED_LIBS)
|
||||
add_subdirectory("py-interface")
|
||||
add_subdirectory("pytest")
|
||||
if(BUILD_CLI)
|
||||
add_subdirectory("amdsmi_cli")
|
||||
endif()
|
||||
@@ -252,7 +252,7 @@ install(
|
||||
|
||||
#Debian package specific variables
|
||||
set(CPACK_DEBIAN_PACKAGE_PROVIDES "amd-smi")
|
||||
set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "python3-argcomplete, libdrm-dev, python3-yaml")
|
||||
set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "python3-argcomplete, libdrm-dev, python3-PyYAML")
|
||||
set(CPACK_DEBIAN_ASAN_PACKAGE_RECOMMENDS ${CPACK_DEBIAN_PACKAGE_RECOMMENDS})
|
||||
set(CPACK_DEBIAN_DEV_PACKAGE_RECOMMENDS ${CPACK_DEBIAN_PACKAGE_RECOMMENDS})
|
||||
set(CPACK_DEBIAN_ASAN_PACKAGE_PROVIDES "${AMD_SMI_PACKAGE}-asan")
|
||||
|
||||
@@ -133,6 +133,7 @@ do_install_amdsmi_python_lib() {
|
||||
local PREVIOUS_PIP_BREAK_SYSTEM_PACKAGES="$PIP_BREAK_SYSTEM_PACKAGES"
|
||||
export PIP_BREAK_SYSTEM_PACKAGES=1
|
||||
|
||||
|
||||
# Remove old python library
|
||||
local pip_list_output
|
||||
pip_list_output=$(python3 -m pip list --format=columns --disable-pip-version-check)
|
||||
@@ -188,22 +189,10 @@ 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
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
# Other prerm actions
|
||||
rm_ldconfig() {
|
||||
# left-hand term originates from ENABLE_LDCONFIG = ON/OFF at package build
|
||||
if [ "@ENABLE_LDCONFIG@" == "ON" ]; then
|
||||
@@ -8,6 +10,7 @@ rm_ldconfig() {
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
rm_leftovers() {
|
||||
# remove pyc files generated by python
|
||||
rm -rf "@CPACK_PACKAGING_INSTALL_PREFIX@/@CMAKE_INSTALL_LIBEXECDIR@/amdsmi_cli/__pycache__"
|
||||
@@ -27,6 +30,15 @@ rm_logFolder() {
|
||||
rm -rf /var/log/amd_smi_lib
|
||||
}
|
||||
|
||||
|
||||
rm_rocm_tests_dir(){
|
||||
if [ -d "@CPACK_PACKAGING_INSTALL_PREFIX@/share/amd_smi/tests/" ]; then
|
||||
rm -rf "@CPACK_PACKAGING_INSTALL_PREFIX@/share/amd_smi/tests/"
|
||||
echo "Removed ROCm tests directory."
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
return_logrotateToOrigConfig() {
|
||||
local logrotateConfFile=/etc/logrotate.d/amd_smi.conf
|
||||
if [ -f $logrotateConfFile ]; then
|
||||
@@ -86,6 +98,7 @@ case "$1" in
|
||||
rm_ldconfig
|
||||
rm_leftovers
|
||||
rm_logFolder
|
||||
rm_rocm_tests_dir
|
||||
return_logrotateToOrigConfig
|
||||
;;
|
||||
( purge )
|
||||
|
||||
@@ -132,6 +132,7 @@ do_install_amdsmi_python_lib() {
|
||||
local PREVIOUS_PIP_BREAK_SYSTEM_PACKAGES="$PIP_BREAK_SYSTEM_PACKAGES"
|
||||
export PIP_BREAK_SYSTEM_PACKAGES=1
|
||||
|
||||
|
||||
# Remove old python library
|
||||
local pip_list_output
|
||||
pip_list_output=$(python3 -m pip list --format=columns --disable-pip-version-check)
|
||||
@@ -187,22 +188,10 @@ 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
|
||||
}
|
||||
|
||||
# post install or upgrade, $i is 1 or 2 -> do these actions
|
||||
if [ "$1" -ge 1 ]; then
|
||||
do_install_amdsmi_python_lib
|
||||
do_install_amdsmi_pytest
|
||||
do_ldconfig
|
||||
do_updatepciids
|
||||
do_configureLogrotate || exit 0
|
||||
|
||||
@@ -15,10 +15,20 @@ rm_leftovers() {
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
rm_logFolder() {
|
||||
rm -rf /var/log/amd_smi_lib
|
||||
}
|
||||
|
||||
|
||||
rm_rocm_tests_dir(){
|
||||
if [ -d "@CPACK_PACKAGING_INSTALL_PREFIX@/share/amd_smi/tests/" ]; then
|
||||
rm -rf "@CPACK_PACKAGING_INSTALL_PREFIX@/share/amd_smi/tests/"
|
||||
echo "Removed ROCm tests directory."
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
return_logrotateToOrigConfig() {
|
||||
local logrotateConfFile=/etc/logrotate.d/amd_smi.conf
|
||||
if [ -f $logrotateConfFile ]; then
|
||||
@@ -77,5 +87,6 @@ if [ "$1" -le 1 ]; then
|
||||
rm_python_lib
|
||||
rm_leftovers
|
||||
rm_logFolder
|
||||
rm_rocm_tests_dir
|
||||
return_logrotateToOrigConfig
|
||||
fi
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ message("--------CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY: " ${CPACK_COMPONENT
|
||||
# copy python test files into shared directory
|
||||
install(
|
||||
DIRECTORY ./
|
||||
DESTINATION ${SHARE_INSTALL_PREFIX}/tests/pytest/
|
||||
DESTINATION ${SHARE_INSTALL_PREFIX}/tests/python_unittest/
|
||||
COMPONENT dev
|
||||
USE_SOURCE_PERMISSIONS
|
||||
FILES_MATCHING
|
||||
+47
-84
@@ -13,72 +13,35 @@ Follow our install/build guides to ensure the Python API is installed correctly
|
||||
## How to Run
|
||||
### Basic How To
|
||||
The 2 tests are in this PATH:
|
||||
```/opt/rocm/share/amd_smi/tests/pytest/integration_test.py```
|
||||
```/opt/rocm/share/amd_smi/tests/pytest/unit_tests.py```
|
||||
```/opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py```
|
||||
```/opt/rocm/share/amd_smi/tests/python_unittest/unit_tests.py```
|
||||
|
||||
|
||||
The recommended method to run the tests:
|
||||
<u>Pytest verbose</u>
|
||||
```python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/pytest/integration_test.py -s -v```
|
||||
```python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/pytest/unit_tests.py -s -v```
|
||||
|
||||
<u>Pytest only (not verbose)</u>
|
||||
```python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/pytest/integration_test.py -v```
|
||||
```python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/pytest/unit_tests.py -v```
|
||||
The recommended method to run the tests:
|
||||
|
||||
<u>Unittest verbose</u>
|
||||
```/opt/rocm/share/amd_smi/tests/pytest/unit_tests.py -v```
|
||||
```/opt/rocm/share/amd_smi/tests/pytest/integration_test.py -v```
|
||||
```/opt/rocm/share/amd_smi/tests/python_unittest/unit_tests.py -v```
|
||||
```/opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py -v```
|
||||
|
||||
<u>Unittest only (not verbose)</u>
|
||||
```/opt/rocm/share/amd_smi/tests/pytest/unit_tests.py -b -v```
|
||||
```/opt/rocm/share/amd_smi/tests/pytest/integration_test.py -b -v```
|
||||
```/opt/rocm/share/amd_smi/tests/python_unittest/unit_tests.py -b -v```
|
||||
```/opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py -b -v```
|
||||
|
||||
See sections below for more detailed options with examples.
|
||||
|
||||
### Unittest or Pytest Run
|
||||
The Unittest Run calls the tests directly, assuming pytest is correctly installed in the PATH.
|
||||
This is more straightforward and intuitive but with less control for options. For example, the cache provider will always be used.
|
||||
|
||||
```/opt/rocm/share/amd_smi/tests/pytest/*```
|
||||
|
||||
options:
|
||||
- -h, --help show this help message and exit
|
||||
- -v, --verbose Verbose output
|
||||
- -q, --quiet Quiet output
|
||||
- -b, --buffer Buffer stdout and stderr during tests
|
||||
- -k "TESTNAME" Only run tests which match the given substring
|
||||
|
||||
The Pytest Run could be more reliable and consistent, especially if pytest is not in the PATH.
|
||||
This offers more options and flexibility, such as the option to disable the cache provider, ensuring completely independent runs.
|
||||
|
||||
```python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/pytest/*```
|
||||
|
||||
options:
|
||||
- -h, --help show this help message and exit
|
||||
- --co Collect and list tests
|
||||
- -p no:cacheprovider Disable cache provider
|
||||
- -v, --verbose Verbose output
|
||||
- -q, --quiet Quiet output
|
||||
- -s, --capture=no Disables output capturing, stdout output
|
||||
- -k "TESTNAME" Only run tests which match the given substring
|
||||
|
||||
The complete list of options can be accessed here [Pytest command-line flags](https://docs.pytest.org/en/latest/reference/reference.html#command-line-flags).
|
||||
|
||||
## Unittest Run Options
|
||||
### Unittest Run: Verbose on
|
||||
Helpful to see print outs of Python.
|
||||
|
||||
```/opt/rocm/share/amd_smi/tests/pytest/integration_test.py -v```
|
||||
```/opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py -v```
|
||||
|
||||
```/opt/rocm/share/amd_smi/tests/pytest/unit_tests.py -v```
|
||||
```/opt/rocm/share/amd_smi/tests/python_unittest/unit_tests.py -v```
|
||||
|
||||
ex.
|
||||
<details open>
|
||||
<summary>Click for example: <i><b>Unittest run: verbose on</i></b></summary>
|
||||
|
||||
~~~shell
|
||||
/opt/rocm/share/amd_smi/tests/pytest/integration_test.py -v
|
||||
/opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py -v
|
||||
test_init (__main__.TestAmdSmiInit) ... ok
|
||||
test_bad_page_info (__main__.TestAmdSmiPythonInterface) ... ###Test amdsmi_get_gpu_bad_page_info
|
||||
|
||||
@@ -403,16 +366,16 @@ OK
|
||||
|
||||
### Unittest Run: Verbose on + Filter (or exclude) a test
|
||||
|
||||
```/opt/rocm/share/amd_smi/tests/pytest/integration_test.py -k "test_walkthrough" -v```
|
||||
```/opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py -k "test_walkthrough" -v```
|
||||
|
||||
```/opt/rocm/share/amd_smi/tests/pytest/integration_test.py -k "not test_walkthrough" -v```
|
||||
```/opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py -k "not test_walkthrough" -v```
|
||||
|
||||
ex.
|
||||
<details open>
|
||||
<summary>Click for example: <i><b>Unittest Run: Verbose on + Filter (or exclude) a Test</b></i></summary>
|
||||
|
||||
~~~shell
|
||||
> /opt/rocm/share/amd_smi/tests/pytest/integration_test.py -k "test_bdf_device_id" -v
|
||||
> /opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py -k "test_bdf_device_id" -v
|
||||
test_bdf_device_id (__main__.TestAmdSmiPythonInterface) ... ###Test Processor 0, bdf: 0000:08:00.0
|
||||
|
||||
###Test amdsmi_get_gpu_vbios_info
|
||||
@@ -453,16 +416,16 @@ OK
|
||||
Runs all tests. Silence print statements to stdout. Lists tests results.
|
||||
This is also the best way to list all tests available.
|
||||
|
||||
```/opt/rocm/share/amd_smi/tests/pytest/integration_test.py -b -v```
|
||||
```/opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py -b -v```
|
||||
|
||||
```/opt/rocm/share/amd_smi/tests/pytest/unit_tests.py -b -v```
|
||||
```/opt/rocm/share/amd_smi/tests/python_unittest/unit_tests.py -b -v```
|
||||
|
||||
ex.
|
||||
<details open>
|
||||
<summary>Click for example: <i><b>Unittest Run: Silence stdout (print statements) and run all tests</i></b></summary>
|
||||
|
||||
~~~shell
|
||||
/opt/rocm/share/amd_smi/tests/pytest/unit_tests.py -b -v
|
||||
/opt/rocm/share/amd_smi/tests/python_unittest/unit_tests.py -b -v
|
||||
test_check_res (__main__.TestAmdSmiPythonBDF) ... ok
|
||||
test_format_bdf (__main__.TestAmdSmiPythonBDF) ... ok
|
||||
test_parse_bdf (__main__.TestAmdSmiPythonBDF) ... ok
|
||||
@@ -477,16 +440,16 @@ OK
|
||||
|
||||
## Pytest Run Options
|
||||
### Pytest: List tests
|
||||
```python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/pytest/integration_test.py --co```
|
||||
```python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py --co```
|
||||
|
||||
```python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/pytest/unit_tests.py --co```
|
||||
```python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/python_unittest/unit_tests.py --co```
|
||||
|
||||
ex.
|
||||
<details open>
|
||||
<summary>Click for example: <b><i>Pytest: List tests</i></b></summary>
|
||||
|
||||
~~~shell
|
||||
python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/pytest/integration_test.py --co
|
||||
python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py --co
|
||||
===================================================== test session starts =====================================================
|
||||
platform linux -- Python 3.8.10, pytest-8.2.2, pluggy-1.5.0
|
||||
rootdir: /opt/rocm/share/amd_smi
|
||||
@@ -511,53 +474,53 @@ collected 6 items
|
||||
</details>
|
||||
|
||||
### Pytest Run: Verbose on
|
||||
```python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/pytest/integration_test.py -v```
|
||||
```python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py -v```
|
||||
|
||||
```python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/pytest/unit_tests.py -v```
|
||||
```python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/python_unittest/unit_tests.py -v```
|
||||
|
||||
ex.
|
||||
<details open>
|
||||
<summary>Click for example: <b><i>Pytest Run: verbose on</i></b></summary>
|
||||
|
||||
~~~shell
|
||||
python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/pytest/unit_tests.py -v
|
||||
python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/python_unittest/unit_tests.py -v
|
||||
===================================================== test session starts =====================================================
|
||||
platform linux -- Python 3.8.10, pytest-8.2.2, pluggy-1.5.0 -- /usr/bin/python3
|
||||
rootdir: /opt/rocm/share/amd_smi
|
||||
configfile: pyproject.toml
|
||||
collected 3 items
|
||||
|
||||
../../opt/rocm/share/amd_smi/tests/pytest/unit_tests.py::TestAmdSmiPythonBDF::test_check_res PASSED [ 33%]
|
||||
../../opt/rocm/share/amd_smi/tests/pytest/unit_tests.py::TestAmdSmiPythonBDF::test_format_bdf PASSED [ 66%]
|
||||
../../opt/rocm/share/amd_smi/tests/pytest/unit_tests.py::TestAmdSmiPythonBDF::test_parse_bdf PASSED [100%]
|
||||
../../opt/rocm/share/amd_smi/tests/python_unittest/unit_tests.py::TestAmdSmiPythonBDF::test_check_res PASSED [ 33%]
|
||||
../../opt/rocm/share/amd_smi/tests/python_unittest/unit_tests.py::TestAmdSmiPythonBDF::test_format_bdf PASSED [ 66%]
|
||||
../../opt/rocm/share/amd_smi/tests/python_unittest/unit_tests.py::TestAmdSmiPythonBDF::test_parse_bdf PASSED [100%]
|
||||
|
||||
====================================================== 3 passed in 0.04s ======================================================
|
||||
~~~
|
||||
</details>
|
||||
|
||||
### Pytest Run: Verbose on + stdout (print statements)
|
||||
```python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/pytest/integration_test.py -s -v```
|
||||
```python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py -s -v```
|
||||
|
||||
```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/python_unittest/unit_tests.py -s -v```
|
||||
|
||||
ex.
|
||||
<details open>
|
||||
<summary>Click for example: <b><i> Pytest Run: verbose on + stdout (print statements)</i></b></summary>
|
||||
|
||||
~~~shell
|
||||
python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/pytest/integration_test.py -s -v
|
||||
python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py -s -v
|
||||
===================================================== test session starts =====================================================
|
||||
platform linux -- Python 3.8.10, pytest-8.2.2, pluggy-1.5.0 -- /usr/bin/python3
|
||||
rootdir: /opt/rocm/share/amd_smi
|
||||
configfile: pyproject.toml
|
||||
collected 6 items
|
||||
|
||||
../../opt/rocm/share/amd_smi/tests/pytest/integration_test.py::TestAmdSmiInit::test_init PASSED
|
||||
../../opt/rocm/share/amd_smi/tests/pytest/integration_test.py::TestAmdSmiPythonInterface::test_bad_page_info ###Test amdsmi_get_gpu_bad_page_info
|
||||
../../opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py::TestAmdSmiInit::test_init PASSED
|
||||
../../opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py::TestAmdSmiPythonInterface::test_bad_page_info ###Test amdsmi_get_gpu_bad_page_info
|
||||
|
||||
**** [ERROR] | Test: test_bad_page_info | Caught AmdSmiLibraryException
|
||||
PASSED
|
||||
../../opt/rocm/share/amd_smi/tests/pytest/integration_test.py::TestAmdSmiPythonInterface::test_bdf_device_id ###Test Processor 0, bdf: 0000:08:00.0
|
||||
../../opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py::TestAmdSmiPythonInterface::test_bdf_device_id ###Test Processor 0, bdf: 0000:08:00.0
|
||||
|
||||
###Test amdsmi_get_gpu_vbios_info
|
||||
|
||||
@@ -584,13 +547,13 @@ PASSED
|
||||
|
||||
uuid is: 1fff73a3-0000-1000-8075-223e5e64eac1
|
||||
PASSED
|
||||
../../opt/rocm/share/amd_smi/tests/pytest/integration_test.py::TestAmdSmiPythonInterface::test_ecc ###Test Processor 0, bdf: 0000:08:00.0
|
||||
../../opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py::TestAmdSmiPythonInterface::test_ecc ###Test Processor 0, bdf: 0000:08:00.0
|
||||
|
||||
###Test amdsmi_get_gpu_ras_feature_info
|
||||
|
||||
**** [ERROR] | Test: test_ecc | Caught AmdSmiLibraryException
|
||||
PASSED
|
||||
../../opt/rocm/share/amd_smi/tests/pytest/integration_test.py::TestAmdSmiPythonInterface::test_gpu_performance ###Test Processor 0, bdf: 0000:08:00.0
|
||||
../../opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py::TestAmdSmiPythonInterface::test_gpu_performance ###Test Processor 0, bdf: 0000:08:00.0
|
||||
|
||||
###Test amdsmi_get_gpu_activity
|
||||
engine_usage['gfx_activity'] is: 1 %
|
||||
@@ -725,7 +688,7 @@ PASSED
|
||||
pcie_info['pcie_metric']['pcie_nak_sent_count'] is: N/A
|
||||
pcie_info['pcie_metric']['pcie_nak_received_count'] is: N/A
|
||||
PASSED
|
||||
../../opt/rocm/share/amd_smi/tests/pytest/integration_test.py::TestAmdSmiPythonInterface::test_walkthrough ###Test amdsmi_get_processor_handles()
|
||||
../../opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py::TestAmdSmiPythonInterface::test_walkthrough ###Test amdsmi_get_processor_handles()
|
||||
###Test amdsmi_get_gpu_device_bdf() | START walk_through | processor i = 0
|
||||
###Test Processor 0, bdf: 0000:08:00.0
|
||||
|
||||
@@ -871,27 +834,27 @@ PASSED
|
||||
### Pytest Run: Verbose on + Filter (or exclude) a Test
|
||||
Use [Pytest: List tests](###-Pytest:-List-tests) then either exclude (with "not") or only run the specified test.
|
||||
|
||||
```python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/pytest/integration_test.py -k "test_gpu_performance" -v```
|
||||
```python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py -k "test_gpu_performance" -v```
|
||||
|
||||
```python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/pytest/integration_test.py -k "not test_gpu_performance" -v```
|
||||
```python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py -k "not test_gpu_performance" -v```
|
||||
|
||||
ex.
|
||||
<details open>
|
||||
<summary>Click for example: <b><i>Pytest Run: Verbose on + Filter (or exclude) a Test</i></b></summary>
|
||||
|
||||
~~~shell
|
||||
python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/pytest/integration_test.py -k "not test_gpu_performance" -v
|
||||
python3 -m pytest -p no:cacheprovider /opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py -k "not test_gpu_performance" -v
|
||||
===================================================== test session starts =====================================================
|
||||
platform linux -- Python 3.8.10, pytest-8.2.2, pluggy-1.5.0 -- /usr/bin/python3
|
||||
rootdir: /opt/rocm/share/amd_smi
|
||||
configfile: pyproject.toml
|
||||
collected 6 items / 1 deselected / 5 selected
|
||||
|
||||
../../opt/rocm/share/amd_smi/tests/pytest/integration_test.py::TestAmdSmiInit::test_init PASSED [ 20%]
|
||||
../../opt/rocm/share/amd_smi/tests/pytest/integration_test.py::TestAmdSmiPythonInterface::test_bad_page_info PASSED [ 40%]
|
||||
../../opt/rocm/share/amd_smi/tests/pytest/integration_test.py::TestAmdSmiPythonInterface::test_bdf_device_id PASSED [ 60%]
|
||||
../../opt/rocm/share/amd_smi/tests/pytest/integration_test.py::TestAmdSmiPythonInterface::test_ecc PASSED [ 80%]
|
||||
../../opt/rocm/share/amd_smi/tests/pytest/integration_test.py::TestAmdSmiPythonInterface::test_walkthrough PASSED [100%]
|
||||
../../opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py::TestAmdSmiInit::test_init PASSED [ 20%]
|
||||
../../opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py::TestAmdSmiPythonInterface::test_bad_page_info PASSED [ 40%]
|
||||
../../opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py::TestAmdSmiPythonInterface::test_bdf_device_id PASSED [ 60%]
|
||||
../../opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py::TestAmdSmiPythonInterface::test_ecc PASSED [ 80%]
|
||||
../../opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py::TestAmdSmiPythonInterface::test_walkthrough PASSED [100%]
|
||||
|
||||
=============================================== 5 passed, 1 deselected in 0.09s ===============================================
|
||||
~~~
|
||||
@@ -902,14 +865,14 @@ collected 6 items / 1 deselected / 5 selected
|
||||
Please refer to Python's UnitTest documentation for better overview of commands to run.
|
||||
|
||||
```shell
|
||||
python3 /opt/rocm/share/amd_smi/tests/pytest/unit_tests.py -v
|
||||
python3 /opt/rocm/share/amd_smi/tests/python_unittest/unit_tests.py -v
|
||||
test_check_res (tests.amd_smi_test.py-test.unit_tests.TestAmdSmiPythonBDF) ... ok
|
||||
test_format_bdf (tests.amd_smi_test.py-test.unit_tests.TestAmdSmiPythonBDF) ... ok
|
||||
test_parse_bdf (tests.amd_smi_test.py-test.unit_tests.TestAmdSmiPythonBDF) ... ok
|
||||
```
|
||||
|
||||
```shell
|
||||
python3 /opt/rocm/share/amd_smi/tests/pytest/integration_test.py -v
|
||||
python3 /opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py -v
|
||||
test_init (__main__.TestAmdSmiInit) ... ok
|
||||
test_bad_page_info (__main__.TestAmdSmiPythonInterface) ... ###Test amdsmi_get_gpu_bad_page_info
|
||||
|
||||
@@ -1229,7 +1192,7 @@ OK
|
||||
```
|
||||
|
||||
```shell
|
||||
(Tue Jul-7 12:07:47am)-(CPU 0.3%:0:Net 18)-(charpoag@mlsetools2:/opt/rocm/share/amd_smi/tests/pytest)-(44K:3)
|
||||
(Tue Jul-7 12:07:47am)-(CPU 0.3%:0:Net 18)-(charpoag@mlsetools2:/opt/rocm/share/amd_smi/tests/python_unittest)-(44K:3)
|
||||
> python3 -m pytest -s -ra -vvv -p no:cacheprovider
|
||||
==================================== test session starts =====================================
|
||||
platform linux -- Python 3.8.10, pytest-8.2.2, pluggy-1.5.0 -- /usr/bin/python3
|
||||
@@ -1553,7 +1516,7 @@ PASSED
|
||||
```
|
||||
|
||||
```shell
|
||||
$ python3 /opt/rocm/share/amd_smi/tests/pytest/integration_test.py -k "*test_init" -vvv
|
||||
$ python3 /opt/rocm/share/amd_smi/tests/python_unittest/integration_test.py -k "*test_init" -vvv
|
||||
test_init (__main__.TestAmdSmiInit) ... ok
|
||||
|
||||
----------------------------------------------------------------------
|
||||
@@ -1564,7 +1527,7 @@ OK
|
||||
```
|
||||
|
||||
```shell
|
||||
(Tue Jul-7 12:10:10am)-(CPU 0.3%:0:Net 16)-(charpoag@mlsetools2:/opt/rocm/share/amd_smi/tests/pytest)-(44K:3)
|
||||
(Tue Jul-7 12:10:10am)-(CPU 0.3%:0:Net 16)-(charpoag@mlsetools2:/opt/rocm/share/amd_smi/tests/python_unittest)-(44K:3)
|
||||
> python3 -m pytest -ra -vvv -p no:cacheprovider
|
||||
==================================== test session starts =====================================
|
||||
platform linux -- Python 3.8.10, pytest-8.2.2, pluggy-1.5.0 -- /usr/bin/python3
|
||||
مرجع در شماره جدید
Block a user