189 lines
9.1 KiB
Plaintext
189 lines
9.1 KiB
Plaintext
|
*** Settings ***
|
||
|
Resource ../RE0_Common/KeyWord.robot
|
||
|
Resource ElementPath.robot
|
||
|
|
||
|
*** Keywords ***
|
||
|
FusionSphere备份
|
||
|
[Arguments] ${agent} ${bk_type} ${mds_name} ${encryption_attr} ${compress_attr} ${dedup_attr}
|
||
|
元素点击 ${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()="${agent}"] 点击选择代理 定位代理所在位置失败
|
||
|
元素点击 ${dpm_Protection strategy} 点击进入保护策略页面 定位保护策略按钮失败
|
||
|
环境清理
|
||
|
元素点击 ${FS_Add_Policy} 点击添加策略 定位添加策略按钮失败
|
||
|
Sleep 15s
|
||
|
元素输入 ${Set_PolicyName} ${random_strategyName} 定位策略名输入框失败
|
||
|
元素点击 ${FS_Bk_Target} 勾选名为minimal的虚拟机 定位minimal虚拟机失败
|
||
|
元素点击 ${Add_Bk_List_FusionSphere} 点击添加到右侧备份虚拟机框 定位添加到已选列表框失败
|
||
|
元素点击 ${Bk_Target_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 重删
|
||
|
元素点击 ${Storage_NextStep} 点击下一步进入到备份高级选项 定位下一步失败
|
||
|
log 进入备份高级选项
|
||
|
Run Keyword If ${encryption_attr}==1 加密
|
||
|
Run Keyword If ${compress_attr}==1 压缩
|
||
|
... ELSE IF ${compress_attr}==0 log 取消压缩1
|
||
|
元素点击 ${FS_NextStep} 点击下一步进入任务周期页面 定位下一步失败
|
||
|
元素点击 ${Add_taskcycle} 点击添加任务周期 定位添加任务周期按钮失败
|
||
|
Run Keyword If "${bk_type}"=="完全" 完全备份
|
||
|
... ELSE IF "${bk_type}"=="差量" 差量备份
|
||
|
... ELSE IF "${bk_type}"=="增量" 增量备份
|
||
|
Sleep 2s
|
||
|
元素点击 ${Cycle_Once} 设置任务仅执行一次 定位仅执行一次失败
|
||
|
元素点击 ${Cycle_Confirm} 确定任务周期设置完毕 定位任务周期设置失败
|
||
|
Sleep 2s
|
||
|
元素点击 ${FS_Complete_CreatePolicy} 点击确定按钮完成策略创建 定位确定按钮失败
|
||
|
元素点击 ${Success_Confirm} 确定策略创建成功 策略创建失败
|
||
|
元素点击 ${BackupSet} 点击进入备份集一栏 定位备份集栏失败
|
||
|
Sleep 60s
|
||
|
Wait Until Page Contains Element xpath=//*[@id="backupSetTable"]/div[2]/table/tbody/tr[2]/td[text()="已完成"] 600s 备份未完成
|
||
|
Log 备份完成
|
||
|
Sleep 2s
|
||
|
|
||
|
FusionSphere恢复
|
||
|
循环点击 ${BackupSet} ${Click_recover}
|
||
|
元素点击 ${Click_recover} 点击恢复按钮 定位恢复按钮失败
|
||
|
Sleep 2s
|
||
|
Comment 元素点击 xpath=//span[contains(text(),"${DataStore}")]/../../td[@width="20px"]/div[@class="dhx_bg_img_fix"] 勾选本地存储 定位本地存储失败
|
||
|
元素点击 ${Recover_Nextstep_FS} 点击下一步进入恢复高级选项 定位下一步按钮失败
|
||
|
元素点击 ${Recover_Policy_Complete} 点击完成完成恢复策略创建 定位完成按钮失败
|
||
|
Sleep 5s
|
||
|
元素点击 ${confirm_restore} 点击确定恢复确认按钮成功 点击确定恢复确认按钮失败
|
||
|
Sleep 2s
|
||
|
元素点击 ${Success_Confirm} 恢复策略确定创建成功 恢复作业创建成功弹窗定位失败
|
||
|
元素点击 ${Policy_Work} 点击进入作业栏 定位作业栏失败
|
||
|
Sleep 60s
|
||
|
Wait Until Page Contains Element ${Recover_Success} 600s 恢复失败
|
||
|
sleep 2s
|
||
|
Log 恢复成功
|
||
|
|
||
|
备份集属性校验
|
||
|
[Arguments] ${compress} ${encryption} ${deduped} # 压缩|加密|重删
|
||
|
sleep 10s
|
||
|
循环点击 ${BackupSet} ${BK_Details}
|
||
|
sleep 2s
|
||
|
元素点击 ${BK_Details} 点击进入备份集详情 定位备份集详情失败
|
||
|
Sleep 10s
|
||
|
Run Keyword If ${compress}==1 压缩属性校验
|
||
|
... ELSE Log 属性不校验
|
||
|
Run Keyword If ${encryption}==1 加密属性校验
|
||
|
... ELSE Log 属性不校验
|
||
|
Run Keyword If ${deduped}==1 重删属性校验
|
||
|
... ELSE Log 属性不校验
|
||
|
元素点击 ${Attr_Cancel} 点击取消关闭备份集详情弹窗 定位取消按钮失败
|
||
|
Log 备份集属性确认完毕
|
||
|
Sleep 2s
|
||
|
|
||
|
完全备份
|
||
|
Sleep 2s
|
||
|
Click Element ${Full_Backup}
|
||
|
Log 勾选完全备份
|
||
|
|
||
|
差量备份
|
||
|
Sleep 2s
|
||
|
Click Element ${Divergence_Backup}
|
||
|
Log 勾选差量备份
|
||
|
|
||
|
增量备份
|
||
|
Sleep 2s
|
||
|
Click Element ${Incre_Backup}
|
||
|
Log 勾选增量备份
|
||
|
|
||
|
加密
|
||
|
Sleep 2s
|
||
|
元素点击 ${FS_Encryption} 勾选加密 定位选项选项失败
|
||
|
Sleep 2s
|
||
|
|
||
|
压缩
|
||
|
Log 点击压缩
|
||
|
|
||
|
重删
|
||
|
Sleep 2s
|
||
|
元素点击 ${Option_Dedup} 勾选重删 定位重删选项失败
|
||
|
Log 点击重删
|
||
|
Sleep 2s
|
||
|
|
||
|
取消压缩
|
||
|
Sleep 2s
|
||
|
Set Focus To Element ${Option_Compress}
|
||
|
Click Element ${Option_Compress}
|
||
|
Log 取消压缩
|
||
|
Sleep 2s
|
||
|
|
||
|
策略删除
|
||
|
元素点击 ${DPM_Tab_Policy} 定位策略栏失败 定位策略失败
|
||
|
元素点击 ${Policy_Delete} 点击删除策略 定位策略删除失败
|
||
|
元素点击 ${Confirm_Delete} 确定删除策略 确认删除定位失败
|
||
|
元素点击 ${Success_Confirm} 策略删除成功 定位删除成功按钮失败
|
||
|
Sleep 2s
|
||
|
|
||
|
加密属性校验
|
||
|
${get_attr}= Get Text ${Encryption_Attr}
|
||
|
Element Text Should Be ${Encryption_Attr} 是
|
||
|
Log 加密属性校验完毕
|
||
|
|
||
|
压缩属性校验
|
||
|
${get_attr}= Get Text ${Compress_Attr}
|
||
|
Element Text Should Be ${Compress_Attr} 是
|
||
|
Log 压缩属性校验完毕
|
||
|
|
||
|
重删属性校验
|
||
|
${get_attr}= Get Text ${FS_Deduped_Attr}
|
||
|
Element Text Should Be ${FS_Deduped_Attr} 是
|
||
|
Log 重删属性校验完毕
|
||
|
|
||
|
立即执行
|
||
|
[Arguments] ${bk_type} # 立即执行备份类型
|
||
|
元素点击 ${dpm_Protection strategy} 点击进入保护策略成功 点击进入保护策略失败
|
||
|
元素点击 ${Run_Now} 点击立即执行成功 点击立即执行失败
|
||
|
元素点击 ${Select_BackType} 点击备份类型下拉框成功 点击备份类型下拉框失败
|
||
|
Run Keyword If "${bk_type}"=="完全" 立即执行_完全
|
||
|
... ELSE IF "${bk_type}"=="差量" 立即执行_差量
|
||
|
... ELSE IF "${bk_type}"=="增量" 立即执行_增量
|
||
|
Sleep 2s
|
||
|
循环点击 ${ExecutePolicy_execute} ${Complie_confirm}
|
||
|
Sleep 5s
|
||
|
元素点击 ${Complie_confirm} 点击确定按钮 定位确定按钮失败
|
||
|
元素点击 ${BackupSet} 点击进入备份集一栏 定位备份集栏失败
|
||
|
元素输入 ${Input_Policy_Name} ${random_strategyName} 输入策略名
|
||
|
FOR ${n} IN RANGE 10
|
||
|
Click Element ${Button_Searchbk}
|
||
|
${bk_status} Run Keyword And Return Status Wait Until Element Is Visible Xpath=//td[text()="${random_strategyName}"]/../td[contains(text(),"${bk_type}")]/../td[text()="已完成"]
|
||
|
Run Keyword If "${bk_status}"=="True" Exit For Loop
|
||
|
... ELSE Log 备份未完成
|
||
|
Sleep 60s
|
||
|
END
|
||
|
Run Keyword If ${bk_status}==False Fail
|
||
|
... ELSE Log 备份成功
|
||
|
Sleep 15s
|
||
|
|
||
|
立即执行_完全
|
||
|
元素点击 ${Now Full_Bacup} 选择完全备份成功 选择完全备份失败
|
||
|
LOG 开始执行完全备份策略
|
||
|
|
||
|
立即执行_增量
|
||
|
元素点击 ${Now Add_Backup} 选择增量备份成功 选择增量备份失败
|
||
|
LOG 开始执行增量备份策略
|
||
|
|
||
|
立即执行_差量
|
||
|
元素点击 ${Now Difference_Backup} 选择差量备份成功 选择差量备份失败
|
||
|
LOG 开始执行差量备份策略
|
||
|
|
||
|
环境清理
|
||
|
元素点击 ${DPM_Tab_Policy} 30s 定位策略失败
|
||
|
Log 切换到策略一栏
|
||
|
Sleep 2s
|
||
|
FOR ${n} IN RANGE 3
|
||
|
${policy_status} Run Keyword And Return Status Wait Until Element Is Visible ${Policy_Delete}
|
||
|
Run Keyword If ${policy_status}==True 策略删除
|
||
|
... ELSE Exit For Loop
|
||
|
END
|
||
|
Log 环境清理完毕
|