Compare commits
10 Commits
33903eb494
...
cf65ea20e0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cf65ea20e0 | ||
|
|
3d590025cb | ||
|
|
c4da902e69 | ||
|
|
b19816a0cc | ||
|
|
7509745013 | ||
|
|
108e960184 | ||
|
|
dbada0b65d | ||
|
|
ff8ffe420f | ||
|
|
28b9c3f17d | ||
|
|
4558af6c33 |
BIN
1.29.3.tar.gz
Normal file
BIN
1.29.3.tar.gz
Normal file
Binary file not shown.
@ -0,0 +1,93 @@
|
|||||||
|
From dcd5f6b38e895134bb24df4c8fa4a0fba3e0f381 Mon Sep 17 00:00:00 2001
|
||||||
|
From: yixiangzhike <yixiangzhike007@163.com>
|
||||||
|
Date: Mon, 29 May 2023 11:22:03 +0800
|
||||||
|
Subject: [PATCH] Adapt product feature to local release version
|
||||||
|
|
||||||
|
---
|
||||||
|
src/journal.sh | 6 +++++-
|
||||||
|
src/logging.sh | 10 +++++++++-
|
||||||
|
src/lsb_release | 4 ++++
|
||||||
|
src/test/loggingTest.sh | 6 +++++-
|
||||||
|
4 files changed, 23 insertions(+), 3 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/journal.sh b/src/journal.sh
|
||||||
|
index 62ce983..8ae06e6 100644
|
||||||
|
--- a/src/journal.sh
|
||||||
|
+++ b/src/journal.sh
|
||||||
|
@@ -874,7 +874,11 @@ __INTERNAL_CreateHeader(){
|
||||||
|
__INTERNAL_LogText " Test duration : " 2> /dev/null
|
||||||
|
|
||||||
|
# OS release
|
||||||
|
- local release=$(cat /etc/redhat-release)
|
||||||
|
+ if [ -e /etc/openEuler-release ]; then
|
||||||
|
+ local release=$(cat /etc/openEuler-release)
|
||||||
|
+ else
|
||||||
|
+ local release=$(cat /etc/redhat-release)
|
||||||
|
+ fi
|
||||||
|
[[ -n "$release" ]] && {
|
||||||
|
__INTERNAL_WriteToMetafile release -- "$release"
|
||||||
|
__INTERNAL_LogText " Distro : ${release}" 2> /dev/null
|
||||||
|
diff --git a/src/logging.sh b/src/logging.sh
|
||||||
|
index 738bef0..96455c7 100644
|
||||||
|
--- a/src/logging.sh
|
||||||
|
+++ b/src/logging.sh
|
||||||
|
@@ -881,7 +881,9 @@ on the RHEL-5-Client you will get release 5 and variant Client.
|
||||||
|
|
||||||
|
__INTERNAL_rlGetDistroVersion() {
|
||||||
|
local version=0
|
||||||
|
- if rpm -q redhat-release &>/dev/null; then
|
||||||
|
+ if rpm -q openEuler-release &>/dev/null; then
|
||||||
|
+ version=$( rpm -q --qf="%{VERSION}" openEuler-release )
|
||||||
|
+ elif rpm -q redhat-release &>/dev/null; then
|
||||||
|
version=$( rpm -q --qf="%{VERSION}" redhat-release )
|
||||||
|
elif rpm -q fedora-release &>/dev/null; then
|
||||||
|
version=$( rpm -q --qf="%{VERSION}" fedora-release )
|
||||||
|
@@ -905,6 +907,12 @@ rlGetDistroRelease() {
|
||||||
|
}
|
||||||
|
rlGetDistroVariant() {
|
||||||
|
local VARIANT
|
||||||
|
+ # openEuler has no Variant
|
||||||
|
+ if rpm -q openEuler-release &>/dev/null; then
|
||||||
|
+ echo $VARIANT
|
||||||
|
+ return 0
|
||||||
|
+ fi
|
||||||
|
+
|
||||||
|
VARIANT=$(__INTERNAL_rlGetOSReleaseItem VARIANT) && {
|
||||||
|
echo $VARIANT
|
||||||
|
return 0
|
||||||
|
diff --git a/src/lsb_release b/src/lsb_release
|
||||||
|
index 9d7afbc..8b04c75 100755
|
||||||
|
--- a/src/lsb_release
|
||||||
|
+++ b/src/lsb_release
|
||||||
|
@@ -72,7 +72,11 @@ INFO_LSB_DIR="lsb-release.d" # where to get LSB addon modules
|
||||||
|
INFO_DISTRIB_SUFFIX="release" # <distrib>-<suffix>
|
||||||
|
ALTERNATE_DISTRIB_FILE="/etc/debian_version" # for Debian [based distrib]
|
||||||
|
ALTERNATE_DISTRIB_NAME="Debian" # "
|
||||||
|
+if [ -e /etc/openEuler-release ]; then
|
||||||
|
+CHECKFIRST="/etc/openEuler-release" # check it before file search
|
||||||
|
+else
|
||||||
|
CHECKFIRST="/etc/redhat-release" # check it before file search
|
||||||
|
+fi
|
||||||
|
|
||||||
|
# Defines our exit codes
|
||||||
|
EXIT_STATUS="0" # default = Ok :)
|
||||||
|
diff --git a/src/test/loggingTest.sh b/src/test/loggingTest.sh
|
||||||
|
index a4bc588..a9de8f8 100644
|
||||||
|
--- a/src/test/loggingTest.sh
|
||||||
|
+++ b/src/test/loggingTest.sh
|
||||||
|
@@ -237,7 +237,11 @@ test_rlGetArch() {
|
||||||
|
test_rlGetDistroRelease() {
|
||||||
|
local out=$(rlGetDistroRelease)
|
||||||
|
assertTrue 'rlGetDistroRelease returns 0' "[ $? -eq 0 ]"
|
||||||
|
- if [ -e /etc/redhat-release ]
|
||||||
|
+ if [ -e /etc/openEuler-release ]
|
||||||
|
+ then
|
||||||
|
+ grep -q -i "$out" /etc/openEuler-release
|
||||||
|
+ assertTrue 'rlGetDistroRelease returns release which is in the /etc/openEuler-release' "[ $? -eq 0 ]"
|
||||||
|
+ elif [ -e /etc/redhat-release ]
|
||||||
|
then
|
||||||
|
grep -q -i "$out" /etc/redhat-release
|
||||||
|
assertTrue 'rlGetDistroRelease returns release which is in the /etc/redhat-release' "[ $? -eq 0 ]"
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
96
beakerlib.spec
Normal file
96
beakerlib.spec
Normal file
@ -0,0 +1,96 @@
|
|||||||
|
Name: beakerlib
|
||||||
|
Summary: A shell-level integration testing library
|
||||||
|
Version: 1.29.3
|
||||||
|
Release: 2
|
||||||
|
License: GPLv2
|
||||||
|
BuildArch: noarch
|
||||||
|
URL: https://github.com/%{name}/%{name}
|
||||||
|
Autoreq: 0
|
||||||
|
Requires: nfs-utils
|
||||||
|
Requires: /bin/bash
|
||||||
|
Requires: /bin/sh
|
||||||
|
Recommends: /usr/bin/python3
|
||||||
|
Recommends: /usr/bin/perl
|
||||||
|
Requires: grep sed iproute coreutils tar gzip
|
||||||
|
Requires: util-linux which dnf-utils
|
||||||
|
Requires: /usr/bin/bc /usr/bin/time
|
||||||
|
Requires: (wget or curl)
|
||||||
|
Suggests: wget
|
||||||
|
Recommends: python3-lxml
|
||||||
|
Recommends: /usr/bin/xmllint
|
||||||
|
Conflicts: beakerlib-redhat < 1-30
|
||||||
|
|
||||||
|
BuildRequires: /usr/bin/pod2man perl-generators util-linux
|
||||||
|
|
||||||
|
Source0: https://github.com/beakerlib/beakerlib/archive/%{version}.tar.gz
|
||||||
|
|
||||||
|
Patch1: beakerlib-adapt-product-feature-to-local-release-version.patch
|
||||||
|
Patch2: perl-syntax-error.patch
|
||||||
|
|
||||||
|
%package_help
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autosetup -p1 -n %{name}-%{version}
|
||||||
|
|
||||||
|
%build
|
||||||
|
make build
|
||||||
|
|
||||||
|
%install
|
||||||
|
%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
|
||||||
|
%{!?_tmpfilesdir: %global _tmpfilesdir %{_prefix}/lib/tmpfiles.d/}
|
||||||
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
make PKGDOCDIR=%{_pkgdocdir} DESTDIR=$RPM_BUILD_ROOT install
|
||||||
|
mkdir -p $RPM_BUILD_ROOT/%{_tmpfilesdir}
|
||||||
|
touch ./beakerlib-tmpfiles.conf
|
||||||
|
cat >beakerlib-tmpfiles.conf<<EOF
|
||||||
|
x /var/tmp/beakerlib-*
|
||||||
|
EOF
|
||||||
|
install -m 0644 ./beakerlib-tmpfiles.conf $RPM_BUILD_ROOT/%{_tmpfilesdir}/%{name}.conf
|
||||||
|
|
||||||
|
%description
|
||||||
|
The BeakerLib project means to provide a library of various helpers, which
|
||||||
|
could be used when writing operating system level integration tests.
|
||||||
|
|
||||||
|
%files
|
||||||
|
%dir %{_datadir}/%{name}
|
||||||
|
%dir %{_datadir}/%{name}/xslt-templates
|
||||||
|
%{_datadir}/%{name}/dictionary.vim
|
||||||
|
%{_datadir}/%{name}/*.sh
|
||||||
|
%{_datadir}/%{name}/xslt-templates/*
|
||||||
|
%{_bindir}/%{name}-*
|
||||||
|
%config %{_tmpfilesdir}/%{name}.conf
|
||||||
|
|
||||||
|
%package vim-syntax
|
||||||
|
Summary: Files for syntax highlighting BeakerLib tests in VIM editor
|
||||||
|
Requires: vim-common
|
||||||
|
BuildRequires: vim-common
|
||||||
|
|
||||||
|
%description vim-syntax
|
||||||
|
Files for syntax highlighting BeakerLib tests in VIM editor
|
||||||
|
|
||||||
|
%files vim-syntax
|
||||||
|
%{_datadir}/vim/vimfiles/after/ftdetect/beakerlib.vim
|
||||||
|
%{_datadir}/vim/vimfiles/after/syntax/beakerlib.vim
|
||||||
|
|
||||||
|
%files help
|
||||||
|
%{_mandir}/man1/%{name}*1*
|
||||||
|
%dir %{_pkgdocdir}
|
||||||
|
%dir %{_pkgdocdir}/examples
|
||||||
|
%dir %{_pkgdocdir}/examples/*
|
||||||
|
%doc %{_pkgdocdir}/*
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Thu Nov 16 2023 zhangxianting <zhangxianting@uniontech.com> - 1.29.3-2
|
||||||
|
- fix modifying beakerlib deja summary execution
|
||||||
|
|
||||||
|
* Tue Oct 24 2023 xujing <xujing125@huawei.com> - 1.29.3-1
|
||||||
|
- update version to 1.29.3
|
||||||
|
|
||||||
|
* Mon Jun 12 2023 yixiangzhike <yixiangzhike007@163.com> - 1.18.1-3
|
||||||
|
- beakerlib adapt product feature to local release version
|
||||||
|
|
||||||
|
* Tue Jan 5 2021 Ge Wang <wangge20@huawei.com> - 1.18.1-2
|
||||||
|
- Modify Source file
|
||||||
|
|
||||||
|
* Sat Aug 1 2020 zhangxingliang <zhangxingliang3@huawei.com> - 1.18.1-1
|
||||||
|
- Package init
|
||||||
4
beakerlib.yaml
Normal file
4
beakerlib.yaml
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
version_control: github
|
||||||
|
src_repo: beakerlib/beakerlib
|
||||||
|
tag_prefix: ^
|
||||||
|
seperator: .
|
||||||
27
perl-syntax-error.patch
Normal file
27
perl-syntax-error.patch
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
From d4f649af8edfeceb9667b3ed8106705186989998 Mon Sep 17 00:00:00 2001
|
||||||
|
From: zhangxianting <zhangxianting@uniontech.com>
|
||||||
|
Date: Fri, 10 Nov 2023 12:29:20 +0800
|
||||||
|
Subject: [PATCH] perl syntax error
|
||||||
|
|
||||||
|
---
|
||||||
|
src/perl/deja-summarize | 4 ++--
|
||||||
|
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/perl/deja-summarize b/src/perl/deja-summarize
|
||||||
|
index b2b105b..f7f7bf1 100755
|
||||||
|
--- a/src/perl/deja-summarize
|
||||||
|
+++ b/src/perl/deja-summarize
|
||||||
|
@@ -170,8 +170,8 @@ sub newResults {
|
||||||
|
# (fail or broken, or whatever).
|
||||||
|
sub isBad {
|
||||||
|
my ($b) = @_;
|
||||||
|
- for my $bad qw(fail brokentest kfail) {
|
||||||
|
- return 1 if ($b eq $bad);
|
||||||
|
+ for my $bad (qw(fail brokentest kfail)) {
|
||||||
|
+ return 1 if ($b eq $bad);
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.27.0
|
||||||
|
|
||||||
Loading…
x
Reference in New Issue
Block a user