summaryrefslogtreecommitdiff
path: root/keyword/common/login_logout.robot
diff options
context:
space:
mode:
Diffstat (limited to 'keyword/common/login_logout.robot')
-rw-r--r--keyword/common/login_logout.robot29
1 files changed, 22 insertions, 7 deletions
diff --git a/keyword/common/login_logout.robot b/keyword/common/login_logout.robot
index dc0c293..1d72ec9 100644
--- a/keyword/common/login_logout.robot
+++ b/keyword/common/login_logout.robot
@@ -17,8 +17,8 @@ Resource ${EXECDIR}/keyword/profiles/profile.robot
InitPotocol
${appDict} Create Dictionary
${appVDict} Create Dictionary
- Connect To Database Using Custom Params pymysql host='${host}',port=3306,user='${mysqluser}',passwd='test',database='tsg-bifang'
- ${app_id} query SELECT group_id, app_id, app_name FROM app_id_dict WHERE is_valid = 1 AND app_name = 'http' OR app_name = 'ssl' OR app_name = 'dns' OR app_name = 'ftp' OR app_name = 'mail' OR app_name = 'doh' OR app_name = 'rtp' OR app_name = 'sip' OR app_name = 'ssh' OR app_name = 'https' OR app_name = 'imaps' OR app_name = 'pop3s' OR app_name = 'smtps' OR app_name = 'quic' OR app_name = 'Psiphon3' OR app_name = 'tor' OR app_name = 'TachyonVPN' OR app_name = 'Freegate' OR app_name = 'skype' OR app_name = 'facebook' OR app_name = 'baidu' OR app_name = 'instagram' OR app_name = 'telegram' OR app_name = 'whatsapp' OR app_name = 'twitter' OR app_name = 'youtube' OR app_name = 'gmail' OR app_name = 'taobao' OR app_name = 'qq' OR app_name = 'wechat' OR app_name = 'wireguard' OR app_name = 'tachyonvpn' OR app_name = 'dingding' OR app_name = 'v4c' OR app_name = 'UGVPN' OR app_name = 'VPNlat' OR app_name = 'AnonyTun' OR app_name = 'urbanVPN' OR app_name = 'TurboVPN' OR app_name = 'FlashVPN' OR app_name = 'ProtonVPN' OR app_name = 'bilibili' OR app_name = 'gtalk' OR app_name = 'TurboVPN_mm' OR app_name = 'facebook_messenger' OR app_name = 'testAutoApplication'
+ Connect To Database Using Custom Params pymysql host='${host}',port=3306,user='test',passwd='test',database='tsg-bifang'
+ ${app_id} query SELECT object_id, app_id, app_name FROM app_id_dict WHERE is_valid = 1 AND app_name = 'http' OR app_name = 'ssl' OR app_name = 'dns' OR app_name = 'ftp' OR app_name = 'mail' OR app_name = 'doh' OR app_name = 'rtp' OR app_name = 'sip' OR app_name = 'ssh' OR app_name = 'https' OR app_name = 'imaps' OR app_name = 'pop3s' OR app_name = 'smtps' OR app_name = 'quic' OR app_name = 'Psiphon3' OR app_name = 'tor' OR app_name = 'TachyonVPN' OR app_name = 'Freegate' OR app_name = 'skype' OR app_name = 'facebook' OR app_name = 'baidu' OR app_name = 'instagram' OR app_name = 'telegram' OR app_name = 'whatsapp' OR app_name = 'twitter' OR app_name = 'youtube' OR app_name = 'gmail' OR app_name = 'taobao' OR app_name = 'qq' OR app_name = 'wechat' OR app_name = 'wireguard' OR app_name = 'tachyonvpn' OR app_name = 'dingding' OR app_name = 'v4c' OR app_name = 'UGVPN' OR app_name = 'VPNlat' OR app_name = 'AnonyTun' OR app_name = 'urbanVPN' OR app_name = 'TurboVPN' OR app_name = 'FlashVPN' OR app_name = 'ProtonVPN' OR app_name = 'bilibili' OR app_name = 'gtalk' OR app_name = 'TurboVPN_mm' OR app_name = 'facebook_messenger' OR app_name = 'testAutoApplication'
# ... SELECT group_id,low_boundary,region_name FROM tsg_obj_app_id WHERE is_valid=1 and region_name in('http','ftp','${httpVersion}','ssl','dns','doh','quic','mail')
${app_length} Get Length ${app_id}
log ${app_length}
@@ -253,10 +253,25 @@ TestinLogin
ApiLogout
[Tags] tsg_adc tsg_bf_api
- POST /${version}/user/logout headers=${headers}
- Object response body
- Integer $.code 200
- ${rescode} Integer $.code
+
+
+ # ${headers} Set Variable {"Authorization":"${token}","Content-Type":"application/json"}
+ # Create session api ${httpVersion}://${host}:${port} ${headers} verify=false
+ # ${login_data} Create Dictionary username=${username} password=${encodePassword} authMode=${authmode}
+ # ${login_data} json.Dumps ${login_data}
+ # # ${response}= Post Request api /${version}/user/login?username=${username}&password=${encodePassword}&authMode=${authmode}&vsysId=${vsysId}
+ # ${response} Post Request api /${version}/user/login data=${login_data}
+ # ${response} to json ${response.content}
+ # Should Be Equal As Strings ${response['code']} 200
+
+ ${headers} Set Variable {"Authorization":"${token}","Content-Type":"application/json"}
+ Create session api ${httpVersion}://${host}:${port} ${headers} verify=false
+ ${response} Post Request api /${version}/user/logout
+
+ # POST /${version}/user/logout headers=${headers}
+ # Object response body
+ # Integer $.code 200
+ # ${rescode} Integer $.code
BifangLoginAndAddLocalIP
[Tags] tsg_adc tsg_bf_api
@@ -321,7 +336,7 @@ AddInterceptPolicy
${mvysKeyringId} ${mvysDecryptionProfileId} Run Keyword If "${vsysType}"!="1" and "${tsgVersion}"=="22.10" CreateMvsysInterProfile tango-ca-v3-trust-ca.cer tango-ca-v3-trust-ca.key
... ELSE Set Variable 1 1
Comment 创建安全策略
- ${policyDict} Run Keyword If "${tsgVersion}">="22.11" Create Dictionary policyName=SecurityPolicy-Intercept-001 policyType=pxy_intercept policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring_for_trusted":${turstKeyringId},"keyring_for_untrusted":${unTurstKeyringId},"decryption":${defaultDescryptionId},"tcp_option_profile":1,"traffic_mirror":{"enable":0,"mirror_profile":null}} isValid=${1} appIdObjects=${SSL_ID},${HTTP_ID}
+ ${policyDict} Run Keyword If "${tsgVersion}">="22.11" Create Dictionary policyName=SecurityPolicy-Intercept-001 policyType=pxy_intercept policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring_for_trusted":${turstKeyringId},"keyring_for_untrusted":${unTurstKeyringId},"decryption_profile":${defaultDescryptionId},"tcp_option_profile":1,"traffic_mirror":{"enable":0}} isValid=${1} appIdObjects=${SSL_ID},${HTTP_ID}
... ELSE Create Dictionary policyName=SecurityPolicy-Intercept-001 policyType=tsg_security policyDesc=autotest action=intercept userRegion={"protocol":"SSL","keyring":${mvysKeyringId},"decryption":${mvysDecryptionProfileId},"traffic_mirror":{"enable":0}} isValid=${1} appIdObjects=${SSL_ID},${HTTP_ID}
log ${policyDict}
${rescode} ${policyId} AddPolicies 1 ${policyDict} v2