273 lines
14 KiB
Plaintext
273 lines
14 KiB
Plaintext
*** Settings ***
|
||
Library Selenium2Library
|
||
Library DatabaseLibrary
|
||
Resource ElementPath.robot
|
||
Library SSHLibrary
|
||
Resource ../RE0_Common/KeyWord.robot
|
||
|
||
*** Keywords ***
|
||
Gbase8t建表
|
||
[Arguments] ${Gbase8t_HostIP} ${Gbase8t_infomix} ${Gbase8t_Pwd} # 代理IP;数据库安装用户;数据库安装用户密码
|
||
Gbase8t删表 ${Gbase8t_HostIP} ${Gbase8t_infomix} ${Gbase8t_Pwd}
|
||
Open Connection ${Gbase8t_HostIP} 22
|
||
log 用户登录远程测试机器
|
||
SSHLibrary.Login ${Gbase8t_infomix} ${Gbase8t_Pwd}
|
||
Execute Command ./informixdb_v1.sh create
|
||
Execute Command ./informixdb_v1.sh insert
|
||
${out}= Execute Command ./informixdb_v1.sh query
|
||
log ${out}
|
||
Close Connection
|
||
log Gbase建表成功
|
||
Set Suite Variable ${out}
|
||
|
||
Gbase8t删表
|
||
[Arguments] ${Gbase8t_HostIP} ${Gbase8t_infomix} ${Gbase8t_Pwd} # 代理IP;数据库安装用户;数据库安装用户密码
|
||
Open Connection ${Gbase8t_HostIP} 22
|
||
log 用户登录远程测试机器
|
||
SSHLibrary.Login ${Gbase8t_infomix} ${Gbase8t_Pwd}
|
||
log 执行删除脚本
|
||
Run Keyword And Ignore Error Execute Command ./informixdb_v1.sh drop
|
||
|
||
Gbase8t插数据
|
||
[Arguments] ${Gbase8t_HostIP} ${Gbase8t_infomix} ${Gbase8t_Pwd} # 代理IP;数据库安装用户;数据库安装用户密码
|
||
Open Connection ${Gbase8t_HostIP} 22
|
||
log 用户登录远程测试机器
|
||
SSHLibrary.Login ${Gbase8t_infomix} ${Gbase8t_Pwd}
|
||
log 执行脚本和sql语句
|
||
Execute Command ./informixdb_v1.sh insert
|
||
${out}= Execute Command ./informixdb_v1.sh query
|
||
Sleep 15s
|
||
log ${out}
|
||
Set Suite Variable ${out}
|
||
Close Connection
|
||
|
||
Gbase8t数据校验
|
||
[Arguments] ${Gbase8t_HostIP} ${Gbase8t_infomix} ${Gbase8t_Pwd} # 代理IP;数据库安装用户;数据库安装用户密码
|
||
Open Connection ${Gbase8t_HostIP} 22
|
||
log 用户登录远程测试机器
|
||
SSHLibrary.Login ${Gbase8t_infomix} ${Gbase8t_Pwd}
|
||
log 执行脚本和sql语句
|
||
sleep 5s
|
||
${out_num}= Execute Command ./informixdb_v1.sh query
|
||
log ${out_num}
|
||
Should Contain "${out_num}" "${out}"
|
||
log 数据校验成功
|
||
Comment Run Keyword If "${out2}"=="${out}" log 数据校验一致,恢复成功
|
||
... ELSE log 数据校验不一致,恢复失败
|
||
|
||
Gbase8t备份
|
||
[Arguments] ${agent_name} ${Gbase8t_infomix} ${Gbase8t_Pwd} ${Gbase8t_sid} ${Gbase8t_port} ${Gbase8t_HostIP} ${mds_name} ${encryption_attr} ${compress_attr} ${dedup_attr} ${Gbase_cache} # 代理名称;系统用户名;密码;服务名;端口号;代理IP;介质名称;加密;压缩;重删;缓存
|
||
元素点击 ${Timed_DataProtect} 点击进入定时数据保护页面 定位定时数据保护失败
|
||
${date} Evaluate time.strftime('%Y%m%d%H%M%S',time.localtime()) time
|
||
${random_strategyName}= Catenate SEPARATOR=_ Gbase8t ${date}
|
||
${createpolicy} Catenate SEPARATOR= 新建了策略[ ${random_strategyName} ]
|
||
Set Suite Variable ${random_strategyName}
|
||
Set Suite Variable ${createpolicy}
|
||
Sleep 5s
|
||
元素点击 xpath=//span[text()="${agent_name}"] 点击选择代理 定位代理所在位置失败
|
||
Sleep 5s
|
||
元素点击 ${BackupSet} 点击进入备份集页面 定位备份集按钮失败
|
||
元素点击 ${dpm_Protection strategy} 点击进入保护策略页面 定位保护策略按钮失败
|
||
元素点击 ${Add_Policy} 点击添加策略按钮 定位添加策略按钮失败
|
||
元素点击 ${Gbase8t_module} 点击Gbase8t组件 定位Gbase8t组件失败
|
||
元素输入 ${Input_celuename} ${random_strategyName} 定位策略名输入框失败
|
||
元素输入 ${Input_Gbase_user} ${Gbase8t_infomix} 定位用户名输入框失败
|
||
元素输入 ${Input_Gbase_pwd} ${Gbase8t_Pwd} 定位密码输入框失败
|
||
元素输入 ${Input_Gbase_sid} ${Gbase8t_sid} 定位服务名输入框失败
|
||
元素输入 ${Input_Gbase_port} ${Gbase8t_port} 定位端口号输入框失败
|
||
元素输入 ${Input_Gbase_ip} ${Gbase8t_HostIP} 定位IP输入框失败
|
||
Sleep 10s
|
||
元素点击 ${Connection credentials_Next} 进入到目标数据库选择界面 定位下一步按钮失败
|
||
Sleep 10s
|
||
元素点击 ${Target_database_Next_Gbase8t} 进入到任务周期页面 定位下一步按钮失败
|
||
元素点击 ${Add_taskcycle} 点击添加任务周期 定位添加任务周期按钮失败
|
||
元素点击 ${Full_Backup} 勾选完全备份 定位完全备份元素失败
|
||
Sleep 2s
|
||
元素点击 ${Cycle_Once} 设置任务仅执行一次 定位仅执行一次失败
|
||
元素点击 ${Cycle_Confirm} 确定任务周期设置完毕 定位任务周期设置失败
|
||
元素点击 ${Cycle_NextStep} 点击下一步进入备份集存储设置界面 定位下一步失败
|
||
元素点击 ${Manual_ChooseMDS} 点击勾选手动选择介质 定位选择介质失败
|
||
元素点击 ${Select_MDS_DM} 点击介质选择按钮 定位介质选择按钮失败
|
||
元素点击 xpath=//select[@id="dialogues_addCycleStorage_storagePath_selectMedia_selectedMdsIP_select"]/option[@label="${mds_name}"] 点击选择指定介质 定位指定介质失败
|
||
Run Keyword If ${dedup_attr}==1 重删
|
||
... ELSE log 不重删
|
||
元素点击 ${Storage_NextStep} 点击下一步进入到备份高级选项 定位下一步失败
|
||
log 进入备份高级选项
|
||
Run Keyword If ${encryption_attr}==1 加密
|
||
... ELSE log 不加密
|
||
Run Keyword If ${compress_attr}==1 压缩
|
||
... ELSE log 不压缩
|
||
Run Keyword If ${Gbase_cache}==1 备份缓存
|
||
... ELSE IF ${Gbase_cache}==0 备份取消缓存
|
||
sleep 2s
|
||
循环点击 ${Backuphigh_OK} ${Success_Confirm}
|
||
sleep 2s
|
||
元素点击 ${Success_Confirm} 确定策略创建成功 策略创建失败
|
||
元素点击 ${BackupSet} 点击进入备份集一栏 定位备份集栏失败
|
||
元素输入 ${DPMFind_Policy} ${random_strategyName} 定位策略名搜索框失败
|
||
元素点击 ${DPMButton_Searchbutton} 点击查找筛选策略 定位查找按钮失败
|
||
sleep 30s
|
||
Wait Until Page Contains Element ${Backup_Completed} 300s 备份未完成
|
||
Log 备份完成
|
||
|
||
Gbase8t恢复
|
||
[Arguments] ${Gbase8t_infomix} ${Gbase8t_Pwd} ${Gbase8t_sid} ${Gbase8t_port} ${Gbase8t_HostIP} ${Gbase_cache} # 系统用户名;密码;服务名;端口号;代理IP;缓存
|
||
sleep 5s
|
||
元素点击 ${Click_recover} 选择备份集进行恢复 定位恢复按钮失败
|
||
sleep 5s
|
||
元素输入 ${Input_Rgbase_user} ${Gbase8t_infomix} 定位用户名输入框失败
|
||
元素输入 ${Input_Rgbase_pwd} ${Gbase8t_Pwd} 定位密码输入框失败
|
||
元素输入 ${Input_Rgbase_sid} ${Gbase8t_sid} 定位服务名输入框失败
|
||
元素输入 ${Input_Rgbase_port} ${Gbase8t_port} 定位端口号输入框失败
|
||
元素输入 ${Input_Rgbase_ip} ${Gbase8t_HostIP} 定位IP输入框失败
|
||
Sleep 10s
|
||
元素点击 ${Recover_Nextstep} 恢复策略下一步成功 定位恢复下一步按键失败
|
||
Run Keyword If ${Gbase_cache}==1 Gbase8t恢复缓存
|
||
... ELSE Log 不勾选缓存
|
||
sleep 2s
|
||
元素点击 ${Recovery_Gbase8t} 确认执行恢复策略 定位确认恢复失败
|
||
循环点击 ${Confirm_Recovery} ${Success_Confirm}
|
||
sleep 2s
|
||
元素点击 ${Success_Confirm} 恢复策略确定创建成功 恢复作业创建成功弹窗定位失败
|
||
元素点击 ${Policy_Work} 点击进入作业栏 定位作业栏失败
|
||
元素输入 ${Input_All_Policy} 恢复策略 定位所有策略输入框失败
|
||
元素点击 ${Search_By_Policy} 点击查找筛选恢复策略 定位查找按钮失败
|
||
sleep 30s
|
||
Wait Until Page Contains Element ${Recover_Success} 250s 恢复失败
|
||
sleep 2s
|
||
Log 恢复成功
|
||
|
||
Gbase8t立即执行策略
|
||
[Arguments] ${Gbase_type}
|
||
元素点击 ${dpm_Protection strategy} 点击进入定时保护策略一栏 定位保护策略栏失败
|
||
元素点击 ${Complie_execute} 点击策略立即执行按钮 定位立即执行元素失败
|
||
元素点击 ${Select_Srctype_Gbase8t} 点击选择备份类型按钮 定位选择备份类型元素失败
|
||
Run Keyword If "${Gbase_type}"=="差量" Gbase8t差量备份
|
||
... ELSE IF Log 此次备份不为差量备份
|
||
元素点击 ${ExecutePolicy_execute} 点击完成按钮 定位完成元素失败
|
||
Sleep 5s
|
||
元素点击 ${Gbase8t_Execute_Confirm} 点击确定按钮 定位确定按钮失败
|
||
Sleep 5s
|
||
元素点击 ${BackupSet} 点击进入备份集一栏 定位备份集栏失败
|
||
Sleep 60s
|
||
Wait Until Page Contains Element xpath=//*[@id="backupSetTable"]/div[2]/table/tbody/tr[2]/td[5][text()="Gbase8t${Gbase_type}备份"] 100s 备份集为非${Gbase_type}
|
||
Log 备份集类型为${Gbase_type}
|
||
Sleep 5s
|
||
Wait Until Page Contains Element ${Backup_Completed} 300s 备份未完成
|
||
Log 备份完成
|
||
|
||
Gbase8t差量备份
|
||
Sleep 5s
|
||
Click Element ${Complie_diff_Gbase8t}
|
||
Log 勾选差量备份
|
||
Sleep 5s
|
||
|
||
Gbase8t备份缓存
|
||
元素点击 ${Gbase_cache} 更改缓存路径 定位更改缓存路径选项失败
|
||
元素输入 ${Cache_Path} /opt 定位缓存路径输入框失败
|
||
元素点击 ${Fin_CachePath} 缓存路径设置完毕 定位缓存路径设置确定按钮失败
|
||
|
||
Gbase8t恢复缓存
|
||
元素点击 ${Recover_Cache} 勾选缓存 定位缓存选项失败
|
||
元素输入 ${Rcache_Path} /opt 定位缓存路径输入框失败
|
||
元素点击 ${Fin_Recover_CachePath} 缓存路径设置完毕 定位缓存路径设置确定按钮失败
|
||
|
||
加密
|
||
Sleep 2s
|
||
元素点击 ${Type_encrypt} 勾选加密 定位选项选项失败
|
||
Sleep 2s
|
||
log 已选择加密
|
||
|
||
压缩
|
||
Sleep 2s
|
||
元素点击 ${Type_compress} 勾选压缩 定位压缩选项失败
|
||
Sleep 2s
|
||
log 取消勾选压缩
|
||
|
||
重删
|
||
Sleep 2s
|
||
元素点击 ${Type_dedup} 勾选重删 定位重删选项失败
|
||
Log 点击重删
|
||
Sleep 2s
|
||
log 已选择重删
|
||
|
||
取消压缩
|
||
Sleep 2s
|
||
元素点击 ${Type_compress} 取消勾选压缩 定位选项选项失败
|
||
Sleep 2s
|
||
log 取消勾选压缩
|
||
|
||
备份缓存
|
||
元素点击 ${Sybase_change_cache} 更改缓存路径 定位更改缓存路径选项失败
|
||
元素输入 ${Cache_Path} /opt 定位缓存路径输入框失败
|
||
元素点击 ${Fin_CachePath} 缓存路径设置完毕 定位缓存路径设置确定按钮失败
|
||
|
||
恢复缓存
|
||
元素点击 ${Recover_Cache} 勾选缓存 定位缓存选项失败
|
||
元素输入 ${Recover_CachePath} /opt 定位缓存路径输入框失败
|
||
元素点击 ${Fin_Recover_CachePath} 缓存路径设置完毕 定位缓存路径设置确定按钮失败
|
||
|
||
备份取消缓存
|
||
Sleep 2s
|
||
元素点击 ${Active_Cache} 取消勾选缓存 定位选项选项失败
|
||
Sleep 2s
|
||
log 备份不勾选缓存
|
||
|
||
备份集属性校验
|
||
[Arguments] ${encryption} ${compress} ${deduped} ${cache} # 加密、压缩、重删、缓存
|
||
sleep 2s
|
||
循环点击 ${BackupSet} ${Detail}
|
||
元素点击 ${Detail} 点击进入备份集详情 定位备份集详情失败
|
||
Sleep 5s
|
||
加密属性校验 ${encryption}
|
||
压缩属性校验 ${compress}
|
||
重删属性校验 ${deduped}
|
||
缓存属性校验 ${cache}
|
||
Sleep 5s
|
||
元素点击 ${Attr_Cancel} 点击取消关闭备份集详情弹窗 定位取消按钮失败
|
||
Log 备份集属性确认完毕
|
||
Sleep 2s
|
||
|
||
加密属性校验
|
||
[Arguments] ${encryption}
|
||
Element Should Contain ${Encryption_Attr} ${encryption}
|
||
Log 加密属性校验完毕
|
||
|
||
压缩属性校验
|
||
[Arguments] ${compress}
|
||
Element Text Should Be ${Compress_Attr} ${compress}
|
||
Log 压缩属性校验完毕
|
||
|
||
重删属性校验
|
||
[Arguments] ${deduped}
|
||
Element Should Contain ${Dedup_Confirm} ${deduped}
|
||
Log 重删属性校验完毕
|
||
|
||
缓存属性校验
|
||
[Arguments] ${cache}
|
||
Element Should Contain ${Cache_Attr} ${cache}
|
||
Log 缓存属性校验完毕
|
||
|
||
Gbase8t启动服务与设置属性值
|
||
[Arguments] ${Host_IP} ${Host_User} ${Host_PWD} ${agent_name} ${InstallPath_Lin} # IP、数据库安装用户、密码、代理名称、数据库安装路径
|
||
log 启动Gbase8t数据库服务
|
||
Open Connection ${Host_IP} 22
|
||
SSHLibrary.Login ${Host_User} ${Host_PWD}
|
||
Execute Command oninit -vy
|
||
sleep 15s
|
||
Close Connection
|
||
log Gbase8t服务已启动
|
||
log 登录黑方,填写属性值
|
||
元素点击 ${Timed_DataProtect} 点击进入定时数据管理 定位定时数据管理失败
|
||
元素输入 ${Input_Agent_Name} ${agent_name} 定位代理名称输入框失败
|
||
Right Click Element xpath=//span[text()="${agent_name}"]
|
||
Sleep 5s
|
||
元素点击 ${DPM_attribute} 点击代理属性 定位代理属性失败
|
||
元素点击 ${DPM_attribute2} 点击数据库 定位数据库失败
|
||
元素输入 ${DPM_InstallPath} ${InstallPath_Lin} 定位数据库安装路径输入框失败
|
||
Sleep 5s
|
||
元素点击 ${DPM_UpdateVar} 更新数据库属性 定位更新按钮失败
|
||
元素点击 ${Success_Confirm} 更新数据库属性确认 定位确认按钮失败
|
||
元素点击 ${DPM_Cancel} 点击关闭 定位关闭按钮失败
|
||
log 属性值设置完成
|