Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Paul Graydon
slapos
Commits
2bc52efd
Commit
2bc52efd
authored
Jul 29, 2024
by
Paul Graydon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/fluentd: Add tests for wendelin-telecom-gateway software type
parent
7a4a8001
Pipeline
#37000
passed with stage
in 0 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
56 additions
and
0 deletions
+56
-0
software/fluentd/test/test.py
software/fluentd/test/test.py
+56
-0
No files found.
software/fluentd/test/test.py
View file @
2bc52efd
...
@@ -280,3 +280,59 @@ class GatewayConfTestCase(WendelinTutorialTestCase):
...
@@ -280,3 +280,59 @@ class GatewayConfTestCase(WendelinTutorialTestCase):
msgpack
.
unpackb
(
msgpack
.
unpackb
(
self
.
serve
(
self
.
_wendelin_port
,
WendelinHTTPRequestHandler
)),
self
.
serve
(
self
.
_wendelin_port
,
WendelinHTTPRequestHandler
)),
)
)
class
WendelinTelecomGatewayTutorialTestCase
(
FluentdTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'port'
:
cls
.
_fluentd_port
,
'shared-key'
:
'secret'
,
'wendelin-frontend-url'
:
f'http://[
{
cls
.
computer_partition_ipv6_address
}
]:
{
cls
.
_wendelin_telecom_port
}
'
,
'username'
:
'foo'
,
'password'
:
'bar'
}
@
classmethod
def
getInstanceSoftwareType
(
cls
):
return
'wendelin-telecom-gateway'
@
classmethod
def
setUpClass
(
cls
):
cls
.
_tmp_dir
=
tempfile
.
mkdtemp
()
fluentd_port
=
findFreeTCPPort
(
cls
.
computer_partition_ipv6_address
)
cls
.
_fluentd_port
=
fluentd_port
wendelin_telecom_port
=
findFreeTCPPort
(
cls
.
computer_partition_ipv6_address
)
cls
.
_wendelin_telecom_port
=
wendelin_telecom_port
super
(
FluentdTestCase
,
cls
).
setUpClass
()
cls
.
_fluentd_conf
=
os
.
path
.
join
(
cls
.
computer_partition_root_path
,
'etc'
,
'fluentd-agent.conf'
)
fluentd_dir
=
os
.
path
.
join
(
cls
.
computer_partition_root_path
,
'software_release'
,
'parts'
,
'fluentd'
)
cls
.
_fluentd_bin
=
os
.
path
.
join
(
fluentd_dir
,
'bin'
,
'fluentd'
)
cls
.
_gem_path
=
os
.
path
.
join
(
fluentd_dir
,
'lib'
,
'ruby'
,
'gems'
)
@
classmethod
def
tearDownClass
(
cls
):
shutil
.
rmtree
(
cls
.
_tmp_dir
)
super
(
FluentdTestCase
,
cls
).
tearDownClass
()
def
read_fluentd_conf
(
self
):
return
subprocess
.
check_output
(
[
self
.
_fluentd_bin
,
'-c'
,
self
.
_fluentd_conf
,
'--dry-run'
],
env
=
{
'GEM_PATH'
:
self
.
_gem_path
},
text
=
True
,
)
def
_test_configuration
(
self
,
expected_str
):
self
.
assertRegex
(
self
.
read_fluentd_conf
(),
expected_str
,
)
def
test_configuration_file
(
self
):
self
.
_test_configuration
(
'starting fluentd'
)
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