修改策略验证case

This commit is contained in:
朱明明
2020-08-03 14:47:23 +08:00
parent e5ba387223
commit f5f1de9f00

View File

@@ -29,12 +29,13 @@ ${certId} ${EMPTY}
*** Test Cases *** *** Test Cases ***
VerifyProxy-Security-00001 VerifyProxy-Security-00001
# 新增 对象 # 新增 对象
# 创建源 ip # 创建源 ip
${rescodeip} ${object_Source_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"ip","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"source","objectDesc":"","subObjectIds":[],"addItemList":[{"ip":"192.168.50.25-192.168.50.25","ipIf":false,"portIf":false,"port":"0-65535","itemId":"","clientIp1":"","clientIp2":"","clientPort1":"0","clientPort2":"65535","clientIpFormat":"range","clientPortFormat":"range","addrType":4,"direction":0,"temporaryItemId":1595312834}],"updateItemList":[],"deleteItemIds":[],"objectId":"","iconColor":"","objectSubType":"endpoint"}} ${rescodeip} ${object_Source_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"ip","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"qwqweqw","objectDesc":"","subObjectIds":[],"addItemList":[{"ip":"192.168.50.25","ipIf":false,"portIf":false,"port":"0-65535","itemId":"","clientIp1":"192.168.50.25","clientIp2":"192.168.50.25","clientPort1":"0","clientPort2":"65535","clientIpFormat":"range","clientPortFormat":"range","addrType":4,"direction":0,"temporaryItemId":1596177068}],"updateItemList":[],"deleteItemIds":[],"iconColor":"#31739C","objectSubType":"endpoint"}}
${objectids} set Variable ${object_Source_Id} ${objectids} set Variable ${object_Source_Id}
# 创建目的ip # 创建目的ip
${rescodeip} ${object_Destination_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"ip","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"destination","objectDesc":"","subObjectIds":[],"addItemList":[{"ip":"254.253.252.251-254.253.252.251","ipIf":false,"portIf":false,"port":"0-65535","itemId":"","clientIp1":"","clientIp2":"","clientPort1":"0","clientPort2":"65535","clientIpFormat":"range","clientPortFormat":"range","addrType":4,"direction":0,"temporaryItemId":1595313199}],"updateItemList":[],"deleteItemIds":[],"objectId":"","iconColor":"","objectSubType":"endpoint"}} ${rescodeip} ${object_Destination_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"ip","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"1231231231231","objectDesc":"","subObjectIds":[],"addItemList":[{"ip":"254.253.252.251","ipIf":false,"portIf":false,"port":"0-65535","itemId":"","clientIp1":"254.253.252.251","clientIp2":"254.253.252.251","clientPort1":"0","clientPort2":"65535","clientIpFormat":"range","clientPortFormat":"range","addrType":4,"direction":0,"temporaryItemId":1596176949}],"updateItemList":[],"deleteItemIds":[],"iconColor":"#31739C","objectSubType":"endpoint"}}
${objectids} Catenate SEPARATOR=, ${objectids} ${object_Destination_Id} ${objectids} Catenate SEPARATOR=, ${objectids} ${object_Destination_Id}
#创建subid #创建subid
${rescodeip} ${object_SubId_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"subscriberid","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"subid","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["$test25"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[],"objectId":"","iconColor":""}} ${rescodeip} ${object_SubId_Id} AddObject {"opAction":"add","returnData":1,"objectList":{"objectType":"subscriberid","isValid":1,"isInitialize":0,"isExclusion":0,"objectName":"subid","objectDesc":"","subObjectIds":[],"addItemList":[{"keywordArray":["$test25"],"itemId":"","isHexbin":0}],"updateItemList":[],"deleteItemIds":[],"objectId":"","iconColor":""}}
@@ -57,7 +58,7 @@ VerifyProxy-Security-00001
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]} ${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
# 获取策略id # 获取策略id
log ${policyIds} log ${policyIds}
sleep 20 sleep 30
# 新增策略验证 # 新增策略验证
# 创建attributes中的字典 # 创建attributes中的字典
${sni} Create Dictionary attributeType=string attributeName=sni protocol=ssl attributeValue={"string": "verifytest"} ${sni} Create Dictionary attributeType=string attributeName=sni protocol=ssl attributeValue={"string": "verifytest"}
@@ -71,6 +72,7 @@ VerifyProxy-Security-00001
${attributes} Create List ${sni} ${san} ${cn} ${app_id} ${subscriberid} ${ipsource} ${ipdestination} ${attributes} Create List ${sni} ${san} ${cn} ${app_id} ${subscriberid} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes} ${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession} ${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log ${verifyList}
${rescode} ${resData} VerifyPolicies ${verifyList} ${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果 # 打印检查结果
# 将 策略id 加入对象 id # 将 策略id 加入对象 id
@@ -79,6 +81,8 @@ VerifyProxy-Security-00001
# ${objectids} Create List ${object_Source_Id} ${object_Destination_Id} ${object_SubId_Id} ${object_SNI_Id} ${object_SAN_Id} ${object_CN_Id} ${policyId} # ${objectids} Create List ${object_Source_Id} ${object_Destination_Id} ${object_SubId_Id} ${object_SNI_Id} ${object_SAN_Id} ${object_CN_Id} ${policyId}
# # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中 # # 调用关键字 提取应答json获取其中所有的id值并判断新下发的id值是否在应答json的id中
log 1111111111111111${objectid_verify}
log 222222222222222${resData}
${ok} VerifyProxy ${resData} ${objectid_verify} ${ok} VerifyProxy ${resData} ${objectid_verify}
# # ${ok} VerifyProxy ${objectids} ${resData} # # ${ok} VerifyProxy ${objectids} ${resData}
Should Be Equal As Strings ${ok} ture Should Be Equal As Strings ${ok} ture
@@ -146,7 +150,7 @@ VerifyProxy-Security-00002
${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]} ${policyIds} Create List {"policyType":"tsg_security","policyIds":[${policyId}]}
# # 获取策略id # # 获取策略id
log ${policyIds} log ${policyIds}
sleep 20 sleep 30
# # 新增策略验证 # # 新增策略验证
# 创建attributes中的字典 # 创建attributes中的字典
${url} Create Dictionary attributeType=string attributeName=url protocol=http attributeValue={"string": "verifytest"} ${url} Create Dictionary attributeType=string attributeName=url protocol=http attributeValue={"string": "verifytest"}
@@ -164,6 +168,9 @@ VerifyProxy-Security-00002
${attributes} Create List ${url} ${host} ${req_body} ${res_body} ${req_hdr_ua} ${req_hdr_ck} ${res_hdr_sc} ${res_hdr_ct} ${app_id} ${ipsource} ${ipdestination} ${attributes} Create List ${url} ${host} ${req_body} ${res_body} ${req_hdr_ua} ${req_hdr_ck} ${res_hdr_sc} ${res_hdr_ct} ${app_id} ${ipsource} ${ipdestination}
${verifySession} Create Dictionary attributes=${attributes} ${verifySession} Create Dictionary attributes=${attributes}
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession} ${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
log 111111111111111111111111111111
log ${verifyList}
log 11111111111111111111111111111
${rescode} ${resData} VerifyPolicies ${verifyList} ${rescode} ${resData} VerifyPolicies ${verifyList}
# 打印检查结果 # 打印检查结果
# 将 策略id 加入对象 id # 将 策略id 加入对象 id