!47 Skip test error in docker

From: @godvi 
Reviewed-by: @HuaxinLuGitee 
Signed-off-by: @HuaxinLuGitee
This commit is contained in:
openeuler-ci-bot 2022-09-27 01:25:35 +00:00 committed by Gitee
commit 6c207e973d
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
2 changed files with 62 additions and 1 deletions

View File

@ -1,6 +1,6 @@
Name: ima-evm-utils Name: ima-evm-utils
Version: 1.3.2 Version: 1.3.2
Release: 5 Release: 6
Summary: IMA/EVM control utilities Summary: IMA/EVM control utilities
License: GPLv2 License: GPLv2
URL: http://linux-ima.sourceforge.net/ URL: http://linux-ima.sourceforge.net/
@ -9,6 +9,7 @@ Source0: http://sourceforge.net/projects/linux-ima/files/ima-evm-utils/%{na
Patch9000: add-save-command-to-support-digest-list-building.patch Patch9000: add-save-command-to-support-digest-list-building.patch
Patch9001: fix-caps-parameter-cannot-be-parsed.patch Patch9001: fix-caps-parameter-cannot-be-parsed.patch
Patch9002: add-sm3-option.patch Patch9002: add-sm3-option.patch
Patch9003: skip-test-error-in-docker.patch
BuildRequires: autoconf automake libtool asciidoc vim-common BuildRequires: autoconf automake libtool asciidoc vim-common
BuildRequires: libxslt openssl openssl-devel keyutils-libs-devel tpm2-tss-devel BuildRequires: libxslt openssl openssl-devel keyutils-libs-devel tpm2-tss-devel
@ -74,6 +75,9 @@ make check
%doc %{_mandir}/*/* %doc %{_mandir}/*/*
%changelog %changelog
* Mon Sep 26 2022 shenxiangwei <shenxiangwei1@huawei.com> - 1.3.2-6
- Skip test error in docker
* Wed Aug 24 2022 shenxiangwei <shenxiangwei1@huawei.com> - 1.3.2-5 * Wed Aug 24 2022 shenxiangwei <shenxiangwei1@huawei.com> - 1.3.2-5
- Add sm3 option - Add sm3 option

View File

@ -0,0 +1,57 @@
From d3a4e24f6a2bac023f7e7c0eda403f0d8e25996d Mon Sep 17 00:00:00 2001
From: shenxiangwei <shenxiangwei1@huawei.com>
Date: Mon, 26 Sep 2022 19:36:25 +0800
Subject: [PATCH] Skip test error in docker
---
tests/ima_hash.test | 5 +++++
tests/sign_verify.test | 10 ++++++++++
2 files changed, 15 insertions(+)
diff --git a/tests/ima_hash.test b/tests/ima_hash.test
index 8d66e59..cd97e1d 100644
--- a/tests/ima_hash.test
+++ b/tests/ima_hash.test
@@ -24,6 +24,11 @@ trap _report_exit EXIT
set -f # disable globbing
check() {
+ cat /proc/fs/ext4/sda1/options | grep xattr
+ if [ `echo $?` -ne 0 ];then
+ return "$SKIP"
+ fi
+
local alg=$1 prefix=$2 chash=$3 hash
local file=$alg-hash.txt
diff --git a/tests/sign_verify.test b/tests/sign_verify.test
index 288e133..e1899df 100644
--- a/tests/sign_verify.test
+++ b/tests/sign_verify.test
@@ -130,6 +130,11 @@ check_sign() {
# PREFIX (signature header prefix in hex),
# OPTS (additional options for evmctl),
# FILE (working file to sign).
+ cat /proc/fs/ext4/sda1/options | grep xattr
+ if [ `echo $?` -ne 0 ];then
+ return "$SKIP"
+ fi
+
local "$@"
local KEY=${KEY%.*}.key
local FILE=${FILE:-$ALG.txt}
@@ -225,6 +230,11 @@ check_verify() {
# ALG (hash algo),
# OPTS (additional options for evmctl),
# FILE (filename to verify).
+ cat /proc/fs/ext4/sda1/options | grep xattr
+ if [ `echo $?` -ne 0 ];then
+ return "$SKIP"
+ fi
+
local "$@"
# shellcheck disable=SC2086
--
2.37.3.windows.1