190 lines
14 KiB
Plaintext
190 lines
14 KiB
Plaintext
|
*** Settings ***
|
||
|
Variables ../../Config/Plantform_Config.py
|
||
|
Resource ElementPath.robot
|
||
|
Library Selenium2Library
|
||
|
Resource ../RE0_Common/KeyWord.robot
|
||
|
|
||
|
*** Keywords ***
|
||
|
添加副本归档策略_D2D2T_非存量
|
||
|
[Arguments] ${GD_Tape} # 归档备份范围
|
||
|
元素点击 ${Archive} 点击进入创建归档策略栏 定位左侧创建归档策略栏失败
|
||
|
Sleep 2s
|
||
|
循环点击 ${Add_Archive_Policy} ${CDM_Policy}
|
||
|
元素点击 ${CDM_Policy} 选择创建副本归档策略 定位副本数据管理选项失败
|
||
|
${archive_policy} catenate SEPARATOR=_ CDM_ ${random_strategyName}
|
||
|
元素输入 ${Input_Arch_Policy} ${archive_policy} 定位归档策略名称输入框失败
|
||
|
元素点击 xpath=//span[text()="${random_strategyName}"]/../../td[2] 勾选指定备份策略 定位要归档的备份策略失败
|
||
|
元素点击 ${Add_To_Right} 点击添加将策略添加到右侧 定位添加按钮失败
|
||
|
元素点击 ${Next_Step} 点击下一步进入选项页面 定位下一步按钮失败
|
||
|
Run Keyword If '${GD_Tape}'=='CLZL' Click Element ${Option_CLZL}
|
||
|
... ELSE IF '${GD_Tape}'=='ZL' Click Element ${Optiob_ZL}
|
||
|
... ELSE IF '${GD_Tape}'=='CL' Click Element ${Option_CL}
|
||
|
... ELSE Fail 归档类型输入错误
|
||
|
Sleep 2s
|
||
|
元素点击 ${Complete_Arch_Policy} 点击完成结束归档策略创建 定位完成按钮失败
|
||
|
元素点击 ${Success_Confirm} 二次确认策略创建成功 定位策略创建成功弹窗失败
|
||
|
元素点击 xpath=//td[text()="${archive_policy}"]/..//span[text()="启动"] 点击启动归档策略 定位归档策略启动按钮失败
|
||
|
元素点击 ${Success_Confirm} 归档任务启动成功 定位归档启动成功弹窗失败
|
||
|
Sleep 5s
|
||
|
FOR ${n} IN RANGE 10
|
||
|
元素点击 Xpath=//td[text()="${archive_policy}"]/..//span[text()="详情"] 点击展开归档策略详情 定位归档策略详情失败
|
||
|
${arch_status} Run Keyword And Return Status Wait Until Element Is Visible Xpath=//td[text()="${random_strategyName}"]/..//td[contains(text(),"1/0")]
|
||
|
元素点击 ${Close_Arch_More} 点击关闭归档任务详情 定位归档任务详情确定按钮失败
|
||
|
Run Keyword If "${arch_status}"=="True" Exit For Loop
|
||
|
... ELSE Log 归档未完成
|
||
|
Sleep 30s
|
||
|
END
|
||
|
元素点击 Xpath=//td[text()="${archive_policy}"]/..//span[text()="详情"] 点击展开归档策略详情 定位归档策略详情失败
|
||
|
${arch_status} Run Keyword And Return Status Wait Until Element Is Visible Xpath=//td[text()="${random_strategyName}"]/..//td[contains(text(),"1/0")]
|
||
|
Run Keyword If "${arch_status}"=="True" Log 归档完成
|
||
|
... ELSE Fail 归档未完成
|
||
|
元素点击 ${Close_Arch_More} 点击关闭归档任务详情 定位归档任务详情确定按钮失败
|
||
|
|
||
|
添加定时归档策略_D2D2T_非存量
|
||
|
[Arguments] ${GD_Tape} ${Num_GD}=2 # 归档备份集的范围|归档的备份集个数
|
||
|
元素点击 ${Archive} 点击进入创建归档策略栏 定位左侧创建归档策略栏失败
|
||
|
Sleep 2s
|
||
|
循环点击 ${Add_Archive_Policy} ${CDM_Policy}
|
||
|
元素点击 ${DPM_Policy} 选择创建定时归档策略 定位定时数据管理选项失败
|
||
|
${archive_policy} catenate SEPARATOR=_ DPM_ ${random_strategyName}
|
||
|
Set Suite Variable ${archive_policy}
|
||
|
元素输入 ${Input_Arch_Policy} ${archive_policy} 定位归档策略名称输入框失败
|
||
|
元素点击 xpath=//span[text()="${random_strategyName}"]/../../td[2] 勾选指定备份策略 定位要归档的备份策略失败
|
||
|
元素点击 ${Add_To_Right} 点击添加将策略添加到右侧 定位添加按钮失败
|
||
|
元素点击 ${Next_Step} 点击下一步进入选项页面 定位下一步按钮失败
|
||
|
Run Keyword If '${GD_Tape}'=='CLZL' Click Element ${Option_CLZL}
|
||
|
... ELSE IF '${GD_Tape}'=='ZL' Click Element ${Optiob_ZL}
|
||
|
... ELSE IF '${GD_Tape}'=='CL' Click Element ${Option_CL}
|
||
|
... ELSE Fail 归档类型输入错误
|
||
|
Sleep 2s
|
||
|
元素点击 ${Complete_Arch_Policy} 点击完成结束归档策略创建 定位完成按钮失败
|
||
|
元素点击 ${Success_Confirm} 二次确认策略创建成功 定位策略创建成功弹窗失败
|
||
|
元素点击 xpath=//td[text()="${archive_policy}"]/..//span[text()="启动"] 点击启动归档策略 定位归档策略启动按钮失败
|
||
|
元素点击 ${Success_Confirm} 归档任务启动成功 定位归档启动成功弹窗失败
|
||
|
Sleep 5s
|
||
|
FOR ${n} IN RANGE 10
|
||
|
元素点击 Xpath=//td[text()="${archive_policy}"]/..//span[text()="详情"] 点击展开归档策略详情 定位归档策略详情失败
|
||
|
${arch_status} Run Keyword And Return Status Wait Until Element Is Visible Xpath=//td[text()="${random_strategyName}"]/..//td[contains(text(),"${Num_GD}/0")]
|
||
|
元素点击 ${Close_Arch_More} 点击关闭归档任务详情 定位归档任务详情确定按钮失败
|
||
|
Run Keyword If "${arch_status}"=="True" Exit For Loop
|
||
|
... ELSE Log 归档未完成
|
||
|
Sleep 30s
|
||
|
END
|
||
|
元素点击 Xpath=//td[text()="${archive_policy}"]/..//span[text()="详情"] 点击展开归档策略详情 定位归档策略详情失败
|
||
|
${arch_status} Run Keyword And Return Status Wait Until Element Is Visible Xpath=//td[text()="${random_strategyName}"]/..//td[contains(text(),"${Num_GD}/0")]
|
||
|
Run Keyword If "${arch_status}"=="True" Log 归档完成
|
||
|
... ELSE Fail 归档未完成
|
||
|
元素点击 ${Close_Arch_More} 点击关闭归档任务详情 定位归档任务详情确定按钮失败
|
||
|
|
||
|
添加副本归档策略_黑方重启
|
||
|
[Arguments] ${GD_Tape} # 归档备份范围
|
||
|
元素点击 ${Archive} 点击进入创建归档策略栏 定位左侧创建归档策略栏失败
|
||
|
Sleep 2s
|
||
|
循环点击 ${Add_Archive_Policy} ${CDM_Policy}
|
||
|
元素点击 ${CDM_Policy} 选择创建副本归档策略 定位副本数据管理选项失败
|
||
|
${archive_policy} catenate SEPARATOR=_ CDM_ ${random_strategyName}
|
||
|
元素输入 ${Input_Arch_Policy} ${archive_policy} 定位归档策略名称输入框失败
|
||
|
元素点击 xpath=//span[text()="${random_strategyName}"]/../../td[2] 勾选指定备份策略 定位要归档的备份策略失败
|
||
|
元素点击 ${Add_To_Right} 点击添加将策略添加到右侧 定位添加按钮失败
|
||
|
元素点击 ${Next_Step} 点击下一步进入选项页面 定位下一步按钮失败
|
||
|
Run Keyword If '${GD_Tape}'=='CLZL' Click Element ${Option_CLZL}
|
||
|
... ELSE IF '${GD_Tape}'=='ZL' Click Element ${Optiob_ZL}
|
||
|
... ELSE IF '${GD_Tape}'=='CL' Click Element ${Option_CL}
|
||
|
... ELSE Fail 归档类型输入错误
|
||
|
Sleep 2s
|
||
|
元素点击 ${Complete_Arch_Policy} 点击完成结束归档策略创建 定位完成按钮失败
|
||
|
元素点击 ${Success_Confirm} 二次确认策略创建成功 定位策略创建成功弹窗失败
|
||
|
元素点击 xpath=//td[text()="${archive_policy}"]/..//span[text()="启动"] 点击启动归档策略 定位归档策略启动按钮失败
|
||
|
元素点击 ${Success_Confirm} 归档任务启动成功 定位归档启动成功弹窗失败
|
||
|
Open Connection ${Plantform_BC_IP_Des}
|
||
|
SSHLibrary.Login ${Plantform_BC_Name} ${Plantform_BC_PWD}
|
||
|
Write reboot
|
||
|
Close Connection
|
||
|
Close All Browsers
|
||
|
Sleep 240s
|
||
|
Open Connection ${Plantform_BC_IP_Des}
|
||
|
SSHLibrary.Login ${Plantform_BC_Name} ${Plantform_BC_PWD}
|
||
|
Log 黑方连接成功
|
||
|
FOR ${n} IN RANGE 10
|
||
|
Execute Command systemctl status unabackup > /bc_status.txt
|
||
|
${bc_status} Execute Command grep "unabackup start success" /bc_status.txt
|
||
|
${bc_status_length} Get Length ${bc_status}
|
||
|
Run Keyword If ${bc_status_length}>0 Exit For Loop
|
||
|
... ELSE Log 黑方服务还未启动
|
||
|
Sleep 30s
|
||
|
END
|
||
|
Run Keyword If ${bc_status_length}==0 Fail
|
||
|
... ELSE Log 黑方服务已启动
|
||
|
Close Connection
|
||
|
登录黑方 ${Plantform_BC_Des_Url} ${Sys_Admin} ${WebPWD}
|
||
|
元素点击 ${Archive} 点击进入创建归档策略栏 定位左侧创建归档策略栏失败
|
||
|
FOR ${n} IN RANGE 10
|
||
|
元素点击 Xpath=//td[text()="${archive_policy}"]/..//span[text()="详情"] 点击展开归档策略详情 定位归档策略详情失败
|
||
|
${arch_status} Run Keyword And Return Status Wait Until Element Is Visible Xpath=//td[text()="${random_strategyName}"]/..//td[contains(text(),"2/0")]
|
||
|
元素点击 ${Close_Arch_More} 点击关闭归档任务详情 定位归档任务详情确定按钮失败
|
||
|
Run Keyword If "${arch_status}"=="True" Exit For Loop
|
||
|
... ELSE Log 归档未完成
|
||
|
Sleep 30s
|
||
|
END
|
||
|
元素点击 Xpath=//td[text()="${archive_policy}"]/..//span[text()="详情"] 点击展开归档策略详情 定位归档策略详情失败
|
||
|
${arch_status} Run Keyword And Return Status Wait Until Element Is Visible Xpath=//td[text()="${random_strategyName}"]/..//td[contains(text(),"2/0")]
|
||
|
Run Keyword If "${arch_status}"=="True" Log 归档完成
|
||
|
... ELSE Fail 归档未完成
|
||
|
元素点击 ${Close_Arch_More} 点击关闭归档任务详情 定位归档任务详情确定按钮失败
|
||
|
|
||
|
添加副本归档策略_磁带库重启
|
||
|
[Arguments] ${GD_Tape} # 归档备份范围
|
||
|
元素点击 ${Archive} 点击进入创建归档策略栏 定位左侧创建归档策略栏失败
|
||
|
Sleep 2s
|
||
|
循环点击 ${Add_Archive_Policy} ${CDM_Policy}
|
||
|
元素点击 ${CDM_Policy} 选择创建副本归档策略 定位副本数据管理选项失败
|
||
|
${archive_policy} catenate SEPARATOR=_ CDM_ ${random_strategyName}
|
||
|
元素输入 ${Input_Arch_Policy} ${archive_policy} 定位归档策略名称输入框失败
|
||
|
元素点击 xpath=//span[text()="${random_strategyName}"]/../../td[2] 勾选指定备份策略 定位要归档的备份策略失败
|
||
|
元素点击 ${Add_To_Right} 点击添加将策略添加到右侧 定位添加按钮失败
|
||
|
元素点击 ${Next_Step} 点击下一步进入选项页面 定位下一步按钮失败
|
||
|
Run Keyword If '${GD_Tape}'=='CLZL' Click Element ${Option_CLZL}
|
||
|
... ELSE IF '${GD_Tape}'=='ZL' Click Element ${Optiob_ZL}
|
||
|
... ELSE IF '${GD_Tape}'=='CL' Click Element ${Option_CL}
|
||
|
... ELSE Fail 归档类型输入错误
|
||
|
Sleep 2s
|
||
|
元素点击 ${Complete_Arch_Policy} 点击完成结束归档策略创建 定位完成按钮失败
|
||
|
元素点击 ${Success_Confirm} 二次确认策略创建成功 定位策略创建成功弹窗失败
|
||
|
元素点击 xpath=//td[text()="${archive_policy}"]/..//span[text()="启动"] 点击启动归档策略 定位归档策略启动按钮失败
|
||
|
元素点击 ${Success_Confirm} 归档任务启动成功 定位归档启动成功弹窗失败
|
||
|
Sleep 5s
|
||
|
Open Connection ${CDK_IP}
|
||
|
SSHLibrary.Login ${CDK_Name} ${CDK_Pwd}
|
||
|
Execute Command reboot
|
||
|
Close Connection
|
||
|
FOR ${n} IN RANGE 15
|
||
|
元素点击 Xpath=//td[text()="${archive_policy}"]/..//span[text()="详情"] 点击展开归档策略详情 定位归档策略详情失败
|
||
|
${arch_status} Run Keyword And Return Status Wait Until Element Is Visible Xpath=//td[text()="${random_strategyName}"]/..//td[contains(text(),"1/0")]
|
||
|
元素点击 ${Close_Arch_More} 点击关闭归档任务详情 定位归档任务详情确定按钮失败
|
||
|
Run Keyword If "${arch_status}"=="True" Exit For Loop
|
||
|
... ELSE Log 归档未完成
|
||
|
Sleep 30s
|
||
|
END
|
||
|
元素点击 Xpath=//td[text()="${archive_policy}"]/..//span[text()="详情"] 点击展开归档策略详情 定位归档策略详情失败
|
||
|
${arch_status} Run Keyword And Return Status Wait Until Element Is Visible Xpath=//td[text()="${random_strategyName}"]/..//td[contains(text(),"1/0")]
|
||
|
Run Keyword If "${arch_status}"=="True" Log 归档完成
|
||
|
... ELSE Fail 归档未完成
|
||
|
元素点击 ${Close_Arch_More} 点击关闭归档任务详情 定位归档任务详情确定按钮失败
|
||
|
|
||
|
备份集归档状态检测
|
||
|
[Arguments] ${Num_GD} # 已经归档备份集个数
|
||
|
元素点击 ${Archive} 点击进入创建归档策略栏 定位左侧创建归档策略栏失败
|
||
|
FOR ${n} IN RANGE 15
|
||
|
元素点击 Xpath=//td[text()="${archive_policy}"]/..//span[text()="详情"] 点击展开归档策略详情 定位归档策略详情失败
|
||
|
${arch_status} Run Keyword And Return Status Wait Until Element Is Visible Xpath=//td[text()="${random_strategyName}"]/..//td[contains(text(),"${Num_GD}/0")]
|
||
|
元素点击 ${Close_Arch_More} 点击关闭归档任务详情 定位归档任务详情确定按钮失败
|
||
|
Run Keyword If "${arch_status}"=="True" Exit For Loop
|
||
|
... ELSE Log 归档未完成
|
||
|
Sleep 30s
|
||
|
END
|
||
|
元素点击 Xpath=//td[text()="${archive_policy}"]/..//span[text()="详情"] 点击展开归档策略详情 定位归档策略详情失败
|
||
|
${arch_status} Run Keyword And Return Status Wait Until Element Is Visible Xpath=//td[text()="${random_strategyName}"]/..//td[contains(text(),"${Num_GD}/0")]
|
||
|
Run Keyword If "${arch_status}"=="True" Log 归档完成
|
||
|
... ELSE Fail 归档未完成
|
||
|
元素点击 ${Close_Arch_More} 点击关闭归档任务详情 定位归档任务详情确定按钮失败
|