Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
taosdata
TDengine
提交
dd0a0861
TDengine
项目概览
taosdata
/
TDengine
1 年多 前同步成功
通知
1185
Star
22016
Fork
4786
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
TDengine
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
dd0a0861
编写于
3月 08, 2022
作者:
T
tangfangzhi
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
compatibility test scripts
上级
1eb792a8
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
416 addition
and
0 deletion
+416
-0
tests/compatibility/init.sh
tests/compatibility/init.sh
+118
-0
tests/compatibility/init_container.sh
tests/compatibility/init_container.sh
+105
-0
tests/compatibility/run_test.sh
tests/compatibility/run_test.sh
+188
-0
tests/compatibility/settings.sh
tests/compatibility/settings.sh
+5
-0
未找到文件。
tests/compatibility/init.sh
0 → 100755
浏览文件 @
dd0a0861
#!/bin/bash
function
usage
()
{
echo
"
$0
"
echo
-e
"
\t
-w work dir"
echo
-e
"
\t
-o old version package"
echo
-e
"
\t
-n new version package"
echo
-e
"
\t
-c client package"
echo
-e
"
\t
-h help"
}
while
getopts
"w:o:n:c:h"
opt
;
do
case
$opt
in
w
)
WORK_DIR
=
$OPTARG
;;
o
)
TAOS_PKG1
=
$OPTARG
;;
n
)
TAOS_PKG2
=
$OPTARG
;;
c
)
CLIENT_PKG
=
$OPTARG
;;
h
)
usage
exit
0
;;
\?
)
echo
"Invalid option: -
$OPTARG
"
usage
exit
0
;;
esac
done
if
[
-z
"
$WORK_DIR
"
]
;
then
usage
exit
1
fi
if
[
-z
"
$TAOS_PKG1
"
]
;
then
usage
exit
1
fi
if
[
-z
"
$TAOS_PKG2
"
]
;
then
usage
exit
1
fi
if
[
!
-z
"
$CLIENT_PKG
"
]
;
then
if
[
!
-f
"
$CLIENT_PKG
"
]
;
then
echo
"
$CLIENT_PKG
not found"
exit
1
fi
fi
script_dir
=
`
dirname
$0
`
cd
$script_dir
source
settings.sh
code_dir
=
$WORK_DIR
/TDinternal
container_workdir1
=
$WORK_DIR
/compatibility/
$container_name1
container_workdir2
=
$WORK_DIR
/compatibility/
$container_name2
container_workdir3
=
$WORK_DIR
/compatibility/
$container_name3
container_workdir4
=
$WORK_DIR
/compatibility/
$container_name4
mkdir
-p
$container_workdir1
mkdir
-p
$container_workdir2
mkdir
-p
$container_workdir3
mkdir
-p
$container_workdir4
docker
rm
-f
$container_name1
>
/dev/null 2>&1
docker
rm
-f
$container_name2
>
/dev/null 2>&1
docker
rm
-f
$container_name3
>
/dev/null 2>&1
docker
rm
-f
$container_name4
>
/dev/null 2>&1
net_name
=
mynet
docker network create
--driver
bridge
--subnet
172.31.30.0/24
--gateway
172.31.30.1
$net_name
./init_container.sh
-d
$code_dir
-w
$container_workdir1
-p
$TAOS_PKG1
-q
$TAOS_PKG2
-n
$net_name
-c
$container_name1
&
./init_container.sh
-d
$code_dir
-w
$container_workdir2
-p
$TAOS_PKG1
-q
$TAOS_PKG2
-n
$net_name
-c
$container_name2
&
./init_container.sh
-d
$code_dir
-w
$container_workdir3
-p
$TAOS_PKG1
-q
$TAOS_PKG2
-n
$net_name
-c
$container_name3
&
./init_container.sh
-d
$code_dir
-w
$container_workdir4
-p
$TAOS_PKG1
-q
$TAOS_PKG2
-n
$net_name
-c
$container_name4
&
RET
=
0
pids
=
`
jobs
-p
`
for
pid
in
$pids
;
do
wait
$pid
status
=
$?
if
[
$status
-ne
0
]
;
then
echo
"init container
$pid
status is
$status
!"
RET
=
$status
fi
done
if
[
$RET
-eq
0
]
;
then
if
[
-z
"
$CLIENT_PKG
"
]
;
then
docker
exec
$container_name4
pip3
install
/home/TDinternal/community/src/connector/python
RET
=
$?
else
pkg_name
=
`
basename
$CLIENT_PKG
`
pkg_dir
=
`
echo
"
$pkg_name
"
|sed
"s/-Linux-x64.tar.gz//"
`
docker
cp
$CLIENT_PKG
$container_name4
:/home/
docker
exec
$container_name4
sh
-c
"cd /home;tar xzf
$pkg_name
;pip3 install /home/
$pkg_dir
/connector/python"
RET
=
$?
fi
fi
if
[
$RET
-eq
0
]
;
then
echo
"containers created"
else
echo
"containers create failed"
fi
exit
$RET
tests/compatibility/init_container.sh
0 → 100755
浏览文件 @
dd0a0861
#!/bin/bash
function
usage
()
{
echo
"
$0
"
echo
-e
"
\t
-w work dir"
echo
-e
"
\t
-d TDinternal code dir"
echo
-e
"
\t
-p old package"
echo
-e
"
\t
-q new package"
echo
-e
"
\t
-c container name"
echo
-e
"
\t
-h help"
}
while
getopts
"w:p:q:n:c:d:h"
opt
;
do
case
$opt
in
w
)
WORK_DIR
=
$OPTARG
;;
d
)
CODE_DIR
=
$OPTARG
;;
p
)
TAOS_PKG1
=
$OPTARG
;;
q
)
TAOS_PKG2
=
$OPTARG
;;
c
)
CONTAINER_NAME
=
$OPTARG
;;
n
)
NET_NAME
=
$OPTARG
;;
h
)
usage
exit
0
;;
\?
)
echo
"Invalid option: -
$OPTARG
"
usage
exit
0
;;
esac
done
if
[
-z
"
$WORK_DIR
"
]
;
then
usage
exit
1
fi
if
[
-z
"
$TAOS_PKG1
"
]
;
then
usage
exit
1
fi
if
[
-z
"
$TAOS_PKG2
"
]
;
then
usage
exit
1
fi
if
[
-z
"
$CONTAINER_NAME
"
]
;
then
usage
exit
1
fi
if
[
-z
"
$NET_NAME
"
]
;
then
usage
exit
1
fi
if
[
-z
"
$CODE_DIR
"
]
;
then
usage
exit
1
fi
if
[
!
-f
"
$TAOS_PKG1
"
]
;
then
echo
"
$TAOS_PKG1
not found"
exit
1
fi
if
[
!
-f
"
$TAOS_PKG2
"
]
;
then
echo
"
$TAOS_PKG2
not found"
exit
1
fi
pkg_name1
=
`
basename
$TAOS_PKG1
`
pkg_dir1
=
`
echo
"
$pkg_name1
"
|sed
"s/-Linux-x64.tar.gz//"
`
pkg_name2
=
`
basename
$TAOS_PKG2
`
pkg_dir2
=
`
echo
"
$pkg_name2
"
|sed
"s/-Linux-x64.tar.gz//"
`
RET
=
0
docker run
-d
--name
$CONTAINER_NAME
\
--hostname
$CONTAINER_NAME
\
--net
$NET_NAME
--ulimit
core
=
-1
-it
\
-v
$TAOS_PKG1
:/home/tdengine1.tar.gz:ro
\
-v
$TAOS_PKG2
:/home/tdengine2.tar.gz:ro
\
-v
$WORK_DIR
/coredump:/home/coredump
\
-v
$CODE_DIR
:/home/TDinternal
\
taos_test:v1.0 bash
RET
=
$?
if
[
$RET
-ne
0
]
;
then
echo
"docker run failed with
$RET
"
exit
$RET
fi
docker
exec
$CONTAINER_NAME
sh
-c
"cd /home;tar xzf tdengine1.tar.gz;tar xzf tdengine2.tar.gz;cd
$pkg_dir1
;./install.sh -v server -e no"
RET
=
$?
if
[
$RET
-ne
0
]
;
then
echo
"docker exec install.sh failed with
$RET
"
exit
$RET
fi
exit
0
tests/compatibility/run_test.sh
0 → 100755
浏览文件 @
dd0a0861
#!/bin/bash
function
usage
()
{
echo
"
$0
"
echo
-e
"
\t
-w work dir"
echo
-e
"
\t
-o old package"
echo
-e
"
\t
-n new package"
echo
-e
"
\t
-c client package"
echo
-e
"
\t
-h help"
}
while
getopts
"w:o:n:c:h"
opt
;
do
case
$opt
in
w
)
WORK_DIR
=
$OPTARG
;;
o
)
OLD_PACKAGE
=
$OPTARG
;;
n
)
NEW_PACKAGE
=
$OPTARG
;;
c
)
CLIENT_PACKAGE_PARAM
=
"-c
$OPTARG
"
;;
h
)
usage
exit
0
;;
\?
)
echo
"Invalid option: -
$OPTARG
"
usage
exit
0
;;
esac
done
if
[
-z
"
$WORK_DIR
"
]
;
then
usage
exit
1
fi
if
[
-z
"
$OLD_PACKAGE
"
]
;
then
usage
exit
1
fi
if
[
-z
"
$NEW_PACKAGE
"
]
;
then
usage
exit
1
fi
script_dir
=
`
dirname
$0
`
cd
$script_dir
pkg_name
=
`
basename
$NEW_PACKAGE
`
new_version
=
`
echo
"
$pkg_name
"
|sed
"s/TDengine-enterprise-server-//"
|sed
"s/-Linux-x64.tar.gz//"
`
pkg_name
=
`
basename
$OLD_PACKAGE
`
old_version
=
`
echo
"
$pkg_name
"
|sed
"s/TDengine-enterprise-server-//"
|sed
"s/-Linux-x64.tar.gz//"
`
source
settings.sh
containers
=
"
$container_name1
$container_name2
$container_name3
"
# initialize all containers and install with old version package
./init.sh
-w
$WORK_DIR
-o
$OLD_PACKAGE
-n
$NEW_PACKAGE
$CLIENT_PACKAGE_PARAM
# upgrade with new version package
function
upgrade
()
{
local
container_name
=
$1
local
new_pkg_name
=
`
basename
$NEW_PACKAGE
`
local
new_pkg_dir
=
`
echo
"
$new_pkg_name
"
|sed
"s/-Linux-x64.tar.gz//"
`
local
ret
=
0
echo
"upgrade
${
container_name
}
"
docker
exec
$container_name
service taosd stop
ret
=
$?
if
[
$ret
-ne
0
]
;
then
echo
"docker exec
$container_name
service taosd stop, exit:
$ret
"
return
$ret
fi
docker
exec
$container_name
sh
-c
"cd /home/
$new_pkg_dir
;./install.sh -v server -e no"
ret
=
$?
if
[
$ret
-ne
0
]
;
then
echo
"docker exec
$container_name
install.sh, exit:
$ret
"
return
$ret
fi
docker
exec
$container_name
service taosd start
ret
=
$?
if
[
$ret
-ne
0
]
;
then
echo
"docker exec
$container_name
service taosd start, exit:
$ret
"
return
$ret
fi
return
0
}
function
checkStatus
()
{
local
container_name
=
$1
local
check_version
=
$2
echo
"python3 manualTest/TD-5114/checkClusterStatus.py
$container_name
$check_version
"
docker
exec
$container_name4
sh
-c
"cd /home/TDinternal/community/tests/pytest;python3 manualTest/TD-5114/checkClusterStatus.py
$container_name
$check_version
"
return
$?
}
# config container /etc/taos/taos.cfg
taos_cfg
=
/etc/taos/taos.cfg
for
container
in
$containers
;
do
docker
exec
$container
sed
-i
"s/^.*firstEp.*
$/
firstEp
$container_name1
:6030/"
$taos_cfg
docker
exec
$container
sed
-i
"s/^.*fqdn.*
$/
fqdn
$container
/"
$taos_cfg
docker
exec
$container
sed
-i
"s/^.*numOfMnodes.*
$/
numOfMnodes 3/"
$taos_cfg
done
# start taosd
docker
exec
$container_name1
service taosd start
docker
exec
$container_name4
taos
-h
$container_name1
-s
"CREATE DNODE
\"
$container_name2
:6030
\"
;"
docker
exec
$container_name4
taos
-h
$container_name1
-s
"CREATE DNODE
\"
$container_name3
:6030
\"
;"
# start taosd
docker
exec
$container_name2
service taosd start
docker
exec
$container_name3
service taosd start
# show nodes
docker
exec
$container_name4
taos
-h
$container_name1
-s
"SHOW DNODES;"
docker
exec
$container_name4
taos
-h
$container_name1
-s
"SHOW MNODES;"
# check cluster status
for
container
in
$containers
;
do
checkStatus
$container
$old_version
RET
=
$?
if
[
$RET
-ne
0
]
;
then
echo
"check cluster status
$container
error:
$RET
"
exit
$RET
fi
echo
"check cluster status
$container
ret:
$RET
"
done
sleep
1
# upgrade
upgrade
${
container_name3
}
RET
=
$?
if
[
$RET
-ne
0
]
;
then
echo
"upgrade
${
container_name3
}
error:
$RET
"
exit
$RET
fi
sleep
10
# check cluster status
checkStatus
${
container_name3
}
$old_version
RET
=
$?
if
[
$RET
-ne
0
]
;
then
echo
"check cluster status
${
container_name3
}
error:
$RET
"
exit
$RET
fi
echo
"check cluster status
${
container_name3
}
ret:
$RET
"
# upgrade
upgrade
${
container_name2
}
RET
=
$?
if
[
$RET
-ne
0
]
;
then
echo
"upgrade
${
container_name2
}
error:
$RET
"
exit
$RET
fi
sleep
10
# check cluster status
checkStatus
${
container_name2
}
$old_version
RET
=
$?
if
[
$RET
-ne
0
]
;
then
echo
"check cluster status
${
container_name2
}
error:
$RET
"
exit
$RET
fi
echo
"check cluster status
${
container_name2
}
ret:
$RET
"
# upgrade
upgrade
${
container_name1
}
RET
=
$?
if
[
$RET
-ne
0
]
;
then
echo
"upgrade
${
container_name1
}
error:
$RET
"
exit
$RET
fi
sleep
10
# check cluster status
checkStatus
${
container_name3
}
$new_version
RET
=
$?
if
[
$RET
-ne
0
]
;
then
echo
"check cluster status
${
container_name3
}
error:
$RET
"
exit
$RET
fi
echo
"check cluster status
${
container_name3
}
ret:
$RET
"
exit
$RET
tests/compatibility/settings.sh
0 → 100644
浏览文件 @
dd0a0861
container_name1
=
compat_container1
container_name2
=
compat_container2
container_name3
=
compat_container3
container_name4
=
compat_container4
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录