220 lines
11 KiB
Plaintext
220 lines
11 KiB
Plaintext
*** Settings ***
|
||
Library Selenium2Library
|
||
Library SSHLibrary
|
||
Library DatabaseLibrary
|
||
Library String
|
||
Resource ElementPath.robot
|
||
Resource ../RE0_Common/KeyWord.robot
|
||
|
||
*** Keywords ***
|
||
Gbase8s建表
|
||
[Arguments] ${Host_IP} ${Host_User} ${Host_PWD} # 代理IP;代理远程用户;代理远程密码
|
||
Open Connection ${Host_IP} 22
|
||
log 登录Gbase8s远程测试机器
|
||
SSHLibrary.Login ${Host_User} ${Host_PWD}
|
||
Execute Command /opt/GBase/Server/bin/Gbase8s.sh create
|
||
Execute Command /opt/GBase/Server/bin/Gbase8s.sh insert
|
||
${query_result1}= Execute Command /opt/GBase/Server/bin/Gbase8s.sh query
|
||
Set Suite Variable ${query_result1}
|
||
Log ${query_result1}
|
||
Close Connection
|
||
Log 数据表创建完成
|
||
|
||
Gbase8s备份
|
||
[Arguments] ${agent_name} ${Gbase8sUser} ${Gbase8sPwd} ${mds_name} ${encryption_attr} ${compress_attr} ${dedup_attr} ${cache_attr} # 代理名称;数据库用户名;数据库密码;代理IP;介质名称;加密;压缩;重删;缓存
|
||
元素点击 ${Timed_DataProtect} 点击进入定时数据保护页面 定位定时数据保护失败
|
||
${date} Evaluate time.strftime('%Y%m%d%H%M%S',time.localtime()) time
|
||
${random_strategyName}= Catenate SEPARATOR=_ Gbase8s ${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} 点击添加策略按钮 定位添加策略按钮失败
|
||
元素点击 ${Gbase8s_module} 点击Gbase8s组件 定位Gbase8s组件失败
|
||
元素输入 ${Input_celuename} ${random_strategyName} 定位策略名输入框失败
|
||
元素输入 ${Input_Gbase8s_user} ${Gbase8sUser} 定位用户名输入框失败
|
||
元素输入 ${Input_Gbase8s_pwd} ${Gbase8sPwd} 定位密码输入框失败
|
||
Sleep 10s
|
||
元素点击 ${Gbase8s_NextStep_2} 进入到目标数据库选择界面 定位下一步按钮失败
|
||
元素点击 ${Gbase8s_BKDB} 勾选备份数据库 定位备份数据库失败
|
||
Sleep 5s
|
||
元素点击 ${Gbase8s_NextStep_3} 进入到任务周期页面 定位下一步按钮失败
|
||
元素点击 ${Add_TaskCycle} 点击添加任务周期 定位添加任务周期按钮失败
|
||
元素点击 ${Full_Backup} 勾选完全备份 定位完全备份元素失败
|
||
Sleep 2s
|
||
元素点击 ${Cycle_Once} 设置任务仅执行一次 定位仅执行一次失败
|
||
元素点击 ${Cycle_Confirm} 确定任务周期设置完毕 定位任务周期设置失败
|
||
元素点击 ${Gbase8s_NextStep3_2} 点击下一步进入备份集存储设置界面 定位下一步失败
|
||
元素点击 ${Manual_ChooseMDS} 点击勾选手动选择介质 定位选择介质失败
|
||
元素点击 ${Select_MDS_DM} 点击介质选择按钮 定位介质选择按钮失败
|
||
元素点击 xpath=//select[@id="dialogues_addCycleStorage_storagePath_selectMedia_selectedMdsIP_select"]/option[text()="${mds_name}"] 点击选择指定介质 定位指定介质失败
|
||
Run Keyword If ${dedup_attr}==1 重删
|
||
... ELSE log 不重删
|
||
sleep 5s
|
||
元素点击 ${Storage_NextStep} 点击下一步进入到备份高级选项 定位下一步失败
|
||
log 进入备份高级选项
|
||
Run Keyword If ${encryption_attr}==1 加密
|
||
... ELSE log 不加密
|
||
Run Keyword If ${compress_attr}==1 压缩
|
||
... ELSE log 不压缩
|
||
Run Keyword If ${cache_attr}==1 备份缓存
|
||
... ELSE IF ${cache_attr}==0 备份取消缓存
|
||
sleep 2s
|
||
循环点击 ${Backuphigh_OK} ${Success_Confirm}
|
||
sleep 2s
|
||
元素点击 ${Success_Confirm} 确定策略创建成功 策略创建失败
|
||
元素点击 ${BackupSet} 点击进入备份集一栏 定位备份集栏失败
|
||
元素输入 ${DPMFind_Policy} ${random_strategyName} 定位策略名搜索框失败
|
||
元素点击 ${DPMButton_Searchbutton} 点击查找筛选策略 定位查找按钮失败
|
||
sleep 5s
|
||
Wait Until Page Contains Element ${Backup_Completed} 300s 备份未完成
|
||
Log 备份完成
|
||
|
||
Gbase8s恢复
|
||
[Arguments] ${Gbase8sUser} ${Gbase8sPwd} ${cache_attr} # 数据库用户名;数据库密码;缓存
|
||
sleep 5s
|
||
元素点击 ${Click_recover} 选择备份集进行恢复 定位恢复按钮失败
|
||
元素输入 ${Gbase8s_RecoveryUser} ${Gbase8sUser} 定位用户名输入框失败
|
||
元素输入 ${Gbase8s_RecoveryPWD} ${Gbase8sPwd} 定位密码输入框失败
|
||
元素点击 ${Gbase8s_RecoveryNext} 点击下一步,进入恢复高级选项 定位下一步失败
|
||
sleep 5s
|
||
Run Keyword If ${cache_attr}==1 恢复缓存
|
||
... ELSE IF ${cache_attr}==0 元素点击 ${Gbase8s_Cancelcache} 点击取消恢复缓存 定位缓存按钮失败
|
||
sleep 5s
|
||
元素点击 ${Gbase8s_finish} 点击执行恢复成功 定位执行按钮失败
|
||
元素点击 ${Confirm_Recovery} 点击确认恢复成功 定位恢复确认按钮失败
|
||
元素点击 ${Success_Confirm} 恢复策略确定创建成功 恢复作业创建成功弹窗定位失败
|
||
元素点击 ${Policy_Work} 点击进入作业栏 定位作业栏失败
|
||
元素输入 ${Input_All_Policy} 恢复策略 定位所有策略输入框失败
|
||
元素点击 ${Search_By_Policy} 点击查找筛选恢复策略 定位查找按钮失败
|
||
Wait Until Page Contains Element ${Recover_Success} 240s 恢复失败
|
||
sleep 2s
|
||
Log 恢复成功
|
||
|
||
备份集属性校验
|
||
[Arguments] ${encryption} ${compress} ${deduped} ${cache} # 加密;压缩;重删;缓存
|
||
sleep 2s
|
||
循环点击 ${BackupSet} ${Detail}
|
||
元素点击 ${Detail} 点击进入备份集详情 定位备份集详情失败
|
||
Sleep 2s
|
||
Element Should Contain ${Encryption_Attr} ${encryption}
|
||
Log 加密属性校验完毕
|
||
Sleep 2s
|
||
Element Text Should Be ${Compress_Attr} ${compress}
|
||
Log 压缩属性校验完毕
|
||
Sleep 2s
|
||
Element Should Contain ${Dedup_Confirm} ${deduped}
|
||
Log 重删属性校验完毕
|
||
Sleep 2s
|
||
Element Should Contain ${Cache_Attr} ${cache}
|
||
Log 缓存属性校验完毕
|
||
Sleep 2s
|
||
元素点击 ${Attr_Cancel} 点击取消关闭备份集详情弹窗 定位取消按钮失败
|
||
Log 备份集属性确认完毕
|
||
Sleep 5s
|
||
|
||
Gbase8s删表
|
||
[Arguments] ${Host_IP} ${Host_User} ${Host_PWD} # 代理IP;代理远程用户;代理远程密码
|
||
Open Connection ${Host_IP} 22
|
||
log 登录Gbase8s远程测试机器
|
||
SSHLibrary.Login ${Host_User} ${Host_PWD}
|
||
Execute Command /opt/GBase/Server/bin/Gbase8s.sh drop
|
||
Close Connection
|
||
Log 删除数据库表成功
|
||
|
||
Gbase8s数据校验
|
||
[Arguments] ${Host_IP} ${Host_User} ${Host_PWD} # 代理IP;代理远程用户;代理远程密码
|
||
Open Connection ${Host_IP} 22
|
||
log 登录Gbase8s远程测试机器
|
||
SSHLibrary.Login ${Host_User} ${Host_PWD}
|
||
${query_result2}= Execute Command /opt/GBase/Server/bin/Gbase8s.sh query
|
||
Log ${query_result2}
|
||
Run Keyword If ${query_result2}==${query_result1} Log 数据校验一致
|
||
... ELSE Fail 数据校验失败
|
||
Close Connection
|
||
Log 恢复完成
|
||
|
||
加密
|
||
Sleep 2s
|
||
元素点击 ${Type_encrypt} 勾选加密 定位选项选项失败
|
||
Sleep 2s
|
||
log 已选择加密
|
||
|
||
压缩
|
||
Sleep 2s
|
||
元素点击 ${Type_compress} 勾选压缩 定位压缩选项失败
|
||
Sleep 2s
|
||
log 取消勾选压缩
|
||
|
||
重删
|
||
Sleep 2s
|
||
元素点击 ${Type_dedup} 勾选重删 定位重删选项失败
|
||
Log 点击重删
|
||
Sleep 2s
|
||
log 已选择重删
|
||
|
||
备份缓存
|
||
sleep 2s
|
||
log 勾选缓存
|
||
元素点击 ${Sybase_change_cache} 更改缓存路径 定位更改缓存路径选项失败
|
||
元素输入 ${Cache_Path} /opt 定位缓存路径输入框失败
|
||
元素点击 ${Fin_CachePath} 缓存路径设置完毕 定位缓存路径设置确定按钮失败
|
||
|
||
备份取消缓存
|
||
Sleep 2s
|
||
元素点击 ${Active_Cache} 取消勾选缓存 定位选项选项失败
|
||
Sleep 2s
|
||
log 备份不勾选缓存
|
||
|
||
恢复缓存
|
||
元素点击 ${Gbase8s_changecache} 点击更改缓存路径 定位更改缓存路径失败
|
||
元素输入 ${Rcache_path} /opt 定位缓存路径输入框失败
|
||
元素点击 ${Fin_Recover_CachePath} 缓存路径设置完毕 定位缓存路径设置确定按钮失败
|
||
|
||
Gbase8s立即执行
|
||
[Arguments] ${bktype} # 备份类型
|
||
元素点击 ${dpm_Protection strategy} 点击进入定时保护策略一栏 定位保护策略栏失败
|
||
元素点击 ${Complie_execute} 点击策略立即执行按钮 定位立即执行元素失败
|
||
元素点击 ${Select_Srctype_Gbase8t} 点击选择备份类型按钮 定位选择备份类型元素失败
|
||
Run Keyword If "${bktype}"=="增量" 立即增量备份
|
||
... ELSE IF "${bktype}"=="完全" 立即完全备份
|
||
元素点击 ${Gbase8s_executeSure} 点击完成按钮 定位完成元素失败
|
||
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()="GBase8s${bktype}备份"] 100s 备份集为非${bktype}
|
||
Log 备份集类型为${bktype}
|
||
Sleep 5s
|
||
Wait Until Page Contains Element ${Backup_Completed} 300s 备份未完成
|
||
Log 备份完成
|
||
|
||
立即增量备份
|
||
Sleep 2s
|
||
Click Element ${Complie_incre_Sybase}
|
||
Log 立即执行增量备份
|
||
Sleep 2s
|
||
|
||
立即完全备份
|
||
Sleep 2s
|
||
Click Element ${Now Full_BackupMysql}
|
||
Log 立即执行完全备份
|
||
Sleep 2s
|
||
|
||
Gbase8s插数据
|
||
[Arguments] ${Host_IP} ${Host_User} ${Host_PWD} # 代理IP;代理远程用户;代理远程密码
|
||
Open Connection ${Host_IP} 22
|
||
log 登录Gbase8s远程测试机器
|
||
SSHLibrary.Login ${Host_User} ${Host_PWD}
|
||
Execute Command /opt/GBase/Server/bin/Gbase8s.sh insert
|
||
${query_result1}= Execute Command /opt/GBase/Server/bin/Gbase8s.sh query
|
||
Set Suite Variable ${query_result1}
|
||
Log ${query_result1}
|
||
Close Connection
|
||
Log 数据插入完成
|