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
c25cdb70
Commit
c25cdb70
authored
Feb 11, 2021
by
chrissi^
Browse files
parker: wg-keys are now generated in running mode
parent
a68f58f4
Changes
2
Hide whitespace changes
Inline
Side-by-side
parker/parker.py
View file @
c25cdb70
...
...
@@ -98,7 +98,7 @@ class SmallUBootStrategy(Strategy):
# that the shell responses does not mean all services are ready -.-
time
.
sleep
(
10
)
# wait for
the wireguard keygen
to finish
# wait for
gluon-reconfigure
to finish
start
=
time
.
time
()
for
_
in
range
(
120
):
stdout
,
_
,
_
=
self
.
shell
.
run
(
"ps"
)
...
...
@@ -107,10 +107,10 @@ class SmallUBootStrategy(Strategy):
time
.
sleep
(
5
)
else
:
raise
Exception
(
"glon-reconfigure took too long!"
)
logger
.
info
(
"Gluon-Reconfigure took {}s"
.
format
(
time
.
time
()
-
start
))
print
(
"Gluon-Reconfigure took {}s"
.
format
(
time
.
time
()
-
start
))
# wait until the config mode web-interface is ready
for
_
in
range
(
1
0
):
for
_
in
range
(
2
0
):
try
:
print
(
""
)
r
=
requests
.
get
(
"http://192.168.1.1/"
,
timeout
=
3
)
...
...
parker/test_parker.py
View file @
c25cdb70
...
...
@@ -92,11 +92,6 @@ def test_good_config_no_contact(target, in_good_config):
def
test_good_config_autoupdater_enabled
(
target
,
in_good_config
):
assert_web
(
"http://192.168.1.1/cgi-bin/config/admin/autoupdater"
,
'value="1" id="id.1.1.enabled" name="id.1.1.enabled" checked="checked"'
)
@
pytest
.
mark
.
config_mode
def
test_generated_wg_key
(
target
,
in_good_config
,
command
):
stdout
,
_
,
code
=
command
.
run
(
'cat /etc/parker/wg-privkey | wg pubkey'
)
assert
code
==
0
,
"Verification of WG private key failed: {}"
.
format
(
''
.
join
(
stdout
))
@
pytest
.
mark
.
config_mode
def
test_ssh_authorized_keys
(
target
,
in_good_config
,
command
):
r
=
requests
.
get
(
'http://192.168.1.1/cgi-bin/config/admin/remote'
)
...
...
@@ -171,6 +166,12 @@ def test_good_running_private_wifi_psk(target, in_good_running, config, command)
stdout
,
_
,
_
=
command
.
run
(
"uci show wireless"
)
assert
config
[
"private_wifi_psk"
]
in
" "
.
join
(
stdout
),
"Did not find any wifi-interface with PSK {}"
.
format
(
config
[
"private_wifi_psk"
])
@
pytest
.
mark
.
running_mode
def
test_generated_wg_key
(
target
,
in_good_running
,
command
):
stdout
,
_
,
code
=
command
.
run
(
'cat /etc/parker/wg-privkey | wg pubkey'
)
assert
code
==
0
,
"Verification of WG private key failed: {}"
.
format
(
''
.
join
(
stdout
))
@
pytest
.
mark
.
running_mode
@
pytest
.
mark
.
flaky
(
reruns
=
20
,
reruns_delay
=
10
)
def
test_good_running_wan_dns
(
target
,
in_good_running
,
config
,
command
):
...
...
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