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
cc33a9c8
Commit
cc33a9c8
authored
8 years ago
by
Stéphane Diemer
Browse files
Options
Downloads
Patches
Plain Diff
Changed DNS test.
parent
e275f5ce
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_dns_records.py
+35
-30
35 additions, 30 deletions
tests/test_dns_records.py
with
35 additions
and
30 deletions
tests/test_dns_records.py
+
35
−
30
View file @
cc33a9c8
...
...
@@ -53,39 +53,44 @@ def check_dns(hostname, expected_ip):
os
.
chdir
(
os
.
path
.
dirname
(
__file__
))
if
os
.
path
.
isfile
(
'
../utils.py
'
):
all_ok
=
True
es_utils
=
imp
.
load_source
(
'
es_utils
'
,
'
../utils.py
'
)
conf
=
es_utils
.
load_conf
()
ip
=
conf
.
get
(
'
NETWORK_IP_NAT
'
)
if
not
ip
or
ip
==
'
0
'
:
ip
=
conf
.
get
(
'
NETWORK_IP
'
)
conf_resolvers_keys
=
(
'
NETWORK_DNS1
'
,
'
NETWORK_DNS2
'
,
)
for
conf_resolver_key
in
conf_resolvers_keys
:
conf_resolver
=
conf
.
get
(
conf_resolver_key
)
if
conf_resolver
and
conf_resolver
!=
'
0
'
and
conf_resolver
not
in
resolvers
:
print
(
'
Resolver %s not configured on the system
'
%
conf_resolver
)
all_ok
=
False
conf_servers
=
(
'
MS_SERVER_NAME
'
,
'
MONITOR_SERVER_NAME
'
,
'
CM_SERVER_NAME
'
,
)
for
s
in
conf_servers
:
hostname
=
conf
.
get
(
s
)
ok
=
check_dns
(
hostname
,
ip
)
if
not
ok
:
all_ok
=
False
else
:
if
not
os
.
path
.
isfile
(
'
../utils.py
'
):
print
(
'
conf.sh not found
'
)
sys
.
exit
(
1
)
es_utils
=
imp
.
load_source
(
'
es_utils
'
,
'
../utils.py
'
)
conf
=
es_utils
.
load_conf
()
all_ok
=
True
conf_resolvers_keys
=
(
'
NETWORK_DNS1
'
,
'
NETWORK_DNS2
'
,
)
for
conf_resolver_key
in
conf_resolvers_keys
:
conf_resolver
=
conf
.
get
(
conf_resolver_key
)
if
conf_resolver
and
conf_resolver
!=
'
0
'
and
conf_resolver
not
in
resolvers
:
print
(
'
Resolver %s not configured on the system
'
%
conf_resolver
)
all_ok
=
False
ip
=
conf
.
get
(
'
NETWORK_IP_NAT
'
)
if
not
ip
or
ip
==
'
0
'
:
ip
=
conf
.
get
(
'
NETWORK_IP
'
)
if
not
ip
or
ip
==
'
0
'
:
if
not
all_ok
:
sys
.
exit
(
1
)
# cannot test resolution IP
sys
.
exit
(
2
)
conf_servers
=
(
'
MS_SERVER_NAME
'
,
'
MONITOR_SERVER_NAME
'
,
'
CM_SERVER_NAME
'
,
)
for
s
in
conf_servers
:
hostname
=
conf
.
get
(
s
)
ok
=
check_dns
(
hostname
,
ip
)
if
not
ok
:
all_ok
=
False
if
not
all_ok
:
sys
.
exit
(
1
)
else
:
...
...
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