summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author何冰凝 <[email protected]>2022-10-27 19:01:23 +0800
committer何冰凝 <[email protected]>2022-10-27 19:01:23 +0800
commit2c9bc1b4f93f9e1e5b1edca1057730f97d2657de (patch)
tree8c9abeebf08e72ec33144a1206dffc32e556783d
parentf529bf6b15cf0c8bc4ac67f80d5e9c05c7d64549 (diff)
1、提交Mvsys创建拦截策略的逻辑。2、拆分dns和ftp协议case
-rw-r--r--case/policies/proxy/http.robot122
-rw-r--r--case/policies/security/dns.robot60
-rw-r--r--case/policies/security/ftp.robot136
-rw-r--r--keyword/common/clear_data.robot10
-rw-r--r--keyword/common/functional_keywords.robot41
-rw-r--r--keyword/common/login_logout.robot28
-rw-r--r--keyword/objects/object.robot43
-rw-r--r--keyword/objects/process_object_body.robot4
-rw-r--r--keyword/policys/policy.robot49
-rw-r--r--keyword/policys/process_policy_body.robot6
-rw-r--r--keyword/profiles/profile.robot118
-rw-r--r--keyword/system/iplibraries.robot5
-rw-r--r--other/data/proxy/http/proxy-http-allow-fqdn-url-reqheader-resheader-data.yaml22
13 files changed, 420 insertions, 224 deletions
diff --git a/case/policies/proxy/http.robot b/case/policies/proxy/http.robot
index 557e03d..50c4795 100644
--- a/case/policies/proxy/http.robot
+++ b/case/policies/proxy/http.robot
@@ -1,7 +1,7 @@
*** Settings ***
Test Setup LoginAndAddLocalIP 1
Test Teardown Run Keywords
-... DeletePolicyAndObjectAndOther
+... DeletePolicyAndObjectAndOther
... AND LogoutAndDelLocalIP 1
Force Tags WholeProcess Serial
Library OperatingSystem
@@ -14,253 +14,253 @@ Resource ${EXECDIR}/keyword/common/login_logout_switch.robot
${createPolicyIds} ${EMPTY}
${createObjectIds} ${EMPTY}
+
*** Test Cases ***
allow-fqdn-suffix
- [Tags] SingleFiler
+ [Tags] SingleFiler Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-allow-fqdn-suffix-data.yaml ${TEST NAME}
allow-fqdn-exactly
- [Tags] SingleFiler
+ [Tags] SingleFiler Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-allow-fqdn-exactly-data.yaml ${TEST NAME}
allow-url-suffix
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-allow-url-suffix-data.yaml ${TEST NAME}
allow-url-prefix
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-allow-url-prefix-data.yaml ${TEST NAME}
allow-url-substring
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-allow-url-substring-data.yaml ${TEST NAME}
allow-url-exactly
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-allow-url-exactly-data.yaml ${TEST NAME}
allow-reqheader-prefix
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-allow-reqheader-prefix-data.yaml ${TEST NAME}
allow-reqheader-substring
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-allow-reqheader-substring-data.yaml ${TEST NAME}
allow-resheader-prefix
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-allow-resheader-prefix-data.yaml ${TEST NAME}
allow-resheader-substring
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-allow-resheader-substring-data.yaml ${TEST NAME}
allow-fqdn-url-reqheader-resheader
- [Tags] MultiFilter
+ [Tags] MultiFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-allow-fqdn-url-reqheader-resheader-data.yaml ${TEST NAME}
-
deny-fqdn-suffix
- [Tags] SingleFiler
+ [Tags] SingleFiler Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-deny-fqdn-suffix-data.yaml ${TEST NAME}
deny-fqdn-exactly
- [Tags] SingleFiler
+ [Tags] SingleFiler Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-deny-fqdn-exactly-data.yaml ${TEST NAME}
deny-url-suffix
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-deny-url-suffix-data.yaml ${TEST NAME}
deny-url-prefix
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-deny-url-prefix-data.yaml ${TEST NAME}
deny-url-substring
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-deny-url-substring-data.yaml ${TEST NAME}
deny-url-exactly
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-deny-url-exactly-data.yaml ${TEST NAME}
deny-reqheader-prefix
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-deny-reqheader-prefix-data.yaml ${TEST NAME}
deny-reqheader-substring
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-deny-reqheader-substring-data.yaml ${TEST NAME}
deny-resheader-prefix
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-deny-resheader-prefix-data.yaml ${TEST NAME}
deny-resheader-substring
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-deny-resheader-substring-data.yaml ${TEST NAME}
deny-reqbody-substring
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-deny-reqbody-substring-data.yaml ${TEST NAME}
deny-resbody-substring
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-deny-resbody-substring-data.yaml ${TEST NAME}
deny-fqdn-url-reqheader-resheader-reqbody-resbody
- [Tags] MultiFilter
+ [Tags] MultiFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-deny-fqdn-url-reqheader-resheader-reqbody-resbody-data.yaml ${TEST NAME}
monitor-fqdn-suffix
- [Tags] SingleFiler
+ [Tags] SingleFiler Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-monitor-fqdn-suffix-data.yaml ${TEST NAME}
monitor-fqdn-exactly
- [Tags] SingleFiler
+ [Tags] SingleFiler Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-monitor-fqdn-exactly-data.yaml ${TEST NAME}
monitor-url-suffix
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-monitor-url-suffix-data.yaml ${TEST NAME}
monitor-url-prefix
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-monitor-url-prefix-data.yaml ${TEST NAME}
monitor-url-substring
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-monitor-url-substring-data.yaml ${TEST NAME}
monitor-url-exactly
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-monitor-url-exactly-data.yaml ${TEST NAME}
monitor-reqheader-prefix
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-monitor-reqheader-prefix-data.yaml ${TEST NAME}
monitor-reqheader-substring
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-monitor-reqheader-substring-data.yaml ${TEST NAME}
monitor-resheader-prefix
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-monitor-resheader-prefix-data.yaml ${TEST NAME}
monitor-resheader-substring
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-monitor-resheader-substring-data.yaml ${TEST NAME}
monitor-reqbody-substring
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-monitor-reqbody-substring-data.yaml ${TEST NAME}
monitor-resbody-substring
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-monitor-resbody-substring-data.yaml ${TEST NAME}
monitor-fqdn-url-reqheader-resheader-reqbody-resbody
- [Tags] MultiFilter
+ [Tags] MultiFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-monitor-fqdn-url-reqheader-resheader-reqbody-resbody-data.yaml ${TEST NAME}
redirect-url-fqdn
- [Tags] MultiFilter
+ [Tags] MultiFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-redirect-url-fqdn-data.yaml ${TEST NAME}
redirect-url-reqheader
- [Tags] SingleFilter
+ [Tags] SingleFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-redirect-url-reqheader-data.yaml ${TEST NAME}
redirect-url-resheader
- [Tags] MultiFilter
+ [Tags] MultiFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-redirect-url-resheader-data.yaml ${TEST NAME}
redirect-url-reqbody
- [Tags] MultiFilter
+ [Tags] MultiFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-redirect-url-reqbody-data.yaml ${TEST NAME}
replace-url-fqdn
- [Tags] MultiFilter
+ [Tags] MultiFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-replace-url-fqdn-data.yaml ${TEST NAME}
replace-url-reqheader
- [Tags] MultiFilter
+ [Tags] MultiFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-replace-url-reqheader-data.yaml ${TEST NAME}
replace-url-resheader
- [Tags] MultiFilter
+ [Tags] MultiFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-replace-url-resheader-data.yaml ${TEST NAME}
hijack-url-fqdn
- [Tags] MultiFilter
+ [Tags] MultiFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-hijack-url-fqdn-data.yaml ${TEST NAME}
hijack-url-reqheader
- [Tags] MultiFilter
+ [Tags] MultiFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-hijack-url-reqheader-data.yaml ${TEST NAME}
hijack-url-resheader
- [Tags] MultiFilter
+ [Tags] MultiFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-hijack-url-resheader-data.yaml ${TEST NAME}
insert-url-fqdn
- [Tags] MultiFilter
+ [Tags] MultiFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-insert-url-fqdn-data.yaml ${TEST NAME}
insert-url-reqheader
- [Tags] MultiFilter
+ [Tags] MultiFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-insert-url-reqheader-data.yaml ${TEST NAME}
insert-url-resheader
- [Tags] MultiFilter
+ [Tags] MultiFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-insert-url-resheader-data.yaml ${TEST NAME}
edit_element-url-fqdn
- [Tags] MultiFilter
+ [Tags] MultiFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-edit_element-url-fqdn-data.yaml ${TEST NAME}
edit_element-url-reqheader
- [Tags] MultiFilter
+ [Tags] MultiFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-edit_element-url-reqheader-data.yaml ${TEST NAME}
edit_element-url-resheader
- [Tags] MultiFilter
+ [Tags] MultiFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-edit_element-url-resheader-data.yaml ${TEST NAME}
edit_element-url-reqbody
- [Tags] MultiFilter
+ [Tags] MultiFilter Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-edit_element-url-reqbody-data.yaml ${TEST NAME}
run_script-url
- [Tags] SingleFilter RunScript
+ [Tags] SingleFilter RunScript Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-run_script-url-data.yaml ${TEST NAME}
run_script-host-url
- [Tags] MultiFilter RunScript
+ [Tags] MultiFilter RunScript Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-run_script-host-url-data.yaml ${TEST NAME}
run_script-host-url-reqheader
- [Tags] MultiFilter RunScript
+ [Tags] MultiFilter RunScript Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-run_script-host-url-reqheader-data.yaml ${TEST NAME}
run_script-host-url-resheader
- [Tags] MultiFilter RunScript
+ [Tags] MultiFilter RunScript Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-run_script-host-url-resheader-data.yaml ${TEST NAME}
run_script-host-url-reqheader-resheader
- [Tags] MultiFilter RunScript
+ [Tags] MultiFilter RunScript Proxy
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/proxy/http/proxy-http-run_script-host-url-reqheader-resheader-data.yaml ${TEST NAME}
diff --git a/case/policies/security/dns.robot b/case/policies/security/dns.robot
index 02161c2..e809ec3 100644
--- a/case/policies/security/dns.robot
+++ b/case/policies/security/dns.robot
@@ -31,7 +31,19 @@ allow-fqdn-suffix
# [Tags] OnlyApplication Famous sites
# ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/dns/security-dns-allow-only-application-data.yaml ${TEST NAME}
-deny-only-IpAndApplication
+deny-drop-only-IpAndApplication
+ [Tags] OnlySourceAndApp OnlyApplication
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/dns/security-dns-deny-only-IpAndApplication-data.yaml ${TEST NAME}
+
+deny-tamper-only-IpAndApplication
+ [Tags] OnlySourceAndApp OnlyApplication
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/dns/security-dns-deny-only-IpAndApplication-data.yaml ${TEST NAME}
+
+deny-drop-sendicmp-only-IpAndApplication
+ [Tags] OnlySourceAndApp OnlyApplication
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/dns/security-dns-deny-only-IpAndApplication-data.yaml ${TEST NAME}
+
+deny-redirect-only-IpAndApplication
[Tags] OnlySourceAndApp OnlyApplication
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/dns/security-dns-deny-only-IpAndApplication-data.yaml ${TEST NAME}
@@ -39,12 +51,48 @@ deny-only-IpAndApplication
# [Tags] OnlyApplication Famous sites
# ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/dns/security-dns-deny-only-application-data.yaml ${TEST NAME}
-deny-fqdn-suffix
- [Tags] WholeProcess Parallel Drop Tamper RateLimit
+deny-drop-fqdn-suffix
+ [Tags] WholeProcess Parallel Drop Tamper
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/dns/security-dns-deny-fqdn-suffix-data.yaml ${TEST NAME}
+
+deny-tamper-fqdn-suffix
+ [Tags] WholeProcess Parallel Drop Tamper
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/dns/security-dns-deny-fqdn-suffix-data.yaml ${TEST NAME}
+
+deny-drop-sendIcmp-fqdn-suffix
+ [Tags] WholeProcess Parallel Drop Tamper
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/dns/security-dns-deny-fqdn-suffix-data.yaml ${TEST NAME}
+
+deny-redirect-fqdn-suffix
+ [Tags] WholeProcess Parallel Drop Tamper
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/dns/security-dns-deny-fqdn-suffix-data.yaml ${TEST NAME}
+
+deny-drop-noLog-fqdn-suffix
+ [Tags] WholeProcess Parallel Drop Tamper
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/dns/security-dns-deny-fqdn-suffix-data.yaml ${TEST NAME}
-deny-fqdn-exactly
- [Tags] WholeProcess Parallel Drop Tamper RateLimit
+deny-drop-fqdn-exactly
+ [Tags] WholeProcess Parallel Drop Tamper
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/dns/security-dns-deny-fqdn-exactly-data.yaml ${TEST NAME}
+
+deny-tamper-fqdn-exactly
+ [Tags] WholeProcess Parallel Drop Tamper
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/dns/security-dns-deny-fqdn-exactly-data.yaml ${TEST NAME}
+
+deny-drop-sendIcmp-fqdn-exactly
+ [Tags] WholeProcess Parallel Drop Tamper
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/dns/security-dns-deny-fqdn-exactly-data.yaml ${TEST NAME}
+
+deny-redirect-fqdn-exactly
+ [Tags] WholeProcess Parallel Drop Tamper
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/dns/security-dns-deny-fqdn-exactly-data.yaml ${TEST NAME}
+
+deny-drop-noLog-fqdn-exactly
+ [Tags] WholeProcess Parallel Drop Tamper
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/dns/security-dns-deny-fqdn-exactly-data.yaml ${TEST NAME}
+
+deny-drop-capture-fqdn-exactly
+ [Tags] WholeProcess Parallel Drop Tamper
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/dns/security-dns-deny-fqdn-exactly-data.yaml ${TEST NAME}
monitor-only-IpAndApplication
@@ -79,6 +127,4 @@ monitor-dns-log-verify
-
-
\ No newline at end of file
diff --git a/case/policies/security/ftp.robot b/case/policies/security/ftp.robot
index 6d92f91..ac74d4c 100644
--- a/case/policies/security/ftp.robot
+++ b/case/policies/security/ftp.robot
@@ -87,7 +87,19 @@ allow-uri-account-content
[Tags] MultiFilter
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-allow-uri-account-content-data.yaml ${TEST NAME}
-deny-only-IpAndApplication
+deny-reset-only-IpAndApplication
+ [Tags] OnlySourceAndApp OnlyApplication
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-only-IpAndApplication-data.yaml ${TEST NAME}
+
+deny-rateLittle-only-IpAndApplication
+ [Tags] OnlySourceAndApp OnlyApplication
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-only-IpAndApplication-data.yaml ${TEST NAME}
+
+deny-rateBig-only-IpAndApplication
+ [Tags] OnlySourceAndApp OnlyApplication
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-only-IpAndApplication-data.yaml ${TEST NAME}
+
+deny-tamper-only-IpAndApplication
[Tags] OnlySourceAndApp OnlyApplication
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-only-IpAndApplication-data.yaml ${TEST NAME}
@@ -95,53 +107,147 @@ deny-only-IpAndApplication
# [Tags] OnlyApplication
# ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-only-application-data.yaml ${TEST NAME}
-deny-uri-suffix
+deny-reset-uri-suffix
[Tags] Reset Tamper RateLimit
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-uri-suffix-data.yaml ${TEST NAME}
-deny-uri-prefix
+deny-reset-update-rateLittle-uri-prefix
+ [Tags] Reset Tamper RateLimit
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-uri-prefix-data.yaml ${TEST NAME}
+
+deny-rateLittle-uri-prefix
+ [Tags] Reset Tamper RateLimit
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-uri-prefix-data.yaml ${TEST NAME}
+
+deny-rateBig-uri-prefix
+ [Tags] Reset Tamper RateLimit
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-uri-prefix-data.yaml ${TEST NAME}
+
+deny-tamper-uri-prefix
+ [Tags] Reset Tamper RateLimit
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-uri-prefix-data.yaml ${TEST NAME}
+
+deny-reset-noLog-uri-prefix
[Tags] Reset Tamper RateLimit
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-uri-prefix-data.yaml ${TEST NAME}
-deny-uri-substring
+deny-reset-update-rateLittle-uri-substring
+ [Tags] Reset Tamper RateLimit
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-uri-substring-data.yaml ${TEST NAME}
+
+deny-rateLittle-uri-substring
+ [Tags] Reset Tamper RateLimit
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-uri-substring-data.yaml ${TEST NAME}
+
+deny-rateBig-uri-substring
+ [Tags] Reset Tamper RateLimit
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-uri-substring-data.yaml ${TEST NAME}
+
+deny-tamper-uri-substring
[Tags] Reset Tamper RateLimit
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-uri-substring-data.yaml ${TEST NAME}
-deny-uri-exactly
+deny-reset-uri-exactly
+ [Tags] Reset Tamper RateLimit
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-uri-exactly-data.yaml ${TEST NAME}
+
+deny-rateLittle-uri-exactly
[Tags] Reset Tamper RateLimit
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-uri-exactly-data.yaml ${TEST NAME}
-deny-content-suffix
+deny-rateBig-uri-exactly
+ [Tags] Reset Tamper RateLimit
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-uri-exactly-data.yaml ${TEST NAME}
+
+deny-tamper-uri-exactly
+ [Tags] Reset Tamper RateLimit
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-uri-exactly-data.yaml ${TEST NAME}
+
+deny-reset-content-suffix
[Tags] Reset Tamper RateLimit
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-content-suffix-data.yaml ${TEST NAME}
-deny-content-prefix
+deny-rateBig-content-suffix
+ [Tags] Reset Tamper RateLimit
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-content-suffix-data.yaml ${TEST NAME}
+
+deny-tamper-content-suffix
+ [Tags] Reset Tamper RateLimit
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-content-suffix-data.yaml ${TEST NAME}
+
+deny-reset-noLog-content-suffix
+ [Tags] Reset Tamper RateLimit
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-content-suffix-data.yaml ${TEST NAME}
+
+deny-reset-content-prefix
[Tags] Reset Tamper RateLimit
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-content-prefix-data.yaml ${TEST NAME}
+
+deny-tamper-content-prefix
+ [Tags] Reset Tamper RateLimit
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-content-prefix-data.yaml ${TEST NAME}
+
+
-deny-content-substring
+deny-reset-content-substring
[Tags] Reset Tamper RateLimit
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-content-substring-data.yaml ${TEST NAME}
-deny-content-exactly
+deny-tamper-content-substring
+ [Tags] Reset Tamper RateLimit
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-content-substring-data.yaml ${TEST NAME}
+
+deny-reset-content-exactly
+ [Tags] Reset Tamper RateLimit
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-content-exactly-data.yaml ${TEST NAME}
+
+deny-rateBig-content-exactly
[Tags] Reset Tamper RateLimit
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-content-exactly-data.yaml ${TEST NAME}
-
-
-deny-account-suffix
+deny-tamper-content-exactly
+ [Tags] Reset Tamper RateLimit
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-content-exactly-data.yaml ${TEST NAME}
+
+
+
+deny-reset-account-suffix
[Tags] Reset Tamper RateLimit
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-account-suffix-data.yaml ${TEST NAME}
-deny-account-prefix
+deny-reset-update-rateLittle-account-prefix
+ [Tags] Reset Tamper RateLimit
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-account-prefix-data.yaml ${TEST NAME}
+
+deny-rateLittle-account-prefix
+ [Tags] Reset Tamper RateLimit
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-account-prefix-data.yaml ${TEST NAME}
+
+deny-rateBig-account-prefix
+ [Tags] Reset Tamper RateLimit
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-account-prefix-data.yaml ${TEST NAME}
+
+deny-tamper-account-prefix
[Tags] Reset Tamper RateLimit
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-account-prefix-data.yaml ${TEST NAME}
-deny-account-substring
+deny-reset-account-substring
[Tags] Reset Tamper RateLimit
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-account-substring-data.yaml ${TEST NAME}
-deny-account-exactly
+deny-tamper-account-substring
+ [Tags] Reset Tamper RateLimit
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-account-substring-data.yaml ${TEST NAME}
+
+deny-reset-update-rateLittle-account-exactly
+ [Tags] Reset Tamper RateLimit
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-account-exactly-data.yaml ${TEST NAME}
+
+deny-rateBig-account-exactly
+ [Tags] Reset Tamper RateLimit
+ ${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-account-exactly-data.yaml ${TEST NAME}
+
+deny-tamper-account-exactly
[Tags] Reset Tamper RateLimit
${objectIds} ${policyIds} PolilcysByTemplate ${path}/data/security/ftp/security-ftp-deny-account-exactly-data.yaml ${TEST NAME}
diff --git a/keyword/common/clear_data.robot b/keyword/common/clear_data.robot
index b23f956..e3da76d 100644
--- a/keyword/common/clear_data.robot
+++ b/keyword/common/clear_data.robot
@@ -11,6 +11,7 @@ Resource common.robot
${policyUrl} /policy/compile
${decryptionProfileUrl} /policy/profile/decryption
${decryptionExclusionUrl} /policy/items
+${keyingProfileUrl} /policy/profile/keyringobj
*** Keywords ***
DeletePolicyAndObjectAndOther
[Documentation] delete :policy object category app signature profile ...
@@ -41,6 +42,8 @@ DeletePolicyAndObjectAndOther
Run Keyword If "${createDecryptionExclusionIds}"=="${EMPTY}" log no SSL Decryption exclusion to del
... ELSE DeleteExclusionByIds /${version}${decryptionExclusionUrl} ${createDecryptionExclusionIds}
+
+
Run Keyword If "${appids}"=="${EMPTY}" log no appids to del
... ELSE DeleteApplicationByIds ${appids}
@@ -60,6 +63,13 @@ DeletePolicyAndGroupObject
Run Keyword If "${objectIds}"=="${EMPTY}" log no objectIds to del
... ELSE DeleteObjectByIds ${objectIds}
+ #删除SSL 解密配置文件
+ Run Keyword If "${createDefaultDecryptionProfileds}"=="${EMPTY}" log no SSL Decryption profiledId to del
+ ... ELSE DeleteProfileByIds /${version}${decryptionProfileUrl} ${createDefaultDecryptionProfileds}
+
+ #删除SSL keying文件
+ Run Keyword If "${createKeyingIds}"=="${EMPTY}" log no SSL keying profile to del
+ ... ELSE DeleteProfileByIds /${version}${keyingProfileUrl} ${createKeyingIds}
DeletePolicyAndObject
[Arguments] ${policyids} ${objectids} ${categoriesId}=null
${objectId1} Create List [${objectids}]
diff --git a/keyword/common/functional_keywords.robot b/keyword/common/functional_keywords.robot
index dc197dc..e4bd840 100644
--- a/keyword/common/functional_keywords.robot
+++ b/keyword/common/functional_keywords.robot
@@ -85,45 +85,7 @@ CreatePolicyFile2
Log profileId:${profileId}
[Return] ${response}
-CreatePolicyFile
- [Documentation]
- ... 必传参数:url、filePath(文件路径)、fileName(文件名称)、flag(模块标识)
- ... 可选参数:header(不传时使用默认值)
- [Arguments] ${url} ${filePath} ${fileName} ${flag} ${feature}
- log ${feature}
- ${suffix} Generate Random String
- ${randomName} Catenate SEPARATOR=_ test ${suffix}
- ${value} Run Keyword If '${flag}'=='resPages' and ${tsgVersion}<22.06 Set Variable {"isValid":1,"format":"html","opAction":"add","profileName":"${randomName}","profileId":null,"returnData":1}
- ... ELSE IF '${flag}'=='resPages' and ${tsgVersion}>=22.06 Set Variable {"isValid":1,"format":"html","opAction":"add","profileName":"${randomName}","profileId":null,"vsysId":1,"isShared":0,"returnData":1}
- ... ELSE IF '${flag}'=='hijack' and ${tsgVersion}<22.06 Set Variable {"isValid":1,"contentType":"${feature}","opAction":"add","profileName":"${randomName}","contentName":"${fileName}","profileId":null,"returnData":1}
- ... ELSE IF '${flag}'=='hijack' and ${tsgVersion}>=22.06 Set Variable {"isValid":1,"contentType":"${feature}","opAction":"add","profileName":"${randomName}","contentName":"${fileName}","profileId":null,"vsysId":1,"isShared":0,"returnData":1}
- ... ELSE IF '${flag}'=='insert' and ${tsgVersion}<22.06 Set Variable {"isValid":1,"format":"js","insertOn":"${feature}","opAction":"add","profileName":"${randomName}","profileId":null,"returnData":1}
- ... ELSE IF '${flag}'=='insert' and ${tsgVersion}>=22.06 Set Variable {"isValid":1,"format":"js","insertOn":"${feature}","opAction":"add","profileName":"${randomName}","profileId":null,"vsysId":1,"isShared":0,"returnData":1}
- ... ELSE IF '${flag}'=='insertcss' and ${tsgVersion}<22.06 Set Variable {"isValid":1,"format":"css","insertOn":"","opAction":"add","profileName":"${randomName}","profileId":null,"returnData":1}
- ... ELSE IF '${flag}'=='insertcss' and ${tsgVersion}>=22.06 Set Variable {"isValid":1,"format":"css","insertOn":"","opAction":"add","profileName":"${randomName}","profileId":null,"vsysId":1,"isShared":0,"returnData":1}
- ... ELSE IF '${flag}'=='runScript' and ${tsgVersion}>=22.08 Set Variable {"maxExecTime":${feature},"namespaceId":1,"opAction":"add","profileName":"${randomName}","vsysId":1,"returnData":1}
-
- ${header} Set Variable ${value}
- ${binFile} Evaluate open(r"${filePath}${fileName}",'rb')
- ${fileDict} Create Dictionary file=${binFile}
- ${requestData} Create Dictionary name="file" filename="${fileName}" Content-Type=application/octet-stream
- ${suffix} Generate Random String
- ${profileName} Catenate SEPARATOR=_ test ${suffix}
- ${fileDesc} Create Dictionary File-Desc=${header}
- ${content} UpFilePostRequest ${url} ${requestData} ${fileDict} ${fileDesc}
- ${msg} Set Variable ${content['msg']}
- ${list} Set Variable ${content['data']['list']}
- ${profiledId} Set Variable ${list[0]['profileId']}
- ${profileName} Set Variable ${list[0]['profileName']}
- ${response} Create Dictionary msg=${msg} profileId=${profiledId} profileName=${profileName}
- Log add operation:${msg}
- Log profileId:${profiledId}
- ${profiledIdList} Create List ${profiledId}
- ${createProfiledsTemp} Run Keyword If "${createProfileds}"!="${EMPTY}" AppendListToList ${createProfileds} ${profiledIdList}
- ... ELSE Set Variable ${profiledIdList}
- SET GLOBAL VARIABLE ${createProfileds} ${createProfiledsTemp}
- [Return] ${profiledId}
CreatePolicyFile3
[Documentation]
@@ -295,7 +257,8 @@ DeleteProfileByIds
log DeleteProfile
log ${profileIds}
${response} Run Keyword If ${tsgVersion}<22.06 BaseDeleteRequest ${typeUrl} {"profileIds":${profileIds}}
- ... ELSE BaseDeleteRequest ${typeUrl} {"profileIds":${profileIds},"vsysId":1}
+ ... ELSE IF "${typeUrl}"=="/${version}/policy/profile/keyringobj" BaseDeleteRequest ${typeUrl} {"keyringIds":${profileIds},"vsysId":${vsysId}}
+ ... ELSE BaseDeleteRequest ${typeUrl} {"profileIds":${profileIds},"vsysId":${vsysId}}
${response_code} Get From Dictionary ${response} code
#log aaaaaaaaaa:${response_code}
Should Be Equal As Strings ${response_code} 200
diff --git a/keyword/common/login_logout.robot b/keyword/common/login_logout.robot
index f5bf9c5..60aa56a 100644
--- a/keyword/common/login_logout.robot
+++ b/keyword/common/login_logout.robot
@@ -183,7 +183,7 @@ ApiLogin
${headers} Set variable {"Authorization":"${token}","Content-Type":"application/json"}
Create session api ${httpVersion}://${host}:${port} ${headers} verify=false
- ${response}= Post Request api /${version}/user/login?username=${username}&password=${encodePassword}&authMode=${authmode}
+ ${response}= Post Request api /${version}/user/login?username=${username}&password=${encodePassword}&authMode=${authmode}&vsysId=${vsysId}
${response} to json ${response.content}
Should Be Equal As Strings ${response['code']} 200
${tokenStr} Get From Dictionary ${response['data']} token
@@ -191,6 +191,12 @@ ApiLogin
SET GLOBAL VARIABLE ${token} ${tokenStr}
log ${token}
SET GLOBAL VARIABLE ${headers} {"Contest-Type":"application/json","Authorization":"${token}"}
+ log ${vsysId}
+ log ${tsgVersion}
+ #用vsysid查询当前的vsys type
+ ${vsysTypeCode} Run Keyword If ${tsgVersion}>=22.10 GetVsysType ${vsysId}
+ ... ELSE Set Variable 1
+
#初始化接口中策略中引用协议和策略校验协议
Run Keyword If ${addPolicy}==1 InitPotocol
#加载对象mode
@@ -199,13 +205,23 @@ ApiLogin
SET GLOBAL VARIABLE ${createObjectIds} ${EMPTY}
SET GLOBAL VARIABLE ${createPolicyIds} ${EMPTY}
SET GLOBAL VARIABLE ${createProfileds} ${EMPTY}
- SET GLOBAL VARIABLE ${createDecryptionProfileds} ${EMPTY}
+ SET GLOBAL VARIABLE ${createKeyingIds} ${EMPTY}
+ SET GLOBAL VARIABLE ${createDefaultDecryptionProfileds} ${EMPTY}
SET GLOBAL VARIABLE ${createDecryptionExclusionIds} ${EMPTY}
SET GLOBAL VARIABLE ${createPacketCapturePolicyIds} ${EMPTY}
+ SET GLOBAL VARIABLE ${createDecryptionProfileds} ${EMPTY}
+ #全局变量vsysType,1是Tvys,2是Mvys
+ SET GLOBAL VARIABLE ${createProfileds} ${EMPTY}
#云测平台登录令牌
- SET GLOBAL VARIABLE ${sid} ${sidCode}
+ SET GLOBAL VARIABLE ${vsysType} ${vsysTypeCode}
+ log ${vsysType}
Delete All Sessions
-
+
+GetVsysType
+ [Arguments] ${vsysId}
+ ${response} BaseGetRequestForV2 /system/vsys id=${vsysId} ${version}
+ ${vsysTypeCode} Get From Dictionary ${response['data']['list'][0]} type
+ [Return] ${vsysTypeCode}
TestinLogin
${msTimeStamp} GetTimeStamp
@@ -283,8 +299,10 @@ AddInterceptPolicy
SET GLOBAL VARIABLE ${testInterceptIP} ${objectId}
${HTTP_ID} Get From Dictionary ${objprotol} http
${SSL_ID} Get From Dictionary ${objprotol} ssl
+ ${mvysKeyingId} ${mvysDecryptionProfileId} Run Keyword If "${vsysType}"!="1" CreateMvsysInterProfile tango-ca-v3-trust-ca.cer tango-ca-v3-trust-ca.key
+ ... ELSE Set Variable 1 1
Comment 创建安全策略
- ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-001 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":1,"decryption":1,"traffic_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID},${HTTP_ID}
+ ${policyDict} Create Dictionary policyName=SecurityPolicy-Intercept-001 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":${mvysKeyingId},"decryption":${mvysDecryptionProfileId},"traffic_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID},${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2
SET GLOBAL VARIABLE ${testInterceptPolicy} ${policyId}
diff --git a/keyword/objects/object.robot b/keyword/objects/object.robot
index b60cca2..d27c41c 100644
--- a/keyword/objects/object.robot
+++ b/keyword/objects/object.robot
@@ -37,16 +37,16 @@ AddLocalIPObject
${objectDict} Create Dictionary objectType=ip objectSubType=endpoint isValid=${1} addItemList=${addItemLists} objectName=defaultClientIP
${rescode} ${objectId1} AddObjects ${1} ${objectDict}
SET GLOBAL VARIABLE ${testClentID} ${objectId1}
- Comment 创建SubId
- log to_AddLocalSubidObject
- #可以添加多个
- ${addItemList1} Create Dictionary keywordArray=${testSubscriberID} isHexbin=${0}
- ${addItemLists} Create list ${addItemList1}
- ${objectDict} Create Dictionary objectType=subscriberid objectSubType=defaultsubscriberid objectName=defaultSubid isValid=${1} addItemList=${addItemLists}
- ${rescode} ${subiid} AddObjects ${1} ${objectDict}
- #log ${subiid}
- log LocalSubIP:${subiid}
- SET GLOBAL VARIABLE ${testClentSubID} ${subiid}
+ # Comment 创建SubId
+ # log to_AddLocalSubidObject
+ # #可以添加多个
+ # ${addItemList1} Create Dictionary keywordArray=${testSubscriberID} isHexbin=${0}
+ # ${addItemLists} Create list ${addItemList1}
+ # ${objectDict} Create Dictionary objectType=subscriberid objectSubType=defaultsubscriberid objectName=defaultSubid isValid=${1} addItemList=${addItemLists}
+ # ${rescode} ${subiid} AddObjects ${1} ${objectDict}
+ # #log ${subiid}
+ # log LocalSubIP:${subiid}
+ # SET GLOBAL VARIABLE ${testClentSubID} ${subiid}
Comment 创建mobile_identity-imsi
${addItemList1} Create Dictionary keywordArray=${imsi} isHexbin=${0}
${addItemLists} Create list ${addItemList1}
@@ -62,7 +62,6 @@ AddLocalIPObject
${addItemLists} Create list ${addItemList1} ${addItemList2} ${addItemList3} ${addItemList4}
${objectDict} Create Dictionary objectType=mobile_identity objectSubType=phone_number isValid=${1} addItemList=${addItemLists} objectName=defaultPhnenumber
${rescode} ${phoneNum_id} AddObjects ${1} ${objectDict}
- #InsertObjectIdToFile global_phoneNum_id ${imsi_id}
InsertObjectIdToFile global_phoneNum_id ${phoneNum_id}
SET GLOBAL VARIABLE ${testPhoneNumId} ${phoneNum_id}
Comment 创建apn
@@ -71,14 +70,13 @@ AddLocalIPObject
${addItemLists} Create list ${addItemList1} ${addItemList2}
${objectDict} Create Dictionary objectType=apn objectSubType=apn isValid=${1} addItemList=${addItemLists} objectName=defaultAPN
${rescode} ${apn_id} AddObjects ${1} ${objectDict}
- #InsertObjectIdToFile global_apn_id ${imsi_id}
InsertObjectIdToFile global_apn_id ${apn_id}
SET GLOBAL VARIABLE ${testApnId} ${apn_id}
${objectId1} Evaluate int(${objectId1})
${objectId1} Convert To Integer ${objectId1}
${sourceClientIP} Create Dictionary objectId=${objectId1} protocolField=TSG_SECURITY_SOURCE_ADDR
- ${subiid} Convert To Integer ${subiid}
- ${sourceSubid} Create Dictionary objectId=${subiid} protocolField=${null}
+ # ${subiid} Convert To Integer ${subiid}
+ # ${sourceSubid} Create Dictionary objectId=${subiid} protocolField=${null}
${imsi_id} Convert To Integer ${imsi_id}
${sourceImsi} Create Dictionary objectId=${imsi_id} protocolField=TSG_FILED_GTP_IMSI
${phoneNum_id} Convert To Integer ${phoneNum_id}
@@ -87,7 +85,7 @@ AddLocalIPObject
${sourceApn} Create Dictionary objectId=${apn_id} protocolField=TSG_FILED_GTP_APN
- ${sourceList} Create List ${sourceClientIP} ${sourceSubid} ${sourceImsi} ${sourcePhoneNumber} ${sourceApn}
+ ${sourceList} Create List ${sourceClientIP} ${sourceImsi} ${sourcePhoneNumber} ${sourceApn}
SET GLOBAL VARIABLE ${defaultClient} ${sourceList}
@@ -236,7 +234,7 @@ DeleteObjectByIds
${type} Evaluate isinstance(${objectIds},list)
log ${objectIds}
Should Be True ${type}
- ${dict} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary objectIds=${objectIds} vsysId=1
+ ${dict} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary objectIds=${objectIds} vsysId=${vsysId}
... ELSE Create Dictionary objectIds=${objectIds}
${json} json.Dumps ${dict} ensure_ascii=False
${response} BaseDeleteRequest /${version}${objectUrl} ${json}
@@ -445,12 +443,12 @@ DelLocalIPObject
log to_DelLocalIPObject
${emptyList} Create List
- ${objectId1} Set Variable [${testClentID},${testClentSubID},${testImsiId},${testPhoneNumId},${testApnId}]
+ ${objectId1} Set Variable [${testClentID},${testImsiId},${testPhoneNumId},${testApnId}]
${objectId1} json.loads ${objectId1}
# ${categoriesId} Create List
DeleteObjectByIds ${objectId1}
SET GLOBAL VARIABLE ${testClentID} ${EMPTY}
- SET GLOBAL VARIABLE ${testClentSubID} ${EMPTY}
+ # SET GLOBAL VARIABLE ${testClentSubID} ${EMPTY}
SET GLOBAL VARIABLE ${testImsiId} ${EMPTY}
SET GLOBAL VARIABLE ${testPhoneNumId} ${EMPTY}
SET GLOBAL VARIABLE ${testApnId} ${EMPTY}
@@ -606,6 +604,9 @@ CreateObjects
... ELSE Set Variable ${objectJson}
${objectJson} = Run Keyword If "${return}"!="FAIL" and "${objectId}" != "None" Replace String ${objectJson} "opAction": "add" "option": "update"
... ELSE Set Variable ${objectJson}
+ Comment 替换vsysid
+ ${objectJson} = Run Keyword If "${vsysId}"!="1" Replace String ${objectJson} "vsysId": 1 "vsysId": ${vsysId}
+ ... ELSE Set Variable ${objectJson}
#${objectId} Run Keyword If "${return}"!="FAIL" Set Variable ${objectId} ELSE Set Variable ${EMPTY}
#JSON处理
${objectJsonList} Create List
@@ -645,7 +646,7 @@ CreateObjects
${return} ${returnCode} Run Keyword And Ignore Error Get From Dictionary ${objectData} returnCode
${returnCode} = Run Keyword If "${return}"=="PASS" Set Variable ${returnCode}
... ELSE Set Variable ${Empty}
- ${objectData} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary opAction=add returnData=1 objectList=${objectJsonList} vsysId=1
+ ${objectData} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary opAction=add returnData=1 objectList=${objectJsonList} vsysId=${vsysId}
... ELSE Create Dictionary opAction=add returnData=1 objectList=${objectJsonList}
Log !!!!!!!!!!!!!!!!!!!!!!!!!!!!
Log ${itemvalue}
@@ -851,7 +852,7 @@ DeleteGroupObject
[Arguments] ${objectids}
#删除对象
log todeleteobjAndCategory
- ${response} BaseDeleteRequest /${version}/policy/object {"objectIds":${objectids},"vsysId":1}
+ ${response} BaseDeleteRequest /${version}/policy/object {"objectIds":${objectids},"vsysId":${vsysId}}
${response_code} Get From Dictionary ${response} code
Should Be Equal As Strings ${response_code} 200
${response} Convert to String ${response}
@@ -868,7 +869,7 @@ DeleteGroupCategory
[Arguments] ${categoryids}
#删除对象
log todeleteobjAndCategory
- ${response} BaseDeleteRequest /${version}/category/dict {"categoryIds":${categoryids},"vsysId":1}
+ ${response} BaseDeleteRequest /${version}/category/dict {"categoryIds":${categoryids},"vsysId":${vsysId}}
${response_code} Get From Dictionary ${response} code
Should Be Equal As Strings ${response_code} 200
${response} Convert to String ${response}
diff --git a/keyword/objects/process_object_body.robot b/keyword/objects/process_object_body.robot
index 11b25c1..ac6758d 100644
--- a/keyword/objects/process_object_body.robot
+++ b/keyword/objects/process_object_body.robot
@@ -74,7 +74,7 @@ ObjectOperation
${json} ObjectOrganize ${object} ${opAction}
# 转为json结构并返回
${dict} Run Keyword If ${tsgVersion}<22.06 Create Dictionary opAction=${opAction} returnData=${returnData} objectList=replace:objectList
- ... ELSE Create Dictionary opAction=${opAction} returnData=${returnData} objectList=replace:objectList vsysId=1
+ ... ELSE Create Dictionary opAction=${opAction} returnData=${returnData} objectList=replace:objectList vsysId=${vsysId}
${bodyJson} json.Dumps ${dict} ensure_ascii=False
${json} Replace String ${bodyJson} "replace:objectList" ${json}
@@ -132,7 +132,7 @@ CategoryOperation
${json} CategoryOrganize ${category} ${opAction}
# 转为json结构并返回
- ${dict} Create Dictionary opAction=${opAction} returnData=${returnData} list=replace:objectList vsysId=1
+ ${dict} Create Dictionary opAction=${opAction} returnData=${returnData} list=replace:objectList vsysId=${vsysId}
${bodyJson} json.Dumps ${dict} ensure_ascii=False
${json} Replace String ${bodyJson} "replace:objectList" ${json}
diff --git a/keyword/policys/policy.robot b/keyword/policys/policy.robot
index 11cad56..e6772e0 100644
--- a/keyword/policys/policy.robot
+++ b/keyword/policys/policy.robot
@@ -15,6 +15,7 @@ Resource ${EXECDIR}/keyword/common/systemcommand.robot
Resource process_policy_body.robot
Resource ${EXECDIR}/keyword/common/common.robot
Resource ${EXECDIR}/keyword/objects/object.robot
+Resource ${EXECDIR}/keyword/profiles/profile.robot
Resource ${EXECDIR}/keyword/system/iplibraries.robot
Resource ${EXECDIR}/keyword/common/log_variable.robot
Resource ${EXECDIR}/keyword/common/stmp_handle.robot
@@ -327,10 +328,10 @@ PolilcysByTemplate
... ELSE Set Variable ${mobileInfo} ${EMPTY}
log ${mobileInfo}
#0824临时关闭
- # Run Keyword If "${isAppReturn}"!="FAIL" and "${isApp}"=="1" and "${isCrontab}"!="1" and "${isAirTest}"!="1" Run Keyword And Continue On Failure CreateTestinTask ${key} ${mobileInfo} ${scriptDeviceInfo}
- # ... ELSE IF "${isAppReturn}"!="FAIL" and "${isApp}"=="1" and "${isCrontab}"=="1" and "${isAirTest}"!="1" CreateTestinCrontabTask ${key}
- # ... ELSE IF "${isAppReturn}"!="FAIL" and "${isApp}"=="1" and "${isAirTest}"=="1" and "${opAction}"=="add" AirTestFuncVerify ${mobileInfo} ${airTestMessage} ${key}
- # ... ELSE IF "${opAction}"=="update" log No app-related operations
+ Run Keyword If "${isAppReturn}"!="FAIL" and "${isApp}"=="1" and "${isCrontab}"!="1" and "${isAirTest}"!="1" Run Keyword And Continue On Failure CreateTestinTask ${key} ${mobileInfo} ${scriptDeviceInfo}
+ ... ELSE IF "${isAppReturn}"!="FAIL" and "${isApp}"=="1" and "${isCrontab}"=="1" and "${isAirTest}"!="1" CreateTestinCrontabTask ${key}
+ ... ELSE IF "${isAppReturn}"!="FAIL" and "${isApp}"=="1" and "${isAirTest}"=="1" and "${opAction}"=="add" AirTestFuncVerify ${mobileInfo} ${airTestMessage} ${key}
+ ... ELSE IF "${opAction}"=="update" log No app-related operations
Run Keyword If "${returnaddTestClentIPFlag}"=="PASS" SET GLOBAL VARIABLE ${addTestClentIPFlag} ${addTestClentIPFlag1}
... ELSE SET GLOBAL VARIABLE ${addTestClentIPFlag} ${addTestClentIPFlag}
log ${addTestClentIPFlag}
@@ -718,6 +719,8 @@ Listen Phone
${returnLogSuccess} ${log} Run Keyword And Ignore Error GetLogListMulti ${logType} ${startTime} ${endTime} ${callIp} ${logPolicyId} ${logQueryParam}
${excuteSuccessful} Run Keyword If "${returnConnect}"=="PASS" and "${returnIsExcute}"=="PASS" and "${returnLogSuccess}"=="PASS" Evaluate ${excuteSuccessful}+1
... ELSE Set Variable ${excuteSuccessful}
+ ${returnLogSuccess} Run Keyword If "${returnLogSuccess}"=="FAIL" Run Keyword And Continue On Failure Wait Until Keyword Succeeds 10min 30sec RetryGetLog ${logType} ${startTime} ${endTime} ${callIp} ${logPolicyId} ${logQueryParam} ${isUTC}
+ ... ELSE Set Variable ${returnLogSuccess}
${reachExcuteFail} Run Keyword If "${returnConnect}"=="PASS" and ("${returnIsExcute}"!="PASS" or "${returnLogSuccess}"!="PASS") Evaluate ${reachExcuteFail}+1
... ELSE Set Variable ${reachExcuteFail}
${unReachable} Run Keyword If "${returnConnect}"!="PASS" and "${returnIsExcute}"!="PASS" and "${returnLogSuccess}"!="PASS" Evaluate ${unReachable}+1
@@ -734,7 +737,7 @@ Call Phone
${listenAccount} Get From Dictionary ${verify} listenAccount
${returnConnect} ${connect} Run Keyword And Ignore Error Open Connection ${manageIp}
${returnLogin} ${login} Run Keyword And Ignore Error SSHLibrary.Login ${manageUser} ${managePassword}
- Write sipp -sn uac ${listenIp}:5077 -s 40120 -i ${callIp} -p 5078 -r 50 -rp 1000
+ Write sipp -sn uac ${listenIp}:5077 -s 40214 -i ${callIp} -p 5078 -r 50 -rp 1000
[Return] ${callIp}
ExcuteFtpCommand
[Arguments] ${verify} ${loginInfo} ${defaultFtpInfo} ${logQueryParam} ${logType} ${logPolicyId}
@@ -1101,7 +1104,7 @@ OrangePolicyDisOrEnAble
[Documentation] 根据策略id组织策略修改接口的字符串
[Arguments] ${policyId} ${opAction}
Log To Console OrangePolicyDisOrEnAble
- ${policyUpdateList} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary opAction=${opAction} policyList=${policyId} vsysId=1
+ ${policyUpdateList} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary opAction=${opAction} policyList=${policyId} vsysId=${vsysId}
... ELSE Create Dictionary opAction=${opAction} policyList=${policyId}
[Return] ${policyUpdateList}
@@ -1185,7 +1188,7 @@ VerifyPolicy
${verifyResult} GetVerifyState ${verifyList} ${id}
# 拼接策略校验中应包含的id,如果初始化本机id测使用本机进行校验,否则仅使用策略中返回的校验
#${objectidVerifyList} Run Keyword If ${addTestClentIPFlag}==1 Create List {"policyId" : 125192,"policyName" : "autotestmonitor","isExecutePolicy" : true} "objectId" : ${testClentID}, "objectId" : ${testClentSubID}, "objectId" : ${object_imsi_id}, "objectId" : ${obj_phoneNum_Id}, "objectId" : ${obj_apn_Id},
- ${objectidVerifyList} Run Keyword IF ${addTestClentIPFlag}==1 Create List ${testClentID} ${testClentSubID} ${testImsiId} ${testPhoneNumId} ${testApnId}
+ ${objectidVerifyList} Run Keyword IF ${addTestClentIPFlag}==1 Create List ${testClentID} ${testImsiId} ${testPhoneNumId} ${testApnId}
#... ELSE IF
... ELSE Create List
Run Keyword IF "${atributeObjIds}" != "None" AppendListToList ${objectidVerifyList} ${atributeObjIds}
@@ -1319,7 +1322,10 @@ CreatePolicysAndObjects
#${doLog} Run Keyword If "${return}"!="FAIL" Set Variable ${doLog} ELSE Set Variable ${EMPTY}
${policyJson} = Run Keyword If "${return}"!="FAIL" and "${doLog}" != "None" Replace String ${policyJson} "doLog": 1 "doLog": ${doLog}
... ELSE Set Variable ${policyJson}
-
+ Comment 替换vsysid
+ ${policyJson} = Run Keyword If "${vsysId}"!="1" Replace String ${policyJson} "vsysId": 1 "vsysId": ${vsysId}
+ ... ELSE Set Variable ${policyJson}
+
${return} ${policyDesc} Run Keyword And Ignore Error Get From Dictionary ${policyData} policyDesc
#${policyDesc} Run Keyword If "${return}"!="FAIL" Set Variable ${policyDesc} ELSE Set Variable ${EMPTY}
${policyJson} = Run Keyword If "${return}"!="FAIL" and "${policyDesc}" != "None" Replace String ${policyJson} "policyDesc": "autotest" "policyDesc": "${policyDesc}"
@@ -1468,6 +1474,9 @@ CreateSslDecryptionExclusion
log ${decryptionExclusionJson}
${decryptionExclusionJson} Set Variable ${decryptionExclusionJson}
${decryptionExclusionJson} Replace String ${decryptionExclusionJson} "keywordArray": [null] "keywordArray": ["${exclusionFqdn}"]
+ Comment 替换vsysid
+ ${decryptionExclusionJson} = Run Keyword If "${vsysId}"!="1" Replace String ${decryptionExclusionJson} "vsysId": 1 "vsysId": ${vsysId}
+ ... ELSE Set Variable ${decryptionExclusionJson}
${decryptionExclusionJson} json.loads ${decryptionExclusionJson}
log ${decryptionExclusionJson}
${exclusionItemId} CreateDecryptionExclusion ${decryptionExclusionJson}
@@ -1503,6 +1512,10 @@ CreateSslDecryptionProfile
${decryptionProfileJson} = Run Keyword If "${return}"!="FAIL" and "${cn}" != "None" Replace String ${decryptionProfileJson} "cn": 1 "cn": ${cn}
... ELSE Set Variable ${decryptionProfileJson}
+ Comment 替换vsysid
+ ${policyJson} = Run Keyword If "${vsysId}"!="1" Replace String ${policyJson} "vsysId": 1 "vsysId": ${vsysId}
+ ... ELSE Set Variable ${policyJson}
+
${return} ${issuer} Run Keyword And Ignore Error Get From Dictionary ${decryptionProfile} issuer
${decryptionProfileJson} = Run Keyword If "${return}"!="FAIL" and "${issuer}" != "None" Replace String ${decryptionProfileJson} "issuer": 0 "issuer": ${issuer}
... ELSE Set Variable ${decryptionProfileJson}
@@ -1527,27 +1540,11 @@ CreateSslDecryptionProfile
${return} ${allow_http2} Run Keyword And Ignore Error Get From Dictionary ${decryptionProfile} allow_http2
${decryptionProfileJson} = Run Keyword If "${return}"!="FAIL" and "${allow_http2}" != "None" Replace String ${decryptionProfileJson} "allow_http2": 0 "allow_http2": ${allow_http2}
... ELSE Set Variable ${decryptionProfileJson}
- ${decryptionProfileJson} json.loads ${decryptionProfileJson}
+ # ${decryptionProfileJson} json.loads ${decryptionProfileJson}
log ${decryptionProfileJson}
${profiledId} CreateDecryptionProfile ${decryptionProfileJson}
[Return] ${profiledId}
-CreateDecryptionProfile
- [Documentation]
- ... 创建SSL解密配置文件
- [Arguments] ${decryptionProfileJson} ${code}=null
- ${returnData} Get From Dictionary ${decryptionProfileJson} returnData
- ${bodyJson} json.Dumps ${decryptionProfileJson}
- log ${bodyJson}
- ${response} BasePostRequestForV2 ${decryptionProfileUrl} ${bodyJson} ${version}
- log ${response}
-
- ${list} Set Variable ${response['data']['list']}
- ${profiledId} Set Variable ${list[0]['profileId']}
- ${profiledIdList} Create List ${profiledId}
- ${createDecryptionProfiledsTemp} Run Keyword If "${createDecryptionProfileds}"!="${EMPTY}" AppendListToList ${createDecryptionProfileds} ${profiledIdList}
- ... ELSE Set Variable ${profiledIdList}
- SET GLOBAL VARIABLE ${createDecryptionProfileds} ${createDecryptionProfiledsTemp}
- [Return] ${profiledId}
+
CreateDecryptionExclusion
[Documentation]
diff --git a/keyword/policys/process_policy_body.robot b/keyword/policys/process_policy_body.robot
index afc113f..ead553a 100644
--- a/keyword/policys/process_policy_body.robot
+++ b/keyword/policys/process_policy_body.robot
@@ -77,7 +77,7 @@ PolicyDataOperation
Log To Console Call PolicyDataOperation
${json} PolicyOrganize ${policy} ${opAction} ${policyObjectVersion}
# 转为json结构并返回
- ${dict} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary opAction=${opAction} returnData=${returnData} policyList=replace:policyList vsysId=1
+ ${dict} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary opAction=${opAction} returnData=${returnData} policyList=replace:policyList vsysId=${vsysId}
... ELSE Create Dictionary opAction=${opAction} returnData=${returnData} policyList=replace:policyList
${bodyJson} json.Dumps ${dict} ensure_ascii=False
${json} Replace String ${bodyJson} "replace:policyList" ${json}
@@ -270,7 +270,7 @@ ManageObjectV2
${filterList} Create List
Run Keyword If '${addTestClentIPFlag}'=='1' and '${defaultClient}'!='${EMPTY}' and '${defaultClient}'=='clientip' ManageClientIPObjectV2 ${sourceList}
- Run Keyword If '${addTestClentIPFlag}'=='1' and '${defaultClient1}'!='${EMPTY}' and '${defaultClient1}'=='clientsubid' ManageClientSubIDObjectV2 ${sourceList}
+ # Run Keyword If '${addTestClentIPFlag}'=='1' and '${defaultClient1}'!='${EMPTY}' and '${defaultClient1}'=='clientsubid' ManageClientSubIDObjectV2 ${sourceList}
Run Keyword If '${addTestClentIPFlag}'=='1' and '${defaultClient2}'!='${EMPTY}' and '${defaultClient2}'=='clientImsi' ManageClientImsiObjectV2 ${sourceList}
Run Keyword If '${addTestClentIPFlag}'=='1' and '${defaultClient3}'!='${EMPTY}' and '${defaultClient3}'=='clientPhoneNumber' ManageClientPhoneNumberObjectV2 ${sourceList}
Run Keyword If '${addTestClentIPFlag}'=='1' and '${defaultClient4}'!='${EMPTY}' and '${defaultClient4}'=='clientApn' ManageClientApnObjectV2 ${sourceList}
@@ -390,7 +390,7 @@ GetPolicyIds
FOR ${policy} IN @{value['data']['policyList']}
${policyIdList} Create List ${policy['policyId']}
#${policyIdList} Set Variable ${policy['policyId']}
- ${policyObj} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary policyType=${policy['policyType']} policyIds=${policyIdList} vsysId=1
+ ${policyObj} Run Keyword If ${tsgVersion}>=22.06 Create Dictionary policyType=${policy['policyType']} policyIds=${policyIdList} vsysId=${vsysId}
... ELSE Create Dictionary policyType=${policy['policyType']} policyIds=${policyIdList}
Append To List ${policyIds} ${policyObj}
#Append To List ${policyIds} ${policy['policyId']}
diff --git a/keyword/profiles/profile.robot b/keyword/profiles/profile.robot
index d5a8df1..409b889 100644
--- a/keyword/profiles/profile.robot
+++ b/keyword/profiles/profile.robot
@@ -1,14 +1,14 @@
*** Settings ***
Library yaml
-Library JSON
Library Collections
Library RequestsLibrary
Resource ${EXECDIR}/variable/incoming_common_variable.txt
Resource ${EXECDIR}/variable/common_variable.txt
-Resource ${EXECDIR}/common/common.robot
-Resource ${EXECDIR}/common/api_request.robot
+Resource ${EXECDIR}/keyword/common/common.robot
+Resource ${EXECDIR}/keyword/common/api_request.robot
Library DatabaseLibrary
Library String
+Library json
Library OperatingSystem
Library Selenium2Library
Library ${EXECDIR}/customlib/dict_data.py
@@ -208,7 +208,7 @@ DeleteDnsProfileByIds1
${response} Convert to String ${response}
log ${response}
-DeleteProfileByIds
+DeleteProfileByIdsbak
[Arguments] ${profileIds} ${ProfileUrl} ${delName}
#删除对象
log DeleteProfile
@@ -346,24 +346,6 @@ CreateTrustedCertificateAuthoritiesProfile
${tcaResponse} TrustedCertificateAuthoritiesProfileRequest ${tcaProfileUrl} ${path}keying_files/ ${fileName} ${bodyJson} ${code} ${opAction} ${profileId}
[Return] ${tcaResponse}
-CreateDecryptionProfile
- [Documentation]
- ... 必传参数:decryptionProfileData要替换的请求json,code 接口返回的code码,为空就代表200
- ... 返回值:${resPagesResponse}是文件id
- [Arguments] ${decryptionProfileData} ${code} ${opAction}=add ${profileId}=1
- ${decryptionProfileMode}= Get File ${path}/data/template/decryptionprofilemode.yaml
- ${decryptionProfileModeData}= yaml.Safe Load ${decryptionProfileMode}
- ${decryptionProfileModeData1} Get From Dictionary ${decryptionProfileModeData} decryptionprofilemode
- ${decryptionProfileModeData2} = Evaluate str(${decryptionProfileModeData1})
- ${decryptionProfileModeDataStr1} Replace String Using Regexp ${decryptionProfileModeData2} decryption': (.*?)}], 'refuseCode decryption': ${decryptionProfileData}}], 'refuseCode
- ${suffix} Generate Random String
- ${randomName} Catenate SEPARATOR=_ test ${suffix}
- ${decryptionProfileModeDataStr1} Replace String ${decryptionProfileModeDataStr1} 'profileName': 'test' 'profileName': '${randomName}'
- ${decryptionProfileModeDataStr1} Replace String ${decryptionProfileModeDataStr1} 'opAction': 'add' 'opAction': '${opAction}'
- ${decryptionProfileModeDataStr1} Replace String ${decryptionProfileModeDataStr1} 'profileId': 1 'profileId': '${profileId}'
- ${bodyJson} dictconversion ${decryptionProfileModeDataStr1}
- ${profileId} DecryptionProfileRequest ${bodyJson} ${code} ${opAction} ${profileId}
- [Return] ${profileId}
CreateTrafficMirrorProfile
[Documentation]
@@ -659,7 +641,6 @@ CreatePayloadProfile
[Return] ${profileId}
-
PayloadProfileRequest
[Arguments] ${bodyJson} ${code} ${opAction} ${profileId}
[Documentation] 请求接口创建,返回id 返回格式:int数值 ${bodyJson}参数是请求策略接口的jison格式
@@ -674,4 +655,93 @@ PayloadProfileRequest
... ELSE IF "${rescode}"=="200" and "${opAction}"=="update" Set Variable ${profileId}
... ELSE Set Variable ${EMPTY}
- [Return] ${profileId1} \ No newline at end of file
+ [Return] ${profileId1}
+
+CreateMvsysInterProfile
+ [Arguments] ${cerName} ${keyName}
+ ${profiledId} CreatePolicyFile /${version}/policy/profile/keyringobj ${path}/keying_files/ ${cerName} keying ${keyName}
+ ${DecryptionProfileId} CreateDefaultDecryptionProfile {"opAction":"add","returnData":1,"list":[{"profileName":"test","profileDesc":"","isValid":1,"isShared":0,"decryption":{"dynamic_bypass":{"ev_cert":0,"cert_transparency":0,"mutual_authentication":1,"cert_pinning":1,"protocol_errors":1,"trusted_root_cert_is_not_installed_on_client":0},"certificate_checks":{"approach":{"cn":1,"issuer":1,"self-signed":1,"expiration":1},"fail_action":"pass-through"},"protocol_version":{"min":"ssl3","max":"tls13","mirror_client":1,"allow_http2":1}}}],"refuseCode":true,"vsysId":${vsysId}}
+ [Return] ${profiledId} ${DecryptionProfileId}
+
+CreatePolicyFile
+ [Documentation]
+ ... 必传参数:url、filePath(文件路径)、fileName(文件名称)、flag(模块标识)
+ ... 可选参数:header(不传时使用默认值)
+ [Arguments] ${url} ${filePath} ${fileName} ${flag}=${EMPTY} ${feature}=${EMPTY}
+ log ${feature}
+ ${suffix} Generate Random String
+ ${randomName} Catenate SEPARATOR=_ test ${suffix}
+ ${value} Run Keyword If '${flag}'=='resPages' and ${tsgVersion}<22.06 Set Variable {"isValid":1,"format":"html","opAction":"add","profileName":"${randomName}","profileId":null,"returnData":1}
+ ... ELSE IF '${flag}'=='resPages' and ${tsgVersion}>=22.06 Set Variable {"isValid":1,"format":"html","opAction":"add","profileName":"${randomName}","profileId":null,"vsysId":${vsysId},"isShared":0,"returnData":1}
+ ... ELSE IF '${flag}'=='hijack' and ${tsgVersion}<22.06 Set Variable {"isValid":1,"contentType":"${feature}","opAction":"add","profileName":"${randomName}","contentName":"${fileName}","profileId":null,"returnData":1}
+ ... ELSE IF '${flag}'=='hijack' and ${tsgVersion}>=22.06 Set Variable {"isValid":1,"contentType":"${feature}","opAction":"add","profileName":"${randomName}","contentName":"${fileName}","profileId":null,"vsysId":${vsysId},"isShared":0,"returnData":1}
+ ... ELSE IF '${flag}'=='insert' and ${tsgVersion}<22.06 Set Variable {"isValid":1,"format":"js","insertOn":"${feature}","opAction":"add","profileName":"${randomName}","profileId":null,"returnData":1}
+ ... ELSE IF '${flag}'=='insert' and ${tsgVersion}>=22.06 Set Variable {"isValid":1,"format":"js","insertOn":"${feature}","opAction":"add","profileName":"${randomName}","profileId":null,"vsysId":${vsysId},"isShared":0,"returnData":1}
+ ... ELSE IF '${flag}'=='insertcss' and ${tsgVersion}<22.06 Set Variable {"isValid":1,"format":"css","insertOn":"","opAction":"add","profileName":"${randomName}","profileId":null,"returnData":1}
+ ... ELSE IF '${flag}'=='insertcss' and ${tsgVersion}>=22.06 Set Variable {"isValid":1,"format":"css","insertOn":"","opAction":"add","profileName":"${randomName}","profileId":null,"vsysId":${vsysId},"isShared":0,"returnData":1}
+ ... ELSE IF '${flag}'=='runScript' and ${tsgVersion}>=22.08 Set Variable {"maxExecTime":${feature},"namespaceId":1,"opAction":"add","profileName":"${randomName}","vsysId":${vsysId},"returnData":1}
+ ... ELSE IF '${flag}'=='keying' and ${tsgVersion}>=22.10 Set Variable {"isValid":1,"opAction":"add","returnData":1,"keyringName":"${fileName}","keyringType":"root","reissueExpiryHour":24,"crl":"null","publicKeyAlgo":"rsa2048","keyringId":null,"includeRoot":0,"useHsm":0,"vsysId":${vsysId},"isShared":0,"slotId":null}
+
+ ${header} Set Variable ${value}
+
+ ${binFile} Evaluate open(r"${filePath}${fileName}",'rb')
+ ${privateBinFile} Run Keyword If "${flag}"=="keying" Evaluate open(r"${filePath}${feature}",'rb')
+ ... ELSE Set Variable ${EMPTY}
+ ${fileDict} Run Keyword If "${flag}"=="keying" Create Dictionary publicFile=${binFile} privateFile=${privateBinFile}
+ ... ELSE Create Dictionary file=${binFile}
+ ${requestData} Create Dictionary name="file" filename="${fileName}" Content-Type=application/octet-stream
+ ${suffix} Generate Random String
+ ${profileName} Catenate SEPARATOR=_ test ${suffix}
+ ${fileDesc} Create Dictionary File-Desc=${header}
+ ${content} UpFilePostRequest ${url} ${requestData} ${fileDict} ${fileDesc}
+ ${msg} Set Variable ${content['msg']}
+ ${list} Set Variable ${content['data']['list']}
+ ${profiledId} Run Keyword If "${flag}"=="keying" Set Variable ${list[0]['keyringId']}
+ ... ELSE Set Variable ${list[0]['profileId']}
+ ${profileName} Run Keyword If "${flag}"=="keying" Set Variable ${list[0]['keyringName']}
+ ... ELSE Set Variable ${list[0]['profileName']}
+ ${response} Create Dictionary msg=${msg} profileId=${profiledId} profileName=${profileName}
+ Log add operation:${msg}
+ Log profileId:${profiledId}
+ ${profiledIdList} Create List ${profiledId}
+ ${createProfiledsTemp} Run Keyword If "${createProfileds}"!="${EMPTY}" AppendListToList ${createProfileds} ${profiledIdList}
+ ... ELSE Set Variable ${profiledIdList}
+ Run Keyword If "${flag}"=="keying" SET GLOBAL VARIABLE ${createKeyingIds} ${createProfiledsTemp}
+ ... ELSE SET GLOBAL VARIABLE ${createProfileds} ${createProfiledsTemp}
+ [Return] ${profiledId}
+
+CreateDecryptionProfile
+ [Documentation]
+ ... 创建SSL解密配置文件
+ [Arguments] ${decryptionProfileJson} ${code}=null
+ # ${returnData} Get From Dictionary ${decryptionProfileJson} returnData
+ # ${bodyJson} json.Dumps ${decryptionProfileJson}
+ # log ${bodyJson}
+ ${response} BasePostRequestForV2 ${decryptionProfileUrl} ${decryptionProfileJson} ${version}
+ log ${response}
+
+ ${list} Set Variable ${response['data']['list']}
+ ${profiledId} Set Variable ${list[0]['profileId']}
+ ${profiledIdList} Create List ${profiledId}
+ ${createDecryptionProfiledsTemp} Run Keyword If "${createDecryptionProfileds}"!="${EMPTY}" AppendListToList ${createDecryptionProfileds} ${profiledIdList}
+ ... ELSE Set Variable ${profiledIdList}
+ SET GLOBAL VARIABLE ${createDecryptionProfileds} ${createDecryptionProfiledsTemp}
+ [Return] ${profiledId}
+
+CreateDefaultDecryptionProfile
+ [Documentation]
+ ... 创建默认的SSL解密配置文件
+ [Arguments] ${decryptionProfileJson} ${code}=null
+ # ${returnData} Get From Dictionary ${decryptionProfileJson} returnData
+ # ${bodyJson} json.Dumps ${decryptionProfileJson}
+ # log ${bodyJson}
+ ${response} BasePostRequestForV2 ${decryptionProfileUrl} ${decryptionProfileJson} ${version}
+ log ${response}
+
+ ${list} Set Variable ${response['data']['list']}
+ ${profiledId} Set Variable ${list[0]['profileId']}
+ ${profiledIdList} Create List ${profiledId}
+ ${createDefaultDecryptionProfiledsTemp} Run Keyword If "${createDefaultDecryptionProfileds}"!="${EMPTY}" AppendListToList ${createDefaultDecryptionProfileds} ${profiledIdList}
+ ... ELSE Set Variable ${profiledIdList}
+ SET GLOBAL VARIABLE ${createDefaultDecryptionProfileds} ${createDefaultDecryptionProfiledsTemp}
+ [Return] ${profiledId} \ No newline at end of file
diff --git a/keyword/system/iplibraries.robot b/keyword/system/iplibraries.robot
index 5c73d39..269e01b 100644
--- a/keyword/system/iplibraries.robot
+++ b/keyword/system/iplibraries.robot
@@ -104,6 +104,9 @@ CreateIplibraries
... ELSE Set Variable ${endIp}
${ipLibraryJson} = Run Keyword If "${return}"!="FAIL" and "${endIp}" != "None" Replace String ${ipLibraryJson} "endIp": "1.1.1.1" "endIp": "${endIp}"
... ELSE Set Variable ${ipLibraryJson}
+ Comment 替换vsysid
+ ${ipLibraryJson} = Run Keyword If "${vsysId}"!="1" Replace String ${ipLibraryJson} "vsysId": 1 "vsysId": ${vsysId}
+ ... ELSE Set Variable ${ipLibraryJson}
log ${ipLibraryJson}
${response} Run Keyword If "${opAction}"=="add" BasePostRequestForV2 ${iplibrariesUrl} ${ipLibraryJson} ${version}
... ELSE IF "${opAction}"=="update" BaseEditRequestForV2 ${iplibrariesUrl} ${ipLibraryJson} ${version}
@@ -142,7 +145,7 @@ DeleteIPLibrariesIds
[Return] ${response}
DeleteIPLibrariesIds1
[Arguments] ${iplibrariesIds}
- ${response} BaseDeleteRequest /${version}/${iplibrariesUrl} {"geoNameIds":${iplibrariesIds},"vsysId":1}
+ ${response} BaseDeleteRequest /${version}/${iplibrariesUrl} {"geoNameIds":${iplibrariesIds},"vsysId":${vsysId}}
log ${response}
[Return] ${response}
diff --git a/other/data/proxy/http/proxy-http-allow-fqdn-url-reqheader-resheader-data.yaml b/other/data/proxy/http/proxy-http-allow-fqdn-url-reqheader-resheader-data.yaml
index ae16ecb..00ec452 100644
--- a/other/data/proxy/http/proxy-http-allow-fqdn-url-reqheader-resheader-data.yaml
+++ b/other/data/proxy/http/proxy-http-allow-fqdn-url-reqheader-resheader-data.yaml
@@ -73,16 +73,7 @@
- "addItemList":
- "keywordArray":
- "utf-8"
- "district": "Content-Type"
- -
- "protocolField": "TSG_FIELD_HTTP_RES_HDR"
- "objectType": "http_signature"
- "objectSubType": "Set-Cookie"
- "objectList":
- - "addItemList":
- - "keywordArray":
- - "instagram"
- "district": "Set-Cookie"
+ "district": "Content-Type"
-
"opAction": "update"
"isEdit": 1
@@ -159,13 +150,4 @@
- "keywordArray":
- "7574662d38"
"district": "Content-Type"
- "isHexbin": 1
- -
- "protocolField": "TSG_FIELD_HTTP_RES_HDR"
- "objectType": "http_signature"
- "objectSubType": "Set-Cookie"
- "objectList":
- - "addItemList":
- - "keywordArray":
- - "instagram"
- "district": "Set-Cookie" \ No newline at end of file
+ "isHexbin": 1 \ No newline at end of file