Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
km3io
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
km3py
km3io
Commits
06640ddc
Commit
06640ddc
authored
5 years ago
by
Johannes Schumann
Browse files
Options
Downloads
Patches
Plain Diff
Tests for udp_trailer and udp max sequence number
parent
d09cd8d3
No related branches found
No related tags found
1 merge request
!7
Summaryslice status
Pipeline
#7943
passed with warnings
5 years ago
Stage: test
Stage: coverage
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_daq.py
+64
-2
64 additions, 2 deletions
tests/test_daq.py
with
64 additions
and
2 deletions
tests/test_daq.py
+
64
−
2
View file @
06640ddc
...
@@ -2,7 +2,7 @@ import os
...
@@ -2,7 +2,7 @@ import os
import
re
import
re
import
unittest
import
unittest
from
km3io.daq
import
DAQReader
,
get_rate
,
get_fifo_status
from
km3io.daq
import
DAQReader
,
get_rate
,
get_fifo_status
,
has_udp_trailer
,
get_udp_max_sequence_number
SAMPLES_DIR
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"
samples
"
)
SAMPLES_DIR
=
os
.
path
.
join
(
os
.
path
.
dirname
(
__file__
),
"
samples
"
)
...
@@ -175,13 +175,75 @@ class TestSummaryslices(unittest.TestCase):
...
@@ -175,13 +175,75 @@ class TestSummaryslices(unittest.TestCase):
def
test_rates
(
self
):
def
test_rates
(
self
):
assert
3
==
len
(
self
.
ss
.
rates
)
assert
3
==
len
(
self
.
ss
.
rates
)
@unittest.skip
#TODO
def
test_fifo
(
self
):
def
test_fifo
(
self
):
s
=
self
.
ss
.
slices
[
0
]
s
=
self
.
ss
.
slices
[
0
]
dct_fifo_stat
=
{
808981510
:
True
,
808981523
:
False
,
808981672
:
False
,
808974773
:
False
}
dct_fifo_stat
=
{
808981510
:
True
,
808981523
:
False
,
808981672
:
False
,
808974773
:
False
}
for
dom_id
,
fifo_status
in
dct_fifo_stat
.
items
():
for
dom_id
,
fifo_status
in
dct_fifo_stat
.
items
():
frame
=
s
[
s
.
dom_id
==
dom_id
]
frame
=
s
[
s
.
dom_id
==
dom_id
]
assert
get_fifo_status
(
frame
.
fifo
[
0
])
==
fifo_status
assert
get_fifo_status
(
frame
.
fifo
[
0
])
==
fifo_status
def
test_has_udp_trailer
(
self
):
s
=
self
.
ss
.
slices
[
0
]
dct_udp_trailer
=
{
806451572
:
True
,
806455814
:
True
,
806465101
:
True
,
806483369
:
True
,
806487219
:
True
,
806487226
:
True
,
806487231
:
True
,
808432835
:
True
,
808435278
:
True
,
808447180
:
True
,
808447186
:
True
}
for
dom_id
,
udp_trailer
in
dct_udp_trailer
.
items
():
frame
=
s
[
s
.
dom_id
==
dom_id
]
assert
has_udp_trailer
(
frame
.
fifo
[
0
])
==
udp_trailer
def
test_max_sequence_number
(
self
):
s
=
self
.
ss
.
slices
[
0
]
dct_seq_numbers
=
{
808974758
:
18
,
808974773
:
26
,
808974811
:
25
,
808974972
:
41
,
808976377
:
35
,
808979567
:
20
,
808979721
:
17
,
808979729
:
25
,
808981510
:
35
,
808981523
:
27
,
808981672
:
17
,
808981812
:
34
,
808981864
:
18
,
808982018
:
21
,
808982041
:
27
,
808982077
:
32
,
808982547
:
20
,
808984711
:
26
,
808996773
:
31
,
808997793
:
21
,
809006037
:
26
,
809007627
:
18
,
809503416
:
28
,
809521500
:
31
,
809524432
:
21
,
809526097
:
23
,
809544058
:
21
,
809544061
:
23
}
for
dom_id
,
max_sequence_number
in
dct_seq_numbers
.
items
():
frame
=
s
[
s
.
dom_id
==
dom_id
]
assert
get_udp_max_sequence_number
(
frame
.
dq_status
[
0
])
==
max_sequence_number
class
TestGetReate
(
unittest
.
TestCase
):
class
TestGetReate
(
unittest
.
TestCase
):
def
test_zero
(
self
):
def
test_zero
(
self
):
...
...
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