Skip to content

[warm-reboot] Add Preboot n BGP member down and n Lag down tests#1004

Merged
neethajohn merged 5 commits intosonic-net:masterfrom
neethajohn:warmboot-nbgp-nlag
Jul 24, 2019
Merged

[warm-reboot] Add Preboot n BGP member down and n Lag down tests#1004
neethajohn merged 5 commits intosonic-net:masterfrom
neethajohn:warmboot-nbgp-nlag

Conversation

@neethajohn
Copy link
Copy Markdown
Contributor

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

  • [] Bug fix
  • [] Testbed and Framework(new/improvement)
  • Test case(new/improvement)

Approach

How did you do it?

  • warm-reboot-sad.yml
    • Added ':' separated parameter for each preboot operation which indicates the number of bgp members/lag down. If no ':' separated parameter exists, the count is set to 1
  • validate_preboot_list.yml
    • Validate if the cnt for each preboot operation is within allowed limits. For bgp and lag down case, the max value is set to one less than the number of Vms. For lag member case, max allowed value is the total number of members in a lag
  • sad_path.py
    • VM selection method is extended to select count number of VMs after picking a start VM.
    • extend all cases to make changes for count number of VMs instead of a single VM

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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:

  1. The test case can define how many failures to inject freely.
  2. 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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

retained the original yml and moved the n member case to a separate one

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe make these variable names plural?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Copy Markdown
Contributor

@qiluo-msft qiluo-msft Jul 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Copy Markdown
Contributor

@qiluo-msft qiluo-msft Jul 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[](start = 21, length = 1)

[](start = 21, length = 1)

one extra space #Closed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

Copy link
Copy Markdown
Contributor

@qiluo-msft qiluo-msft Jul 12, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

item.find(':') != -1 [](start = 41, length = 20)

item.find(':') != -1 [](start = 41, length = 20)

':' in item #Closed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@qiluo-msft
Copy link
Copy Markdown
Contributor

qiluo-msft commented Jul 13, 2019

    self.check_param('preboot_oper', None, required = False)

These new params are difficult to understand by a new user. Could you provide usage comments? #Closed


Refers to: ansible/roles/test/files/ptftests/advanced-reboot.py:146 in 600e6b7. [](commit_id = 600e6b7, deletion_comment = False)

Copy link
Copy Markdown
Contributor

@qiluo-msft qiluo-msft Jul 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean change everything into 'value:cnt' will make code easier.


In reply to: 303570408 [](ancestors = 303570408)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Contributor

@qiluo-msft qiluo-msft Jul 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vm_len [](start = 49, length = 6)

vm_len [](start = 49, length = 6)

How to prevent div by 0? #Closed

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do the mod operation only if vm_list is non empty otherwise I will set it to 0

Copy link
Copy Markdown
Contributor

@qiluo-msft qiluo-msft Jul 13, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@neethajohn neethajohn force-pushed the warmboot-nbgp-nlag branch from 31a1fcf to f86054c Compare July 15, 2019 19:41
@neethajohn neethajohn force-pushed the warmboot-nbgp-nlag branch from f86054c to 600e6b7 Compare July 17, 2019 16:39
@neethajohn neethajohn merged commit d5498f0 into sonic-net:master Jul 24, 2019
@neethajohn neethajohn deleted the warmboot-nbgp-nlag branch July 24, 2019 17:54
yxieca pushed a commit that referenced this pull request Jul 31, 2019
* Add Preboot n BGP member down and n Lag down tests

Signed-off-by: Neetha John <nejo@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants