peilinqian commented on issue #22173:
URL:
https://github.com/apache/shardingsphere/issues/22173#issuecomment-1321594008
```
"""
Case Type : 环境配置
Case Name : 配置通用sharding规则,进行启动
Create At : 2022/10/21
Owner : pwx5328113
Description :
1、检查涉及opengasus节点状态
2、远程复制解压安装脚本
3、配置server.yaml
4、配置config-*.yaml
5、清理ZK缓存信息
6、重启ss-proxy
Expect :
1、检查涉及opengasus节点状态,状态正常
2、远程复制解压安装脚本,成功
3、配置server.yaml,成功
4、配置config-*.yaml,成功
5、清理ZK缓存信息,
6、重启ss-proxy
History :
"""
import os
import unittest
from testcase.utils.Constant import Constant
from testcase.utils.Logger import Logger
from testcase.utils.OgCommonSH import OgCommonSH
from testcase.utils.SsCommonSH import SsCommonSH
from yat.test import macro
class commonConfigStart(unittest.TestCase):
def setUp(self):
self.log = Logger()
self.constant = Constant()
self.log.info(f'----{os.path.basename(__file__)}:start----')
self.pri1_sh = OgCommonSH('ds0_pri_DbUser')
self.pri1_sh.db_instance_path = macro.DB_INSTANCE_PATH1
self.pri1_sh.db_env_path = macro.DB_ENV_PATH1
self.pri2_sh = OgCommonSH('ds1_pri_DbUser')
self.pri2_sh.db_instance_path = macro.DB_INSTANCE_PATH2
self.pri2_sh.db_env_path = macro.DB_ENV_PATH2
self.ss_sh = SsCommonSH('default')
def test_main(self):
step_txt = '---step1:检查涉及opengasus节点状态;expect:正常----'
self.log.info(step_txt)
self.assertTrue(self.pri1_sh.get_db_instance_status(),
'执行失败:' + step_txt)
self.assertTrue(self.pri2_sh.get_db_instance_status(),
'执行失败:' + step_txt)
step_txt = '---step2:远程复制解压安装脚本,并解压配置ss-proxy;expect:成功----'
self.log.info(step_txt)
self.assertTrue(self.ss_sh.config_ss(), '执行失败:' + step_txt)
step_txt = '----step3:配置server.yaml;expect:成功----'
self.log.info(step_txt)
self.assertTrue(self.ss_sh.config_server_yaml("ZK_User"),
'执行失败:' + step_txt)
step_txt = '----step4:配置config-*.yaml;expect:成功----'
self.log.info(step_txt)
nodes = ('ds0_pri_DbUser', 'ds1_pri_DbUser')
conf = self.ss_sh.config_sharding_yaml('config-db.yaml',
'batchMode=on\&LoggerLevel=off',
'',
*nodes)
self.assertTrue(conf, '执行失败:' + step_txt)
step_txt = '----step5:清理ZK缓存信息;expect:成功----'
self.log.info(step_txt)
self.assertTrue(self.ss_sh.clean_zk(zk_node_name='ZK_User'),
'执行失败:' + step_txt)
step_txt = '----step6:star ss-proxy;expect:成功----'
self.log.info(step_txt)
self.assertTrue(self.ss_sh.start_ss(), '执行失败:' + step_txt)
def tearDown(self):
self.log.info('----this is teardown----')
self.log.info(f'----{os.path.basename(__file__)}:end----')
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]