Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
envsetup
Manage
Activity
Members
Plan
Redmine
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mediaserver
envsetup
Commits
af00d5a8
Commit
af00d5a8
authored
6 years ago
by
Stéphane Diemer
Browse files
Options
Downloads
Patches
Plain Diff
Do not test DNS of non installed services (refs
#24569
).
parent
a82a7148
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_dns_records.py
+16
-16
16 additions, 16 deletions
tests/test_dns_records.py
with
16 additions
and
16 deletions
tests/test_dns_records.py
+
16
−
16
View file @
af00d5a8
...
@@ -85,24 +85,24 @@ if not ip or ip == '0':
...
@@ -85,24 +85,24 @@ if not ip or ip == '0':
print
(
'
No IP set in configuration file, unable to test DNS.
'
)
print
(
'
No IP set in configuration file, unable to test DNS.
'
)
sys
.
exit
(
2
)
sys
.
exit
(
2
)
conf_servers
=
(
services_info
=
(
'
MS_SERVER_NAME
'
,
(
'
MS_SERVER_NAME
'
,
'
mediaserver
'
,
'
python3-mediaserver
'
),
'
MONITOR_SERVER_NAME
'
,
(
'
MONITOR_SERVER_NAME
'
,
'
monitor
'
,
'
python3-mediaserver-monitor
'
),
'
CM_SERVER_NAME
'
,
(
'
CM_SERVER_NAME
'
,
'
campusmanager
'
,
'
campus-manager
'
),
)
)
conf_
server_defaults
=
(
for
conf_
name
,
default_domain
,
package
in
services_info
:
'
mediaserver
'
,
domain
=
conf
.
get
(
conf_name
)
'
monitor
'
,
if
domain
and
domain
!=
default_domain
:
'
campusmanager
'
,
# check that the service is installed on this system
)
status
,
output
=
subprocess
.
getstatusoutput
(
'
dpkg -s %s
'
%
package
)
if
status
==
0
:
for
s
in
conf_servers
:
print
(
'
Checking IP of
"
%s
"
.
'
%
domain
)
hostname
=
conf
.
get
(
s
)
ok
=
check_dns
(
domain
,
ip
)
if
hostname
not
in
conf_server_defaults
:
if
not
ok
:
ok
=
check_dns
(
hostname
,
ip
)
all_ok
=
False
if
not
ok
:
else
:
all_ok
=
False
print
(
'
Package %s is not installed, IP of
"
%s
"
will not be checked.
'
%
(
package
,
domain
))
if
not
all_ok
:
if
not
all_ok
:
sys
.
exit
(
1
)
sys
.
exit
(
1
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment