Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
floodlight
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
croft1
floodlight
Commits
a1615b57
Commit
a1615b57
authored
12 years ago
by
Jason Parraga
Browse files
Options
Downloads
Patches
Plain Diff
Fixed unsave ant warnings and cleaned up a few things
parent
499374a0
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
src/test/java/net/floodlightcontroller/flowcache/PortDownReconciliationTest.java
+28
-30
28 additions, 30 deletions
...lightcontroller/flowcache/PortDownReconciliationTest.java
with
28 additions
and
30 deletions
src/test/java/net/floodlightcontroller/flowcache/PortDownReconciliationTest.java
+
28
−
30
View file @
a1615b57
...
...
@@ -95,7 +95,7 @@ public class PortDownReconciliationTest extends FloodlightTestCase {
protected
Map
<
Long
,
IOFSwitch
>
switches
;
protected
Capture
<
List
<
OFMessage
>>
wc1
,
wc2
,
wc3
,
wc4
;
protected
Capture
<
FloodlightContext
>
bc1
,
bc2
,
bc3
,
bc4
;
protected
OFMessage
fm
d
,
fm
d
2
;
protected
OFMessage
fm
,
fm2
;
protected
ArrayList
<
OFMatchReconcile
>
lofmr
;
protected
OFMatchReconcile
ofmr
;
protected
static
Logger
log
;
...
...
@@ -152,7 +152,6 @@ public class PortDownReconciliationTest extends FloodlightTestCase {
req
.
setLengthU
(
requestLength
);
// Actions for the STATS_REPLY object
OFFlowMod
flow
=
new
OFFlowMod
();
OFActionOutput
action
=
new
OFActionOutput
((
short
)
3
,
(
short
)
0xffff
);
List
<
OFAction
>
actions
=
new
ArrayList
<
OFAction
>();
actions
.
add
(
action
);
...
...
@@ -234,8 +233,7 @@ public class PortDownReconciliationTest extends FloodlightTestCase {
// Create the only OFMatch Reconcile object that will be in the list
ofmr
=
new
OFMatchReconcile
();
long
affectedSwitch
=
sw1
.
getId
();
OFMatch
match
=
new
OFMatch
().
setWildcards
(
OFMatch
.
OFPFW_ALL
);
OFMatchWithSwDpid
ofmatchsw
=
new
OFMatchWithSwDpid
(
match
,
OFMatchWithSwDpid
ofmatchsw
=
new
OFMatchWithSwDpid
(
new
OFMatch
().
setWildcards
(
OFMatch
.
OFPFW_ALL
),
affectedSwitch
);
ofmr
.
rcAction
=
OFMatchReconcile
.
ReconcileAction
.
UPDATE_PATH
;
ofmr
.
ofmWithSwDpid
=
ofmatchsw
;
...
...
@@ -248,7 +246,7 @@ public class PortDownReconciliationTest extends FloodlightTestCase {
// Expected Flow Mod Deletes Messages
// Flow Mod Delete for base switch
fm
d
=
((
OFFlowMod
)
mockFloodlightProvider
.
getOFMessageFactory
()
fm
=
((
OFFlowMod
)
mockFloodlightProvider
.
getOFMessageFactory
()
.
getMessage
(
OFType
.
FLOW_MOD
)).
setMatch
(
new
OFMatch
().
setWildcards
(
OFMatch
.
OFPFW_ALL
))
.
setCommand
(
OFFlowMod
.
OFPFC_DELETE
)
// Notice
...
...
@@ -260,10 +258,10 @@ public class PortDownReconciliationTest extends FloodlightTestCase {
.
setLength
(
U16
.
t
(
OFFlowMod
.
MINIMUM_LENGTH
));
// Flow Mod Delete for the neighborswitches
fm
d
2
=
((
OFFlowMod
)
mockFloodlightProvider
.
getOFMessageFactory
()
fm2
=
((
OFFlowMod
)
mockFloodlightProvider
.
getOFMessageFactory
()
.
getMessage
(
OFType
.
FLOW_MOD
))
// Notice
we used the base switch's flow's match
.
setMatch
(
flow
.
getMatch
())
// Notice
that this Match object is more specific
.
setMatch
(
reply
.
getMatch
())
.
setCommand
(
OFFlowMod
.
OFPFC_DELETE
)
// Notice
// we
...
...
@@ -314,14 +312,14 @@ public class PortDownReconciliationTest extends FloodlightTestCase {
pdr
.
reconcileFlows
(
lofmr
);
// Validate results
verify
(
sw1
);
assertTrue
(
wc1
.
hasCaptured
());
List
<
List
<
OFMessage
>
>
msglist
=
wc1
.
getValues
();
List
<
OFMessage
>
msglist
=
wc1
.
getValues
()
.
get
(
0
)
;
// Make sure the messages we captures correct
for
(
List
<
OFMessage
>
m
:
msglist
)
{
if
(
m
instanceof
OFFlowMod
)
assertEquals
(
fm
d
,
m
);
for
(
OFMessage
m
:
msglist
)
{
if
(
m
instanceof
OFFlowMod
)
assertEquals
(
fm
,
m
);
}
}
...
...
@@ -375,19 +373,19 @@ public class PortDownReconciliationTest extends FloodlightTestCase {
// Make sure each capture has captured the proper Flow Mod Delete
// message
List
<
List
<
OFMessage
>
>
msglist
=
wc2
.
getValues
();
for
(
List
<
OFMessage
>
m
:
msglist
)
{
if
(
m
instanceof
OFFlowMod
)
assertEquals
(
fm
d
2
,
m
);
List
<
OFMessage
>
msglist
=
wc2
.
getValues
()
.
get
(
0
)
;
for
(
OFMessage
m
:
msglist
)
{
if
(
m
instanceof
OFFlowMod
)
assertEquals
(
fm2
,
m
);
}
msglist
=
wc3
.
getValues
();
for
(
List
<
OFMessage
>
m
:
msglist
)
{
if
(
m
instanceof
OFFlowMod
)
assertEquals
(
fm
d
2
,
m
);
msglist
=
wc3
.
getValues
()
.
get
(
0
)
;
for
(
OFMessage
m
:
msglist
)
{
if
(
m
instanceof
OFFlowMod
)
assertEquals
(
fm2
,
m
);
}
msglist
=
wc4
.
getValues
();
for
(
List
<
OFMessage
>
m
:
msglist
)
{
if
(
m
instanceof
OFFlowMod
)
assertEquals
(
fm
d
2
,
m
);
msglist
=
wc4
.
getValues
()
.
get
(
0
)
;
for
(
OFMessage
m
:
msglist
)
{
if
(
m
instanceof
OFFlowMod
)
assertEquals
(
fm2
,
m
);
}
}
...
...
@@ -443,19 +441,19 @@ public class PortDownReconciliationTest extends FloodlightTestCase {
// Make sure each capture has captured the proper Flow Mod Delete
// message
List
<
List
<
OFMessage
>
>
msglist
=
wc2
.
getValues
();
for
(
List
<
OFMessage
>
m
:
msglist
)
{
if
(
m
instanceof
OFFlowMod
)
assertEquals
(
fm
d
2
,
m
);
List
<
OFMessage
>
msglist
=
wc2
.
getValues
()
.
get
(
0
)
;
for
(
OFMessage
m
:
msglist
)
{
if
(
m
instanceof
OFFlowMod
)
assertEquals
(
fm2
,
m
);
}
msglist
=
wc3
.
getValues
();
for
(
List
<
OFMessage
>
m
:
msglist
)
{
if
(
m
instanceof
OFFlowMod
)
assertEquals
(
fm
d
2
,
m
);
msglist
=
wc3
.
getValues
()
.
get
(
0
)
;
for
(
OFMessage
m
:
msglist
)
{
if
(
m
instanceof
OFFlowMod
)
assertEquals
(
fm2
,
m
);
}
msglist
=
wc4
.
getValues
();
for
(
List
<
OFMessage
>
m
:
msglist
)
{
if
(
m
instanceof
OFFlowMod
)
assertEquals
(
fm
d
2
,
m
);
msglist
=
wc4
.
getValues
()
.
get
(
0
)
;
for
(
OFMessage
m
:
msglist
)
{
if
(
m
instanceof
OFFlowMod
)
assertEquals
(
fm2
,
m
);
}
}
}
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