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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
slapos
Commits
52c3633d
Commit
52c3633d
authored
May 25, 2018
by
Eteri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use putil for keep-alive test
parent
56d0240e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
8 deletions
+14
-8
software/erp5testnode/testsuite/fluentTest/tests/test.py
software/erp5testnode/testsuite/fluentTest/tests/test.py
+14
-8
No files found.
software/erp5testnode/testsuite/fluentTest/tests/test.py
View file @
52c3633d
...
...
@@ -14,6 +14,8 @@ import subprocess
test_msg
=
"dummyInputSimpleIngest"
caddy_pidfile
=
os
.
environ
.
get
(
'CADDY_DIR'
)
with
open
(
caddy_pidfile
)
as
f
:
caddy_pid
=
f
.
readline
()
if
os
.
environ
.
get
(
'DEBUG'
):
import
logging
...
...
@@ -96,13 +98,20 @@ class TestIngestion(FluentdPluginTestCase):
start_fluentd_cat
(
self
,
test_msg
,
"tag_test_2"
)
time
.
sleep
(
10
)
self
.
assertEqual
(
test_msg
,
TestServerHandler
.
posted_data
)
def
test_keepAlive_on
(
self
):
print
(
"############## TEST 3 ##############"
)
s
=
requests
.
session
()
print
(
"check connection type "
)
print
(
s
.
headers
[
'Connection'
])
self
.
assertEqual
(
'keep-alive'
,
s
.
headers
[
'Connection'
])
caddy_process
=
psutil
.
Process
(
int
(
caddy_pid
))
port
=
9443
start_fluentd_cat
(
self
,
"dummyInputDelayCheckKeepAlive"
,
"tag_test_3"
)
time
.
sleep
(
10
)
for
conn
in
caddy_process
.
connections
(
'inet'
):
if
len
(
conn
.
raddr
)
>
1
and
conn
.
laddr
.
port
==
4443
:
self
.
assertEqual
(
'ESTABLISHED'
,
conn
.
status
)
#conn.status == 'ESTABLISHED' :
def
test_ingest_with_15mins_delay
(
self
):
'''
...
...
@@ -124,9 +133,6 @@ class TestIngestion(FluentdPluginTestCase):
'''
print
(
"############## TEST 5 ##############"
)
with
open
(
caddy_pidfile
)
as
f
:
caddy_pid
=
f
.
readline
()
start_fluentd_cat
(
self
,
"dummyInputCaddyRestart1"
,
"tag_test_5_1"
)
time
.
sleep
(
10
)
...
...
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