diff --git a/01-TestCase/zjj/DLL-DeviceID-Test.robot b/01-TestCase/zjj/DLL-DeviceID-Test.robot new file mode 100644 index 0000000..d8ba3c2 --- /dev/null +++ b/01-TestCase/zjj/DLL-DeviceID-Test.robot @@ -0,0 +1,41 @@ +*** Settings *** +Test Teardown DeletePolicyAndObject ${policyIds} ${objectids} +Force Tags zjj tsg_effectiveRange_deviceid +Library OperatingSystem +Resource ../../02-Keyword/tsg_adc/SystemCommand.robot +Resource ../../02-Keyword/tsg_bfapi/PolicyObject.robot +Resource ../../02-Keyword/tsg_bfapi/LogVariable.robot +Resource ../../02-Keyword/tsg_adc/FileOperation.robot +Resource ../../02-Keyword/tsg_adc/FileOperation.robot +Resource ../../02-Keyword/tsg_bfapi/policy_object/Policy.robot +##注意此文件中的测试用例需要修改ManagePolicyBocy.robot的内容EffectiveRangeValueType3函数的#${obj} Create Dictionary tag=location value=${valueList} 替换为${obj} Create Dictionary tag=device_id value=${valueList} + +*** Variables *** +${url} /v1/policy/profile/responsepages + +*** Test Cases *** +DLL-DeviceID-SecurityPolicy-Deny-Http-00001 + [Tags] fqdn + Comment 鍒涘缓fqdn + ${objectDict} Create Dictionary objectType=fqdn isValid=${1} addItemList=$webalta.ru + ${rescode} ${objectId} AddObject2 ${1} ${objectDict} + ${objectids} set Variable ${objectId} + #鍒涘缓 Deny 鎼厤Allow + Comment 鍒涘缓瀹夊叏绛栫暐 + ${policyDict} Create Dictionary policyName=DLL-DeviceID-SecurityPolicy-Deny-Http-00001 policyType=tsg_security policyDesc=autotest action=deny userRegion={"protocol":"HTTP","method":"drop"} effectiveRange=device_1 filterList=${objectId}|TSG_FIELD_HTTP_HOST isValid=${1} appIdObjects=2 + log ${policyDict} + ${rescode} ${policyId} AddPolicies 1 ${policyDict} v2 + ${policyIds1} set Variable {"policyType":"tsg_security","policyIds":[${policyId}]} + ${policyIds} Create List ${policyIds1} + ${starttime} Get Time + #鍔熻兘绔獙璇� + Sleep ${policyVerificationSleepSeconds}s + ${commandstr} run keyword if '${systemType}'=='Windows' set variable ${curlbatpath}/command/SecurityPolicy_Deny_HTTP_00001.bat + ... ELSE set variable curl http://webalta.ru/ + ${stringlist} run keyword if '${systemType}'=='Windows' Create List Connection was reset + ... ELSE Create List Connection reset by peer + ${endtime} Get Time + #鏃ュ織楠岃瘉 + ${s} Convert to String ${policyId} + GetLogList security_event_log ${deny_http_starttime} ${deny_http_endtime} ${testClentIP} ${s} http_host webalta.ru + \ No newline at end of file