test: Add test programs for #1158

refs: #1158
Change-Id: I853dd84f5433a01da510813e9fb1276e5477f73f
This commit is contained in:
Ken Sato
2018-09-19 13:07:29 +09:00
committed by Masamichi Takagi
parent 42b9b31606
commit ab284b0531
4 changed files with 106 additions and 0 deletions

45
test/issues/1158/C1158.sh Normal file
View File

@ -0,0 +1,45 @@
#!/bin/sh
USELTP=0
USEOSTEST=0
. ../../common.sh
tid=001
echo "*** CT_$tid start *******************************"
tgt_file=`find /sys/devices/ -name local_cpus | head -n 1`
echo "[Linux ] cat ${tgt_file}"
cat ${tgt_file} | tee ./CT_${tid}_lnx.txt
echo "[McKernel] mcexec cat ${tgt_file}"
${MCEXEC} cat ${tgt_file} | tee ./CT_${tid}_mck.txt
diff ./CT_${tid}_lnx.txt ./CT_${tid}_mck.txt &> /dev/null
if [ $? == 0 ]; then
echo "[OK] local_cpus is same between Linux and McKernel"
echo "*** CT_$tid: PASSED"
else
echo "[NG] local_cpus is NOT same between Linux and McKernel"
echo "*** CT_$tid: FAILED"
fi
echo ""
tid=002
echo "*** CT_$tid start *******************************"
tgt_file=`find /sys/devices/ -name local_cpulist | head -n 1`
echo "[Linux ] cat ${tgt_file}"
cat ${tgt_file} | tee ./CT_${tid}_lnx.txt
echo "[McKernel] mcexec cat ${tgt_file}"
${MCEXEC} cat ${tgt_file} | tee ./CT_${tid}_mck.txt
diff ./CT_${tid}_lnx.txt ./CT_${tid}_mck.txt &> /dev/null
if [ $? == 0 ]; then
echo "[OK] local_cpulist is same between Linux and McKernel"
echo "*** CT_$tid: PASSED"
else
echo "[NG] local_cpulist is NOT same between Linux and McKernel"
echo "*** CT_$tid: FAILED"
fi
echo ""

14
test/issues/1158/Makefile Normal file
View File

@ -0,0 +1,14 @@
CC = gcc
TARGET=
CPPFLAGS =
LDFLAGS =
all: $(TARGET)
test: all
@sh ./C1158.sh
clean:
rm -f $(TARGET) *.o

32
test/issues/1158/README Normal file
View File

@ -0,0 +1,32 @@
【Issue#1158 動作確認】
□ テスト内容
Issueで報告された症状は現在発生しない。
理由は、setup_pci_files()が実行されないためである。
なお、setup_pci_files()はsysfsのPCIリソースへのインタフェースのうち、
local_cpus, local_cpulist のMcKernelでのビューを作成する目的で作成されたが、
正常に動作しないためコメントアウトされている。
McKernelからのlocal_cpus, local_cpulistを参照した場合、
Linuxと同様の情報が参照されることを確認する。
1. テストプログラムによる確認
CT_001: local_cpus の参照
/sys/devices/ 配下のlocal_cpusについて、
Linuxと同様の情報が参照できることを確認する
CT_002: local_cpulist の参照
/sys/devices/ 配下のlocal_cpulistについて、
Linuxと同様の情報が参照できることを確認する
□ 実行手順
$ make test
McKernelのインストール先や、OSTEST, LTPの配置場所は、
$HOME/.mck_test_config を参照している
.mck_test_config は、McKernelをビルドした際に生成される
mck_test_config.sample ファイルを$HOMEにコピーし、適宜編集する
□ 実行結果
result.log 参照
すべての項目をPASSしていることを確認

View File

@ -0,0 +1,15 @@
*** CT_001 start *******************************
[Linux ] cat /sys/devices/pci0000:00/0000:00:00.0/local_cpus
00010001
[McKernel] mcexec cat /sys/devices/pci0000:00/0000:00:00.0/local_cpus
00010001
[OK] local_cpus is same between Linux and McKernel
*** CT_001: PASSED
*** CT_002 start *******************************
[Linux ] cat /sys/devices/pci0000:00/0000:00:00.0/local_cpulist
0,16
[McKernel] mcexec cat /sys/devices/pci0000:00/0000:00:00.0/local_cpulist
0,16
[OK] local_cpulist is same between Linux and McKernel
*** CT_002: PASSED