diff options
Diffstat (limited to 'case/security/http/demo.robot')
| -rw-r--r-- | case/security/http/demo.robot | 97 |
1 files changed, 97 insertions, 0 deletions
diff --git a/case/security/http/demo.robot b/case/security/http/demo.robot new file mode 100644 index 0000000..7c63066 --- /dev/null +++ b/case/security/http/demo.robot @@ -0,0 +1,97 @@ +*** Settings ***
+Test Teardown DeletePolicyAndObjectAndOther
+Force Tags admission basic
+Library OperatingSystem
+Resource ../../../keyword/common/command.robot
+Resource ../../../keyword/objects/object.robot
+Resource ../../../keyword/policys/policy.robot
+Resource ../../../keyword/common/clear_data.robot
+Resource ../../../keyword/common/verify.robot
+*** Variables ***
+${createPolicyIds} ${EMPTY}
+${createObjectIds} ${EMPTY}
+
+*** Test Cases ***
+policy_http_allow
+ log ${TEST NAME}
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/http/demo_data.yaml ${TEST NAME}
+
+
+test_json
+ ${a} set variable {"datafomat": "complate", "opAction": "add", "returnData": 1, "objectList": [{"objectId": null, "objectType": "ip", "objectSubType": "endpoint", "isValid": 1, "isInitialize": 0, "isExclusion": 0, "objectName": "auttest\u5355ip\u6307\u5b9a\u7aef\u53e3", "objectDesc": "test", "subObjectIds": [null], "addItemList": [{"ip": "255.255.255.254", "port": "65535"}, {"ip": "255.255.255.254", "port": "65535"}], "updateItemList": [null], "deleteItemIds": [null], "iconColor": "#31739C"}]}
+
+ ${bodyJson} json.Loads ${a}
+ log ${bodyJson}
+
+ Replace String ${bodyJson} [null] []
+ log ${bodyJson}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+policy_dns_allow_ip_potol
+ [Tags] admission basic api adc
+ Comment 全流程:创建对象-》创建策略-》策略验证-》策略效果验证-》日志验证
+ log ${TEST NAME}
+ Comment 创建Allow策略
+ ${policyIds} CreatePolilcys ${path}/data/security/dns ${TEST NAME}.yaml ${TEST NAME}
+ ${objType} = Evaluate type(${policyIds})
+ #功能端验证
+ #Sleep ${policyVerificationSleepSeconds}s
+ Comment 策略验证
+
+ Comment 效果验证
+ ${windowsCommand} set variable nslookup -d www.facebook.com
+ ${LinuxCommand} set variable nslookup www.facebook.com
+ ${commandstr} run keyword if '${systemType}'=='Windows' set variable nslookup -d www.facebook.com
+ ... ELSE set variable nslookup www.facebook.com
+ ${stringlist} run keyword if '${systemType}'=='Windows' Create List www.facebook.com canonical name = star-mini.c10r.facebook.com。
+ ... ELSE Create List www.facebook.com canonical name = star-mini.c10r.facebook.com
+ ${rescode} SystemCommandContains ${commandstr} ${stringlist}
+ ${trueCounter} Run Keyword If '${rescode}'=='True' SystemCommandsRetry ${commandstr} ${stringlist}
+ ... ELSE set variable 1
+
+ ${rescode} Evaluate ${trueCounter}>${0}
+ ${lastRescode} Should Be Equal "${rescode}" "True"
+ #日志验证
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file |
