803 lines
52 KiB
Plaintext
803 lines
52 KiB
Plaintext
*** Settings ***
|
||
Resource ElementPath.robot
|
||
Library SSHLibrary
|
||
Resource ../RE0_Common/KeyWord.robot
|
||
Library DatabaseLibrary
|
||
Library String
|
||
|
||
*** Keywords ***
|
||
创建数据表
|
||
[Arguments] ${ip} ${user} ${pwd} ${port} # 数据库ip地址|用户名称|密码|端口号
|
||
Connect To Database Using Custom Params pymysql host='${ip}', port=${port}, user='${user}', passwd='${pwd}', db='test', charset= 'utf8'
|
||
Execute Sql String use test; #执行SQL语句
|
||
Execute Sql String drop table if exists unary; #执行SQL语句
|
||
Execute Sql String create table unary(worker int);
|
||
Execute Sql String insert into unary(worker) values (2008);
|
||
${query_result} query select worker from unary;
|
||
Log ${query_result}
|
||
Disconnect From Database
|
||
Log 断开数据库连接
|
||
|
||
Mysql备份
|
||
[Arguments] ${Mysql_Agent} ${bk_type} ${DPM_Mysql_DB_User} ${DPM_Mysql_DB_PWD} ${DPM_Mysql_DB_Port} ${DPM_Mysql_DB_IP_Remote} ${Srcbkfun} ${MysqlDump} ${MysqlBinLog} ${MysqlLog} ${MysqlConfig} ${mds_name} ${encryption_attr} ${compress_attr} ${dedup_attr} ${cache}
|
||
元素点击 ${Timed_DataProtect} 点击进入定时数据保护页面 定位定时数据保护失败
|
||
${date} Evaluate time.strftime('%Y%m%d%H%M%S',time.localtime()) time
|
||
${random_strategyName}= Catenate SEPARATOR=_ ${bk_type} ${date}
|
||
${createpolicy} Catenate SEPARATOR= 新建了策略[ ${random_strategyName} ]
|
||
Set Suite Variable ${random_strategyName}
|
||
Set Suite Variable ${createpolicy}
|
||
Sleep 5s
|
||
元素点击 xpath=//span[text()="${Mysql_Agent}"] 点击选择代理 定位代理所在位置失败
|
||
Sleep 10s
|
||
元素点击 ${Add_Policy} 点击添加策略按钮 定位添加策略按钮失败
|
||
元素点击 ${Mysql_Module} 点击Mysql组件 定位Mysql组件失败
|
||
sleep 5s
|
||
元素输入 ${Set_PolicyName} ${random_strategyName} 定位策略名输入框失败
|
||
元素输入 ${Input_Mysql_Name} ${DPM_Mysql_DB_User} 定位mysql用户名输入框失败
|
||
元素输入 ${Input_Mysql_Pwd} ${DPM_Mysql_DB_PWD} 定位mysql用户密码输入框失败
|
||
元素输入 ${Input_Mysql_Port} ${DPM_Mysql_DB_Port} 定位mysql端口输入框失败
|
||
元素输入 ${Input_Mysql_IP} ${DPM_Mysql_DB_IP_Remote} 定位mysql ip输入框失败
|
||
Run Keyword If ${Srcbkfun}==1 选择备份级别--库级别
|
||
... ELSE IF ${Srcbkfun}==0 选择备份级别--实例级别
|
||
元素点击 ${Connect_Mysql_NextStep} 进入到目标数据库选择界面 定位下一步按钮失败
|
||
元素点击 ${Bk_DB} 勾选需要备份的Mysql数据库 定位目标数据库失败
|
||
元素点击 ${Mysql_Path} 点击Mysql路径参数 定位Mysql路径参数失败
|
||
元素点击 ${Select_Mysqldump} 勾选mysqldump 定位mysqldump勾选框失败
|
||
元素输入 ${Input_MysqlDump} ${MysqlDump} 定位mysqldump输入框失败
|
||
元素点击 ${Select_MysqlBinLog} 勾选mysqlbinlog 定位mysqlbinlog勾选框失败
|
||
元素输入 ${Input_MysqlBinLog} ${MysqlBinLog} 定位mysqlbinlog输入框失败
|
||
元素点击 ${Select_Log} 勾选mysqllog 定位mysqllog勾选框失败
|
||
元素输入 ${Input_Log} ${MysqlLog} 定位mysqllog输入框失败
|
||
元素点击 ${Select_Config} 勾选mysqlconfig 定位mysqlconfig勾选框失败
|
||
元素输入 ${Input_Config} ${MysqlConfig} 定位mysqlconfig输入框失败
|
||
元素点击 ${Mysql_Path_Confirm} 点击确认完成mysql路径参数配置 定位mysql路径配置确定按钮失败
|
||
元素点击 ${Bk_Mysql_NextStep} 进入到任务周期页面 定位下一步按钮失败
|
||
元素点击 ${Add_taskcycle} 点击添加任务周期 定位添加任务周期按钮失败
|
||
Run Keyword If "${bk_type}"=="完全" 完全备份
|
||
... ELSE IF "${bk_type}"=="增量" 增量备份
|
||
Sleep 2s
|
||
元素点击 ${Cycle_Once} 设置任务仅执行一次 定位仅执行一次失败
|
||
元素点击 ${Cycle_Confirm} 确定任务周期设置完毕 定位任务周期设置失败
|
||
元素点击 ${Cycle_NextStep} 点击下一步进入备份集存储设置界面 定位下一步失败
|
||
元素点击 ${Manual_ChooseMDS} 点击勾选手动选择介质 定位选择介质失败
|
||
元素点击 ${Select_Mysql_MDS} 点击介质选择按钮 定位介质选择按钮失败
|
||
元素点击 xpath=//select[@id="dialogues_addCycleStorage_storagePath_selectMedia_selectedMdsIP_select"]/option[@label="${mds_name}"] 点击选择指定介质 定位指定介质失败
|
||
Run Keyword If ${dedup_attr}==1 重删
|
||
元素点击 ${Storage_NextStep} 点击下一步进入到备份高级选项 定位下一步失败
|
||
Run Keyword If ${encryption_attr}==1 Mysql逻辑勾选加密
|
||
... ELSE IF ${encryption_attr}==0 Mysql逻辑取消加密
|
||
Run Keyword If ${compress_attr}==1 勾选压缩
|
||
... ELSE IF ${compress_attr}==0 取消压缩
|
||
Run Keyword If ${cache}==1 备份缓存 /opt
|
||
... ELSE Log 不勾选缓存
|
||
循环点击 ${Senior_NextStep} ${Cl_addOK}
|
||
元素点击 ${Cl_addOK} 二次确定策略创建成功 策略创建失败
|
||
元素点击 ${BackupSet} 点击进入备份集一栏 定位备份集栏失败
|
||
元素输入 ${Input_Policy_Name} ${random_strategyName} 定位策略搜索框失败
|
||
Log 输入策略名进行搜索
|
||
Sleep 15s
|
||
FOR ${n} IN RANGE 20
|
||
Click Element ${Button_Searchbk}
|
||
${bk_status} Run Keyword And Return Status Wait Until Element Is Visible Xpath=//*[@id="backupSetTable"]/div[2]/table/tbody/tr[2]/td[text()="已完成"]
|
||
Run Keyword If "${bk_status}"=="True" Exit For Loop
|
||
... ELSE Log 备份未完成
|
||
Sleep 30s
|
||
END
|
||
Run Keyword If ${bk_status}==False Fail
|
||
... ELSE Log 备份成功
|
||
Sleep 15s
|
||
|
||
Mysql按个数保留备份
|
||
[Arguments] ${Mysql_Agent} ${bk_type} ${DPM_Mysql_DB_User} ${DPM_Mysql_DB_PWD} ${DPM_Mysql_DB_Port} ${DPM_Mysql_DB_IP_Remote} ${Srcbkfun} ${mds_name} ${encryption_attr} ${compress_attr} ${dedup_attr} ${cache}
|
||
[Documentation] mysql备份集按个数保留1个;备份test、unary数据库;根据传入的参数进行介质、备份类型、加密压缩重删参数的选择
|
||
...
|
||
... 新增备份集页面根据策略名称搜索的操作,防止修改时间对备份集状态的或者造成影响
|
||
元素点击 ${Timed_DataProtect} 点击进入定时数据保护页面 定位定时数据保护失败
|
||
${date} Evaluate time.strftime('%Y%m%d%H%M%S',time.localtime()) time
|
||
${random_strategyName}= Catenate SEPARATOR=_ ${bk_type} ${date}
|
||
${createpolicy} Catenate SEPARATOR= 新建了策略[ ${random_strategyName} ]
|
||
Set Suite Variable ${random_strategyName}
|
||
Set Suite Variable ${createpolicy}
|
||
Sleep 5s
|
||
元素点击 xpath=//span[text()="${Mysql_Agent}"] 点击选择代理 定位代理所在位置失败
|
||
Sleep 10s
|
||
元素点击 ${Add_Policy} 点击添加策略按钮 定位添加策略按钮失败
|
||
元素点击 ${Mysql_Module} 点击Mysql组件 定位Mysql组件失败
|
||
sleep 5s
|
||
元素输入 ${Set_PolicyName} ${random_strategyName} 定位策略名输入框失败
|
||
元素输入 ${Input_Mysql_Name} ${DPM_Mysql_DB_User} 定位mysql用户名输入框失败
|
||
元素输入 ${Input_Mysql_Pwd} ${DPM_Mysql_DB_PWD} 定位mysql用户密码输入框失败
|
||
元素输入 ${Input_Mysql_Port} ${DPM_Mysql_DB_Port} 定位mysql端口输入框失败
|
||
元素输入 ${Input_Mysql_IP} ${DPM_Mysql_DB_IP_Remote} 定位mysql ip输入框失败
|
||
Run Keyword If ${Srcbkfun}==1 选择备份级别--库级别
|
||
... ELSE IF ${Srcbkfun}==0 选择备份级别--实例级别
|
||
元素点击 ${Connect_Mysql_NextStep} 进入到目标数据库选择界面 定位下一步按钮失败
|
||
元素点击 ${Bk_DB} 勾选需要备份的Mysql数据库test 定位目标数据库失败
|
||
元素点击 ${Bk_DB_unary} 勾选需要备份的Mysql数据库unary 定位目标数据库失败
|
||
元素点击 ${Mysql_Path} 点击Mysql路径参数 定位Mysql路径参数失败
|
||
元素点击 ${Select_Mysqldump} 勾选mysqldump 定位mysqldump勾选框失败
|
||
元素输入 ${Input_MysqlDump} ${MysqlDump_Win} 定位mysqldump输入框失败
|
||
元素点击 ${Select_MysqlBinLog} 勾选mysqlbinlog 定位mysqlbinlog勾选框失败
|
||
元素输入 ${Input_MysqlBinLog} ${MysqlBinLogp_Win} 定位mysqlbinlog输入框失败
|
||
元素点击 ${Select_Log} 勾选mysqllog 定位mysqllog勾选框失败
|
||
元素输入 ${Input_Log} ${MysqlLogp_Win} 定位mysqllog输入框失败
|
||
元素点击 ${Select_Config} 勾选mysqlconfig 定位mysqlconfig勾选框失败
|
||
元素输入 ${Input_Config} ${MysqlLogp_Win} 定位mysqlconfig输入框失败
|
||
元素点击 ${Mysql_Path_Confirm} 点击确认完成mysql路径参数配置 定位mysql路径配置确定按钮失败
|
||
元素点击 ${Bk_Mysql_NextStep} 进入到任务周期页面 定位下一步按钮失败
|
||
元素点击 ${Add_taskcycle} 点击添加任务周期 定位添加任务周期按钮失败
|
||
Run Keyword If "${bk_type}"=="完全" Mysql_KeyWord.完全备份
|
||
... ELSE IF "${bk_type}"=="增量" Mysql_KeyWord.增量备份
|
||
Sleep 2s
|
||
元素点击 ${Cycle_Once} 设置任务仅执行一次 定位仅执行一次失败
|
||
元素点击 ${Cycle_Confirm} 确定任务周期设置完毕 定位任务周期设置失败
|
||
元素点击 ${Cycle_NextStep} 点击下一步进入备份集存储设置界面 定位下一步失败
|
||
元素点击 ${Manual_ChooseMDS} 点击勾选手动选择介质 定位选择介质失败
|
||
元素点击 ${Select_Mysql_MDS} 点击介质选择按钮 定位介质选择按钮失败
|
||
元素点击 xpath=//select[@id="dialogues_addCycleStorage_storagePath_selectMedia_selectedMdsIP_select"]/option[@label="${mds_name}"] 点击选择指定介质 定位指定介质失败
|
||
Run Keyword If ${dedup_attr}==1 Mysql_KeyWord.重删
|
||
元素点击 ${Select_Bk_Savetime} 点击展开备份集保留时间下拉框 定位备份集保留时间下拉框失败
|
||
元素点击 ${Save_by_geshu} 点击选择保留周期为按个数保留 定位保留周期为按个数保留失败
|
||
元素点击 ${Storage_NextStep} 点击下一步进入到备份高级选项 定位下一步失败
|
||
log 进入备份高级选项
|
||
Run Keyword If ${encryption_attr}==1 Mysql_KeyWord.Mysql逻辑勾选加密
|
||
Run Keyword If ${compress_attr}==1 Mysql_KeyWord.压缩
|
||
... ELSE IF ${compress_attr}==0 Mysql_KeyWord.取消压缩
|
||
Run Keyword If ${cache}==1 Mysql_KeyWord.备份缓存 C:\
|
||
... ELSE Log 不勾选缓存
|
||
循环点击 ${Senior_NextStep} ${Cl_addOK}
|
||
元素点击 ${Cl_addOK} 二次确定策略创建成功 策略创建失败
|
||
元素点击 ${BackupSet} 点击进入备份集一栏 定位备份集栏失败
|
||
Sleep 50s
|
||
元素输入 ${DPMFind_Policy} ${random_strategyName} 策略名输入失败
|
||
Sleep 2s
|
||
元素点击 ${DPMButton_Searchbutton} 点击搜索按钮 定位搜索按钮失败
|
||
Sleep 30s
|
||
Wait Until Page Contains Element Xpath=//*[@id="backupSetTable"]/div[2]/table/tbody/tr[3]/td[3][text()="test"]/..//td[text()="已完成"] 180s test库备份失败
|
||
Wait Until Page Contains Element Xpath=//*[@id="backupSetTable"]/div[2]/table/tbody/tr[2]/td[3][text()="unary"]/..//td[text()="已完成"] 180s unary库备份失败
|
||
sleep 30s
|
||
Log 备份完成
|
||
Sleep 5s
|
||
|
||
Mysql_Physical备份
|
||
[Arguments] ${Mysql_Physical_Agent} ${bk_type} ${Srcbkfun} ${DPM_Mysql_Phy_Inst_Port} ${DPM_Mysql_physical_DB_User} ${DPM_Mysql_physical_DB_PWD} ${DPM_Mysql_physical_DB_Port} ${DPM_Mysql_physical_DB_IP_Local} ${channel} ${Path_Dump} ${Path_BinLog} ${Path_Bin} ${Path_Backup} ${mds_name} ${dedup_attr} ${encryption_attr}
|
||
... ${compress_attr}
|
||
... ${compress_attr} #代理hostname|备份方式|连接协议|自定义实例名|DB用户|数据库密码|数据库端口号|数据库IP|备份通道|MySQL 配置文件路径|MySQL binog索引文件路径|数据库BIN路径|备份工具目录|介质|重删|加密|压缩
|
||
元素点击 ${Timed_DataProtect} 点击进入定时数据保护页面 定位定时数据保护失败
|
||
${date} Evaluate time.strftime('%Y%m%d%H%M%S',time.localtime()) time
|
||
${random_strategyName}= Catenate SEPARATOR=_ ${bk_type} ${date}
|
||
${createpolicy} Catenate SEPARATOR= 新建了策略[ ${random_strategyName} ]
|
||
Set Suite Variable ${random_strategyName}
|
||
Set Suite Variable ${createpolicy}
|
||
Sleep 15s
|
||
元素点击 xpath=//span[text()="${Mysql_Physical_Agent}"] 点击选择代理 定位代理所在位置失败
|
||
Sleep 10s
|
||
元素点击 ${Add_Policy} 点击添加策略按钮 定位添加策略按钮失败
|
||
Sleep 15s
|
||
元素点击 ${Mysql_Phy_Module} 点击Mysql物理组件 定位Mysql组件失败
|
||
元素输入 ${Set_PolicyName} ${random_strategyName} 定位策略名输入框失败
|
||
Run Keyword If ${Srcbkfun}==1 常规凭据连接 ${DPM_Mysql_Phy_Inst_Port} ${DPM_Mysql_physical_DB_User} ${DPM_Mysql_physical_DB_PWD} ${DPM_Mysql_physical_DB_Port} ${DPM_Mysql_physical_DB_IP_Local}
|
||
... ELSE IF ${Srcbkfun}==0 Socket凭据连接 ${DPM_Mysql_Phy_Inst_Port} ${DPM_Mysql_physical_DB_User} ${DPM_Mysql_physical_DB_PWD}
|
||
元素点击 ${Mysql_Phy_Connect_NextStep} 点击下一步进入到Mysql选项 定位连接凭据下一步按钮失败
|
||
Run Keyword If ${channel}==1 多通道备份 ${Path_Dump} ${Path_BinLog} ${Path_Bin} ${Path_Backup}
|
||
... ELSE IF ${channel}==0 单通道备份
|
||
元素点击 ${Mysql_Phy_SelectConfig_NextStep} 点击下一步进入到目标数据库选项 定位新建备份策略下一步失败
|
||
Sleep 5s
|
||
元素点击 ${Bk_Mysql_Phy_NextStep} 进入到备份集存储页面 定位目标数据库下一步按钮失败
|
||
元素点击 ${Manual_ChooseMDS} 点击勾选手动选择介质 定位选择介质失败
|
||
元素点击 ${Select_Mysql_MDS} 点击介质选择按钮 定位介质选择按钮失败
|
||
元素点击 xpath=//select[@id="dialogues_addCycleStorage_storagePath_selectMedia_selectedMdsIP_select"]/option[@label="${mds_name}"] 点击选择指定介质 定位指定介质失败
|
||
Run Keyword If ${dedup_attr}==1 重删
|
||
... ELSE IF ${dedup_attr}==0 log 不使用重删
|
||
元素点击 ${Mysql_Phy_Storage_NextStep} 点击下一步进入到备份高级选项 定位下一步失败
|
||
log 进入备份高级选项
|
||
Run Keyword If ${encryption_attr}==1 Mysql物理加密
|
||
... ELSE IF ${encryption_attr}==0 log 不使用加密
|
||
Run Keyword If ${compress_attr}==1 压缩
|
||
... ELSE IF ${compress_attr}==0 log 不使用压缩
|
||
Comment Run Keyword If ${cache}==1 备份缓存_默认勾选 /opt
|
||
Comment ...
|
||
... ELSE IF ${cache}==0 取消缓存
|
||
Comment ...
|
||
... ELSE IF ${cache}==2 log 不勾选缓存
|
||
sleep 5s
|
||
元素点击 ${Mysql_Phy_Senior_NextStep} 点击下一步进入到备份集任务周期 定位备份集高级选项下一步失败
|
||
元素点击 ${Add_TaskCycle} 点击添加任务周期 定位添加任务周期按钮失败
|
||
Run Keyword If "${bk_type}"=="完全" 完全备份
|
||
... ELSE IF "${bk_type}"=="增量" 增量备份
|
||
Sleep 5s
|
||
元素点击 ${Cycle_Once} 设置任务仅执行一次 定位仅执行一次失败
|
||
元素点击 ${Cycle_Confirm} 确定任务周期设置完毕 定位任务周期设置失败
|
||
循环点击 ${MySQL_Phy_Complete_CreatePolicy} ${Success_Confirm}
|
||
sleep 5s
|
||
元素点击 ${Success_Confirm} 确定策略创建成功 策略创建失败
|
||
元素点击 ${Policy_Work} 点击进入作业栏 定位作业栏失败
|
||
FOR ${n} IN RANGE 10
|
||
${bk_status} Run Keyword And Return Status Wait Until Element Is Visible Xpath=//div[text()="${random_strategyName}"]/../..//div[contains(text(),"本次备份成功")]
|
||
Run Keyword If "${bk_status}"=="True" Exit For Loop
|
||
... ELSE Log 备份未完成
|
||
Sleep 60s
|
||
END
|
||
Run Keyword If ${rec_speed}==1 挂载恢复速度校验
|
||
... ELSE Log 取消速度校验
|
||
元素点击 ${BackupSet} 点击进入备份集一栏 定位备份集栏失败
|
||
Wait Until Element Is Visible xpath=//td[text()="${random_strategyName}"]/..//td[text()="已完成"] 180s 备份失败
|
||
Log 备份完成
|
||
Sleep 2s
|
||
|
||
Mysql_Physical恢复
|
||
[Arguments] ${mysql_dbname} ${mysql_dbpwd} ${mysql_dbport} ${mysql_dbip} ${Srcbkfun} ${channel} ${mysql_binlog} ${mysqlBackup} ${mysql_servicename} #数据库用户、数据库密码、端口号、IP、连接协议、备份通道、mysqlbinlog、mysql恢复工作、mysql服务名(mysqld或者mysql,根据实际情况)
|
||
循环点击 ${BackupSet} ${Click_recover}
|
||
循环点击 ${Click_recover} ${Recover_Mysql_Phy_Nextstep}
|
||
sleep 3s
|
||
Run Keyword If ${Srcbkfun}==1 常规连接恢复 ${mysql_dbname} ${mysql_dbpwd} ${mysql_dbport} ${mysql_dbip}
|
||
... ELSE IF ${Srcbkfun}==0 Socket连接恢复 ${mysql_dbname} ${mysql_dbpwd}
|
||
元素点击 ${Recover_Mysql_Phy_Nextstep} 点击下一步进入到MySQL选项 恢复目标下一步定位失败
|
||
sleep 3s
|
||
Run Keyword If ${channel}==1 MySQL物理多通道恢复 ${mysqlBackup} ${mysql_servicename}
|
||
... ELSE IF ${channel}==0 单通道恢复MySQL选项 ${mysql_binlog} ${mysql_servicename}
|
||
sleep 3s
|
||
循环点击 ${Recover_Complete} ${Confirm_Recovery}
|
||
循环点击 ${Confirm_Recovery} ${Success_Confirm}
|
||
Sleep 2s
|
||
元素点击 ${Success_Confirm} 恢复策略确定创建成功 恢复作业创建成功弹窗定位失败
|
||
元素点击 ${Policy_Work} 点击进入作业栏 定位作业栏失败
|
||
FOR ${n} IN RANGE 10
|
||
${re_status} Run Keyword And Return Status Wait Until Page Contains Element ${Recover_Success}
|
||
Run Keyword If "${re_status}"=="True" Exit For Loop
|
||
... ELSE Log 恢复未完成
|
||
Sleep 60s
|
||
END
|
||
Wait Until Page Contains Element ${Recover_Success} 10s 恢复失败
|
||
sleep 2s
|
||
Log 恢复成功
|
||
|
||
备份集属性校验
|
||
[Arguments] ${encryption} ${compress} ${deduped} ${cache}
|
||
sleep 2s
|
||
元素点击 xpath=//span[@id="compileBackupViewId${random_strategyName}"] 点击展开详情 定位详情失败
|
||
Sleep 5s
|
||
Run Keyword If ${encryption}==1 加密属性校验_是
|
||
... ELSE 加密属性校验_否
|
||
Run Keyword If ${compress}==1 压缩属性校验_是
|
||
... ELSE 压缩属性校验_否
|
||
Run Keyword If ${deduped}==1 重删属性校验
|
||
... ELSE 重删属性校验_否
|
||
Run Keyword If ${cache}==1 缓存属性校验
|
||
... ELSE IF ${cache}==0 缓存属性校验_否
|
||
... ELSE Log 不校验缓存
|
||
元素点击 ${Attr_Cancel} 点击取消关闭备份集详情弹窗 定位取消按钮失败
|
||
Log 备份集属性确认完毕
|
||
Sleep 2s
|
||
|
||
删除数据表
|
||
[Arguments] ${ip} ${user} ${pwd} ${port} # 数据库ip|数据库用户名|数据库密码|数据库端口号
|
||
Connect To Database Using Custom Params pymysql host='${ip}', port=${port}, user='${user}', passwd='${pwd}', db='test', charset= 'utf8'
|
||
Execute Sql String use test;
|
||
Execute Sql String drop table unary; #执行SQL语句
|
||
Disconnect From Database
|
||
Log 断开数据库连接
|
||
|
||
Mysql恢复
|
||
[Arguments] ${mysql_name} ${mysql_pwd} ${mysql_port} ${mysql_ip} ${cache} ${MysqlDump} ${MysqlBinLog} ${MysqlLog} ${MysqlConfig}
|
||
循环点击 ${Click_recover} ${Recover_Mysql_Name}
|
||
元素输入 ${Recover_Mysql_Name} ${mysql_name} 定位mysql用户名输入框失败
|
||
元素输入 ${Recover_Mysql_Pwd} ${mysql_pwd} 定位mysql用户密码输入框失败
|
||
元素输入 ${Recover_Mysql_Port} ${mysql_port} 定位mysql端口输入框失败
|
||
元素输入 ${Recover_Mysql_IP} ${mysql_ip} 定位mysql ip输入框失败
|
||
元素点击 ${Recover_mysqlNextstep} 点击下一步进入到恢复目标选项 恢复目标选项定位失败
|
||
元素点击 xpath=//span[text()="test"]/../../td[2] 点击勾选恢复数据库test 定位恢复数据库test失败
|
||
元素点击 ${Recover_Mysql_NextStep_2} 点击下一步进入到高级选项 定位恢复目标页的下一步按钮失败
|
||
Comment 元素点击 ${restore_DB} 定位恢复目标数据库成功 定位恢复目标数据库失败
|
||
Comment 元素点击 ${RecoveryPolicy_nextStep2} 点击下一步进入恢复高级选项成功 点击下一步进入恢复高级选项失败
|
||
元素点击 ${Select_MysqldumpRe} 勾选mysqldump 定位mysqldump勾选框失败
|
||
元素输入 ${Input_MysqlDumpRe} ${MysqlDump} 定位mysqldump输入框失败
|
||
元素点击 ${Select_checkboxBinlogRe} 勾选mysqlbinlog 定位mysqlbinlog勾选框失败
|
||
元素输入 ${Input_mysqlBinlogRe} ${MysqlBinLog} 定位mysqlbinlog输入框失败
|
||
元素点击 ${Select_checkboxQ} 勾选mysqllog 定位mysqllog勾选框失败
|
||
元素输入 ${Input_mysqlField} ${MysqlLog} 定位mysqllog输入框失败
|
||
元素点击 ${Select_checkboxConf} 勾选mysqlconfig 定位mysqlconfig勾选框失败
|
||
元素输入 ${Input_FieldConf} ${MysqlConfig} 定位mysqlconfig输入框失败
|
||
元素点击 ${AddRecoveryPolicy_Next} 点击下一步进入确认恢复页面 定位下一步按钮失败
|
||
元素点击 ${confirm_restore} 点击确认恢复成功 点击确认恢复失败
|
||
Comment 循环点击 ${Recover_mysqlExec} ${Success_Confirm}
|
||
Sleep 2s
|
||
元素点击 ${Success_Confirm} 恢复策略确定创建成功 恢复作业创建成功弹窗定位失败
|
||
元素点击 ${Policy_Work} 点击进入作业栏 定位作业栏失败
|
||
Sleep 30s
|
||
Wait Until Page Contains Element ${Recover_Success} 180s 恢复失败
|
||
sleep 2s
|
||
Log 恢复成功
|
||
|
||
校验数据表
|
||
[Arguments] ${ip} ${user} ${pwd} ${port} # 数据库ip地址|数据库用户名|数据库密码|数据库端口号
|
||
Connect To Database Using Custom Params pymysql host='${ip}', port=${port}, user='${user}', passwd='${pwd}', db='test', charset= 'utf8'
|
||
Execute Sql String use test;
|
||
${query_result} query select worker from unary;
|
||
Log ${query_result[0][0]}
|
||
Run Keyword If ${query_result[0][0]}==2008 Log 校验成功
|
||
... ELSE Fail 数据校验失败
|
||
Execute Sql String drop table unary; #执行SQL语句
|
||
Disconnect From Database
|
||
Log 断开数据库连接
|
||
|
||
完全备份
|
||
Sleep 2s
|
||
Click Element ${Full_Backup}
|
||
Log 勾选完全备份
|
||
|
||
增量备份
|
||
Sleep 2s
|
||
Click Element ${Incre_Backup}
|
||
Log 勾选完全备份
|
||
|
||
Mysql物理加密
|
||
Sleep 2s
|
||
元素点击 ${Option_Mysql_Phy_Encryption} 勾选加密 定位加密选项失败
|
||
Log 点击加密
|
||
Sleep 2s
|
||
|
||
Mysql逻辑取消加密
|
||
Sleep 2s
|
||
Log 点击不勾选加密
|
||
Sleep 2s
|
||
|
||
勾选压缩
|
||
Log 点击勾选压缩
|
||
Set Focus To Element ${Option_Compress}
|
||
Click Element ${Option_Compress}
|
||
|
||
取消压缩
|
||
Log 点击不勾选压缩
|
||
|
||
压缩
|
||
元素点击 ${Option_Compress} 选择压缩 定位压缩失败
|
||
Log 点击压缩
|
||
|
||
重删
|
||
Sleep 2s
|
||
元素点击 ${Option_Dedup} 勾选重删 定位重删选项失败
|
||
Log 点击重删
|
||
Sleep 5s
|
||
|
||
备份缓存
|
||
[Arguments] ${path} # 缓存路径
|
||
元素点击 ${Active_Cache} 勾选缓存 定位缓存选项失败
|
||
sleep 5s
|
||
元素输入 ${Cache_Path} ${path} 定位缓存路径输入框失败
|
||
元素点击 ${Fin_CachePath} 缓存路径设置完毕 定位缓存路径设置确定按钮失败
|
||
|
||
取消缓存
|
||
Sleep 2s
|
||
元素点击 ${Active_Cache} 取消缓存按钮 定位缓存选项失败
|
||
Sleep 2s
|
||
|
||
备份缓存_默认勾选
|
||
[Arguments] ${path} # 缓存路径
|
||
元素点击 ${Change_Cachepath} 点击更换缓存路径 定位更改缓存路径失败
|
||
${cache_status}= Run Keyword And Return Status Wait Until Element Is Visible ${Cache_Path}
|
||
Run Keyword If ${cache_status}==False 循环点击 ${Button_Change_Cache} ${Cache_Path}
|
||
元素输入 ${Cache_Path} ${path} 定位缓存路径输入框失败
|
||
元素点击 ${Fin_CachePath} 缓存路径设置完毕 定位缓存路径设置确定按钮失败
|
||
|
||
恢复缓存_默认勾选
|
||
[Arguments] ${path} # 恢复缓存路径
|
||
元素点击 ${Recover_Change_Cachepath} 点击更换缓存路径 定位更改缓存路径失败
|
||
元素输入 ${Recover_CachePath} ${path} 定位缓存路径输入框失败
|
||
元素点击 ${Fin_Recover_CachePath} 缓存路径设置完毕 定位缓存路径设置确定按钮失败
|
||
|
||
压缩属性校验_是
|
||
Element Text Should Be ${Compress_Attr} 是
|
||
Log 压缩属性校验完毕
|
||
|
||
加密属性校验_是
|
||
Element Should Contain ${Encryption_Attr} 是
|
||
Log 加密属性校验完毕
|
||
|
||
重删属性校验
|
||
Element Should Contain ${Mysql_Deduped_Attr} 是
|
||
Log 重删属性校验完毕
|
||
|
||
恢复缓存
|
||
[Arguments] ${path}
|
||
元素点击 ${Recover_Cache} 勾选缓存 定位缓存选项失败
|
||
元素输入 ${Recover_CachePath} ${path} 定位缓存路径输入框失败
|
||
元素点击 ${Fin_Recover_CachePath} 缓存路径设置完毕 定位缓存路径设置确定按钮失败
|
||
Sleep 2s
|
||
|
||
缓存属性校验
|
||
Element Should Contain ${Cache_Attr} 是
|
||
Log 缓存属性校验完毕
|
||
|
||
立即执行
|
||
[Arguments] ${bk_type} # 立即执行的备份类型
|
||
元素点击 ${dpm_Protection strategy} 切换到定时保护策略栏 定位定时保护策略功能栏失败
|
||
元素点击 ${Run_Now} 点击策略立即执行 定位立即执行失败
|
||
元素点击 ${Select_Mysql_Phy_Style} 点击展开mysql立即执行下拉框 定位立即执行备份类型失败
|
||
Run Keyword If "${bk_type}"=="完全" Click Element ${Now Full_BackupMysql}
|
||
... ELSE IF "${bk_type}"=="增量" Click Element ${Now Add_Backup}
|
||
... ELSE IF "${bk_type}"=="日志" Click Element ${Now RZ_Backup}
|
||
Log 立即执行${bk_type}备份
|
||
元素点击 ${Mysql_Phy_Exe_Confirm} 点击完成按钮 定位完成元素失败
|
||
元素点击 ${Complie_confirm} 点击确定按钮 定位确定按钮失败
|
||
元素点击 ${BackupSet} 点击进入备份集一栏 定位备份集栏失败
|
||
Sleep 30s
|
||
Wait Until Page Contains Element Xpath=//*[@id="backupSetTable"]/div[2]/table/tbody/tr[2]/td[text()="已完成"] 180s 备份未完成
|
||
Log 备份完成
|
||
Sleep 30s
|
||
|
||
挂载备份速度校验
|
||
${bk_speed} get text xpath=//td[@data-field="policyName"]/div[text()="${random_strategyName}"]/../../td[@data-field="networkSpeed"]/div
|
||
${bk_speed} Remove String ${bk_speed} MB/s
|
||
Run Keyword If ${bk_speed}>1 Log 速度正常
|
||
... ELSE Fail 速度异常
|
||
|
||
挂载恢复速度校验
|
||
${re_speed} get text ${Recover_Speed}
|
||
${re_speed} Remove String ${re_speed} MB/s
|
||
Run Keyword If ${re_speed}>1 Log 速度正常
|
||
... ELSE Fail 速度异常
|
||
|
||
恢复取消缓存
|
||
Sleep 2s
|
||
元素点击 ${Recover_Cache} 取消缓存按钮 定位缓存选项失败
|
||
Sleep 2s
|
||
|
||
新增数据表
|
||
[Arguments] ${ip} ${user} ${pwd} ${port} # 数据库ip地址|用户名称|密码|端口号
|
||
Connect To Database Using Custom Params pymysql host='${ip}', port=${port}, user='${user}', passwd='${pwd}', db='test', charset= 'utf8'
|
||
Execute Sql String use test; #执行SQL语句
|
||
Execute Sql String insert into unary select * from unary #执行SQL语句
|
||
${query_result} query select worker from unary;
|
||
Log ${query_result}
|
||
Disconnect From Database
|
||
Log 断开数据库连接
|
||
|
||
选择备份级别--库级别
|
||
sleep 2s
|
||
元素点击 ${MySQL__Srcbkfun_Select} 选择备份级别 定位备份级别下拉框失败
|
||
元素点击 ${MySQL_Dump_Option} 选择库级别 定位库级别选项失败
|
||
|
||
选择备份级别--实例级别
|
||
sleep 2s
|
||
元素点击 ${MySQL__Srcbkfun_Select} 选择备份级别 定位备份级别下拉框失败
|
||
元素点击 ${MySQL_Instance_Option} 选择库级别 定位实例级别选项失败
|
||
|
||
普通备份
|
||
sleep 2s
|
||
元素点击 ${MySqlPhysical_Srcbkfun_Select} 选择备份方式 定位备份方式下拉框失败
|
||
元素点击 ${MySqlPhysical_Dump_Option} 选择普通方式 定位普通方式选项失败
|
||
|
||
流式备份
|
||
sleep 2s
|
||
元素点击 ${MySqlPhysical_Srcbkfun_Select} 选择备份方式 定位备份方式下拉框失败
|
||
元素点击 ${MySqlPhysical_Binary_Option} 选择流式方式 定位流式方式选项失败
|
||
|
||
加密属性校验_否
|
||
Element Should Contain ${Encryption_Attr} 否
|
||
Log 加密属性校验完毕
|
||
|
||
Mysql备份_清理校验后
|
||
[Arguments] ${Mysql_Agent} ${bk_type} ${DPM_Mysql_DB_User} ${DPM_Mysql_DB_PWD} ${DPM_Mysql_DB_Port} ${DPM_Mysql_DB_IP_Remote} ${Srcbkfun} ${mds_name} ${encryption_attr} ${compress_attr} ${dedup_attr} ${cache}
|
||
[Documentation] MySQL逻辑备份,根据传入的参数进行加密压缩重删以及介质来创建不同的备份策略
|
||
...
|
||
... 新增备份集页面根据策略名称搜索操作,防止修改时间对备份集状态的判断造成影响
|
||
...
|
||
... 清理校验后是指在执行TC07_Bk_CheckClean后经过修改时间,使用此关键字不受修改时间的影响
|
||
元素点击 ${Timed_DataProtect} 点击进入定时数据保护页面 定位定时数据保护失败
|
||
${date} Evaluate time.strftime('%Y%m%d%H%M%S',time.localtime()) time
|
||
${random_strategyName}= Catenate SEPARATOR=_ ${bk_type} ${date}
|
||
${createpolicy} Catenate SEPARATOR= 新建了策略[ ${random_strategyName} ]
|
||
Set Suite Variable ${random_strategyName}
|
||
Set Suite Variable ${createpolicy}
|
||
Sleep 5s
|
||
元素点击 xpath=//span[text()="${Mysql_Agent}"] 点击选择代理 定位代理所在位置失败
|
||
Sleep 10s
|
||
元素点击 ${Add_Policy} 点击添加策略按钮 定位添加策略按钮失败
|
||
元素点击 ${Mysql_Module} 点击Mysql组件 定位Mysql组件失败
|
||
sleep 5s
|
||
元素输入 ${Set_PolicyName} ${random_strategyName} 定位策略名输入框失败
|
||
元素输入 ${Input_Mysql_Name} ${DPM_Mysql_DB_User} 定位mysql用户名输入框失败
|
||
元素输入 ${Input_Mysql_Pwd} ${DPM_Mysql_DB_PWD} 定位mysql用户密码输入框失败
|
||
元素输入 ${Input_Mysql_Port} ${DPM_Mysql_DB_Port} 定位mysql端口输入框失败
|
||
元素输入 ${Input_Mysql_IP} ${DPM_Mysql_DB_IP_Remote} 定位mysql ip输入框失败
|
||
Run Keyword If ${Srcbkfun}==1 选择备份级别--库级别
|
||
... ELSE IF ${Srcbkfun}==0 选择备份级别--实例级别
|
||
元素点击 ${Connect_Mysql_NextStep} 进入到目标数据库选择界面 定位下一步按钮失败
|
||
元素点击 ${Bk_DB} 勾选需要备份的Mysql数据库 定位目标数据库失败
|
||
循环点击 ${Mysql_Path} ${Input_MysqlDump}
|
||
元素点击 ${Select_Mysqldump} 勾选mysqldump 定位mysqldump勾选框失败
|
||
元素输入 ${Input_MysqlDump} ${MysqlDump} 定位mysqldump输入框失败
|
||
元素点击 ${Select_MysqlBinLog} 勾选mysqlbinlog 定位mysqlbinlog勾选框失败
|
||
元素输入 ${Input_MysqlBinLog} ${MysqlBinLog} 定位mysqlbinlog输入框失败
|
||
元素点击 ${Select_Log} 勾选mysqllog 定位mysqllog勾选框失败
|
||
元素输入 ${Input_Log} ${MysqlLog} 定位mysqllog输入框失败
|
||
元素点击 ${Select_Config} 勾选mysqlconfig 定位mysqlconfig勾选框失败
|
||
元素输入 ${Input_Config} ${MysqlConfig} 定位mysqlconfig输入框失败
|
||
元素点击 ${Mysql_Path_Confirm} 点击确认完成mysql路径参数配置 定位mysql路径配置确定按钮失败
|
||
元素点击 ${Bk_Mysql_NextStep} 进入到任务周期页面 定位下一步按钮失败
|
||
元素点击 ${Add_taskcycle} 点击添加任务周期 定位添加任务周期按钮失败
|
||
Run Keyword If "${bk_type}"=="完全" 完全备份
|
||
... ELSE IF "${bk_type}"=="增量" 增量备份
|
||
Sleep 2s
|
||
元素点击 ${Cycle_Once} 设置任务仅执行一次 定位仅执行一次失败
|
||
元素点击 ${Cycle_Confirm} 确定任务周期设置完毕 定位任务周期设置失败
|
||
元素点击 ${Cycle_NextStep} 点击下一步进入备份集存储设置界面 定位下一步失败
|
||
元素点击 ${Manual_ChooseMDS} 点击勾选手动选择介质 定位选择介质失败
|
||
元素点击 ${Select_Mysql_MDS} 点击介质选择按钮 定位介质选择按钮失败
|
||
元素点击 xpath=//select[@id="dialogues_addCycleStorage_storagePath_selectMedia_selectedMdsIP_select"]/option[@label="${mds_name}"] 点击选择指定介质 定位指定介质失败
|
||
元素点击 ${Storage_NextStep} 点击下一步进入到备份高级选项 定位下一步失败
|
||
log 进入备份高级选项
|
||
Run Keyword If ${encryption_attr}==1 Mysql逻辑取消加密
|
||
Run Keyword If ${compress_attr}==1 取消压缩
|
||
... ELSE IF ${compress_attr}==0 勾选压缩
|
||
Run Keyword If ${dedup_attr}==1 重删
|
||
Run Keyword If ${cache}==1 备份缓存 /opt
|
||
... ELSE Log 不勾选缓存
|
||
循环点击 ${Complete_Policy_Create_No_Info} ${Success_Confirm}
|
||
元素点击 ${Success_Confirm} 确定策略创建成功 策略创建失败
|
||
元素点击 ${BackupSet} 点击进入备份集一栏 定位备份集栏失败
|
||
Sleep 30s
|
||
元素输入 ${DPMFind_Policy} ${random_strategyName} 策略名输入失败
|
||
Sleep 2s
|
||
元素点击 ${DPMButton_Searchbutton} 点击搜索按钮 定位搜索按钮失败
|
||
Sleep 30s
|
||
Wait Until Page Contains Element Xpath=//*[@id="backupSetTable"]/div[2]/table/tbody/tr[2]/td[text()="已完成"] 180s 备份未完成
|
||
Log 备份完成
|
||
Sleep 5s
|
||
|
||
立即执行_清理校验后mysql
|
||
[Arguments] ${bk_type} # 立即执行的备份类型
|
||
[Documentation] 立即执行mysql备份策略,根据传入的参数来进行增量备份
|
||
...
|
||
... 新增备份集页面根据策略名称搜索的操作,防止修改时间对备份集状态的获取造成影响
|
||
...
|
||
... 清理校验后是指在执行TC07_Bk_CheckClean后经过修改时间,使用此关键字不受修改时间的影响
|
||
元素点击 ${dpm_Protection strategy} 切换到定时保护策略栏 定位定时保护策略功能栏失败
|
||
元素点击 id=dpm_policy_excuteDialog_${random_strategyName}_btn 点击策略立即执行 定位立即执行失败
|
||
元素点击 ${Select_Mysql_Phy_Style} 点击下拉选项 定位下拉选项失败
|
||
Run Keyword If "${bk_type}"=="完全" Click Element ${Now Full_BackupMysql}
|
||
... ELSE IF "${bk_type}"=="增量" Click Element ${Now Add_Backup}
|
||
元素点击 ${Mysql_Phy_Exe_Confirm} 点击完成按钮 定位完成元素失败
|
||
元素点击 ${Complie_confirm} 点击确定按钮 定位确定按钮失败
|
||
元素点击 ${BackupSet} 点击进入备份集一栏 定位备份集栏失败
|
||
Sleep 30s
|
||
元素输入 ${DPMFind_Policy} ${random_strategyName} 策略名输入失败
|
||
Sleep 2s
|
||
元素点击 ${DPMButton_Searchbutton} 点击搜索按钮 定位搜索按钮失败
|
||
Sleep 30s
|
||
Wait Until Page Contains Element Xpath=//*[@id="backupSetTable"]/div[2]/table/tbody/tr[2]/td[text()="已完成"] 180s 备份未完成
|
||
Log 备份完成
|
||
Sleep 5s
|
||
|
||
Mysql_Physical备份_清理校验后
|
||
[Arguments] ${Mysql_Physical_Agent} ${bk_type} ${DPM_Mysql_physical_DB_User} ${DPM_Mysql_physical_DB_PWD} ${DPM_Mysql_physical_DB_Port} ${DPM_Mysql_physical_DB_IP_Local} ${Srcbkfun} ${mds_name} ${encryption_attr} ${compress_attr} ${dedup_attr} ${cache} ${rec_speed}
|
||
[Documentation] MySQL物理备份,根据传入的参数进行加密压缩重删以及介质来创建不同的备份策略
|
||
...
|
||
... 新增备份集页面根据策略名称搜索操作,防止修改时间对备份集状态的判断造成影响
|
||
...
|
||
... 清理校验后是指在执行TC07_Bk_CheckClean后经过修改时间,使用此关键字不受修改时间的影响
|
||
元素点击 ${Timed_DataProtect} 点击进入定时数据保护页面 定位定时数据保护失败
|
||
${date} Evaluate time.strftime('%Y%m%d%H%M%S',time.localtime()) time
|
||
${random_strategyName}= Catenate SEPARATOR=_ ${bk_type} ${date}
|
||
${createpolicy} Catenate SEPARATOR= 新建了策略[ ${random_strategyName} ]
|
||
Set Suite Variable ${random_strategyName}
|
||
Set Suite Variable ${createpolicy}
|
||
Sleep 5s
|
||
元素点击 xpath=//span[text()="${Mysql_Physical_Agent}"] 点击选择代理 定位代理所在位置失败
|
||
Sleep 10s
|
||
元素点击 ${Add_Policy} 点击添加策略按钮 定位添加策略按钮失败
|
||
元素点击 ${Mysql_Phy_Module} 点击Mysql物理组件 定位Mysql组件失败
|
||
元素输入 ${Set_PolicyName} ${random_strategyName} 定位策略名输入框失败
|
||
元素输入 ${Input_Mysql_Phy_Name} ${DPM_Mysql_physical_DB_User} 定位mysql用户名输入框失败
|
||
元素输入 ${Input_Mysql_Phy_Pwd} ${DPM_Mysql_physical_DB_PWD} 定位mysql用户密码输入框失败
|
||
元素输入 ${Input_Mysql_Phy_Port} ${DPM_Mysql_physical_DB_Port} 定位mysql端口输入框失败
|
||
元素输入 ${Input_Mysql_Phy_IP} ${DPM_Mysql_physical_DB_IP_Local} 定位mysql ip输入框失败
|
||
Run Keyword If ${Srcbkfun}==1 普通备份
|
||
... ELSE IF ${Srcbkfun}==0 流式备份
|
||
Sleep 2s
|
||
元素点击 ${Connect_Mysql_Phy_NextStep} 进入到目标数据库选择界面 定位下一步按钮失败
|
||
Sleep 10s
|
||
元素点击 ${Bk_Mysql_Phy_NextStep} 进入到任务周期页面 定位下一步按钮失败
|
||
元素点击 ${Add_taskcycle} 点击添加任务周期 定位添加任务周期按钮失败
|
||
Run Keyword If "${bk_type}"=="完全" 完全备份
|
||
... ELSE IF "${bk_type}"=="增量" 增量备份
|
||
Sleep 2s
|
||
元素点击 ${Cycle_Once} 设置任务仅执行一次 定位仅执行一次失败
|
||
元素点击 ${Cycle_Confirm} 确定任务周期设置完毕 定位任务周期设置失败
|
||
元素点击 ${Cycle_NextStep} 点击下一步进入备份集存储设置界面 定位下一步失败
|
||
元素点击 ${Manual_ChooseMDS} 点击勾选手动选择介质 定位选择介质失败
|
||
元素点击 ${Select_Mysql_MDS} 点击介质选择按钮 定位介质选择按钮失败
|
||
元素点击 xpath=//select[@id="dialogues_addCycleStorage_storagePath_selectMedia_selectedMdsIP_select"]/option[@label="${mds_name}"] 点击选择指定介质 定位指定介质失败
|
||
元素点击 ${Storage_NextStep} 点击下一步进入到备份高级选项 定位下一步失败
|
||
log 进入备份高级选项
|
||
Run Keyword If ${encryption_attr}==1 Log 加密已勾选
|
||
... ELSE IF ${encryption_attr}==0 Mysql物理加密
|
||
Run Keyword If ${compress_attr}==1 取消压缩
|
||
... ELSE IF ${compress_attr}==0 勾选压缩
|
||
Run Keyword If ${dedup_attr}==1 重删
|
||
Run Keyword If ${cache}==1 备份缓存_默认勾选 /opt
|
||
... ELSE IF ${cache}==0 取消缓存
|
||
... ELSE IF ${cache}==2 log 采用流式备份
|
||
sleep 2s
|
||
循环点击 ${MySQL_Phy_Complete_CreatePolicy} ${Success_Confirm}
|
||
Comment 元素点击 ${MySQL_Phy_Complete_CreatePolicy} 点击确定按钮完成策略创建 定位确定按钮失败
|
||
sleep 2s
|
||
元素点击 ${Success_Confirm} 确定策略创建成功 策略创建失败
|
||
元素点击 ${Policy_Work} 点击进入作业栏 定位作业栏失败
|
||
FOR ${n} IN RANGE 10
|
||
${bk_status} Run Keyword And Return Status Wait Until Element Is Visible Xpath=//*[@id="worktableContent"]//tr[1]/td[9]/div[contains(text(),"本次备份成功")]
|
||
Run Keyword If "${bk_status}"=="True" Exit For Loop
|
||
... ELSE Log 备份未完成
|
||
Sleep 60s
|
||
END
|
||
Run Keyword If ${rec_speed}==1 挂载恢复速度校验
|
||
... ELSE Log 取消速度校验
|
||
元素点击 ${BackupSet} 点击进入备份集一栏 定位备份集栏失败
|
||
Sleep 30s
|
||
元素输入 ${DPMFind_Policy} ${random_strategyName} 策略名输入失败
|
||
Sleep 2s
|
||
元素点击 ${DPMButton_Searchbutton} 点击搜索按钮 定位搜索按钮失败
|
||
Sleep 30s
|
||
Wait Until Element Is Visible xpath=//td[text()="${random_strategyName}"]/..//td[text()="已完成"] 120s 备份失败
|
||
Log 备份完成
|
||
Sleep 2s
|
||
|
||
压缩属性校验_否
|
||
Element Text Should Be ${Compress_Attr} 否
|
||
Log 压缩属性校验完毕
|
||
|
||
重删属性校验_否
|
||
Element Should Contain ${Mysql_Deduped_Attr} 否
|
||
Log 重删属性校验完毕
|
||
|
||
缓存属性校验_否
|
||
Element Should Contain ${Cache_Attr} 否
|
||
Log 缓存属性校验完毕
|
||
|
||
Mysql逻辑勾选加密
|
||
sleep 2s
|
||
元素点击 ${Option_Mysql_Encryption} 勾选加密 定位勾选加密选项失败
|
||
log 勾选加密成功
|
||
|
||
备份集属性校验_Mysql
|
||
[Arguments] ${encryption} ${compress} ${deduped} ${cache}
|
||
sleep 5s
|
||
元素点击 xpath=//td[text()="${random_strategyName}"]/..//span[text()="详情"] 点击展开详情 定位详情失败
|
||
Comment 元素点击 Xpath=//span[@id="compileBackupViewId0"] 点击展开详情 定位详情失败
|
||
Sleep 2s
|
||
Run Keyword If ${encryption}==1 加密属性校验_是
|
||
... ELSE 加密属性校验_否1
|
||
Run Keyword If ${compress}==1 压缩属性校验_是
|
||
... ELSE 压缩属性校验_否
|
||
Run Keyword If ${deduped}==1 重删属性校验
|
||
... ELSE 重删属性校验_否
|
||
Run Keyword If ${cache}==1 缓存属性校验
|
||
... ELSE 缓存属性校验_否
|
||
元素点击 ${Attr_Cancel} 点击取消关闭备份集详情弹窗 定位取消按钮失败
|
||
Log 备份集属性确认完毕
|
||
Sleep 2s
|
||
|
||
加密属性校验_否1
|
||
Element Should Contain ${Encryption_Attr} 否
|
||
Log 加密属性校验完毕
|
||
|
||
普通恢复
|
||
[Arguments] ${mysqlbinlog}
|
||
sleep 2s
|
||
元素点击 ${checkboxBinlogRe} 点击MySQLbinlog参数 定位mysqlbinlog勾选框失败
|
||
元素输入 ${BinlogRe_new} ${mysqlbinlog} 定位mysqlbinlog输入框失败
|
||
log 勾选mysqlbinlog完成
|
||
|
||
常规凭据连接
|
||
[Arguments] ${DPM_Mysql_Phy_Inst_Port} ${DPM_Mysql_physical_DB_User} ${DPM_Mysql_physical_DB_PWD} ${DPM_Mysql_physical_DB_Port} ${DPM_Mysql_physical_DB_IP_Local}
|
||
元素输入 ${Input_MysqlPhy_Inst} ${DPM_Mysql_Phy_Inst_Port} 定位实例名+端口输入框失败
|
||
元素输入 ${Input_Mysql_Phy_Name} ${DPM_Mysql_physical_DB_User} 定位mysql用户名输入框失败
|
||
元素输入 ${Input_Mysql_Phy_Pwd} ${DPM_Mysql_physical_DB_PWD} 定位mysql用户密码输入框失败
|
||
Comment 元素输入 ${Input_Mysql_Phy_Port} ${DPM_Mysql_physical_DB_Port} 定位mysql端口输入框失败
|
||
Comment 元素输入 ${Input_Mysql_Phy_IP} ${DPM_Mysql_physical_DB_IP_Local} 定位mysql ip输入框失败
|
||
Sleep 5s
|
||
log 常规连接协议备份
|
||
|
||
Socket凭据连接
|
||
[Arguments] ${DPM_Mysql_Phy_Inst_Port} ${DPM_Mysql_physical_DB_User} ${DPM_Mysql_physical_DB_PWD}
|
||
元素点击 ${MySQL_connect} 点击连接协议下拉框 定位连接协议下拉框失败
|
||
元素点击 ${MySQL_connsock} 选择socket连接协议 定位socket连接协议失败
|
||
元素输入 ${Input_MysqlPhy_Inst} ${DPM_Mysql_Phy_Inst_Port} 定位实例名+端口输入框失败
|
||
元素输入 ${Input_Mysql_Phy_Name} ${DPM_Mysql_physical_DB_User} 定位mysql用户名输入框失败
|
||
元素输入 ${Input_Mysql_Phy_Pwd} ${DPM_Mysql_physical_DB_PWD} 定位mysql用户密码输入框失败
|
||
sleep 5s
|
||
log 使用socket连接协议备份
|
||
|
||
多通道备份
|
||
[Arguments] ${Path_Dump} ${Path_BinLog} ${Path_Bin} ${Path_Backup}
|
||
元素输入 ${MySQL_multichannel} 2 定位通道数设置失败
|
||
元素点击 ${Mysql_Phy_SelectDump} 点击勾选mysql配置文件路径选项 定位mysql配置文件路径选项失败
|
||
元素输入 ${Input_SelectDump} ${Path_Dump} 定位mysql配置文件输入框失败
|
||
元素点击 ${Mysql_Phy_SelectBinLog} 点击勾选mysql binlog路径选项 定位mysql binlog路径选项
|
||
元素输入 ${Input_SelectBinLog} ${Path_BinLog} 定位mysql binlog输入框失败
|
||
元素点击 ${Mysql_Phy_SelectBin} 点击勾选mysql bin路径选项 定位mysql bin路径选项失败
|
||
元素输入 ${Input_SelectBin} ${Path_Bin} 定位mysql bin路径输入框失败
|
||
Comment 元素点击 ${Mysql_Phy_SelectBackup} 点击勾选mysql backup路径选项 定位mysql backup路径选项失败
|
||
元素输入 ${Input_SelectBackup} ${Path_Backup} 定位mysql backup路径输入框失败
|
||
log 多通道设置完成
|
||
|
||
单通道备份
|
||
元素点击 ${MySQL_channel} 点击单通道备份方案 定位单通道选项失败
|
||
|
||
MySQL物理多通道恢复
|
||
[Arguments] ${mysqlBackup} ${service_name}
|
||
log MySQL物理多通道恢复设置
|
||
sleep 3s
|
||
元素输入 ${MySQL_Recxtra} ${mysqlBackup} 输入恢复工具目录失败
|
||
sleep 2s
|
||
元素输入 ${MySQL_Recstop} service ${service_name} stop 输入停止服务命令失败
|
||
元素输入 ${MySQL_Recstart} service ${service_name} start 输入启动数据库服务命令失败
|
||
sleep 5s
|
||
元素点击 ${MySQL_Recstep2} 点击下一步进入高级选项 定位MySQL下一步按钮失败
|
||
恢复缓存_默认勾选 /opt
|
||
|
||
Mysql_Physical恢复_单通道
|
||
[Arguments] ${mysql_name} ${mysql_pwd} ${mysql_port} ${mysql_ip} ${cache} ${Srcbkfun} ${recovery} ${channel}
|
||
循环点击 ${BackupSet} ${Click_recover}
|
||
循环点击 id=compileBackupRecId${random_strategyName} ${Recover_Mysql_Phy_Name}
|
||
sleep 3s
|
||
Run Keyword If ${Srcbkfun}==1 常规连接恢复 ${DPM_Mysql_physical_DB_User} ${DPM_Mysql_physical_DB_PWD} ${DPM_Mysql_physical_DB_Port} ${DPM_Mysql_physical_DB_IP_Local}
|
||
... ELSE IF ${Srcbkfun}==2 Socket连接恢复
|
||
元素点击 ${Recover_Mysql_Phy_Nextstep} 点击下一步进入到MySQL选项 恢复目标下一步定位失败
|
||
sleep 3s
|
||
Run Keyword If ${recovery}==1 恢复前停止服务
|
||
... ELSE log 默认勾选恢复前停止数据库服务
|
||
元素点击 ${MySQL_Recstep2} 点击下一步进入高级选项 定位MySQL下一步按钮失败
|
||
sleep 3s
|
||
Run Keyword If ${channel}==1 恢复缓存_默认勾选 /opt
|
||
... ELSE IF ${channel}==2 log 单通道备份集恢复
|
||
sleep 3s
|
||
循环点击 ${Recover_Complete} ${Confirm_Recovery}
|
||
循环点击 ${Confirm_Recovery} ${Success_Confirm}
|
||
Sleep 2s
|
||
元素点击 ${Success_Confirm} 恢复策略确定创建成功 恢复作业创建成功弹窗定位失败
|
||
元素点击 ${Policy_Work} 点击进入作业栏 定位作业栏失败
|
||
FOR ${n} IN RANGE 10
|
||
${re_status} Run Keyword And Return Status Wait Until Page Contains Element ${Recover_Success}
|
||
Run Keyword If "${re_status}"=="True" Exit For Loop
|
||
... ELSE Log 恢复未完成
|
||
Sleep 60s
|
||
END
|
||
Wait Until Page Contains Element ${Recover_Success} 10s 恢复失败
|
||
Comment Run Keyword If ${rec_speed}==1 挂载恢复速度校验
|
||
... ELSE Log 取消速度校验
|
||
sleep 2s
|
||
Log 恢复成功
|
||
|
||
常规连接恢复
|
||
[Arguments] ${mysql_dbname} ${mysql_dbpwd} ${mysql_dbport} ${mysql_dbip} # 用户名、密码
|
||
元素输入 ${Recover_Mysql_Phy_Name} ${mysql_dbname} 定位mysql用户名输入框失败
|
||
元素输入 ${Recover_Mysql_Phy_Pwd} ${mysql_dbpwd} 定位mysql用户密码输入框失败
|
||
Comment 元素输入 ${Recover_Mysql_Phy_IP} ${mysql_dbip} 定位mysql ip输入框失败
|
||
Comment 元素输入 ${Recover_Mysql_Phy_Port} ${mysql_dbport} 定位mysql端口输入框失败
|
||
Sleep 5s
|
||
log 常规连接协议恢复
|
||
|
||
Socket连接恢复
|
||
[Arguments] ${mysql_dbname} ${mysql_dbpwd}
|
||
元素点击 ${MySQL_Rec} 点击连接协议下拉框 定位连接协议下拉框失败
|
||
元素点击 ${MySQL_Recsock} 选择socket连接协议 定位socket连接协议失败
|
||
元素输入 ${Recover_Mysql_Phy_Name} ${mysql_dbname} 定位mysql用户名输入框失败
|
||
元素输入 ${Recover_Mysql_Phy_Pwd} ${mysql_dbpwd} 定位mysql用户密码输入框失败
|
||
sleep 5s
|
||
log socket连接协议恢复
|
||
|
||
单通道恢复MySQL选项
|
||
[Arguments] ${mysql_binlog} ${service_name}
|
||
log MySQL物理单通道恢复设置
|
||
sleep 5s
|
||
元素输入 ${MySQL_Recstop} service ${service_name} stop 输入停止服务命令失败
|
||
元素输入 ${MySQL_Recstart} service ${service_name} start 输入启动数据库服务命令失败
|
||
元素点击 ${MySQL_Recbinlog} 勾选MySQLbinlog工具目录 定位MySQLbinlog工具目录 失败
|
||
sleep 3s
|
||
元素输入 ${MySQL_Recbinlogpath} ${mysql_binlog} 定位恢复binlog数据框失败
|
||
sleep 3s
|
||
元素点击 ${MySQL_Recstep2} 点击下一步进入高级选项 定位MySQL下一步按钮失败
|
||
sleep 3s
|