From ab284b053147327252a20b95ba753b175cd0305e Mon Sep 17 00:00:00 2001 From: Ken Sato Date: Wed, 19 Sep 2018 13:07:29 +0900 Subject: [PATCH] test: Add test programs for #1158 refs: #1158 Change-Id: I853dd84f5433a01da510813e9fb1276e5477f73f --- test/issues/1158/C1158.sh | 45 +++++++++++++++++++++++++++++++++++++ test/issues/1158/Makefile | 14 ++++++++++++ test/issues/1158/README | 32 ++++++++++++++++++++++++++ test/issues/1158/result.log | 15 +++++++++++++ 4 files changed, 106 insertions(+) create mode 100644 test/issues/1158/C1158.sh create mode 100644 test/issues/1158/Makefile create mode 100644 test/issues/1158/README create mode 100644 test/issues/1158/result.log diff --git a/test/issues/1158/C1158.sh b/test/issues/1158/C1158.sh new file mode 100644 index 00000000..774b9aea --- /dev/null +++ b/test/issues/1158/C1158.sh @@ -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 "" + diff --git a/test/issues/1158/Makefile b/test/issues/1158/Makefile new file mode 100644 index 00000000..b6c65539 --- /dev/null +++ b/test/issues/1158/Makefile @@ -0,0 +1,14 @@ +CC = gcc +TARGET= + +CPPFLAGS = +LDFLAGS = + +all: $(TARGET) + +test: all + @sh ./C1158.sh + +clean: + rm -f $(TARGET) *.o + diff --git a/test/issues/1158/README b/test/issues/1158/README new file mode 100644 index 00000000..7e85a244 --- /dev/null +++ b/test/issues/1158/README @@ -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していることを確認 diff --git a/test/issues/1158/result.log b/test/issues/1158/result.log new file mode 100644 index 00000000..de8ab128 --- /dev/null +++ b/test/issues/1158/result.log @@ -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