Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
picomon
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Colomban Wendling
picomon
Commits
aea08760
Commit
aea08760
authored
Apr 25, 2014
by
Colomban Wendling
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add a check list class to ease adding tests
parent
a77f9cbc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
picomon.py
picomon.py
+9
-8
No files found.
picomon.py
View file @
aea08760
...
...
@@ -165,20 +165,21 @@ class Host(object):
return
'<Host ipv4="
%
s" ipv6="
%
s">'
%
(
self
.
ipv4
,
self
.
ipv6
)
def
genChecks
(
check
,
dests
):
return
[
check
(
d
)
for
d
in
dests
]
class
Checks
(
list
):
def
add
(
self
,
check
,
dests
):
self
+=
[
check
(
d
)
for
d
in
dests
]
mail
=
Host
(
ipv4
=
'127.0.0.1'
,
ipv6
=
'::1'
)
web
=
Host
(
ipv4
=
'127.0.0.0'
,
ipv6
=
'::42'
)
alsace
=
Host
(
ipv4
=
'127.0.0.1'
,
ipv6
=
'::1'
)
checks
=
\
genChecks
(
CheckDNSZone
,
[
"arn-fai.net"
,
"netlib.re"
])
+
\
genChecks
(
CheckPing4
,
[
mail
,
web
])
+
\
genChecks
(
CheckPing6
,
[
mail
,
web
])
# genChecks
(CheckSMTP4, [mail, alsace])
# genChecks
(CheckSMTP6, [mail, alsace])
checks
=
Checks
()
checks
.
add
(
CheckDNSZone
,
[
"arn-fai.net"
,
"netlib.re"
])
checks
.
add
(
CheckPing4
,
[
mail
,
web
])
checks
.
add
(
CheckPing6
,
[
mail
,
web
])
# checks.add
(CheckSMTP4, [mail, alsace])
# checks.add
(CheckSMTP6, [mail, alsace])
if
__name__
==
'__main__'
:
...
...
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