[warm-reboot] Add Preboot n BGP member down and n Lag down tests#1004
[warm-reboot] Add Preboot n BGP member down and n Lag down tests#1004neethajohn merged 5 commits intosonic-net:masterfrom
Conversation
There was a problem hiding this comment.
Why was single failure test got removed?
I think it might make more sense to pass preboot_list in from test case instead of define here. The benefit is:
- The test case can define how many failures to inject freely.
- Each test will pass/fail by itself. e.g. we might be able to pass single lag down, but having trouble with 2 lags down. With 2 different tests. It is easier to see which one failed.
There was a problem hiding this comment.
retained the original yml and moved the n member case to a separate one
There was a problem hiding this comment.
Maybe make these variable names plural?
There was a problem hiding this comment.
(oper_type, cnt) = self.preboot_oper.split(':') if self.preboot_oper and ':' in self.preboot_oper else (self.preboot_oper, 1) [](start = 11, length = 126)
(oper_type, cnt) = self.preboot_oper.split(':') if self.preboot_oper and ':' in self.preboot_oper else (self.preboot_oper, 1) [](start = 11, length = 126)
Use if-else block instead of one liner. #Closed
There was a problem hiding this comment.
[](start = 21, length = 1)
[](start = 21, length = 1)
one extra space #Closed
There was a problem hiding this comment.
item.find(':') != -1 [](start = 41, length = 20)
item.find(':') != -1 [](start = 41, length = 20)
':' in item #Closed
There was a problem hiding this comment.
(self.oper_type, self.cnt) = oper_type.split(':') if ':' in oper_type else (oper_type, 1) [](start = 8, length = 89)
What is your design of the constructor parameter? Why not assume it in one format? #Closed
There was a problem hiding this comment.
oper_type will either be 'value' or 'value:cnt' if cnt is greater than 1. Kept it this way since I didn't want to make changes in parameter format for the existing single member case.
I will have to pass the cnt as an additional parameter if I do the split outside the class.
There was a problem hiding this comment.
I mean change everything into 'value:cnt' will make code easier.
In reply to: 303570408 [](ancestors = 303570408)
There was a problem hiding this comment.
I will be adding one more parameter for lag member down case. so it will be value:cnt1:cnt2 . cnt1 will be the same as the number of VMS. cnt2 will be number of lag members.
I prefer to handle it in the code for cases that don't need it rather than doing it in the yml. for eg,
single bgp member down should be changed to 'bgp_down:1:0' in the yml or I can keep it as 'bgp_down' in the yml and handle it in the script.
There was a problem hiding this comment.
vm_len [](start = 49, length = 6)
vm_len [](start = 49, length = 6)
How to prevent div by 0? #Closed
There was a problem hiding this comment.
will do the mod operation only if vm_list is non empty otherwise I will set it to 0
There was a problem hiding this comment.
item != 'None' and item.find(':') != -1 [](start = 22, length = 39)
item != 'None' and item.find(':') != -1 [](start = 22, length = 39)
You can remove
item != 'None' and
You can use ':' in item #Closed
31a1fcf to
f86054c
Compare
f86054c to
600e6b7
Compare
* Add Preboot n BGP member down and n Lag down tests Signed-off-by: Neetha John <nejo@microsoft.com>
Signed-off-by: Neetha John nejo@microsoft.com
Description of PR
Extend the warm-reboot sad path BGP and LAG tests for bringing n BGP members or n lags down instead of a single one
Type of change
Approach
How did you do it?
How did you verify/test it?
Ran the test on T0 topology and all cases passed
Regression run for fast-reboot and warm-reboot tests also passed