Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFS Gluon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
firmware
FFS Gluon
Commits
4cd26d86
Commit
4cd26d86
authored
4 years ago
by
lemoer
Committed by
David Bauer
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
tests: add respondd test case
parent
772db952
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_respondd.py
+50
-0
50 additions, 0 deletions
tests/test_respondd.py
with
50 additions
and
0 deletions
tests/test_respondd.py
0 → 100644
+
50
−
0
View file @
4cd26d86
#!/usr/bin/python36
import
sys
from
pynet
import
*
import
asyncio
import
time
import
json
a
=
Node
()
b
=
Node
()
connect
(
a
,
b
)
start
()
b
.
wait_until_succeeds
(
"
ping -c 5 node1
"
)
def
query_neighbor_info
(
request
):
response
=
b
.
wait_until_succeeds
(
f
"
gluon-neighbour-info -d ff02::2:1001 -p 1001 -r
{
request
}
-i vx_eth2_mesh -c 2
"
)
# build json array line by line
ret
=
[
json
.
loads
(
l
)
for
l
in
response
.
split
(
"
\n
"
)]
b
.
dbg
(
f
"
{
request
.
lower
()
}
:
\n
{
json
.
dumps
(
ret
,
indent
=
4
)
}
"
)
return
ret
neighbours
=
query_neighbor_info
(
"
neighbours
"
)
vx_eth2_mesh_addr_a
=
a
.
succeed
(
"
cat /sys/class/net/vx_eth2_mesh/address
"
)
vx_eth2_mesh_addr_b
=
b
.
succeed
(
"
cat /sys/class/net/vx_eth2_mesh/address
"
)
res0
=
neighbours
[
0
][
"
batadv
"
]
res1
=
neighbours
[
1
][
"
batadv
"
]
if
vx_eth2_mesh_addr_a
in
res0
:
res
=
res0
else
:
res
=
res1
batadv_neighbours
=
res
[
vx_eth2_mesh_addr_a
][
"
neighbours
"
]
if
vx_eth2_mesh_addr_b
in
batadv_neighbours
:
print
(
"
Node 1 was successfully found in neighbours of node 2.
"
)
else
:
print
(
"
ERROR: Node 1 was not found in neighbours of node 2.
"
)
exit
(
1
)
finish
()
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