Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ffbs
ffbs-ci
Commits
3c84223b
Commit
3c84223b
authored
Jun 05, 2021
by
chrissi^
Browse files
parker: Test if webinterface redirects work
parent
3dad4cde
Changes
1
Hide whitespace changes
Inline
Side-by-side
parker/test_parker.py
View file @
3c84223b
...
...
@@ -8,7 +8,7 @@ import yaml
import
re
import
logging
l
=
logging
.
Logger
(
"pytest"
)
l
ogger
=
logging
.
Logger
(
"pytest"
)
from
labgrid
import
StepReporter
StepReporter
()
...
...
@@ -367,3 +367,38 @@ def test_good_running_ping_gandolf4(target, in_good_running, host_container):
return
time
.
sleep
(
5
)
assert
False
,
"Ping gandolv via v6 failed!"
@
pytest
.
mark
.
running_mode
def
test_good_running_localnode_redirect
(
target
,
in_good_running
,
host_container
,
command
):
stdout
,
_
,
rc
=
host_container
.
run
(
"curl -v http://172.16.127.1/cgi-bin/status"
)
for
l
in
stdout
:
match
=
re
.
search
(
r
"^< Location: http:\/\/([10.\d.]*)\/"
,
l
,
re
.
DOTALL
)
if
match
:
ipv4_redir
=
match
[
1
]
break
else
:
assert
False
,
"No IPv4 redirect detected"
stdout
,
_
,
rc
=
host_container
.
run
(
"curl -v http://[2001:bf7:382::1]/cgi-bin/status"
)
for
l
in
stdout
:
match
=
re
.
search
(
r
"^< Location: http:\/\/\[(2001:[0-9a-f:]*)"
,
l
,
re
.
DOTALL
)
if
match
:
ipv6_redir
=
match
[
1
]
break
else
:
assert
False
,
"No IPv6 redirect detected"
stdout
,
_
,
rc
=
command
.
run
(
"ip -j a"
)
ip_conf
=
json
.
loads
(
""
.
join
(
stdout
))
if_cfg
=
[
x
for
x
in
ip_conf
if
x
[
"ifname"
]
==
"br-client"
]
local_addrs
=
[
x
[
"local"
]
for
x
in
if_cfg
[
0
][
"addr_info"
]
if
x
[
"scope"
]
==
"global"
]
assert
len
(
local_addrs
)
>
0
,
"No addreses on router found"
assert
ipv4_redir
in
local_addrs
,
"IPv4 redirect target not an address on br-client"
assert
ipv6_redir
in
local_addrs
,
"IPv6 redirect target not an address on br-client"
Write
Preview
Supports
Markdown
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