调整verify关键字,兼容和界面提交verify提交json串一致的json串;但是界面提交的json串和接口文档不一致
This commit is contained in:
@@ -476,11 +476,13 @@ Policy-Verify-v1-00020
|
|||||||
${objectIds} Set Variable ${EMPTY}
|
${objectIds} Set Variable ${EMPTY}
|
||||||
Comment 创建对象
|
Comment 创建对象
|
||||||
${ipValue} Create Dictionary ip=192.168.41.67 port=${1}
|
${ipValue} Create Dictionary ip=192.168.41.67 port=${1}
|
||||||
... addrType=${4} protocol=${6}
|
... addrType=${4} protocol=${6} tableName=TSG_SECURITY_SOURCE_ADDR
|
||||||
${ipObj} Create Dictionary attributeType=ip tableName=TSG_OBJ_IP_ADDR protocol=HTTP attributeName=source
|
${ipValue1} Create Dictionary ip=192.168.41.687 port=${1}
|
||||||
... attributeValue=${ipValue}
|
... addrType=${4} protocol=${6} tableName=TSG_SECURITY_DESTINATION_ADDR
|
||||||
${ipObj1} Create Dictionary attributeType=ip tableName=TSG_OBJ_IP_ADDR protocol=HTTP attributeName=destination
|
${ipObj} Create Dictionary attributeType=ip protocol=HTTP attributeName=source
|
||||||
... attributeValue=${ipValue}
|
... attributeValue=${ipValue}
|
||||||
|
${ipObj1} Create Dictionary attributeType=ip protocol=HTTP attributeName=destination
|
||||||
|
... attributeValue=${ipValue2}
|
||||||
${stringValue} Create Dictionary string=*baidu.com
|
${stringValue} Create Dictionary string=*baidu.com
|
||||||
${stringObj} Create Dictionary attributeType=string tableName=TSG_OBJ_URL protocol=HTTP attributeName=url
|
${stringObj} Create Dictionary attributeType=string tableName=TSG_OBJ_URL protocol=HTTP attributeName=url
|
||||||
... attributeValue=${stringValue}
|
... attributeValue=${stringValue}
|
||||||
@@ -494,10 +496,10 @@ Policy-Verify-v1-00020
|
|||||||
Policy-Verify-v1-00021
|
Policy-Verify-v1-00021
|
||||||
${objectIds} Set Variable ${EMPTY}
|
${objectIds} Set Variable ${EMPTY}
|
||||||
Comment 创建对象
|
Comment 创建对象
|
||||||
${ipObj} Create Dictionary attributeType=ip tableName=TSG_OBJ_IP_ADDR protocol=HTTP attributeName=source
|
${ipObj} Create Dictionary attributeType=ip tableName=TSG_SECURITY_SOURCE_ADDR protocol=HTTP attributeName=source
|
||||||
... attributeValue={"ip":"192.168.41.67","port":1,"addrType":4,"protocol":6}
|
|
||||||
${ipObj1} Create Dictionary attributeType=ip tableName=TSG_OBJ_IP_ADDR protocol=HTTP attributeName=destination
|
|
||||||
... attributeValue={"ip":"192.168.41.67","port":1,"addrType":4,"protocol":6}
|
... attributeValue={"ip":"192.168.41.67","port":1,"addrType":4,"protocol":6}
|
||||||
|
${ipObj1} Create Dictionary attributeType=ip tableName=TSG_SECURITY_DESTINATION_ADDR protocol=HTTP attributeName=destination
|
||||||
|
... attributeValue={"ip":"192.168.41.68","port":1,"addrType":4,"protocol":6}
|
||||||
${stringValue} Create Dictionary string=*baidu.com
|
${stringValue} Create Dictionary string=*baidu.com
|
||||||
${stringObj} Create Dictionary attributeType=string tableName=TSG_OBJ_URL protocol=HTTP attributeName=url
|
${stringObj} Create Dictionary attributeType=string tableName=TSG_OBJ_URL protocol=HTTP attributeName=url
|
||||||
... attributeValue=${stringValue}
|
... attributeValue=${stringValue}
|
||||||
@@ -511,10 +513,10 @@ Policy-Verify-v1-00021
|
|||||||
Policy-Verify-v1-00022
|
Policy-Verify-v1-00022
|
||||||
${objectIds} Set Variable ${EMPTY}
|
${objectIds} Set Variable ${EMPTY}
|
||||||
Comment 创建对象
|
Comment 创建对象
|
||||||
${ipObj} Create Dictionary attributeType=ip tableName=TSG_OBJ_IP_ADDR protocol=HTTP attributeName=destination
|
${ipObj} Create Dictionary attributeType=ip protocol=HTTP attributeName=destination
|
||||||
... attributeValue={"ip":"192.168.41.67","port":1,"addrType":4,"protocol":6}
|
... attributeValue={"ip":"192.168.41.67","port":1,"addrType":4,"protocol":6,"tableName":"TSG_SECURITY_DESTINATION_ADDR"}
|
||||||
${ipObj1} Create Dictionary attributeType=ip tableName=TSG_OBJ_IP_ADDR protocol=HTTP attributeName=source
|
${ipObj1} Create Dictionary attributeType=ip protocol=HTTP attributeName=source
|
||||||
... attributeValue={"ip":"192.168.41.67","port":1,"addrType":4,"protocol":6}
|
... attributeValue={"ip":"192.168.41.68","port":1,"addrType":4,"protocol":6,"tableName":"TSG_SECURITY_SOURCE_ADDR"}
|
||||||
${stringObj} Create Dictionary attributeType=string tableName=TSG_OBJ_URL protocol=HTTP attributeName=url
|
${stringObj} Create Dictionary attributeType=string tableName=TSG_OBJ_URL protocol=HTTP attributeName=url
|
||||||
... attributeValue={'string':'*baidu.com'}
|
... attributeValue={'string':'*baidu.com'}
|
||||||
${appIdValue} Create Dictionary string=http.
|
${appIdValue} Create Dictionary string=http.
|
||||||
@@ -528,15 +530,38 @@ Policy-Verify-v1-00022
|
|||||||
Policy-Verify-v1-00023
|
Policy-Verify-v1-00023
|
||||||
${objectIds} Set Variable ${EMPTY}
|
${objectIds} Set Variable ${EMPTY}
|
||||||
Comment 创建对象
|
Comment 创建对象
|
||||||
${ipObj} Create Dictionary attributeType=ip tableName=TSG_OBJ_IP_ADDR protocol=HTTP attributeName=source
|
${ipObj} Create Dictionary attributeType=ip tableName=TSG_SECURITY_SOURCE_ADDR attributeName=source
|
||||||
... attributeValue=192.168.41.67|1|4|6
|
... attributeValue=192.168.41.67|1|4|6
|
||||||
|
${ipObj1} Create Dictionary attributeType=ip tableName=TSG_SECURITY_DESTINATION_ADDR attributeName=destination
|
||||||
|
... attributeValue=192.168.41.68|1|4|6
|
||||||
${stringObj} Create Dictionary attributeType=string tableName=TSG_OBJ_URL protocol=HTTP attributeName=url
|
${stringObj} Create Dictionary attributeType=string tableName=TSG_OBJ_URL protocol=HTTP attributeName=url
|
||||||
... attributeValue=*baidu.com
|
... attributeValue=*baidu.com
|
||||||
|
${stringObj1} Create Dictionary attributeType=string protocol=HTTP attributeName=url
|
||||||
|
... attributeValue=*jd.com
|
||||||
${appIdObj} Create Dictionary attributeType=string protocol=HTTP attributeName=app_id
|
${appIdObj} Create Dictionary attributeType=string protocol=HTTP attributeName=app_id
|
||||||
... attributeValue=http.
|
... attributeValue=http.
|
||||||
${signatureObj} Create Dictionary attributeType=signature protocol=HTTP attributeName=req_body
|
${signatureObj} Create Dictionary attributeType=signature protocol=HTTP attributeName=req_body
|
||||||
... attributeValue=Content-Type|application/json
|
... attributeValue=Content-Type|application/json
|
||||||
${attributes} Create List ${ipObj} ${stringObj} ${appIdObj} ${signatureObj}
|
${attributes} Create List ${ipObj} ${stringObj} ${appIdObj} ${signatureObj} ${ipObj1} ${stringObj1}
|
||||||
|
${verifySession} Create Dictionary attributes=${attributes}
|
||||||
|
${verifyList} Create Dictionary policyType=tsg_security verifySession=${verifySession}
|
||||||
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
Policy-Verify-v1dxy
|
||||||
|
${objectIds} Set Variable ${EMPTY}
|
||||||
|
Comment 创建对象
|
||||||
|
${ipObj} Create Dictionary attributeType=ip attributeName=source
|
||||||
|
... attributeValue=192.168.41.67|1|4|6|TSG_SECURITY_SOURCE_ADDR
|
||||||
|
${ipObj1} Create Dictionary attributeType=ip attributeName=destination
|
||||||
|
... attributeValue=192.168.41.68|1|4|6|TSG_SECURITY_DESTINATION_ADDR
|
||||||
|
${stringObj} Create Dictionary attributeType=string tableName=TSG_OBJ_URL protocol=HTTP attributeName=url
|
||||||
|
... attributeValue=*baidu.com
|
||||||
|
${stringObj1} Create Dictionary attributeType=string protocol=HTTP attributeName=url
|
||||||
|
... attributeValue=*jd.com
|
||||||
|
${appIdObj} Create Dictionary attributeType=string protocol=HTTP attributeName=app_id
|
||||||
|
... attributeValue=http.
|
||||||
|
${signatureObj} Create Dictionary attributeType=signature protocol=HTTP attributeName=req_body
|
||||||
|
... attributeValue=Content-Type|application/json
|
||||||
|
${attributes} Create List ${ipObj} ${stringObj} ${appIdObj} ${signatureObj} ${ipObj1} ${stringObj1}
|
||||||
${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}
|
||||||
${rescode} ${resData} VerifyPolicies ${verifyList}
|
${rescode} ${resData} VerifyPolicies ${verifyList}
|
||||||
|
|||||||
@@ -436,15 +436,31 @@ ManageIpAttributeValue
|
|||||||
Run Keyword If "${port}"=="${EMPTY}" and "${attributeName}"=="destination" Should Not Be Empty ${port}
|
Run Keyword If "${port}"=="${EMPTY}" and "${attributeName}"=="destination" Should Not Be Empty ${port}
|
||||||
Set To Dictionary ${dict} port=${port}
|
Set To Dictionary ${dict} port=${port}
|
||||||
${return} ${addrType} Run Keyword And Ignore Error Set Variable ${attributeValue['addrType']}
|
${return} ${addrType} Run Keyword And Ignore Error Set Variable ${attributeValue['addrType']}
|
||||||
Run Keyword If "${port}"=="${EMPTY}" and "${attributeName}"=="source" Should Not Be Empty ${addrType}
|
Run Keyword If "${addrType}"=="${EMPTY}" and "${attributeName}"=="source" Should Not Be Empty ${addrType}
|
||||||
Run Keyword If "${port}"=="${EMPTY}" and "${attributeName}"=="destination" Should Not Be Empty ${addrType}
|
Run Keyword If "${addrType}"=="${EMPTY}" and "${attributeName}"=="destination" Should Not Be Empty ${addrType}
|
||||||
Set To Dictionary ${dict} addrType=${addrType}
|
Set To Dictionary ${dict} addrType=${addrType}
|
||||||
${return} ${protocol} Run Keyword And Ignore Error Set Variable ${attributeValue['protocol']}
|
${return} ${protocol} Run Keyword And Ignore Error Set Variable ${attributeValue['protocol']}
|
||||||
Run Keyword If "${port}"=="${EMPTY}" and "${attributeName}"=="source" Should Not Be Empty ${protocol}
|
Run Keyword If "${protocol}"=="${EMPTY}" and "${attributeName}"=="source" Should Not Be Empty ${protocol}
|
||||||
Run Keyword If "${port}"=="${EMPTY}" and "${attributeName}"=="destination" Should Not Be Empty ${protocol}
|
Run Keyword If "${protocol}"=="${EMPTY}" and "${attributeName}"=="destination" Should Not Be Empty ${protocol}
|
||||||
Set To Dictionary ${dict} protocol=${protocol}
|
Set To Dictionary ${dict} protocol=${protocol}
|
||||||
|
${return} ${tableName} Run Keyword And Ignore Error Set Variable ${attributeValue['tableName']}
|
||||||
|
Run Keyword If "${tableName}"=="${EMPTY}" and "${attributeName}"=="source" Should Not Be Empty ${tableName}
|
||||||
|
Run Keyword If "${tableName}"=="${EMPTY}" and "${attributeName}"=="destination" Should Not Be Empty ${tableName}
|
||||||
|
Set To Dictionary ${dict} tableName=${tableName}
|
||||||
[Return] ${dict}
|
[Return] ${dict}
|
||||||
ExtractIpAttributeValue
|
ExtractIpAttributeValue
|
||||||
|
[Arguments] ${attributeValue}
|
||||||
|
${list} Split String ${attributeValue} |
|
||||||
|
${len} Get Length ${list}
|
||||||
|
Should Be Equal As Integers ${len} 5
|
||||||
|
${addrType} Evaluate int(${list}[2])
|
||||||
|
${protocol} Set Variable ${list}[3]
|
||||||
|
${tableName} Set Variable ${list}[4]
|
||||||
|
${dict} Create Dictionary ip=${list}[0] port=${list}[1] tableName=${tableName}
|
||||||
|
... addrType=${addrType} protocol=${protocol}
|
||||||
|
[Return] ${dict}
|
||||||
|
|
||||||
|
ExtractIpAttributeValue_bak
|
||||||
[Arguments] ${attributeValue}
|
[Arguments] ${attributeValue}
|
||||||
${list} Split String ${attributeValue} |
|
${list} Split String ${attributeValue} |
|
||||||
${len} Get Length ${list}
|
${len} Get Length ${list}
|
||||||
|
|||||||
Reference in New Issue
Block a user