Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Z
zmops-test
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sanshi
zmops-test
Commits
1f11336d
Commit
1f11336d
authored
Dec 16, 2019
by
sanshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
整个业务代码重构
parent
406cd0c4
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
8 deletions
+16
-8
test_rule_create.py
WorkCase/APP/Rule/test_rule_create.py
+14
-7
__init__.py
WorkCase/__init__.py
+2
-1
No files found.
WorkCase/APP/Rule/test_rule_create.py
View file @
1f11336d
...
...
@@ -188,8 +188,9 @@ class TestRuleCreate(object):
@allure.story
(
"创建告警规则:创建普通告警规则"
)
@allure.severity
(
"blocker"
)
def
test_case_04
(
self
):
host_name
=
self
.
base_host_name
+
"04"
name
=
self
.
base_name
+
"04"
host_id
=
self
.
app
.
case_create_host
(
name
=
name
,
host_type
=
self
.
base_type_agent
,
host_id
=
self
.
app
.
case_create_host
(
name
=
host_
name
,
host_type
=
self
.
base_type_agent
,
iplist
=
self
.
base_ip
,
port
=
self
.
base_port
,
businessIds
=
self
.
base_business_id_1
+
","
+
self
.
base_business_id_2
)
...
...
@@ -208,8 +209,9 @@ class TestRuleCreate(object):
@allure.title
(
"rule.create:创建agent设备在线规则"
)
@allure.story
(
"创建告警规则:创建agent设备在线规则"
)
def
test_case_05
(
self
):
host_name
=
self
.
base_host_name
+
"05"
name
=
self
.
base_name
+
"05"
host_id
=
self
.
app
.
case_create_host
(
name
=
name
,
host_type
=
self
.
base_type_agent
,
host_id
=
self
.
app
.
case_create_host
(
name
=
host_
name
,
host_type
=
self
.
base_type_agent
,
iplist
=
self
.
base_ip
,
port
=
self
.
base_port
,
businessIds
=
self
.
base_business_id_1
+
","
+
self
.
base_business_id_2
)
item_key
=
"agent.ping"
...
...
@@ -224,8 +226,9 @@ class TestRuleCreate(object):
@allure.title
(
"rule.create:创建agent设备离线规则"
)
@allure.story
(
"创建告警规则:创建agent设备离线规则"
)
def
test_case_06
(
self
):
host_name
=
self
.
base_host_name
+
"06"
name
=
self
.
base_name
+
"06"
host_id
=
self
.
app
.
case_create_host
(
name
=
name
,
host_type
=
self
.
base_type_agent
,
host_id
=
self
.
app
.
case_create_host
(
name
=
host_
name
,
host_type
=
self
.
base_type_agent
,
iplist
=
self
.
base_ip
,
port
=
self
.
base_port
,
businessIds
=
self
.
base_business_id_1
+
","
+
self
.
base_business_id_2
)
item_key
=
"agent.ping"
...
...
@@ -240,8 +243,9 @@ class TestRuleCreate(object):
@allure.title
(
"rule.create:创建icmp设备在线规则"
)
@allure.story
(
"创建告警规则:创建icmp设备在线规则"
)
def
test_case_07
(
self
):
host_name
=
self
.
base_host_name
+
"07"
name
=
self
.
base_name
+
"07"
host_id
=
self
.
app
.
case_create_host
(
name
=
name
,
host_type
=
self
.
base_type_snmp
,
host_id
=
self
.
app
.
case_create_host
(
name
=
host_
name
,
host_type
=
self
.
base_type_snmp
,
iplist
=
self
.
base_ip
,
port
=
self
.
base_port
,
businessIds
=
self
.
base_business_id_1
+
","
+
self
.
base_business_id_2
)
item_key
=
"icmpping"
...
...
@@ -256,8 +260,9 @@ class TestRuleCreate(object):
@allure.title
(
"rule.create:创建icmp设备离线规则"
)
@allure.story
(
"创建告警规则:创建icmp设备离线规则"
)
def
test_case_08
(
self
):
host_name
=
self
.
base_host_name
+
"08"
name
=
self
.
base_name
+
"08"
host_id
=
self
.
app
.
case_create_host
(
name
=
name
,
host_type
=
self
.
base_type_snmp
,
host_id
=
self
.
app
.
case_create_host
(
name
=
host_
name
,
host_type
=
self
.
base_type_snmp
,
iplist
=
self
.
base_ip
,
port
=
self
.
base_port
,
businessIds
=
self
.
base_business_id_1
+
","
+
self
.
base_business_id_2
)
item_key
=
"icmpping"
...
...
@@ -272,8 +277,9 @@ class TestRuleCreate(object):
@allure.title
(
"rule.create:创建普通告警规则-所有字段校验"
)
@allure.story
(
"创建告警规则:创建普通告警规则-所有字段校验"
)
def
test_case_09
(
self
):
host_name
=
self
.
base_host_name
+
"09"
name
=
self
.
base_name
+
"09"
host_id
=
self
.
app
.
case_create_host
(
name
=
name
,
host_type
=
self
.
base_type_agent
,
host_id
=
self
.
app
.
case_create_host
(
name
=
host_
name
,
host_type
=
self
.
base_type_agent
,
iplist
=
self
.
base_ip
,
port
=
self
.
base_port
,
businessIds
=
self
.
base_business_id_1
+
","
+
self
.
base_business_id_2
)
...
...
@@ -305,4 +311,5 @@ if __name__ == "__main__":
# a = TestRuleCreate()
# a.setup_class()
# a.test_case_08()
# a.setup_method()
# a.test_case_02()
WorkCase/__init__.py
View file @
1f11336d
...
...
@@ -23,7 +23,8 @@ class CaseBase:
}
self
.
app_environment
=
{
"host"
:
"http://172.16.3.78:3334"
,
"host"
:
"http://172.16.3.25:3334"
,
# "host": "http://172.16.3.78:3334",
"db_url"
:
"172.16.2.155"
,
"db_port"
:
3306
,
"db_user"
:
"root"
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment