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
9e27e899
Commit
9e27e899
authored
Dec 12, 2019
by
sanshi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产创建
parent
ea0bc58f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
85 additions
and
10 deletions
+85
-10
Administrator.xml
.idea/dictionaries/Administrator.xml
+1
-0
test_device_create.py
WorkCase/APP/Device/test_device_create.py
+0
-0
__init__.py
WorkCase/APP/__init__.py
+74
-0
__init__.py
WorkCase/__init__.py
+10
-10
No files found.
.idea/dictionaries/Administrator.xml
View file @
9e27e899
...
...
@@ -33,6 +33,7 @@
<w>
graphids
</w>
<w>
groupid
</w>
<w>
groupids
</w>
<w>
hostdiscovery
</w>
<w>
hostgroup
</w>
<w>
hostid
</w>
<w>
hostids
</w>
...
...
WorkCase/APP/Device/test_device_create.py
View file @
9e27e899
This diff is collapsed.
Click to expand it.
WorkCase/APP/__init__.py
View file @
9e27e899
from
WorkApi.APP.Api.api_login
import
ApiLogin
from
WorkApi.APP.Device.device_create
import
DeviceCreate
import
allure
from
WorkUtils.UtilsResponse
import
UtilsResponse
class
AppBase
(
object
):
def
__init__
(
self
,
host
):
self
.
host
=
host
self
.
token
=
None
self
.
host_id
=
None
@allure.step
(
"调用接口:api.login"
)
def
api_login
(
self
,
name
=
None
,
password
=
None
):
api
=
ApiLogin
(
_host
=
self
.
host
)
api
.
name
=
name
api
.
password
=
password
api
.
get_response
()
return
api
.
response
@allure.step
(
"获取token"
)
def
get_base_token
(
self
,
login_name
,
base_password
):
response
=
self
.
api_login
(
name
=
login_name
,
password
=
base_password
)
self
.
token
=
UtilsResponse
()
.
get_data
(
response
=
response
)
return
self
.
token
@allure.step
(
"调用接口:device.create"
)
def
device_create
(
self
,
token
=
None
,
hostName
=
None
,
hostType
=
None
,
manageLevel
=
None
,
iplist
=
None
,
dns
=
None
,
monitorInterface
=
None
,
monitorType
=
None
,
parentHost
=
None
,
businessIds
=
None
,
businessTree
=
None
,
opsPerson
=
None
,
snmpCommunity
=
None
,
ipmiAuthtype
=
None
,
ipmiPrivilege
=
None
,
ipmiUsername
=
None
,
ipmiPassword
=
None
,
factoryId
=
None
,
model
=
None
,
version
=
None
,
serialnumber
=
None
,
description
=
None
,
monitorStatus
=
None
):
api
=
DeviceCreate
(
_host
=
self
.
host
)
api
.
token
=
token
api
.
hostName
=
hostName
api
.
hostType
=
hostType
api
.
manageLevel
=
manageLevel
api
.
iplist
=
iplist
api
.
dns
=
dns
api
.
monitorInterface
=
monitorInterface
api
.
monitorType
=
monitorType
api
.
parentHost
=
parentHost
api
.
businessIds
=
businessIds
api
.
businessTree
=
businessTree
api
.
opsPerson
=
opsPerson
api
.
snmpCommunity
=
snmpCommunity
api
.
ipmiAuthtype
=
ipmiAuthtype
api
.
ipmiPrivilege
=
ipmiPrivilege
api
.
ipmiUsername
=
ipmiUsername
api
.
ipmiPassword
=
ipmiPassword
api
.
factoryId
=
factoryId
api
.
model
=
model
api
.
version
=
version
api
.
serialnumber
=
serialnumber
api
.
description
=
description
api
.
monitorStatus
=
monitorStatus
api
.
get_response
()
return
api
.
response
@allure.step
(
"创建测试数据"
)
def
case_create
(
self
,
base_name
,
num
,
host_type
,
iplist
,
port
,
businessIds
):
name
=
base_name
+
num
response
=
self
.
device_create
(
token
=
self
.
token
,
hostName
=
name
,
hostType
=
host_type
,
iplist
=
iplist
,
monitorInterface
=
port
,
monitorType
=
1
,
manageLevel
=
1
,
parentHost
=
1
,
businessIds
=
businessIds
,
opsPerson
=
11
,
snmpCommunity
=
"snmpCommunity"
,
ipmiAuthtype
=
1
,
ipmiPrivilege
=
1
,
ipmiUsername
=
"ipmiUsername"
,
ipmiPassword
=
"ipmiPassword"
,
factoryId
=
1
,
model
=
"model"
,
version
=
"version"
,
serialnumber
=
"serialnumber"
,
description
=
"description"
,
monitorStatus
=
1
)
self
.
host_id
=
UtilsResponse
()
.
get_data
(
response
=
response
)
return
self
.
host_id
WorkCase/__init__.py
View file @
9e27e899
...
...
@@ -9,17 +9,17 @@ class CaseBase:
self
.
environment
=
{
# "host": "http://10.0.0.12:7070",
# "db_url": "10.0.0.153",
# "db_port": 3306,
# "db_user": "zmops",
# "db_pw": "0VMoH%W7|h",
# "db_base": "zabbix",
"host"
:
"http://172.16.3.197:7070"
,
"db_url"
:
"172.16.2.155"
,
"db_url"
:
"172.16.2.153"
,
"db_port"
:
3306
,
"db_user"
:
"root"
,
"db_pw"
:
"123456"
,
"db_base"
:
"zabbix"
"db_user"
:
"zmops"
,
"db_pw"
:
"0VMoH
%
W7|h"
,
"db_base"
:
"zabbix"
,
"host"
:
"http://172.16.3.197:7070"
,
# "db_url": "172.16.2.155",
# "db_port": 3306,
# "db_user": "root",
# "db_pw": "123456",
# "db_base": "zabbix"
}
self
.
app_environment
=
{
...
...
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