-
Notifications
You must be signed in to change notification settings - Fork 54
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
[TEST]: Improvement: Switches: New interaction approach: Phase3 #5763
base: develop
Are you sure you want to change the base?
Conversation
dfbaf49
to
cd9c42b
Compare
241d75e
to
ff068b9
Compare
cd9c42b
to
ce481bb
Compare
091834d
to
1ad697a
Compare
1ad697a
to
44e778c
Compare
@@ -210,6 +212,11 @@ class SwitchExtended { | |||
return new PortExtended(sw, portNo, northbound, northboundV2, cleanupManager) | |||
} | |||
|
|||
PortExtended getPortInState(String state) { |
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.
consider to use enum constants here
|
||
def setupSpec() { | ||
switchUnderTest = switches.all().first() | ||
def initialProps = switchUnderTest.getCashedProps() |
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.
typo, the name of getCashedProps method. should be getCachedProps.
also worth to mention, the following is out of this PR scope, but:
the result of getCashedProps method is cached with @memoized.
I can see many usage of this caching. How cache eviction mechanism is implemented here? what if cache becomes outdated?
FlowEncapsulationType.VXLAN.toString().toLowerCase()].sort() : | ||
[FlowEncapsulationType.VXLAN.toString().toLowerCase()] | ||
switchProperties.tap { | ||
[TRANSIT_VLAN.toString(), VXLAN.toString().toLowerCase()].sort() : [VXLAN.toString().toLowerCase()] |
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.
don't you need to call toLowerCase for TRANSIT_VLAN as well?
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.
nope, used org.openkilda.functionaltests.helpers.model.FlowEncapsulationType instead of org.openkilda.model.FlowEncapsulationType (will update the rest of encaps)
with(northboundV2.getAllSwitchProperties().switchProperties.find { it.switchId == sw.dpId }){ | ||
supportedTransitEncapsulation.sort() == newTransitEncapsulation | ||
} | ||
sw.getProps().supportedTransitEncapsulation.sort() == newTransitEncapsulation |
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.
out of PR scope, but
if sw.getPropsV1 calls northbound v1 API, and sw.getProps calls northbound v2 API, it might be worth to rename getProps() method to getPropsV2().
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.
mostly used v2 calls and for the v1 calls we just specify v1
@@ -77,6 +79,10 @@ class Switches { | |||
switches.findAll().unique { it.hwSwString()} | |||
} | |||
|
|||
List<SwitchExtended> notOF12Version() { | |||
switches.findAll { it.ofVersion != "OF_12" } |
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.
might be out of this pr scope, but consider to use constant here and in other places for "OF_12" string
30b6413
to
0a83ba4
Compare
0a83ba4
to
a2c9c28
Compare
No description provided.