Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
B
bcc
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
Kirill Smelkov
bcc
Commits
f51da402
Commit
f51da402
authored
Jun 11, 2015
by
Brenden Blanco
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix python3 incompatible code in tests
Signed-off-by:
Brenden Blanco
<
bblanco@plumgrid.com
>
parent
d6197f30
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
tests/cc/test_brb.py
tests/cc/test_brb.py
+4
-4
No files found.
tests/cc/test_brb.py
View file @
f51da402
...
...
@@ -65,7 +65,7 @@
# 8: OK
from
ctypes
import
c_ubyte
,
c_ushort
,
c_uint
,
c_ulonglong
,
Structure
from
netaddr
import
IPAddress
from
netaddr
import
IPAddress
,
EUI
from
bpf
import
BPF
from
pyroute2
import
IPRoute
from
socket
import
socket
,
AF_INET
,
SOCK_DGRAM
...
...
@@ -160,7 +160,7 @@ class TestBPFSocket(TestCase):
ifindex
=
ip
.
link_lookup
(
ifname
=
ns_eth_out
)[
0
]
self
.
pem_port
.
update
(
c_uint
(
curr_pem_pid
),
c_uint
(
ifindex
))
self
.
pem_ifindex
.
update
(
c_uint
(
ifindex
),
c_uint
(
curr_pem_pid
))
mac_addr
=
Eth_Addr
(
struct
.
unpack
(
'!Q'
,
"
\
0
\
0
"
+
vm_mac
.
replace
(
':'
,
''
).
decode
(
'hex'
))[
0
]
)
mac_addr
=
Eth_Addr
(
int
(
EUI
(
vm_mac
.
decode
()))
)
br_mac_map
.
update
(
mac_addr
,
c_uint
(
curr_br_pid
))
def
attach_filter
(
self
,
ip
,
ifname
,
fd
,
name
):
...
...
@@ -232,9 +232,9 @@ class TestBPFSocket(TestCase):
# get vm mac address
self
.
vm1_mac
=
subprocess
.
check_output
([
"ip"
,
"netns"
,
"exec"
,
self
.
ns1
,
"cat"
,
"/sys/class/net/eth0/address"
])
self
.
vm1_mac
=
self
.
vm1_mac
.
strip
()
self
.
vm1_mac
=
self
.
vm1_mac
.
strip
()
self
.
vm2_mac
=
subprocess
.
check_output
([
"ip"
,
"netns"
,
"exec"
,
self
.
ns2
,
"cat"
,
"/sys/class/net/eth0/address"
])
self
.
vm2_mac
=
self
.
vm2_mac
.
strip
()
self
.
vm2_mac
=
self
.
vm2_mac
.
strip
()
# load the program and configure maps
self
.
config_maps
()
...
...
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