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
6acc0a53
Commit
6acc0a53
authored
9 years ago
by
4ast
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #32 from iovisor/bblanco_dev
Fix test_xlate1 when systems have no default tc
parents
2eb6c3bf
3c0fb6f2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
tests/cc/test_xlate1.py
tests/cc/test_xlate1.py
+7
-1
No files found.
tests/cc/test_xlate1.py
View file @
6acc0a53
...
...
@@ -32,11 +32,17 @@ class TestBPFFilter(TestCase):
fn
=
b
.
load_func
(
"on_packet"
,
BPF
.
SCHED_CLS
)
ip
=
IPRoute
()
ifindex
=
ip
.
link_lookup
(
ifname
=
"eth0"
)[
0
]
# set up a network to change the flow:
# outside | inside
# 172.16.1.1 - 172.16.1.2 | 192.168.1.1 - 192.16.1.2
ip
.
addr
(
"del"
,
index
=
ifindex
,
address
=
"172.16.1.2"
,
mask
=
24
)
ip
.
addr
(
"add"
,
index
=
ifindex
,
address
=
"192.168.1.2"
,
mask
=
24
)
# add an ingress and egress qdisc
ip
.
tc
(
"add"
,
"ingress"
,
ifindex
,
"ffff:"
)
ip
.
tc
(
"add"
,
"sfq"
,
ifindex
,
"1:"
)
# add same program to both ingress/egress, so pkt is translated in both directions
ip
.
tc
(
"add-filter"
,
"bpf"
,
ifindex
,
":1"
,
fd
=
fn
.
fd
,
name
=
fn
.
name
,
parent
=
"ffff:"
,
action
=
"ok"
,
classid
=
1
)
ip
.
tc
(
"add-filter"
,
"bpf"
,
ifindex
,
":2"
,
fd
=
fn
.
fd
,
name
=
fn
.
name
,
parent
=
"
0
:"
,
action
=
"ok"
,
classid
=
1
)
ip
.
tc
(
"add-filter"
,
"bpf"
,
ifindex
,
":2"
,
fd
=
fn
.
fd
,
name
=
fn
.
name
,
parent
=
"
1
:"
,
action
=
"ok"
,
classid
=
1
)
self
.
xlate
=
b
.
get_table
(
"xlate"
,
Key
,
Leaf
)
def
test_xlate
(
self
):
...
...
This diff is collapsed.
Click to expand it.
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