summaryrefslogtreecommitdiff
path: root/variable
diff options
context:
space:
mode:
Diffstat (limited to 'variable')
-rw-r--r--variable/all_flow_case_variable.txt1
-rw-r--r--variable/common_variable.txt95
-rw-r--r--variable/config.yml38
-rw-r--r--variable/file_operation.robot36
-rw-r--r--variable/policy_object_default.txt53
-rw-r--r--variable/var.yaml7
6 files changed, 230 insertions, 0 deletions
diff --git a/variable/all_flow_case_variable.txt b/variable/all_flow_case_variable.txt
new file mode 100644
index 0000000..c742ffc
--- /dev/null
+++ b/variable/all_flow_case_variable.txt
@@ -0,0 +1 @@
+*** Variables ***
diff --git a/variable/common_variable.txt b/variable/common_variable.txt
new file mode 100644
index 0000000..c5c395f
--- /dev/null
+++ b/variable/common_variable.txt
@@ -0,0 +1,95 @@
+*** Variables ***
+#登录类型:api | cli | ${None}(tsg mib) | 未指定,默认为ui
+${loginType} ui
+#执行环境是否Widonws
+${systemType} Windows
+#API配置信息
+${host} 192.168.44.72
+${port} 8080
+${authmode} 1
+${authCode} ${EMPTY}
+${ldapId} 27
+${version} v1
+${version2} v2
+${username} byb
+${password} 111111
+${encodePassword} ${EMPTY}
+${token} ${EMPTY}
+#[Documentation] 测试终端IP统一配置
+${testClentIP} 192.168.50.19
+${testSubscriberID} $test19
+#自动化标签
+${userTagIds} ${EMPTY}
+#Documentation] 是否添加测试终端IP到策略统一配置,0为不添加测试终端IP,1为添加测试终端IP,默认1
+${addTestClentIPFlag} 1
+#测试环境是否需要把tsgui和api添加为SecurityPolicy-Allow 1为需要,默认1 ,
+${addTsgUIAPIFlag} 1
+#执行需要暂停时间
+#策略下发后到验证需等待时间
+${policyVerificationSleepSeconds} 20
+#策略验证后到验证策略日志需等待时间
+${policyLogVerificationSleepSeconds} 60
+${path} C:/Users/admin/Desktop/sql/gap_tsg_ui/other/
+${Downloadpath} C:/Users/byb11/Downloads/
+${curlbatpath} ${path}curl/
+${mailpath} ${path}/mail/
+${responsePageFiles} ${path}/response_pages_files/
+#全流程分阶段测试参数
+#[Documentation] 当前测试部分,all为一个终端全网全流程测试,
+#1为添加策略和对象测试;
+#2为功能端业务验证部分测试;
+#3为llog日志验证测试
+${testPart} all
+#UI配置的本地IP名称
+${LocahIPName} ${EMPTY}
+${ipType} ipv4
+${ipMask} 255.255.255.255
+${browserType} chrome
+# Cli自动化测试变量[start]
+${cliHost} 192.168.40.165
+${cliUsername} tsgadmin
+${cliPassword} Cli2019
+${timeout} 600s
+${retryInterval} 300s
+@{PolicyTypes} tsg_security pxy_manipulation
+@{ObjectTypes} ip url fqdn keywords subscriberid fqdn_category account
+... http_signature
+# Cli自动化测试变量[end]
+# SNMP服务测试变量[start]
+${snmpHost} 192.168.40.165
+${snmpPort} 50161
+${snmpConnTimeout} 5 # 默认超时时间为6s,设置timeout值后超时时间为n*6s
+${snmpCommunity} public
+# SNMP服务测试变量[end]
+#API配置信息
+${oamHost} 192.168.40.210
+${oamPort} 50080
+${contrast} 0.1
+${editpasswd} no #设置密码过期时是否需要修改密码,no为不修改,yes为修改
+# Mysql数据库连接信息
+${mysqlHost} host='192.168.44.72',port=3306,user='root',passwd='bifang!@#',database='tsg-bifang'
+#休息时间
+${sleep_min} 1
+${sleep} 3
+# 隐式等待时间
+${sleep_Wait} 20
+#name个人标识
+${tag} lyf
+#日志查询次数
+${logfornumber} 3
+#邮箱账户信息
+${mailAccount163Dxy} [email protected]
+${mailPasswordDxy} CXFBCUSBOZCWSMRW
+${mailAccount163Lyf} [email protected]
+${mailPasswordLyf} XEYQVHEMTOBOJSAP
+
+#GTP协议添加到策略中字段
+${imsi} 11235666*
+${phone_number1} 1384487*
+${phone_number2} *0339
+${phone_number3} 4487
+${phone_number4} $13844870339
+${apn1} $huawei
+${apn2} *uawei
+#是否添加策略,添加策略则调用sql加载相关配置,默认为1
+${addPolicy} 0 \ No newline at end of file
diff --git a/variable/config.yml b/variable/config.yml
new file mode 100644
index 0000000..342e845
--- /dev/null
+++ b/variable/config.yml
@@ -0,0 +1,38 @@
+#待执行的产品项目, Cloud -云项目; rfcode -执行所有的项目
+https://www.cnblogs.com/jun-zi/p/12055300.html
+ProductItem: Cloud
+
+#待执行的测试套件(标签), all -所有的测试套件: debug -调试中套件; login -登录功能 ; filter -账号筛选: P1 -一级用例
+testSuite: P1
+
+#测试报告标题
+testReportTitle: Cloud_Report
+
+#失败重试开关, 0 -关, 1 -开 ,开启后默认重试一次
+retry_switch: 0
+#失败重试次数
+retryTime: 1
+
+#发送测试报告邮件开关, 0 -关, 1 -开
+emailSwitch: 1
+
+#邮件配置
+#发件邮箱
+smtp_server: smtp.126.com
+server_username: [email protected]
+server_pwd: XXXXXX
+#收件人(列表)
+msg_to:
+
+#邮件主题
+msg_subject: '[XX项目][测试环境-develop][jira号][自动化测试报告]'
+
+#日志级别(字典),由高到低: CRITICAL 、 ERROR 、 WARNING 、 INFO 、 DEBUG
+log:
+ file_name: test.log
+ backup: 5
+ console_level: DEBUG #控制台日志级别
+ file_level: DEBUG #文件日志级别
+ pattern: '%(asctime)s - %(name)s - %(levelname)s - %(message)s' \ No newline at end of file
diff --git a/variable/file_operation.robot b/variable/file_operation.robot
new file mode 100644
index 0000000..44eca35
--- /dev/null
+++ b/variable/file_operation.robot
@@ -0,0 +1,36 @@
+*** Settings ***
+Library String
+Library json
+Library OperatingSystem
+Library RequestsLibrary
+Library Selenium2Library
+Library Collections
+Library FileLibrary
+Resource ../common.robot
+Resource ../../../variable/common_variable.txt
+
+*** Keywords ***
+insert_policyId_to_file
+ [Arguments] ${key} ${policyId} ${objectids}
+ ${dict} Create Dictionary policyId=${policyId} objectId=${objectids}
+ ${json} json.Dumps ${dict}
+ Alter Dict ${path}/variable/AllFlowCaseVariable.txt ${key} ${json}
+
+insert_time_to_file
+ [Arguments] ${key} ${starttime} ${endtime}
+ ${value} json.Loads ${${key}}
+ ${dict} Create Dictionary policyId=${value}[policyId] objectId=${value}[objectId] starttime=${starttime} endtime=${endtime}
+ ${json} json.Dumps ${dict}
+ Alter Dict ${path}/variable/AllFlowCaseVariable.txt ${key} ${json}
+
+insert_policyId_to_file1
+ [Arguments] ${key} ${objectids}
+ Alter Dict ${path}/all_flow_case_variable.txt ${key} ${objectids}
+
+insert_time_to_file1
+ [Arguments] ${key} ${starttime}
+ Alter Dict ${path}/AllFlowCaseVariable1.txt ${key} ${starttime}
+
+insert_Report_to_file1
+ [Arguments] ${key} ${objectids}
+ Alter Dict ${path}/ReportCaseVariable.txt ${key} ${objectids}
diff --git a/variable/policy_object_default.txt b/variable/policy_object_default.txt
new file mode 100644
index 0000000..d38e644
--- /dev/null
+++ b/variable/policy_object_default.txt
@@ -0,0 +1,53 @@
+*** Variables ***
+# 通用
+${Default_IsValid} ${1}
+${Default_IsDelete} false
+
+# 策略
+${Default_PolicyName} autotest_policy
+${Default_PolicyType} tsg_security
+${Default_PolicyDesc} autotest
+${Default_Action} deny
+${Default_PolicySubAction} drop
+${Default_EffectiveRange}
+${Default_UserRegion} method:rst
+${Default_ReferenceObject} ${EMPTY}
+${Default_AppObjectIdArray} []
+${Default_UserTags} ${EMPTY}
+${Default_DoLog} ${1}
+${Default_ScheduleId} ${EMPTY}
+#策略v2
+${Default_v2_SourceObject} ${EMPTY}
+${Default_v2_DestinationObject} ${EMPTY}
+${Default_v2_FilterObject} ${EMPTY}
+# 对象
+${Default_ObjectType} ip
+${Default_CategoryType} fqdn
+${Default_ObjectSubType} ${EMPTY}
+${Default_IsInitialize} ${0}
+${Default_IsExclusion} ${0}
+${Default_ObjectName} autotestobj
+${Default_ObjectDesc} autotestobj
+${Default_SubObjectIds} ${None}
+${Default_Dimension} Function
+${Default_Origin} net
+${Default_AddItem_AddrType} ${4}
+${Default_AddItem_Protocol} ${0}
+${Default_AddItem_Direction} ${0}
+${Default_AddItem_IsSession} endpoint
+${Default_AddItem_ServerIpFormat} range
+${Default_AddItem_ServerIp1} ${EMPTY}
+${Default_AddItem_ServerIp2} ${EMPTY}
+${Default_AddItem_ServerPort} ${0}/${0}
+${Default_AddItem_IsHexbin} ${0}
+${Default_AddItem_IsInitialize} ${0}
+${Default_AddItem_ItemName} ${EMPTY}
+${Default_AddItem_ItemDesc} ${EMPTY}
+#默认客户端条件类型:clientip or clientsubid or clientImsi or clientPhoneNumber or clientApn
+${Default_Client_Type} clientip
+${Default_Client_subidType} clientsubid
+${Default_Client_imsiType} clientImsi
+${Default_Client_phonenumberType} clientPhoneNumber
+${Default_Client_apnType} clientApn
+${Default_PolicyEnabled} open
+${Default_PolicyLogSession} 1 \ No newline at end of file
diff --git a/variable/var.yaml b/variable/var.yaml
new file mode 100644
index 0000000..86170ae
--- /dev/null
+++ b/variable/var.yaml
@@ -0,0 +1,7 @@
+username:dongxiaoyan
+password:111111
+bifang:
+ host:192.168.44.72
+ port:8080
+ mysqlHost:host='192.168.44.71',port=3306,user='root',passwd='bifang!@#',database='tsg-bifang'
+ui: \ No newline at end of file