Bug 3687 - [Anck 4.19 aarch64][nightly]kernel_selftests中sgx.test_sgx用例执行报错“ file test_sgx is not executable, correct this.”
Summary: [Anck 4.19 aarch64][nightly]kernel_selftests中sgx.test_sgx用例执行报错“ file test_sg...
Status: NEW
Alias: None
Product: Antest
Classification: Infrastructures
Component: 测试用例 (show other bugs) 测试用例
Version: unspecified
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: ChaofengWu
QA Contact:
URL:
Whiteboard:
Keywords:
: 8850 (view as bug list)
Depends on:
Blocks:
 
Reported: 2023-01-10 17:30 UTC by meil_wei
Modified: 2024-04-26 15:48 UTC (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description meil_wei alibaba_cloud_group 2023-01-10 17:30:46 UTC
Description of problem:
kernel_selftests中sgx.test_sgx用例执行报错“ file test_sgx is not executable, correct this.”

编译日志:
make[1]: Entering directory `/tmp/tone/cache/kernel-selftests/kernel-4/tools/testing/selftests/sgx'
rsync -a /tmp/tone/cache/kernel-selftests/kernel-4/tools/testing/selftests/sgx/test_sgx /tmp/tone/run/kernel-selftests/kselftest/sgx/
rsync: link_stat "/tmp/tone/cache/kernel-selftests/kernel-4/tools/testing/selftests/sgx/test_sgx" failed: No such file or directory (2)
rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1179) [sender=3.1.2]
make[1]: *** [install] Error 23
make[1]: Leaving directory `/tmp/tone/cache/kernel-selftests/kernel-4/tools/testing/selftests/sgx'

执行日志
selftests: sgx: test_sgx
selftests: sgx: test_sgx: Warning: file test_sgx is not executable, correct this.
not ok 1..1 selftests: sgx: test_sgx [FAIL]


Steps to Reproduce:
下载当前内核 对应的kernel*src.rpm,
rpm -ivh kernel*.src.rpm
which yum-builddep || yum install -y yum-utils
which rpmbuild || yum install -y rpm-build
yum-builddep -y $rpmbuild_dir/SPECS/kernel.spec
rpmbuild -bp $rpmbuild_dir/SPECS/kernel.spec

cd /root/rpmbuild/BUILD/kernel*/linux*/tools/testing/selftests/sgx
./test_sgx

Actual results:
用例执行通过

Expected results:
用例执行失败

Additional info:
# uname -r
4.19.91-253.git.e680634.an7.aarch64

# cat /etc/os-release
NAME="Anolis OS"
VERSION="7.9"
ID="anolis"
ID_LIKE="rhel fedora centos"
VERSION_ID="7.9"
PRETTY_NAME="Anolis OS 7.9"
ANSI_COLOR="0;31"
HOME_URL="https://openanolis.cn/"
BUG_REPORT_URL="https://bugs.openanolis.cn/"

CENTOS_MANTISBT_PROJECT="CentOS-7"
CENTOS_MANTISBT_PROJECT_VERSION="7"
REDHAT_SUPPORT_PRODUCT="centos"
REDHAT_SUPPORT_PRODUCT_VERSION="7"

# free -g
              total        used        free      shared  buff/cache   available
Mem:             14           0          13           0           0          14
Swap:             0           0           0

# lscpu
Architecture:          aarch64
Byte Order:            Little Endian
CPU(s):                4
On-line CPU(s) list:   0-3
Thread(s) per core:    1
Core(s) per socket:    4
Socket(s):             1
NUMA node(s):          1
Model:                 1
BogoMIPS:              50.00
NUMA node0 CPU(s):     0-3
Flags:                 fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm lrcpc dcpop asimddp ssbs
Comment 1 meil_wei alibaba_cloud_group 2023-01-10 17:31:51 UTC
已知问题,可以跳过
结论:sgx是Intel处理器的新特性, arm上没有,需要skip。
Comment 2 shanxifanshi alibaba_cloud_group 2023-01-11 15:15:27 UTC
这个用例在x86环境上也是fail的,已知问题,测试时候需要环境中有/dev/sgx_enclave设备,可以将此作为判断条件,统一来skip用例
Comment 3 shanxifanshi alibaba_cloud_group 2023-01-16 10:33:16 UTC
(In reply to shanxifanshi from comment #2)
> 这个用例在x86环境上也是fail的,已知问题,测试时候需要环境中有/dev/sgx_enclave设备,可以将此作为判断条件,统一来skip用例

用这个命令判断更好一些,grep sgx /proc/cpuinfo,详见文档https://kernel.org/doc/html/latest/x86/sgx.html
Comment 4 zhangxinyi 2024-04-26 15:48:06 UTC
*** Bug 8850 has been marked as a duplicate of this bug. ***