From 2d2d0af6fb9fd0a5366b34d50114a157bc6482f2 Mon Sep 17 00:00:00 2001 From: Ken Sato Date: Wed, 29 Nov 2017 12:23:20 +0900 Subject: [PATCH] add test for Issue#873, 1011 --- test/error_handling/Issue1011/1011.patch | 13 +++++++++++++ test/error_handling/Issue1011/README | 17 +++++++++++++++++ test/error_handling/Issue727/727.patch | 12 ------------ test/error_handling/Issue873/README | 12 ++++++++++++ test/error_handling/Issue873/mck_boot_test.sh | 18 ++++++++++++++++++ 5 files changed, 60 insertions(+), 12 deletions(-) create mode 100644 test/error_handling/Issue1011/1011.patch create mode 100644 test/error_handling/Issue1011/README create mode 100644 test/error_handling/Issue873/README create mode 100755 test/error_handling/Issue873/mck_boot_test.sh diff --git a/test/error_handling/Issue1011/1011.patch b/test/error_handling/Issue1011/1011.patch new file mode 100644 index 00000000..6461b946 --- /dev/null +++ b/test/error_handling/Issue1011/1011.patch @@ -0,0 +1,13 @@ +diff --git a/executer/user/mcexec.c b/executer/user/mcexec.c +index 2d0d50e..9f109aa 100644 +--- a/executer/user/mcexec.c ++++ b/executer/user/mcexec.c +@@ -470,7 +470,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; diff --git a/test/error_handling/Issue1011/README b/test/error_handling/Issue1011/README new file mode 100644 index 00000000..0304c101 --- /dev/null +++ b/test/error_handling/Issue1011/README @@ -0,0 +1,17 @@ +■ Issue#1011 動作確認 +1. ファイルの説明 + 1011.patch mcexec からmcctrl.ko に渡すprogram_load_des構造体のnum_sections に + 常に-1 を設定するパッチ + +2. 確認方法 + 1. 上記パッチを適用していない状態でMcKernelを起動する + 2. mcexec hostname を実行し、ホスト名が表示されることを確認する + 3. 上記パッチをMcKernelに適用後、ビルドと起動を行う + 4. mcexec hostname を実行し、ホスト名が表示されず、"prepare: Invalid argument"が + コンソールに出力されることを確認する + 5. /var/log/messages に"kernel: mcexec_prepare_image: ERROR: # of sections: -1"が + 出力されていることを確認する + +3. 確認結果 + 上記確認方法で期待される動作が確認できたため、問題ない。 + diff --git a/test/error_handling/Issue727/727.patch b/test/error_handling/Issue727/727.patch index 2e235c7f..7871170b 100644 --- a/test/error_handling/Issue727/727.patch +++ b/test/error_handling/Issue727/727.patch @@ -2,18 +2,6 @@ diff --git a/executer/user/mcexec.c b/executer/user/mcexec.c index 2d0d50e..70856e7 100644 --- a/executer/user/mcexec.c +++ b/executer/user/mcexec.c -@@ -71,9 +71,9 @@ - #else /* POSTK_DEBUG_ARCH_DEP_35 */ - #include - #endif /* POSTK_DEBUG_ARCH_DEP_35 */ --#include -+//#include - #ifndef POSTK_DEBUG_ARCH_DEP_77 /* arch depend hide */ --#include -+//#include - #endif /* !POSTK_DEBUG_ARCH_DEP_77 */ - #include "../include/uprotocol.h" - #include @@ -3732,7 +3732,9 @@ return_execve1: /* Copy program image phase */ diff --git a/test/error_handling/Issue873/README b/test/error_handling/Issue873/README new file mode 100644 index 00000000..5bcc203d --- /dev/null +++ b/test/error_handling/Issue873/README @@ -0,0 +1,12 @@ +■ Issue#873 動作確認 +1. ファイルの説明 + mck_boot_test.sh McKernelの停止→起動 を100回繰り返すスクリプト + すべてで成功した場合には[OK]メッセージを、途中で失敗した場合には[NG] メッセージを出力する + +2. 確認方法 + 1. mck_boot_test.sh のMCK_DIR にMcKernelのインストールディレクトリを指定する + 2. sh ./mck_boot_test.sh を実行する + 3. [OK]メッセージがコンソールに出力されることを確認する + +3. 確認結果 + 上記の確認方法で期待される動作が確認できたため、問題ない。 diff --git a/test/error_handling/Issue873/mck_boot_test.sh b/test/error_handling/Issue873/mck_boot_test.sh new file mode 100755 index 00000000..a29f8199 --- /dev/null +++ b/test/error_handling/Issue873/mck_boot_test.sh @@ -0,0 +1,18 @@ +#!/bin/sh + +MCK_DIR=/home/satoken/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"