Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
pim_dm
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
nexedi
pim_dm
Commits
10b83104
Commit
10b83104
authored
Feb 26, 2018
by
Pedro Oliveira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added one test -> transition to NI caused by AW death
parent
07f20ce2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
14 deletions
+36
-14
emulation/log_server/root/ServerLog.py
emulation/log_server/root/ServerLog.py
+4
-3
emulation/log_server/root/TestAssert.py
emulation/log_server/root/TestAssert.py
+31
-11
emulation/switch1/root/script.sh
emulation/switch1/root/script.sh
+1
-0
No files found.
emulation/log_server/root/ServerLog.py
View file @
10b83104
...
...
@@ -3,7 +3,7 @@ import logging
import
logging.handlers
import
socketserver
import
struct
from
TestAssert
import
CustomFilter
,
Test1
,
Test2
,
Test3
from
TestAssert
import
CustomFilter
,
Test1
,
Test2
,
Test3
,
Test4
import
sys
import
threading
from
queue
import
Queue
...
...
@@ -24,7 +24,7 @@ def worker():
class
TestHandler
(
logging
.
StreamHandler
):
currentTest
=
Test1
()
currentTest
.
print_test
()
nextTests
=
[
Test2
(),
Test3
()]
nextTests
=
[
Test2
(),
Test3
()
,
Test4
()
]
main
=
None
def
emit
(
self
,
record
):
...
...
@@ -37,6 +37,7 @@ class TestHandler(logging.StreamHandler):
TestHandler
.
currentTest
=
None
TestHandler
.
main
.
abort
=
True
class
LogRecordStreamHandler
(
socketserver
.
StreamRequestHandler
):
"""Handler for a streaming logging request.
...
...
@@ -110,4 +111,4 @@ def main():
if
__name__
==
'__main__'
:
main
()
main
()
\ No newline at end of file
emulation/log_server/root/TestAssert.py
View file @
10b83104
import
logging
from
abc
import
ABCMeta
from
abc
import
ABCMeta
,
abstractmethod
class
CustomFilter
(
logging
.
Filter
):
def
filter
(
self
,
record
):
...
...
@@ -7,7 +8,7 @@ class CustomFilter(logging.Filter):
record
.
routername
in
[
"R1"
,
"R2"
,
"R3"
,
"R4"
,
"R5"
,
"R6"
]
class
Test
():
class
Test
(
object
):
__metaclass__
=
ABCMeta
def
__init__
(
self
,
testName
,
expectedState
,
success
):
...
...
@@ -27,11 +28,12 @@ class Test():
print
(
'
\
x1b
[1;32;40m'
+
self
.
testName
+
' Success'
+
'
\
x1b
[0m'
)
return
True
@
abstractmethod
def
print_test
(
self
):
pass
class
Test1
(
Test
):
def
__init__
(
self
):
expectedState
=
{
"R2"
:
{
"eth1"
:
"L"
},
"R3"
:
{
"eth1"
:
"L"
},
...
...
@@ -54,8 +56,27 @@ class Test1(Test):
print
(
"Expected: R4 WINNER"
)
class
Test2
(
Test
):
def
__init__
(
self
):
expectedState
=
{
"R2"
:
{
"eth1"
:
"NI"
},
"R3"
:
{
"eth1"
:
"NI"
},
"R5"
:
{
"eth0"
:
"NI"
},
"R6"
:
{
"eth0"
:
"NI"
},
}
success
=
{
"R2"
:
{
"eth1"
:
False
},
"R3"
:
{
"eth1"
:
False
},
"R5"
:
{
"eth0"
:
False
},
"R6"
:
{
"eth0"
:
False
},
}
super
().
__init__
(
"Test2"
,
expectedState
,
success
)
def
print_test
(
self
):
print
(
"Test2: Kill assert winner"
)
print
(
"Expected: Every AL transitions to NI"
)
class
Test3
(
Test
):
def
__init__
(
self
):
expectedState
=
{
"R2"
:
{
"eth1"
:
"L"
},
"R3"
:
{
"eth1"
:
"W"
},
...
...
@@ -68,15 +89,14 @@ class Test2(Test):
"R5"
:
{
"eth0"
:
False
},
"R6"
:
{
"eth0"
:
False
},
}
super
().
__init__
(
"Test
2
"
,
expectedState
,
success
)
super
().
__init__
(
"Test
3
"
,
expectedState
,
success
)
def
print_test
(
self
):
print
(
"Test
2: Kill assert winner
"
)
print
(
"Test
3: Source sends data causing the reelection of AW
"
)
print
(
"Expected: R3 WINNER"
)
class
Test3
(
Test
):
class
Test4
(
Test
):
def
__init__
(
self
):
expectedState
=
{
"R2"
:
{
"eth1"
:
"NI"
},
"R3"
:
{
"eth1"
:
"NI"
},
...
...
@@ -86,8 +106,8 @@ class Test3(Test):
"R3"
:
{
"eth1"
:
False
},
}
super
().
__init__
(
"Test
3
"
,
expectedState
,
success
)
super
().
__init__
(
"Test
4
"
,
expectedState
,
success
)
def
print_test
(
self
):
print
(
"Test
3
: CouldAssert of AssertWinner(R3) -> False"
)
print
(
"Test
4
: CouldAssert of AssertWinner(R3) -> False"
)
print
(
"Expected: everyone NI"
)
emulation/switch1/root/script.sh
View file @
10b83104
rm
/hosthome/Desktop/assert_capture.pcap
tcpdump
-i
br0
-Q
in
-w
/hosthome/Desktop/assert_capture.pcap
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