提交 d7a4419c 编写于 作者: aaronchen2k2k's avatar aaronchen2k2k

shell sample

上级 b52ee7f9
package main
/*
<<<TC
caseId: %s
caseIdInTask: %s
taskId: %s
title: %s
steps: %s
expects:
%s
readme:
%s
TC;
*/
func main() {
%s
}
\ No newline at end of file
#!/usr/bin/env python3
'''
<<TC
caseId: %s
caseIdInTask: %s
taskId: %s
title: %s
steps: %s
expects:
%s
readme:
%s
TC
'''
%s
#!/usr/bin/env bash
<<TC
title:shell hello world.
expect:hello world.
TC
timeout=300
((count = 3)) # Number to test
while [[ $count -ne 0 ]] ; do
// get time field
tm=`ping -c 1 zentao.com 2>/dev/null | grep 'time=' | sed 's/.*time=\([.0-9]*\) ms/\1/g' | awk -F. '{print $1}'`
echo $tm
if [[ $tm -gt $timeout ]] ; then // timeout
((count = 1)) // break
fi
((count = count - 1))
done
if [ ! -n "$tm" ]; then
echo 'Unknown'
elif [[ $tm -gt $timeout ]]; then
echo 'Timeout'
else
echo 'Work'
fi
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册