From f85c20ff3dcd6f6fda0da4fee6bde6c4bdd03a3b Mon Sep 17 00:00:00 2001 From: Kamal Heib Date: Fri, 2 Jun 2023 08:41:13 -0400 Subject: [PATCH] Update to upstream release 4.24.0 Add gating tests Resolves: rhbz#2170069 Signed-off-by: Kamal Heib --- .gitignore | 1 + mstflint.spec | 9 +++++++-- sources | 2 +- tests/run_tests.sh | 10 ++++++++++ tests/sanity.sh | 47 ++++++++++++++++++++++++++++++++++++++++++++++ tests/tests.yml | 12 ++++++++++++ 6 files changed, 78 insertions(+), 3 deletions(-) create mode 100755 tests/run_tests.sh create mode 100755 tests/sanity.sh create mode 100644 tests/tests.yml diff --git a/.gitignore b/.gitignore index b120756..062d51c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ SOURCES/mstflint-4.23.0-1.tar.gz /mstflint-4.23.0-1.tar.gz +/mstflint-4.24.0-1.tar.gz diff --git a/mstflint.spec b/mstflint.spec index fbaa5a4..d6bbb9f 100644 --- a/mstflint.spec +++ b/mstflint.spec @@ -2,8 +2,8 @@ Name: mstflint Summary: Mellanox firmware burning tool -Version: 4.23.0 -Release: 2%{?dist} +Version: 4.24.0 +Release: 1%{?dist} License: GPLv2+ or BSD Url: https://github.com/Mellanox/%{name} Source0: https://github.com/Mellanox/%{name}/releases/download/v%{version}-1/%{name}-%{version}-1.tar.gz @@ -63,6 +63,11 @@ chmod +x %{buildroot}/%{_libdir}/mstflint/python_tools/*.so %{_mandir}/man1/* %changelog +* Fri Jun 02 2023 Kamal Heib - 4.24.0-1 +- Update to upstream release 4.24.0 +- Add gating tests +- Resolves: rhbz#2170069 + * Wed Feb 08 2023 Michal Schmidt - 4.23.0-2 - Update to upstream release 4.23.0 - Resolves: rhbz#2112936 diff --git a/sources b/sources index 5f4ff5b..11476a8 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (mstflint-4.23.0-1.tar.gz) = 5a5d779a7b7635128417701a059c2e2c8d4e58ff9f71950e50d6df1c583ff594cf883af1e0412d995fb8c66390884989a6c4dab0ce95bcd3bc67312be4412f2b +SHA512 (mstflint-4.24.0-1.tar.gz) = 143dd558e9b57e26d25459885957422b650dc2cdc5b0069b77d1cda07d3da4161a57b10b7d38fffe609c23c7905611ec04834f9c06174a7ba7462dd71085c3b5 diff --git a/tests/run_tests.sh b/tests/run_tests.sh new file mode 100755 index 0000000..11017ab --- /dev/null +++ b/tests/run_tests.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +# when running this in 1minutetip the PATH must be specified to execute +# in the local directory. +echo "Setting path to local directory" +PATH=$PATH:$(pwd) + +# simple sanity test +sanity.sh +exit $? diff --git a/tests/sanity.sh b/tests/sanity.sh new file mode 100755 index 0000000..69d1cea --- /dev/null +++ b/tests/sanity.sh @@ -0,0 +1,47 @@ +#!/bin/bash +# +# This is a simple sanity test to satisfy the RHEL8.1 onboard gating +# requirement. + +ret=0 +cx2="ConnectX VPI PCIe 2.0" +cx3="[ConnectX-3]" +device_list=$(lspci | grep 'Mellanox' | grep -v 'Virtual' | grep -v 'DMA controller' | awk '{print $1}') + +# Skip loop if device list is empty +[[ -z "${dev// }" ]] || for dev in "$device_list"; do + # View Device Info + + lspci -vvv -s "$dev" + dev_name=$(lspci -s "$dev") + + # Test Mstflint Tools + + mstflint -d "$dev" q + let ret=$ret+$? + + # mstconfig does not support < 4th Gen devices (e.g. ConnectX-2) + if [[ "$dev_name" != *"$cx2"* ]]; then + mstconfig -d "${dev}" q + let ret=$ret+$? + fi + + mstvpd "$dev" 2>/dev/null + let ret=$ret+$? + + mstregdump "$dev" >/dev/null + let ret=$ret+$? + + # mstfwmanager/mstfwreset do not support ConnectX-2 or ConnectX-3 + if [[ "$dev_name" != *"$cx2"* && "$dev_name" != *"$cx3"* ]]; then + mstfwmanager -d "$dev" --query + let ret=$ret+$? + + mstfwreset -d "$dev" q + let ret=$ret+$? + fi +done + +# end test - it is possible no Mellanox devices were available at all to test, +# in which case we automatically mark the test PASS (exit 0) +exit $ret diff --git a/tests/tests.yml b/tests/tests.yml new file mode 100644 index 0000000..724d05a --- /dev/null +++ b/tests/tests.yml @@ -0,0 +1,12 @@ +- hosts: localhost + roles: + - role: standard-test-basic + tags: + - classic + tests: + - simple: + dir: . + run: ./run_tests.sh + required_packages: + - pciutils + - mstflint