Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sbws
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
juga
sbws
Commits
2e4e0858
Commit
2e4e0858
authored
6 years ago
by
juga
Browse files
Options
Downloads
Patches
Plain Diff
Add more data and more realistic to the tests
parent
26587a89
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/unit/conftest.py
+45
-8
45 additions, 8 deletions
tests/unit/conftest.py
with
45 additions
and
8 deletions
tests/unit/conftest.py
+
45
−
8
View file @
2e4e0858
...
...
@@ -22,19 +22,56 @@ NICK1 = 'A'
NICK2
=
'
B
'
IP1
=
'
169.254.100.1
'
IP2
=
'
169.254.100.2
'
RTTS
=
[
5
,
25
]
DOWNLOADS
=
[{
'
duration
'
:
4
,
'
amount
'
:
40
}]
RTTS1
=
[
0.2943556308746338
,
0.2885427474975586
,
0.2802879810333252
,
0.28124427795410156
,
0.2827129364013672
,
0.2901294231414795
,
0.2784590721130371
,
0.2838578224182129
,
0.2842121124267578
,
0.28656768798828125
]
RTTS2
=
[
0.9097037315368652
,
0.9293286800384521
,
2.3764255046844482
,
0.869133710861206
,
0.8188621997833252
,
0.9046516418457031
,
1.3477752208709717
,
0.8118226528167725
,
0.8821918964385986
,
0.8746812343597412
]
RTTS3
=
[
0.510988712310791
,
0.4889242649078369
,
0.5003941059112549
,
0.49333715438842773
,
0.5000274181365967
,
0.5426476001739502
,
0.5190870761871338
,
0.4908745288848877
,
0.5516133308410645
,
0.4995298385620117
]
DOWNLOADS1
=
[
{
"
duration
"
:
28.01000952720642
,
"
amount
"
:
25916542
},
{
"
duration
"
:
28.203476428985596
,
"
amount
"
:
25916542
},
{
"
duration
"
:
27.897520780563354
,
"
amount
"
:
25916542
},
{
"
duration
"
:
29.330559492111206
,
"
amount
"
:
25916542
},
{
"
duration
"
:
27.93175745010376
,
"
amount
"
:
25916542
}
]
DOWNLOADS2
=
[
{
"
duration
"
:
23.68175435066223
,
"
amount
"
:
81920
},
{
"
duration
"
:
27.667736768722534
,
"
amount
"
:
81920
},
{
"
duration
"
:
31.022956371307373
,
"
amount
"
:
81920
},
{
"
duration
"
:
33.020694971084595
,
"
amount
"
:
81920
},
{
"
duration
"
:
33.59471535682678
,
"
amount
"
:
81920
}
]
DOWNLOADS3
=
[
{
"
duration
"
:
30.008347988128662
,
"
amount
"
:
644411
},
{
"
duration
"
:
30.73241639137268
,
"
amount
"
:
644411
},
{
"
duration
"
:
31.845987796783447
,
"
amount
"
:
644411
},
{
"
duration
"
:
29.703084230422974
,
"
amount
"
:
644411
},
{
"
duration
"
:
30.438726663589478
,
"
amount
"
:
644411
}
]
SCANNER
=
"
test
"
AVG_BW
=
1024
*
1024
AVG_BW
=
966080
RELAY1
=
Result
.
Relay
(
FP1
,
NICK1
,
IP1
,
ED25519
,
average_bandwidth
=
AVG_BW
)
RELAY2
=
Result
.
Relay
(
FP
1
,
NICK2
,
IP2
,
ED25519
)
RELAY2
=
Result
.
Relay
(
FP
2
,
NICK2
,
IP2
,
ED25519
)
RESULT
=
Result
(
RELAY1
,
CIRC12
,
DEST_URL
,
SCANNER
,
t
=
TIME1
)
RESULT_SUCCESS1
=
ResultSuccess
(
RTTS
,
DOWNLOADS
,
RELAY1
,
CIRC12
,
DEST_URL
,
RESULT_SUCCESS1
=
ResultSuccess
(
RTTS
1
,
DOWNLOADS
1
,
RELAY1
,
CIRC12
,
DEST_URL
,
SCANNER
,
t
=
TIME1
)
RESULT_SUCCESS2
=
ResultSuccess
(
RTTS
,
DOWNLOADS
,
RELAY2
,
CIRC21
,
DEST_URL
,
RESULT_SUCCESS2
=
ResultSuccess
(
RTTS
2
,
DOWNLOADS
2
,
RELAY2
,
CIRC21
,
DEST_URL
,
SCANNER
,
t
=
TIME2
)
RESULT_ERROR_STREAM
=
ResultErrorStream
(
RELAY1
,
CIRC12
,
DEST_URL
,
SCANNER
,
t
=
TIME1
,
msg
=
"
Something bad
"
)
...
...
@@ -69,9 +106,9 @@ RESULT_ERROR_STREAM_DICT.update({
RESULT_SUCCESS_DICT
=
BASE_RESULT_DICT
.
copy
()
RESULT_SUCCESS_DICT
.
update
({
"
rtts
"
:
RTTS
,
"
rtts
"
:
RTTS
1
,
"
type
"
:
"
success
"
,
"
downloads
"
:
DOWNLOADS
,
"
downloads
"
:
DOWNLOADS
1
,
})
...
...
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