Test "Error handling improvement" on arm64

The following test set:
  execve: fix memory leak
  add: NULL check for master_channel at IKC interrupt_handler.
  Fix the check routine for elf sections (Fujitsu: POSTK_TEMP_FIX_77)

Change-Id: I16c2a341c48f6df10a4839be08b93ea16bda8fbe
Refs: #727
Refs: #873
Refs: #1011
This commit is contained in:
Shiratori, Takehiro
2018-12-04 17:09:33 +09:00
committed by Masamichi Takagi
parent ec844bb6e3
commit 95e90c727e
22 changed files with 830 additions and 60 deletions

View File

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

View File

@@ -0,0 +1,110 @@
/* README COPYRIGHT FUJITSU LIMITED 2018 */
エラーハンドリング改善テストセットREADME
(1) テストの実行方法
以下の手順でテストを実行する
1. $HOME/.mck_test_configを用意する
当該ファイルは、McKernelをビルドした際に生成されるmck_test_config.sample ファイルを
$HOMEにコピーし、適宜編集する
2. make testを実行する
3. patch/issue727.patchを適用したMcKernelを用意する
4. run_issue727.shを実行する
5. patch/issue1011.patchを適用したMcKernelを用意する
6. run_issue1011.shを実行する
(2) テスト項目詳細
Issue727
0001 テストプログラムexecを実行し、lsコマンドの結果が得られること
0002 patch/issue727.patchを適用した場合、0001テストでmcexecが強制終了し、McKernelがpanicしないこと
Issue873
0001 McKernelの起動/終了を100回繰り返しても失敗しないこと
Issue1011
0001 hostnameコマンドを実行し、ホスト名が表示されること
0002 patch/issue1011.patchを適用した場合、0001テストでホスト名が表示されす、
コンソールには「prepare: Invalid argument」が、
/var/log/messagesには「kernel: mcexec_prepare_image: ERROR: # of sections: -1」が、
それぞれ表示されること
ulimit -u
0001 ulimit -uの設定値がデフォルトの状態で、test_mck -s kill -n 1 -- -p 6が成功すること
0002 ulimit -uに9を設定し、0001テストを実行するとforkに失敗すること
LTPによるリグレッションテスト
perf_event_open01
perf_event_open02
get_mempolicy01
execve01
execve02
execve03
execve04
execve05
fork01
fork02
fork03
fork04
fork05
fork06
fork07
fork08
fork09
fork10
fork11
fork13
fork14
clone01
clone02
clone03
clone04
clone05
clone06
clone07
clone08
kill01
kill02
kill03
kill04
kill05
kill06
kill07
kill08
kill09
kill10
LTPのkill10の実行時、本件とは無関係な不具合を回避するため、プロセス数を4(デフォルトは10)、
グループ数を2に設定している。
kill11
kill12
madvise01
madvise02
madvise03
madvise04
madvise05
signal01
signal02
signal03
signal04
signal05
(3) 実行結果ログ
result.logファイル内に実行時のログを記載する。
実行に利用したIHK/McKernelは、IA版における下記の版数相当の
arm64版移植IHK/McKernelである。
IHK
commit d6fcbee8cb91f9ec4b49f97c918e696ac0335aaf
Author: Shiratori, Takehiro <fj0300es@aa.jp.fujitsu.com>
Date: Tue Oct 16 16:25:33 2018 +0900
McKernel
commit 6f9fef2b13447c74c36d15cf5ebd186f8395ccca
Author: Ken Sato <ken.sato.ty@hitachi-solutions.com>
Date: Tue Sep 25 10:05:41 2018 +0900
(4) 備考
特になし。
以上。

View File

@@ -0,0 +1,51 @@
perf_event_open01
perf_event_open02
get_mempolicy01
execve01
execve02
execve03
execve04
execve05 20 execve05 execve05 4
fork01
fork02
fork03
fork04
fork05
fork06
fork07
fork08
fork09
fork10
fork11
fork13
fork14
clone01
clone02
clone03
clone04
clone05
clone06
clone07
clone08
kill01
kill02
kill03
kill04
kill05
kill06
kill07
kill08
kill09
kill10 -n 4
kill11
kill12
madvise01
madvise02
madvise03
madvise04
madvise05
signal01
signal02
signal03
signal04
signal05

View File

@@ -0,0 +1,18 @@
#!/bin/sh
MCK_DIR=/opt/ppos
REP_NUM=100
for i in `seq 1 ${REP_NUM}`
do
sudo ${MCK_DIR}/sbin/mcstop+release.sh
sleep 1
sudo ${MCK_DIR}/sbin/mcreboot.sh
if [ $? -ne 0 ]; then
echo "[NG] failed to boot Mckernel :${i}"
exit 1
fi
done
echo "[OK] succeed to boot McKernel ${i} times"

View File

@@ -0,0 +1,13 @@
diff --git a/executer/user/mcexec.c b/executer/user/mcexec.c
index 6210921..2cd08ba 100644
--- a/executer/user/mcexec.c
+++ b/executer/user/mcexec.c
@@ -478,7 +478,7 @@ struct program_load_desc *load_interp(struct program_load_desc *desc0, FILE *fp)
j++;
}
}
- desc->num_sections = j;
+ desc->num_sections = -1; // Test for num_secionts check Issue#1011
desc->entry = hdr.e_entry;
desc->interp_align = align;

View File

@@ -0,0 +1,15 @@
diff --git a/executer/user/mcexec.c b/executer/user/mcexec.c
index 6210921..301d2a5 100644
--- a/executer/user/mcexec.c
+++ b/executer/user/mcexec.c
@@ -3769,7 +3769,9 @@ return_execve1:
/* Copy program image phase */
case 2:
-
+ fprintf(stderr, "execve killed\n");
+ fflush(stderr);
+ kill(getpid(), SIGKILL);
ret = -1;
/* Alloc descriptor */
desc = malloc(w.sr.args[2]);

View File

@@ -0,0 +1,353 @@
gcc -o exec exec.c
./run.sh
mcstop+release.sh ... done
mcreboot.sh -c 4-15 -m 4G@0,4G@1,4G@2,4G@3 -O ... done
Makefile
README
exec
exec.c
ltplist.txt
mck_boot_test.sh
patch
result.log
result_issue1011.log
result_issue727.log
run.sh
run_issue1011.sh
run_issue727.sh
Issue727_0001: OK
Issue873_0001 n=100/100 ok.
[OK] succeed to boot McKernel 100 times
Issue873_0001: OK
exa-kernel
Issue1011_0001: OK
TEST_SUITE: kill
TEST_NUMBER: 1
ARGS: -p 6
Generate child process pid:22054, pgid:2084
Generate child process pid:22068, pgid:2084
Generate child process pid:22082, pgid:2084
Generate child process pid:22097, pgid:2084
Generate child process pid:22111, pgid:2084
Generate child process pid:22125, pgid:2084
wait for a few sec...
Send to all processes that have permission to send a signal.
[pid:22039, pgid:2084] Get signal.
RESULT: ok
ulimit -u 0001: OK
TEST_SUITE: kill
TEST_NUMBER: 1
ARGS: -p 6
Generate child process pid:22155, pgid:2084
Generate child process pid:22169, pgid:2084
Generate child process pid:22183, pgid:2084
Generate child process pid:22198, pgid:2084
Generate child process pid:22212, pgid:2084
Generate child process pid:22226, pgid:2084
wait for a few sec...
Send to all processes that have permission to send a signal.
[pid:22139, pgid:2084] Get signal.
RESULT: ok
ulimit -u 0002: NG
perf_event_open01 1 TFAIL : perf_event_open01.c:158: perf_event_open failed unexpectedly: TEST_ERRNO=EPERM(1): Operation not permitted
##### perf_event_open01 returned not 0 #####
perf_event_open02 1 TCONF : perf_event_open02.c:165: PERF_COUNT_HW_INSTRUCTIONS not supported
perf_event_open02 2 TCONF : perf_event_open02.c:165: Remaining cases not appropriate for configuration
##### perf_event_open02 returned not 0 #####
get_mempolicy01 0 TINFO : (case00) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
get_mempolicy01 1 TPASS : (case00) END
get_mempolicy01 0 TINFO : (case01) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
get_mempolicy01 2 TPASS : (case01) END
get_mempolicy01 0 TINFO : (case02) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
get_mempolicy01 3 TPASS : (case02) END
get_mempolicy01 0 TINFO : (case03) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
get_mempolicy01 4 TPASS : (case03) END
get_mempolicy01 0 TINFO : (case04) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
get_mempolicy01 5 TPASS : (case04) END
get_mempolicy01 0 TINFO : (case05) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
get_mempolicy01 6 TPASS : (case05) END
get_mempolicy01 0 TINFO : (case06) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
get_mempolicy01 7 TPASS : (case06) END
get_mempolicy01 0 TINFO : (case07) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
get_mempolicy01 8 TPASS : (case07) END
get_mempolicy01 0 TINFO : (case08) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
get_mempolicy01 9 TPASS : (case08) END
get_mempolicy01 0 TINFO : (case09) START
EXPECT: return value(ret)=0 errno=0 (Success)
RESULT: return value(ret)=0 errno=0 (Success)
get_mempolicy01 10 TPASS : (case09) END
get_mempolicy01 0 TINFO : (case10) START
EXPECT: return value(ret)=-1 errno=14 (Bad address)
RESULT: return value(ret)=-1 errno=14 (Bad address)
get_mempolicy01 11 TPASS : (case10) END
get_mempolicy01 0 TINFO : (case11) START
EXPECT: return value(ret)=-1 errno=22 (Invalid argument)
RESULT: return value(ret)=-1 errno=22 (Invalid argument)
get_mempolicy01 12 TPASS : (case11) END
execl01_child 1 TPASS : execve01_child executed
execve01 0 TINFO : Child process returned TPASS
Hello World
execve02 0 TINFO : Child process returned TPASS
execve03 1 TPASS : execve failed as expected: TEST_ERRNO=ENAMETOOLONG(36): File name too long
execve03 2 TPASS : execve failed as expected: TEST_ERRNO=ENOENT(2): No such file or directory
execve03 3 TPASS : execve failed as expected: TEST_ERRNO=ENOTDIR(20): Not a directory
execve03 4 TPASS : execve failed as expected: TEST_ERRNO=EFAULT(14): Bad address
Error: /tmp/exetEhv7P/fake.22387 is not an executable?, errno: 13
load_elf_desc_shebang: error: loading file: /tmp/exetEhv7P/fake.22387
execve03 5 TPASS : execve failed as expected: TEST_ERRNO=EACCES(13): Permission denied
Error: file /tmp/exetEhv7P/execve03.22387 is zero length
load_elf_desc_shebang: error: loading file: /tmp/exetEhv7P/execve03.22387
execve03 6 TPASS : execve failed as expected: TEST_ERRNO=ENOEXEC(8): Exec format error
Hello World
execve05 1 TPASS : Test DONE, pid 22478, -- execve05 0 execve05 execve05
execve05 1 TPASS : Test DONE, pid 22495, -- execve05 0 execve05 execve05
execve05 1 TPASS : Test DONE, pid 22512, -- execve05 0 execve05 execve05
execve05 1 TPASS : Test DONE, pid 22529, -- execve05 0 execve05 execve05
execve05 1 TPASS : Test DONE, pid 22546, -- execve05 0 execve05 execve05
execve05 1 TPASS : Test DONE, pid 22564, -- execve05 0 execve05 execve05
execve05 1 TPASS : Test DONE, pid 22581, -- execve05 0 execve05 execve05
execve05 1 TPASS : Test DONE, pid 22598, -- execve05 0 execve05 execve05
fork01 1 TPASS : fork() returned 22634
fork01 2 TPASS : child pid and fork() return agree: 22634
fork02 0 TINFO : Inside parent
fork02 0 TINFO : Inside child
fork02 0 TINFO : exit status of wait 0
fork02 1 TPASS : test 1 PASSED
fork03 0 TINFO : process id in parent of child from fork : 22701
fork03 1 TPASS : test 1 PASSED
fork04 1 TPASS : Env var TERM unchanged after fork(): screen
fork04 2 TPASS : Env var NoTSetzWq unchanged after fork(): getenv() does not find variable set
fork04 3 TPASS : Env var TESTPROG unchanged after fork(): FRKTCS04
fork05 0 TINFO : %fs test only for ix86
fork06 0 TINFO : tries 1000
fork06 0 TINFO : successes 1000
fork06 0 TINFO : failures 0
fork06 0 TINFO : There were no children to wait for
fork07 0 TINFO : Forking 100 children
fork07 0 TINFO : Forked all 100 children, now collecting
fork07 0 TINFO : Collected all 100 children
fork07 1 TPASS : 100/100 children read correctly from an inheritted fd
fork08 0 TINFO : parent forksval: 1
fork08 0 TINFO : parent forksval: 2
fork08 0 TINFO : second child got char: b
fork08 0 TINFO : exit status of wait expected 0 got 0
fork08 1 TPASS : Test passed in childnumber 2
fork08 1 TPASS : parent test PASSED
fork08 0 TINFO : exit status of wait expected 0 got 0
fork08 2 TPASS : parent test PASSED
fork08 0 TINFO : exit status of wait expected 0 got 0
fork08 3 TPASS : parent test PASSED
fork08 0 TINFO : Number of processes forked is 2
fork09 0 TINFO : OPEN_MAX is 1024
fork09 0 TINFO : first file descriptor is 8
fork09 0 TINFO : Parent reporting 1023 files open
fork09 0 TINFO : Child opened new file #1023
fork09 1 TPASS : test 1 PASSED
fork10 0 TINFO : fork child A
fork10 1 TPASS : test 1 PASSED
fork11 1 TPASS : fork test passed, 100 processes
fork13 1 TPASS : 1 pids forked, all passed
./run.sh: 105 行: 7799 強制終了 timeout -sKILL 5m ${MCEXEC} ${LTPBIN}/${line}
##### fork14 returned not 0 #####
clone01 1 TPASS : clone returned 8155
clone02 1 TFAIL : clone02.c:144: clone() failed: TEST_ERRNO=EINVAL(22): Invalid argument
clone02 2 TPASS : Test Passed
##### clone02 returned not 0 #####
clone03 1 TPASS : Test passed
clone04 1 TPASS : expected failure; Got EINVAL
clone05 1 TFAIL : clone05.c:65: Test Failed
##### clone05 returned not 0 #####
clone06 1 TPASS : Test Passed
clone07 1 TPASS : Use of return() in child did not cause SIGSEGV
clone08 0 TINFO : running CLONE_PARENT
clone08 1 TPASS : test CLONE_PARENT
clone08 0 TINFO : running CLONE_CHILD_SETTID
clone08 2 TPASS : test CLONE_CHILD_SETTID
clone08 0 TINFO : running CLONE_PARENT_SETTID
clone08 3 TBROK : clone08.c:129: CLONE_PARENT_SETTID clone() failed: TEST_ERRNO=EINVAL(22): Invalid argument
clone08 4 TBROK : clone08.c:129: Remaining cases broken
##### clone08 returned not 0 #####
kill01 1 TPASS : received expected signal 9
kill02 1 TPASS : The signal was sent to all processes in the process group.
kill02 2 TPASS : The signal was not sent to selective processes that were not in the process group.
kill03 1 TPASS : errno set to 22 : Invalid argument, as expected
kill04 1 TPASS : errno set to 3 : No such process, as expected
execve04 1 TBROK : tst_checkpoint.c:129: execve04.c:128: tst_checkpoint_wait(0, 10000): errno=ETIMEDOUT(110): Connection timed out
execve04 2 TBROK : tst_checkpoint.c:129: Remaining cases broken
kill failed with EPERM
kill05 1 TPASS : received expected errno(EPERM)
kill06 1 TPASS : received expected signal 9
kill07 0 TINFO : received expected signal 9
kill07 1 TPASS : Did not catch signal as expected
kill08 1 TPASS : received expected signal 9
kill09 1 TPASS : kill(8913, SIGKILL) returned 0
kill10 1 TPASS : All 2 pgrps received their signals
8946: All 4 children reported in
8960: All 4 children reported in
kill11 0 TINFO : Adjusting RLIMIT_CORE to 1048576
kill11 1 TPASS : signal SIGHUP
kill11 2 TPASS : signal SIGINT
kill11 3 TPASS : signal SIGQUIT dumped core
kill11 4 TPASS : signal SIGILL dumped core
kill11 5 TPASS : signal SIGTRAP dumped core
kill11 6 TPASS : signal SIGIOT/SIGABRT dumped core
kill11 7 TPASS : signal SIGIOT/SIGABRT dumped core
kill11 8 TPASS : signal SIGBUS dumped core
kill11 9 TPASS : signal SIGFPE dumped core
kill11 10 TPASS : signal SIGKILL
kill11 11 TPASS : signal SIGUSR1
kill11 12 TPASS : signal SIGSEGV dumped core
kill11 13 TPASS : signal SIGUSR2
kill11 14 TPASS : signal SIGPIPE
kill11 15 TPASS : signal SIGALRM
kill11 16 TPASS : signal SIGTERM
kill11 17 TPASS : signal SIGXCPU dumped core
kill11 18 TPASS : signal SIGXFSZ dumped core
kill11 19 TPASS : signal SIGVTALRM
kill11 20 TPASS : signal SIGPROF
kill11 21 TPASS : signal SIGIO/SIGPOLL
kill11 22 TPASS : signal SIGPWR
kill11 23 TPASS : signal SIGSYS/SIGUNUSED dumped core
kill12 1 TPASS : Test passed
madvise01 1 TPASS : madvise test for MADV_NORMAL PASSED
madvise01 2 TPASS : madvise test for MADV_RANDOM PASSED
madvise01 3 TPASS : madvise test for MADV_SEQUENTIAL PASSED
madvise01 4 TPASS : madvise test for MADV_WILLNEED PASSED
madvise01 5 TPASS : madvise test for MADV_DONTNEED PASSED
madvise02 1 TPASS : failed as expected: TEST_ERRNO=EINVAL(22): Invalid argument
madvise02 2 TPASS : failed as expected: TEST_ERRNO=EINVAL(22): Invalid argument
madvise02 3 TPASS : failed as expected: TEST_ERRNO=EINVAL(22): Invalid argument
madvise02 4 TCONF : madvise02.c:216: kernel configured with CONFIG_KSM, skip EINVAL test for MADV_MERGEABLE.
madvise02 5 TCONF : madvise02.c:237: kernel configured with CONFIG_KSM, skip EINVAL test for MADV_UNMERGEABLE.
madvise02 6 TPASS : failed as expected: TEST_ERRNO=ENOMEM(12): Cannot allocate memory
madvise02 7 TPASS : madvise succeeded as expected, see kernel commit 1998cc0 for details.
##### madvise02 returned not 0 #####
madvise03 1 TPASS : madvise test for MADV_REMOVE PASSED
madvise03 2 TPASS : madvise test for MADV_DONTFORK PASSED
madvise03 3 TPASS : madvise test for MADV_DOFORK PASSED
madvise04 1 TPASS : madvise test for MADV_DONTDUMP PASSED
madvise04 2 TPASS : madvise test for MADV_DODUMP PASSED
madvise05 1 TCONF : madvise05.c:63: CONFIG_SWAP=n
madvise05 2 TCONF : madvise05.c:63: Remaining cases not appropriate for configuration
##### madvise05 returned not 0 #####
signal01 1 TPASS : signal(SIGKILL, 0x1(SIG_IGN)) failed with EINVAL
signal01 0 TINFO : Child process returned TPASS
signal01 1 TPASS : signal(SIGKILL, (nil)(SIG_DFL)) failed with EINVAL
signal01 0 TINFO : Child process returned TPASS
signal01 1 TPASS : signal(SIGKILL, 0x4027d0(catchsig())) failed with EINVAL
signal01 0 TINFO : Child process returned TPASS
signal01 1 TPASS : Child killed with SIGKILL
signal01 2 TPASS : Child killed with SIGKILL
signal01 3 TPASS : Child killed with SIGKILL
signal02 1 TPASS : expected failure - errno = 22 - Invalid argument
signal02 2 TPASS : expected failure - errno = 22 - Invalid argument
signal02 3 TPASS : expected failure - errno = 22 - Invalid argument
signal03 1 TPASS : signal03 call succeeded
signal03 2 TPASS : signal03 call succeeded
signal03 3 TPASS : signal03 call succeeded
signal03 4 TPASS : signal03 call succeeded
signal03 5 TPASS : signal03 call succeeded
signal03 6 TPASS : signal03 call succeeded
signal03 7 TPASS : signal03 call succeeded
signal03 8 TPASS : signal03 call succeeded
signal03 9 TPASS : signal03 call succeeded
signal03 10 TPASS : signal03 call succeeded
signal03 11 TPASS : signal03 call succeeded
signal03 12 TPASS : signal03 call succeeded
signal03 13 TPASS : signal03 call succeeded
signal03 14 TPASS : signal03 call succeeded
signal03 15 TPASS : signal03 call succeeded
signal03 16 TPASS : signal03 call succeeded
signal03 17 TPASS : signal03 call succeeded
signal03 18 TPASS : signal03 call succeeded
signal03 19 TPASS : signal03 call succeeded
signal03 20 TPASS : signal03 call succeeded
signal03 21 TPASS : signal03 call succeeded
signal03 22 TPASS : signal03 call succeeded
signal03 23 TPASS : signal03 call succeeded
signal03 24 TPASS : signal03 call succeeded
signal03 25 TPASS : signal03 call succeeded
signal03 26 TPASS : signal03 call succeeded
signal03 27 TPASS : signal03 call succeeded
signal03 28 TPASS : signal03 call succeeded
signal03 29 TPASS : signal03 call succeeded
signal03 30 TPASS : signal03 call succeeded
signal03 31 TPASS : signal03 call succeeded
signal04 1 TPASS : signal04 call succeeded received (nil).
signal04 2 TPASS : signal04 call succeeded received (nil).
signal04 3 TPASS : signal04 call succeeded received (nil).
signal04 4 TPASS : signal04 call succeeded received (nil).
signal04 5 TPASS : signal04 call succeeded received (nil).
signal04 6 TPASS : signal04 call succeeded received (nil).
signal04 7 TPASS : signal04 call succeeded received (nil).
signal04 8 TPASS : signal04 call succeeded received (nil).
signal04 9 TPASS : signal04 call succeeded received (nil).
signal04 10 TPASS : signal04 call succeeded received (nil).
signal04 11 TPASS : signal04 call succeeded received (nil).
signal04 12 TPASS : signal04 call succeeded received (nil).
signal04 13 TPASS : signal04 call succeeded received (nil).
signal04 14 TPASS : signal04 call succeeded received (nil).
signal04 15 TPASS : signal04 call succeeded received (nil).
signal04 16 TPASS : signal04 call succeeded received (nil).
signal04 17 TPASS : signal04 call succeeded received (nil).
signal04 18 TPASS : signal04 call succeeded received (nil).
signal04 19 TPASS : signal04 call succeeded received (nil).
signal04 20 TPASS : signal04 call succeeded received (nil).
signal04 21 TPASS : signal04 call succeeded received (nil).
signal04 22 TPASS : signal04 call succeeded received (nil).
signal04 23 TPASS : signal04 call succeeded received (nil).
signal04 24 TPASS : signal04 call succeeded received (nil).
signal04 25 TPASS : signal04 call succeeded received (nil).
signal04 26 TPASS : signal04 call succeeded received (nil).
signal04 27 TPASS : signal04 call succeeded received (nil).
signal04 28 TPASS : signal04 call succeeded received (nil).
signal05 1 TPASS : signal05 call succeeded
signal05 2 TPASS : signal05 call succeeded
signal05 3 TPASS : signal05 call succeeded
signal05 4 TPASS : signal05 call succeeded
signal05 5 TPASS : signal05 call succeeded
signal05 6 TPASS : signal05 call succeeded
signal05 7 TPASS : signal05 call succeeded
signal05 8 TPASS : signal05 call succeeded
signal05 9 TPASS : signal05 call succeeded
signal05 10 TPASS : signal05 call succeeded
signal05 11 TPASS : signal05 call succeeded
signal05 12 TPASS : signal05 call succeeded
signal05 13 TPASS : signal05 call succeeded
signal05 14 TPASS : signal05 call succeeded
signal05 15 TPASS : signal05 call succeeded
signal05 16 TPASS : signal05 call succeeded
signal05 17 TPASS : signal05 call succeeded
signal05 18 TPASS : signal05 call succeeded
signal05 19 TPASS : signal05 call succeeded
signal05 20 TPASS : signal05 call succeeded
signal05 21 TPASS : signal05 call succeeded
signal05 22 TPASS : signal05 call succeeded
signal05 23 TPASS : signal05 call succeeded
signal05 24 TPASS : signal05 call succeeded
signal05 25 TPASS : signal05 call succeeded
signal05 26 TPASS : signal05 call succeeded
signal05 27 TPASS : signal05 call succeeded
signal05 28 TPASS : signal05 call succeeded
signal05 29 TPASS : signal05 call succeeded
signal05 30 TPASS : signal05 call succeeded
signal05 31 TPASS : signal05 call succeeded
make: *** [test] エラー 255

View File

@@ -0,0 +1,3 @@
mcstop+release.sh ... done
mcreboot.sh -c 4-15 -m 4G@0,4G@1,4G@2,4G@3 -O ... done
Issue1011_0002: OK

View File

@@ -0,0 +1,7 @@
mcstop+release.sh ... done
mcreboot.sh -c 4-15 -m 4G@0,4G@1,4G@2,4G@3 -O ... done
gcc -o exec exec.c
execve killed
./run_issue727.sh: 17 行: 20164 強制終了 ${MCEXEC} ./exec
McKernel PANIC detected.
Issue727_0002: NG

107
test/error_handling/arm64/run.sh Executable file
View File

@@ -0,0 +1,107 @@
#!/bin/sh
## run.sh COPYRIGHT FUJITSU LIMITED 2018 ##
USELTP=1
USEOSTEST=1
. ../../common.sh
result=0
###########################
# Issue727 test(no-patch) #
###########################
${MCEXEC} ./exec
if [ $? == 0 ]; then
echo "Issue727_0001: OK"
else
echo "Issue727_0001: NG"
result=-1
fi
##################
# Issue 873 test #
##################
isseu873_result=0
REP_NUM=100
for i in `seq -f %03g 1 ${REP_NUM}`
do
sudo "${SBIN}/mcstop+release.sh"
sleep 1
sudo "${SBIN}/mcreboot.sh" ${BOOTPARAM}
if [ $? != 0 ]; then
echo ""
echo "[NG] failed to boot Mckernel :${i}"
isseu873_result=-1
break
fi
echo -en "Issue873_0001 n=${i}/${REP_NUM} ok.\r"
done
echo ""
if [ ${isseu873_result} == 0 ]; then
echo "[OK] succeed to boot McKernel ${i} times"
echo "Issue873_0001: OK"
else
echo "Issue873_0001: NG"
result=-1
fi
#############################
# Issue 1011 test(no-patch) #
#############################
${MCEXEC} hostname
if [ $? == 0 ]; then
echo "Issue1011_0001: OK"
else
echo "Issue1011_0001: NG"
result=-1
fi
##################
# ulimit -u test #
##################
${MCEXEC} ${TESTMCK} -s kill -n 1 -- -p 6
if [ $? == 0 ]; then
echo "ulimit -u 0001: OK"
else
echo "ulimit -u 0001: NG"
result=-1
fi
ulimit -u 9
${MCEXEC} ${TESTMCK} -s kill -n 1 -- -p 6
if [ $? != 0 ]; then
echo "ulimit -u 0002: OK"
else
echo "ulimit -u 0002: NG"
result=-1
fi
#######################
# LTP regression test #
#######################
export PATH=${LTPBIN}:${PATH}
while read line
do
tp=`echo ${line} | cut -d ' ' -f 1`
if [ ! -e ${LTPBIN}/${tp} ]; then
echo "${LTPBIN}/${tp} not found."
continue
fi
timeout -sKILL 5m ${MCEXEC} ${LTPBIN}/${line}
if [ $? != 0 ]; then
echo "##### ${tp} returned not 0 #####"
result=-1
fi
done < ./ltplist.txt
exit ${result}

View File

@@ -0,0 +1,36 @@
#!/bin/sh
## run_issue1011.sh COPYRIGHT FUJITSU LIMITED 2018 ##
USELTP=0
USEOSTEST=0
. ../../common.sh
result=-1
##########################
# Issue 1011 test(patch) #
##########################
output=`${MCEXEC} hostname 2>&1`
if [ $? != 0 ]; then
echo "${output}" | grep -q "prepare: Invalid argument"
if [ $? == 0 ]; then
output=`tail -5 /var/log/messages`
echo "${output}" | grep -q "kernel: mcexec_prepare_image: ERROR: # of sections: -1"
if [ $? == 0 ]; then
echo "Issue1011_0002: OK"
result=0
else
echo "\"kernel: mcexec_prepare_image: ERROR: # of sections: -1\" not found."
fi
else
echo "\"prepare: Invalid argument\" not found."
fi
fi
if [ ${result} != 0 ]; then
echo "Issue1011_0002: NG"
fi
exit ${result}

View File

@@ -0,0 +1,33 @@
#!/bin/sh
## run_issue727.sh COPYRIGHT FUJITSU LIMITED 2018 ##
USELTP=0
USEOSTEST=0
. ../../common.sh
result=-1
########################
# Issue727 test(patch) #
########################
make
${MCEXEC} ./exec
if [ $? != 0 ]; then
output=`${IHKOSCTL} 0 get status`
echo "${output}" | grep -q "PANIC"
if [ $? == 1 ]; then
echo "Issue727_0002: OK"
result=0
else
echo "McKernel PANIC detected."
fi
fi
if [ ${result} != 0 ]; then
echo "Issue727_0002: NG"
fi
exit ${result}

View File

@@ -0,0 +1,10 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <errno.h>
int
main(int argc, char **argv)
{
execlp("ls", "ls", NULL);
}

View File

@@ -1,33 +1,33 @@
スクリプトは Wed Nov 29 11:22:32 2017
に開始しました[?1034hbash-4.2$ ../../../../mic/mcexec ./exec
727.patch exec exec.c patch-off.log
bash-4.2$ ../../../../mic/ihkosctl 0kmsg kmsg
IHK/McKernel started.
[ -1]: no_execute_available: 1
[ -1]: X86_IA32_NUM_PERF_COUNTERS: 4, X86_IA32_NUM_FIXED_PERF_COUNTERS: 3
[ -1]: Invariant TSC supported.
[ -1]: setup_x86 done.
[ -1]: ns_per_tsc: 384
[ -1]: KCommand Line: hidos dump_level=24
[ -1]: Physical memory: 0x1002c7000 - 0x140000000, 1070829568 bytes, 261433 pages available @ NUMA: 0
[ -1]: Physical memory: 0x880000000 - 0x8c0000000, 1073741824 bytes, 262144 pages available @ NUMA: 1
[ -1]: NUMA: 0, Linux NUMA: 0, type: 1, available bytes: 1070829568, pages: 261433
[ -1]: NUMA: 1, Linux NUMA: 1, type: 1, available bytes: 1073741824, pages: 262144
[ -1]: NUMA 0 distances: 0 (10), 1 (21),
[ -1]: NUMA 1 distances: 1 (10), 0 (21),
[ -1]: map_fixed: phys: 0x90000 => 0xffffffff70015000 (2 pages)
[ -1]: Trampoline area: 0x90000
[ -1]: map_fixed: phys: 0x0 => 0xffffffff70017000 (1 pages)
[ -1]: # of cpus : 7
[ -1]: locals = ffff8001002eb000
[ 0]: BSP: 0 (HW ID: 2 @ NUMA 0)
[ 0]: BSP: booted 6 AP CPUs
[ 0]: Master channel init acked.
[ 0]: vdso is enabled
IHK/McKernel booted.
bash-4.2$ シェルから脱出するには "exit" を使用してください。
bash-4.2$ exit
に開始しました[?1034hbash-4.2$ ../../../../mic/mcexec ./exec
727.patch exec exec.c patch-off.log
bash-4.2$ ../../../../mic/ihkosctl 0kmsg kmsg
IHK/McKernel started.
[ -1]: no_execute_available: 1
[ -1]: X86_IA32_NUM_PERF_COUNTERS: 4, X86_IA32_NUM_FIXED_PERF_COUNTERS: 3
[ -1]: Invariant TSC supported.
[ -1]: setup_x86 done.
[ -1]: ns_per_tsc: 384
[ -1]: KCommand Line: hidos dump_level=24
[ -1]: Physical memory: 0x1002c7000 - 0x140000000, 1070829568 bytes, 261433 pages available @ NUMA: 0
[ -1]: Physical memory: 0x880000000 - 0x8c0000000, 1073741824 bytes, 262144 pages available @ NUMA: 1
[ -1]: NUMA: 0, Linux NUMA: 0, type: 1, available bytes: 1070829568, pages: 261433
[ -1]: NUMA: 1, Linux NUMA: 1, type: 1, available bytes: 1073741824, pages: 262144
[ -1]: NUMA 0 distances: 0 (10), 1 (21),
[ -1]: NUMA 1 distances: 1 (10), 0 (21),
[ -1]: map_fixed: phys: 0x90000 => 0xffffffff70015000 (2 pages)
[ -1]: Trampoline area: 0x90000
[ -1]: map_fixed: phys: 0x0 => 0xffffffff70017000 (1 pages)
[ -1]: # of cpus : 7
[ -1]: locals = ffff8001002eb000
[ 0]: BSP: 0 (HW ID: 2 @ NUMA 0)
[ 0]: BSP: booted 6 AP CPUs
[ 0]: Master channel init acked.
[ 0]: vdso is enabled
IHK/McKernel booted.
bash-4.2$ シェルから脱出するには "exit" を使用してください。
bash-4.2$ exit
スクリプトは Wed Nov 29 11:22:57 2017
に終了しました

View File

@@ -1,35 +1,35 @@
スクリプトは Wed Nov 29 11:25:01 2017
に開始しました[?1034hbash-4.2$ ../../../../mic/mcexec ./exec
execve killed
強制終了
bash-4.2$ ../../../../mic/ihkosctl 0 kmsg
IHK/McKernel started.
[ -1]: no_execute_available: 1
[ -1]: X86_IA32_NUM_PERF_COUNTERS: 4, X86_IA32_NUM_FIXED_PERF_COUNTERS: 3
[ -1]: Invariant TSC supported.
[ -1]: setup_x86 done.
[ -1]: ns_per_tsc: 384
[ -1]: KCommand Line: hidos dump_level=24
[ -1]: Physical memory: 0x1002c7000 - 0x140000000, 1070829568 bytes, 261433 pages available @ NUMA: 0
[ -1]: Physical memory: 0x880000000 - 0x8c0000000, 1073741824 bytes, 262144 pages available @ NUMA: 1
[ -1]: NUMA: 0, Linux NUMA: 0, type: 1, available bytes: 1070829568, pages: 261433
[ -1]: NUMA: 1, Linux NUMA: 1, type: 1, available bytes: 1073741824, pages: 262144
[ -1]: NUMA 0 distances: 0 (10), 1 (21),
[ -1]: NUMA 1 distances: 1 (10), 0 (21),
[ -1]: map_fixed: phys: 0x90000 => 0xffffffff70015000 (2 pages)
[ -1]: Trampoline area: 0x90000
[ -1]: map_fixed: phys: 0x0 => 0xffffffff70017000 (1 pages)
[ -1]: # of cpus : 7
[ -1]: locals = ffff8001002eb000
[ 0]: BSP: 0 (HW ID: 2 @ NUMA 0)
[ 0]: BSP: booted 6 AP CPUs
[ 0]: Master channel init acked.
[ 0]: vdso is enabled
IHK/McKernel booted.
[ 0]: do_syscall: proxy PID 14276 is dead, terminate()
bash-4.2$ シェルから脱出するには "exit" を使用してください。
bash-4.2$ exit
に開始しました[?1034hbash-4.2$ ../../../../mic/mcexec ./exec
execve killed
強制終了
bash-4.2$ ../../../../mic/ihkosctl 0 kmsg
IHK/McKernel started.
[ -1]: no_execute_available: 1
[ -1]: X86_IA32_NUM_PERF_COUNTERS: 4, X86_IA32_NUM_FIXED_PERF_COUNTERS: 3
[ -1]: Invariant TSC supported.
[ -1]: setup_x86 done.
[ -1]: ns_per_tsc: 384
[ -1]: KCommand Line: hidos dump_level=24
[ -1]: Physical memory: 0x1002c7000 - 0x140000000, 1070829568 bytes, 261433 pages available @ NUMA: 0
[ -1]: Physical memory: 0x880000000 - 0x8c0000000, 1073741824 bytes, 262144 pages available @ NUMA: 1
[ -1]: NUMA: 0, Linux NUMA: 0, type: 1, available bytes: 1070829568, pages: 261433
[ -1]: NUMA: 1, Linux NUMA: 1, type: 1, available bytes: 1073741824, pages: 262144
[ -1]: NUMA 0 distances: 0 (10), 1 (21),
[ -1]: NUMA 1 distances: 1 (10), 0 (21),
[ -1]: map_fixed: phys: 0x90000 => 0xffffffff70015000 (2 pages)
[ -1]: Trampoline area: 0x90000
[ -1]: map_fixed: phys: 0x0 => 0xffffffff70017000 (1 pages)
[ -1]: # of cpus : 7
[ -1]: locals = ffff8001002eb000
[ 0]: BSP: 0 (HW ID: 2 @ NUMA 0)
[ 0]: BSP: booted 6 AP CPUs
[ 0]: Master channel init acked.
[ 0]: vdso is enabled
IHK/McKernel booted.
[ 0]: do_syscall: proxy PID 14276 is dead, terminate()
bash-4.2$ シェルから脱出するには "exit" を使用してください。
bash-4.2$ exit
スクリプトは Wed Nov 29 11:25:33 2017
に終了しました