-
Notifications
You must be signed in to change notification settings - Fork 363
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add unit tests for pkg/ovs/openflow #4221
Conversation
d8ab2d7
to
a5a902f
Compare
Codecov Report
@@ Coverage Diff @@
## main #4221 +/- ##
==========================================
- Coverage 73.77% 69.80% -3.98%
==========================================
Files 410 402 -8
Lines 60966 58384 -2582
==========================================
- Hits 44978 40754 -4224
- Misses 13082 14862 +1780
+ Partials 2906 2768 -138
*This pull request uses carry forward flags. Click here to find out more.
|
a5a902f
to
6b3d255
Compare
c0af2c5
to
4274e52
Compare
7f12440
to
d928d9e
Compare
This PR depends on #4258. |
c2f254f
to
73b3334
Compare
f4feb52
to
8dea3e1
Compare
ff315c8
to
6e9d460
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
295ab33
to
5344de4
Compare
0c7d665
to
97dccca
Compare
97dccca
to
9f4687b
Compare
9f4687b
to
866b88d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall, a few nits.
@@ -874,7 +874,12 @@ func nxActionLearnToString(action openflow15.Action) string { | |||
if spec.SrcValue != nil { | |||
srcValueStr := strings.TrimLeft(fmt.Sprintf("%x", spec.SrcValue), "0") | |||
if isMatch { | |||
dstFieldStr := getFieldNameString(spec.DstField.Field.Class, spec.DstField.Field.Field, spec.DstField.Ofs, nBits, true, false) | |||
var dstFieldStr string | |||
if spec.DstField.Field.Class == openflow15.OXM_CLASS_NXM_1 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain a little bit why this change is needed? A new class is introduced after openflow15?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the OpenFlow learn flow action, the registers in OpenFlow 1.5 (OXM_CLASS_NXM_1) are capitalized when used as an output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, one general comment is I saw many cases are almost the same except for the data value, maybe no need to add such duplicated cases?
Value: &openflow15.ByteArrayField{Data: []byte{0x12, 0x34, 0x56}, Length: 3}, | ||
}, | ||
}, | ||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't get the differences among the three cases except for the data. Are they all needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just to test different values. Besides, this can be also to test if the match string is as expected. For example, the first case should be xxreg0=0x123456
, not xxreg0=0x00123456
866b88d
to
045a711
Compare
045a711
to
55ff6b1
Compare
/test-all |
55ff6b1
to
e1c95fb
Compare
Signed-off-by: Hongliang Liu <lhongliang@vmware.com>
e1c95fb
to
25b496b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM overall, a few nits for error check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks for merging and reviewing this PR @tnqn @luolanzone @wenyingd |
Signed-off-by: Hongliang Liu lhongliang@vmware.com