Compare commits
No commits in common. "c9-beta" and "imports/c10s/libnvme-1.10-1.el10" have entirely different histories.
c9-beta
...
imports/c1
17
.gitignore
vendored
17
.gitignore
vendored
@ -1 +1,16 @@
|
|||||||
SOURCES/libnvme-1.11.1.tar.gz
|
/libnvme-1.0-rc4.tar.gz
|
||||||
|
/libnvme-1.0-rc5.tar.gz
|
||||||
|
/libnvme-1.0-rc6.tar.gz
|
||||||
|
/libnvme-1.0-rc7.tar.gz
|
||||||
|
/libnvme-1.0-rc8.tar.gz
|
||||||
|
/libnvme-1.0.tar.gz
|
||||||
|
/libnvme-1.1-rc0.tar.gz
|
||||||
|
/libnvme-1.1.tar.gz
|
||||||
|
/libnvme-1.2.tar.gz
|
||||||
|
/libnvme-1.3.tar.gz
|
||||||
|
/libnvme-1.4.tar.gz
|
||||||
|
/libnvme-1.5.tar.gz
|
||||||
|
/libnvme-1.6.tar.gz
|
||||||
|
/libnvme-1.7.1.tar.gz
|
||||||
|
/libnvme-1.9.tar.gz
|
||||||
|
/libnvme-1.10.tar.gz
|
||||||
|
@ -1 +0,0 @@
|
|||||||
a40bbd4bb2ec9225a4a0dbfab4135895da37404f SOURCES/libnvme-1.11.1.tar.gz
|
|
6
gating.yaml
Normal file
6
gating.yaml
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
--- !Policy
|
||||||
|
product_versions:
|
||||||
|
- rhel-10
|
||||||
|
decision_context: osci_compose_gate
|
||||||
|
rules:
|
||||||
|
- !PassingTestCaseRule {test_case_name: osci.brew-build.tier0.functional}
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
Name: libnvme
|
Name: libnvme
|
||||||
Summary: Linux-native nvme device management library
|
Summary: Linux-native nvme device management library
|
||||||
Version: 1.11.1
|
Version: 1.10
|
||||||
Release: 1%{?dist}
|
Release: 1%{?dist}
|
||||||
License: LGPL-2.1-or-later
|
License: LGPL-2.1-or-later
|
||||||
URL: https://github.com/linux-nvme/libnvme
|
URL: https://github.com/linux-nvme/libnvme
|
||||||
@ -12,12 +12,15 @@ Source0: %{url}/archive/v%{version_no_tilde}/%{name}-%{version_no_tilde}.tar.gz
|
|||||||
BuildRequires: gcc gcc-c++
|
BuildRequires: gcc gcc-c++
|
||||||
BuildRequires: swig
|
BuildRequires: swig
|
||||||
BuildRequires: python3-devel
|
BuildRequires: python3-devel
|
||||||
BuildRequires: meson >= 0.50.0
|
|
||||||
|
BuildRequires: meson >= 0.50
|
||||||
BuildRequires: json-c-devel >= 0.13
|
BuildRequires: json-c-devel >= 0.13
|
||||||
BuildRequires: openssl-devel
|
BuildRequires: openssl-devel
|
||||||
|
BuildRequires: dbus-devel
|
||||||
BuildRequires: keyutils-libs-devel
|
BuildRequires: keyutils-libs-devel
|
||||||
|
%if 0%{?fedora} || 0%{?rhel} > 9
|
||||||
Requires: keyutils-libs
|
BuildRequires: kernel-headers >= 5.15
|
||||||
|
%endif
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Provides type definitions for NVMe specification structures,
|
Provides type definitions for NVMe specification structures,
|
||||||
@ -46,6 +49,7 @@ This package contains the reference manual for %{name}.
|
|||||||
Summary: Python3 bindings for libnvme
|
Summary: Python3 bindings for libnvme
|
||||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||||
Provides: python3-nvme = %{version}-%{release}
|
Provides: python3-nvme = %{version}-%{release}
|
||||||
|
Obsoletes: python3-nvme < 1.0~rc7
|
||||||
%{?python_provide:%python_provide python3-libnvme}
|
%{?python_provide:%python_provide python3-libnvme}
|
||||||
|
|
||||||
%description -n python3-libnvme
|
%description -n python3-libnvme
|
||||||
@ -55,7 +59,7 @@ This package contains Python bindings for libnvme.
|
|||||||
%autosetup -p1 -n %{name}-%{version_no_tilde}
|
%autosetup -p1 -n %{name}-%{version_no_tilde}
|
||||||
|
|
||||||
%build
|
%build
|
||||||
%meson -Dpython=enabled -Dlibdbus=disabled -Ddocs=all -Ddocs-build=true -Dhtmldir=%{_pkgdocdir}
|
%meson -Dpython=enabled -Dlibdbus=enabled -Ddocs=all -Ddocs-build=true -Dhtmldir=%{_pkgdocdir}
|
||||||
%meson_build
|
%meson_build
|
||||||
|
|
||||||
%install
|
%install
|
||||||
@ -65,15 +69,16 @@ This package contains Python bindings for libnvme.
|
|||||||
mv %{buildroot}%{_pkgdocdir}/nvme/html %{buildroot}%{_pkgdocdir}/html
|
mv %{buildroot}%{_pkgdocdir}/nvme/html %{buildroot}%{_pkgdocdir}/html
|
||||||
rm -rf %{buildroot}%{_pkgdocdir}/nvme
|
rm -rf %{buildroot}%{_pkgdocdir}/nvme
|
||||||
mv %{buildroot}/usr/*.rst %{buildroot}%{_pkgdocdir}/
|
mv %{buildroot}/usr/*.rst %{buildroot}%{_pkgdocdir}/
|
||||||
|
rm -r %{buildroot}%{_pkgdocdir}/html/{.buildinfo,.doctrees/}
|
||||||
|
|
||||||
%ldconfig_scriptlets
|
%ldconfig_scriptlets
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%license COPYING ccan/licenses/*
|
%license COPYING ccan/licenses/*
|
||||||
%{_libdir}/libnvme.so.1
|
%{_libdir}/libnvme.so.1
|
||||||
%{_libdir}/libnvme.so.1.11.1
|
%{_libdir}/libnvme.so.1.10.0
|
||||||
%{_libdir}/libnvme-mi.so.1
|
%{_libdir}/libnvme-mi.so.1
|
||||||
%{_libdir}/libnvme-mi.so.1.11.1
|
%{_libdir}/libnvme-mi.so.1.10.0
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%{_libdir}/libnvme.so
|
%{_libdir}/libnvme.so
|
||||||
@ -93,71 +98,84 @@ mv %{buildroot}/usr/*.rst %{buildroot}%{_pkgdocdir}/
|
|||||||
%{python3_sitearch}/libnvme/*
|
%{python3_sitearch}/libnvme/*
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Tue Nov 19 2024 Maurizio Lombardi <mlombard@redhat.com> - 1.11.1-1
|
* Mon Oct 21 2024 Maurizio Lombardi <mlombard@redhat.com> - 1.10-1
|
||||||
- TLS Fixes (RHEL-53980)
|
- Update to version 1.10 (RHEL-63282)
|
||||||
|
|
||||||
* Tue Nov 12 2024 Maurizio Lombardi <mlombard@redhat.com> - 1.11-1
|
* Fri Jul 26 2024 Maurizio Lombardi <mlombard@redhat.com> - 1.9-4
|
||||||
- Update libnvme to version 1.11 (RHEL-67145)
|
- Fix RHEL-37611
|
||||||
|
|
||||||
* Mon Oct 07 2024 Maurizio Lombardi <mlombard@redhat.com> - 1.10-1
|
* Thu Jul 25 2024 Maurizio Lombardi <mlombard@redhat.com> - 1.9-3
|
||||||
- Update to latest upstream version RHEL-61573
|
- Fix RHEL-46699
|
||||||
|
|
||||||
* Thu Aug 01 2024 Maurizio Lombardi <mlombard@redhat.com> - 1.9-3
|
* Mon Jun 24 2024 Troy Dawson <tdawson@redhat.com> - 1.9-2
|
||||||
- Backport fix for RHEL-49544
|
- Bump release for June 2024 mass rebuild
|
||||||
|
|
||||||
* Wed Jul 24 2024 Tomas Bzatek <tbzatek@redhat.com> - 1.9-2
|
* Fri May 03 2024 Tomas Bzatek <tbzatek@redhat.com> - 1.9-1
|
||||||
- Backport URI parser API
|
- Upstream v1.9 release
|
||||||
|
|
||||||
* Tue May 07 2024 Maurizio Lombardi <mlombard@redhat.com> - 1.9-1
|
* Wed Feb 28 2024 Davide Cavalca <dcavalca@fedoraproject.org> - 1.8-2
|
||||||
- Rebase to version 1.9
|
- Do not package doctrees to make the package build reproducible
|
||||||
|
|
||||||
* Tue Apr 02 2024 Maurizio Lombardi <mlombard@redhat.com> - 1.8-1
|
* Wed Feb 14 2024 Tomas Bzatek <tbzatek@redhat.com> - 1.8-1
|
||||||
- Update to version 1.8
|
- Upstream v1.8 release
|
||||||
|
|
||||||
* Fri Nov 03 2023 Maurizio Lombardi <mlombard@redhat.com> - 1.6-1
|
* Fri Feb 09 2024 Tomas Bzatek <tbzatek@redhat.com> - 1.7.1-4
|
||||||
- Update to version 1.6, including the stack-smashing fixes
|
- nbft: Fix SSNS HFI indexes parsing
|
||||||
|
- cleanup: Explicitly initialize auto-cleanup variables
|
||||||
|
|
||||||
* Mon Jul 17 2023 John Meneghini <jmeneghi@redhat.com> - 1.4-7
|
* Thu Jan 25 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.1-3
|
||||||
- Fix BZ#2223429
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||||
|
|
||||||
* Mon Jun 05 2023 Maurizio Lombardi <mlombard@redhat.com> - 1.4-6
|
* Sun Jan 21 2024 Fedora Release Engineering <releng@fedoraproject.org> - 1.7.1-2
|
||||||
- Rebuild for BZ2212307
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
|
||||||
|
|
||||||
* Tue May 16 2023 Maurizio Lombardi <mlombard@redhat.com> - 1.4-5
|
* Thu Dec 28 2023 Tomas Bzatek <tbzatek@redhat.com> - 1.7.1-1
|
||||||
- Add support to NBFT (BZ2188516)
|
- Upstream v1.7.1 release
|
||||||
|
|
||||||
* Mon May 08 2023 Maurizio Lombardi <mlombard@redhat.com> - 1.4-4
|
* Tue Oct 24 2023 Tomas Bzatek <tbzatek@redhat.com> - 1.6-2
|
||||||
- Fix BZ#2190206
|
- Backport stack smashing fixes (#2245707)
|
||||||
|
|
||||||
* Fri May 05 2023 Maurizio Lombardi <mlombard@redhat.com> - 1.4-3
|
* Fri Sep 29 2023 Tomas Bzatek <tbzatek@redhat.com> - 1.6-1
|
||||||
- Fix Jira RHEL-258
|
- Upstream v1.6 release
|
||||||
|
|
||||||
* Thu Apr 06 2023 Maurizio Lombardi <mlombard@redhat.com> - 1.4-2
|
* Thu Jul 20 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.5-3
|
||||||
- Rebuild the package
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
|
||||||
|
|
||||||
* Mon Apr 03 2023 Maurizio Lombardi <mlombard@redhat.com> - 1.4-1
|
* Tue Jul 04 2023 Python Maint <python-maint@redhat.com> - 1.5-2
|
||||||
- Update to version 1.4
|
- Rebuilt for Python 3.12
|
||||||
|
|
||||||
* Thu Jan 12 2023 John Meneghini <jmeneghi@redhat.com> - 1.2-2
|
* Tue Jul 04 2023 Tomas Bzatek <tbzatek@redhat.com> - 1.5-1
|
||||||
- Fix BZ2158264
|
- Upstream v1.5 release
|
||||||
|
|
||||||
* Fri Nov 04 2022 Maurizio Lombardi <mlombard@redhat.com> - 1.2-1
|
* Thu Jun 15 2023 Python Maint <python-maint@redhat.com> - 1.4-3
|
||||||
- Update to upstream version v1.2
|
- Rebuilt for Python 3.12
|
||||||
|
|
||||||
* Mon Sep 19 2022 Maurizio Lombardi <mlombard@redhat.com> - 1.1-1
|
* Thu Apr 20 2023 Tomas Bzatek <tbzatek@redhat.com> - 1.4-2
|
||||||
- Update to upstream version v1.1
|
- Backport the NBFT parser from git master
|
||||||
|
|
||||||
* Fri Jun 24 2022 Maurizio Lombardi <mlombard@redhat.com> - 1.0-5
|
* Mon Apr 03 2023 Tomas Bzatek <tbzatek@redhat.com> - 1.4-1
|
||||||
- Rebuild for RHEL9.1
|
- Upstream v1.4 release
|
||||||
|
|
||||||
* Thu Jun 09 2022 Maurizio Lombardi <mlombard@redhat.com> - 1.0-4
|
* Tue Jan 31 2023 Tomas Bzatek <tbzatek@redhat.com> - 1.3-1
|
||||||
- Add gating tests
|
- Upstream v1.3 release
|
||||||
|
|
||||||
* Wed Jun 01 2022 Maurizio Lombardi <mlombard@redhat.com> - 1.0-3
|
* Thu Jan 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 1.2-2
|
||||||
- Rebuild for RHEL 9.1
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||||
|
|
||||||
* Wed Apr 27 2022 Maurizio Lombardi <mlombard@redhat.com> - 1.0-2
|
* Tue Nov 01 2022 Tomas Bzatek <tbzatek@redhat.com> - 1.2-1
|
||||||
- Porting to RHEL 9
|
- Upstream v1.2 release
|
||||||
|
|
||||||
|
* Fri Aug 05 2022 Tomas Bzatek <tbzatek@redhat.com> - 1.1-1
|
||||||
|
- Upstream v1.1 release
|
||||||
|
|
||||||
|
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1.1~rc0-2
|
||||||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
|
||||||
|
|
||||||
|
* Fri Jul 15 2022 Tomas Bzatek <tbzatek@redhat.com> - 1.1~rc0-1
|
||||||
|
- Upstream v1.1 Release Candidate 0
|
||||||
|
|
||||||
|
* Mon Jun 13 2022 Python Maint <python-maint@redhat.com> - 1.0-2
|
||||||
|
- Rebuilt for Python 3.11
|
||||||
|
|
||||||
* Mon Apr 11 2022 Tomas Bzatek <tbzatek@redhat.com> - 1.0-1
|
* Mon Apr 11 2022 Tomas Bzatek <tbzatek@redhat.com> - 1.0-1
|
||||||
- Upstream v1.0 release
|
- Upstream v1.0 release
|
1
sources
Normal file
1
sources
Normal file
@ -0,0 +1 @@
|
|||||||
|
SHA512 (libnvme-1.10.tar.gz) = 44e8a407c9fda8c296163832c14ba167caab53eab315bd2dee94275458532429f12a35e0adef1356420d83127e658a354ce65ac946acaa53bef2d46a8189054c
|
272
tests/include/tc.sh
Normal file
272
tests/include/tc.sh
Normal file
@ -0,0 +1,272 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright (c) 2016 Red Hat, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# Author: Yi Zhang <yizhan@redhat.com>
|
||||||
|
|
||||||
|
# filename: function
|
||||||
|
|
||||||
|
# USAGE
|
||||||
|
|
||||||
|
test x$LXT_TC = x || return
|
||||||
|
LXT_TC=1
|
||||||
|
|
||||||
|
#
|
||||||
|
# print the current date
|
||||||
|
# usage: d=$(tdate)
|
||||||
|
#
|
||||||
|
tdate ()
|
||||||
|
{
|
||||||
|
date '+%T' 2>/dev/null
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# print the log information
|
||||||
|
# usage: tlog "hello world" "WARNING"
|
||||||
|
#
|
||||||
|
tlog ()
|
||||||
|
{
|
||||||
|
local msg=$1
|
||||||
|
local log_level=${2:-INFO}
|
||||||
|
local cur_date=$(tdate)
|
||||||
|
|
||||||
|
echo "[$log_level][$cur_date]$msg"
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# run the cmd and format the log. return the exitint status of cmd
|
||||||
|
# use the global variables: tSTDOUT and tSTDERR to return the stdout and stderr
|
||||||
|
# usage: trun "ls"
|
||||||
|
# trun "ls"; echo $?
|
||||||
|
# stdout=$tSTDOUT
|
||||||
|
# stderr=$tSTDERR
|
||||||
|
#
|
||||||
|
trun ()
|
||||||
|
{
|
||||||
|
local cmd="$*"
|
||||||
|
|
||||||
|
_trun_ "$cmd"
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# verify the execution of command
|
||||||
|
# if the cmd return 0, mark this checkpoint failed and return 1
|
||||||
|
# if not, mark it passed and return 0
|
||||||
|
# usage: tnot "ls /not_existing"
|
||||||
|
#
|
||||||
|
tnot () {
|
||||||
|
local cmd="$*"
|
||||||
|
_trun_ "$cmd" 1
|
||||||
|
if test $? -eq 0; then
|
||||||
|
tfail_ "$cmd" ;
|
||||||
|
else
|
||||||
|
tpass_ "$cmd" ;
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# verify the execution of command
|
||||||
|
# if the cmd return 0, mark this checkpoint passed and return 0
|
||||||
|
# if not, mark it failed and return 1
|
||||||
|
# usage: tok "ls /"
|
||||||
|
#
|
||||||
|
tok ()
|
||||||
|
{
|
||||||
|
local cmd="$*"
|
||||||
|
_trun_ "$cmd" 0
|
||||||
|
if test $? -eq 0; then
|
||||||
|
tpass_ "$cmd" ;
|
||||||
|
else
|
||||||
|
tfail_ "$cmd" ;
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# verify the execution of command
|
||||||
|
# if the cmd return 0, mark this checkpoint passed and return 0
|
||||||
|
# if not, mark it failes and exit
|
||||||
|
# usage: terr "ls"
|
||||||
|
#
|
||||||
|
#terr ()
|
||||||
|
#{
|
||||||
|
# tok "$*" || tend
|
||||||
|
#}
|
||||||
|
|
||||||
|
#
|
||||||
|
# verify the execution of command
|
||||||
|
# if the cmd return 0, will continue to run the script
|
||||||
|
# if not, mark it failes and exit
|
||||||
|
# usage: terr "ls"
|
||||||
|
#
|
||||||
|
terr ()
|
||||||
|
{
|
||||||
|
local cmd="$*"
|
||||||
|
_trun_ "$cmd" 0
|
||||||
|
if test $? -ne 0; then
|
||||||
|
tfail_ "$cmd" ;
|
||||||
|
tend ;
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# exit the program and print the log message
|
||||||
|
# usage: texit "error message" 100
|
||||||
|
# similar to the exception
|
||||||
|
#
|
||||||
|
texit ()
|
||||||
|
{
|
||||||
|
msg=$1
|
||||||
|
err=$2
|
||||||
|
is_null $err && err=1
|
||||||
|
test $err -lt 1 || err=1
|
||||||
|
|
||||||
|
tlog "$msg" "ERROR"
|
||||||
|
exit $2
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# print the test report, cleanup the testing bed and close the testing.
|
||||||
|
# usage: tend
|
||||||
|
#
|
||||||
|
tend ()
|
||||||
|
{
|
||||||
|
local pcount=$(wc -l $tPASS_FILE | awk '{print $1}')
|
||||||
|
local fcount=$(wc -l $tFAIL_FILE | awk '{print $1}')
|
||||||
|
local total=$(( $pcount + $fcount ))
|
||||||
|
|
||||||
|
echo "#################################Test Report###############################"
|
||||||
|
echo "TOTAL : $total"
|
||||||
|
echo "PASSED : $pcount"
|
||||||
|
echo "FAILED : $fcount"
|
||||||
|
cat $tPASS_FILE $tFAIL_FILE
|
||||||
|
echo "###########################End of running $0########################"
|
||||||
|
|
||||||
|
#cleanup
|
||||||
|
rm -f $tPASS_FILE $tFAIL_FILE $tRETURN_FILE $tSTDERR_FILE
|
||||||
|
# rm -rf $LXT_TMP_DIR
|
||||||
|
if [[ $pcount -eq 0 ]] && [[ $total -eq 0 ]];then
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
test $pcount -eq 0 && exit 1
|
||||||
|
test $pcount -eq $total && exit 0
|
||||||
|
exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# private function
|
||||||
|
#
|
||||||
|
|
||||||
|
#
|
||||||
|
# print the error message and call stack. return 1
|
||||||
|
#
|
||||||
|
tfail_ ()
|
||||||
|
{
|
||||||
|
local msg=$*
|
||||||
|
tlog "$msg" "ERROR" >>$tFAIL_FILE
|
||||||
|
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# print the sucessful message. return 0
|
||||||
|
#
|
||||||
|
tpass_ ()
|
||||||
|
{
|
||||||
|
local msg=$*
|
||||||
|
tlog "$msg" "PASS" >> $tPASS_FILE
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
_trun_ ()
|
||||||
|
{
|
||||||
|
local cmd="$1"
|
||||||
|
local chk="$2"
|
||||||
|
local cur_date=$(tdate)
|
||||||
|
|
||||||
|
local stdout=$(eval "$cmd" 2>$tSTDERR_FILE; echo $? >$tRETURN_FILE 2>/dev/null)
|
||||||
|
#timeout -- how to set timeout?
|
||||||
|
local exit_status=$(< $tRETURN_FILE)
|
||||||
|
local stderr=$(< $tSTDERR_FILE)
|
||||||
|
local msg=CMD
|
||||||
|
#tnot
|
||||||
|
if test x$chk = x1; then
|
||||||
|
test $exit_status -eq 0 || msg=PASS
|
||||||
|
test $exit_status -eq 0 && msg=FAIL
|
||||||
|
#should let the tester know this is the negative testing
|
||||||
|
#if cmd return 0 we will return 1 and vice versa
|
||||||
|
cmd="[NOT] $cmd"
|
||||||
|
fi
|
||||||
|
#tok
|
||||||
|
if test x$chk = x0; then
|
||||||
|
test $exit_status -eq 0 && msg=PASS
|
||||||
|
test $exit_status -eq 0 || msg=FAIL
|
||||||
|
fi
|
||||||
|
|
||||||
|
tSTDOUT=$stdout
|
||||||
|
tSTDERR=$stderr
|
||||||
|
|
||||||
|
test $tIGNORE_STDOUT -eq 1 && stdout='redirect the stdout to /dev/null'
|
||||||
|
test $tIGNORE_STDERR -eq 1 && stderr='redirect the stderr to /dev/null'
|
||||||
|
|
||||||
|
echo "[$msg][$cur_date][$HOSTNAME]$cmd"
|
||||||
|
echo "STDOUT:"
|
||||||
|
test "x$stdout" = x || echo "$stdout"
|
||||||
|
echo "STDERR:$stderr"
|
||||||
|
echo "RETURN:$exit_status"
|
||||||
|
echo
|
||||||
|
|
||||||
|
return $exit_status
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# setup the testing environment
|
||||||
|
#
|
||||||
|
_tsetup_ ()
|
||||||
|
{
|
||||||
|
|
||||||
|
LXT_TMP_DIR="/mnt/testarea/lxt";
|
||||||
|
|
||||||
|
test -z "$HOSTNAME" && HOSTNAME=$(hostname)
|
||||||
|
test -d "$LXT_TMP_DIR" || mkdir -p "$LXT_TMP_DIR" >& /dev/null || exit 1
|
||||||
|
|
||||||
|
tSTDERR_FILE="$LXT_TMP_DIR/stderr.$$"
|
||||||
|
test -e "$tSTDERR_FILE" || > "$tSTDERR_FILE" || exit 1
|
||||||
|
tRETURN_FILE="$LXT_TMP_DIR/return.$$"
|
||||||
|
test -e "$tRETURN_FILE" || > "$tRETURN_FILE" || exit 1
|
||||||
|
tPASS_FILE="$LXT_TMP_DIR/tc.pass.$$"
|
||||||
|
test -e "$tPASS_FILE" || > "$tPASS_FILE" || exit 1
|
||||||
|
tFAIL_FILE="$LXT_TMP_DIR/tc.fail.$$"
|
||||||
|
test -e "$tFAIL_FILE" || > "$tFAIL_FILE" || exit 1
|
||||||
|
}
|
||||||
|
|
||||||
|
#
|
||||||
|
# main
|
||||||
|
#
|
||||||
|
|
||||||
|
# global variables
|
||||||
|
tIGNORE_STDOUT=0
|
||||||
|
tIGNORE_STDERR=0
|
||||||
|
tSTDOUT=
|
||||||
|
tSTDERR=
|
||||||
|
#LXT_TMP_DIR
|
||||||
|
# only used in this file
|
||||||
|
tPASS_FILE=
|
||||||
|
tFAIL_FILE=
|
||||||
|
|
||||||
|
_tsetup_
|
29
tests/sanity/runtest.sh
Executable file
29
tests/sanity/runtest.sh
Executable file
@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# Copyright (c) 2016 Red Hat, Inc.
|
||||||
|
#
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU General Public License for more details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License
|
||||||
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
# Author: Yi Zhang <yizhan@redhat.com>
|
||||||
|
|
||||||
|
#set -x
|
||||||
|
source ../include/tc.sh || exit 200
|
||||||
|
|
||||||
|
tlog "running $0"
|
||||||
|
|
||||||
|
tok "yum -y reinstall libnvme"
|
||||||
|
tok "yum -y remove libnvme"
|
||||||
|
tok "yum -y install libnvme"
|
||||||
|
|
||||||
|
tend
|
11
tests/tests.yml
Normal file
11
tests/tests.yml
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
- hosts: localhost
|
||||||
|
roles:
|
||||||
|
- role: standard-test-basic
|
||||||
|
tags:
|
||||||
|
- classic
|
||||||
|
tests:
|
||||||
|
- simple:
|
||||||
|
dir: sanity
|
||||||
|
run: ./runtest.sh
|
||||||
|
required_packages:
|
||||||
|
- which
|
Loading…
Reference in New Issue
Block a user