Permalink
Browse files

Merge pull request #208 from haibinshi/ocft-split-test-log

Low: tools: ocft: split the log file ocft.log
  • Loading branch information...
2 parents 85960ed + e7e02fa commit 6c8cf51556f025594f204c990aca3f898fcbc698 @dmuhamedagic dmuhamedagic 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 6c8cf51

Please sign in to comment.