Permalink
Browse files

Low: tools: ocft: split the log file ocft.log

Split ocft.log to the files that named the same as the test config file.

Add related note in README.
  • Loading branch information...
1 parent 85960ed commit e7e02fa8089f509b253dcc5b61fcbe8d3f681a7f @haibinshi haibinshi committed Feb 28, 2013
Showing with 12 additions and 4 deletions.
  1. +2 −0 tools/ocft/README.in
  2. +2 −0 tools/ocft/README.zh_CN.in
  3. +8 −4 tools/ocft/ocft.in
View
@@ -38,6 +38,8 @@ INTRODUCTION & DESIGN
the running status of each test case, which will compares the predicated result
with the actual one. If they differ, you will be able to find the bugs of the
resource agent.
+ - All of the output with test will be recorded into the log files, you can find them
+ in /var/lib/@PACKAGE_NAME@/ocft/cases/logs.
HOW TO WRITE CONFIGURATION FILE
@@ -27,6 +27,8 @@ ocft 通过两种手段来设计resouce agents的运行环境,一是更改reso
都写入配置文件,然后运行generator,将你刚写的test case转换成可执行的脚本。最后运行
这些脚本,观察它们的输出,你可以清楚看到每个test case运行状况,他会比较你的预知结
果和resource agent的实际结果,如果不一样,说明你找到resource agent的bug了。
+所有的测试输出都会被记录到日志文件中,你可以在 /var/lib/@PACKAGE_NAME@/ocft/cases/logs
+中找到他们.
2 配置
只有6个top level option,它们是由大写字母和'-'构成的,每个top level option都有若干sub-option,
View
@@ -640,6 +640,10 @@ start_test()
die "cases directory not found."
fi
+ if [ ! -d logs ]; then
+ mkdir logs
+ fi
+
export __OCFT__VERBOSE=$opt_verbose
if [ $# -eq 0 ]; then
@@ -686,11 +690,11 @@ start_test()
;;
esac
fi
+ done 2>&1 | while read -r line; do
+ echo "$line"
+ echo "$(date '+%F %T'): $line" | cat -A |
+ sed -r 's/\^\[\[[0-9]+m|\^I|.$//g' >>logs/$shs.log
done
- done 2>&1 | while read -r line; do
- echo "$line"
- echo "$(date '+%F %T'): $line" | cat -A |
- sed -r 's/\^\[\[[0-9]+m|\^I|.$//g' >>ocft.log
done
}

0 comments on commit e7e02fa

Please sign in to comment.