Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Feb 28, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions tools/ocft/README.in
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions tools/ocft/README.zh_CN.in
Expand Up @@ -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,
Expand Down
12 changes: 8 additions & 4 deletions tools/ocft/ocft.in
Expand Up @@ -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
Expand Down Expand Up @@ -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
}

Expand Down