-
Notifications
You must be signed in to change notification settings - Fork 0
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
New test to create l2vpns and check connectivity #8
base: main
Are you sure you want to change the base?
Conversation
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.
Hi Gretel! Excellent pull request, very nice to see how this is progressing! One thing, though that I would like to require your help is: I see the testing is leveraging ping among switches to check connectivity, but I want to ask you to test connectivity using ping among hosts. Testing connectivity using switches will give you a false positive output because switches all run as process in the emulation host, so it will work as a ping to localhost
Thank you very much @italovalcy. Please, note that I have made changes based on your comments. |
…_codes.py Rename file
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.
Hi Gretel, congratulations on the pull request adding this new test! Amazing to see how this is progressing! I made a few comments to contribute on the testing methodology, suggesting the removal of some sleeps and also changes on the execution order and formatting style. Please let me know what you think!
tests/test_05_l2vpn.py
Outdated
payload = {"name": "Text", "endpoints": | ||
[{"port_id": "urn:sdx:port:ampath.net:Ampath1:50", "vlan": "100",}, | ||
{"port_id": "urn:sdx:port:tenet.ac.za:Tenet03:50", "vlan": "100",},],} |
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.
@gretelliz can you please fix the formatting rules here? for example:
payload = {
"name": "Text",
"endpoints": [
{"port_id": "urn:sdx:port:ampath.net:Ampath1:50", "vlan": "100"},
{"port_id": "urn:sdx:port:tenet.ac.za:Tenet03:50", "vlan": "100"}
]
}
tests/test_05_l2vpn.py
Outdated
payload = {"name": "Text", "endpoints": | ||
[{"port_id": "urn:sdx:port:ampath.net:Ampath1:50", "vlan": "101",}, | ||
{"port_id": "urn:sdx:port:tenet.ac.za:Tenet03:50", "vlan": "101",},],} |
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.
same here
tests/test_05_l2vpn.py
Outdated
payload = {"name": "Text", "endpoints": | ||
[{"port_id": "urn:sdx:port:ampath.net:Ampath1:50", "vlan": "102",}, | ||
{"port_id": "urn:sdx:port:tenet.ac.za:Tenet03:50", "vlan": "102",},],} |
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.
same here
tests/test_05_l2vpn.py
Outdated
# wait a few seconds for convergency | ||
time.sleep(30) |
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.
not sure if I understood the convergency here. From the previous commands, there was no links going down
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.
You're right, the comment is confusing. This is some time after removing a link.
tests/test_05_l2vpn.py
Outdated
h8.cmd('ip addr add 10.1.1.8/24 dev vlan102') | ||
|
||
result = h1.cmd('ping -c4 10.1.1.8') | ||
assert ', 0% packet loss,' in result |
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 recommend that the assert goes in the end, to allow the VLAN interfaces be removed before actually checking for the results (and possibly failing, leaving the clean up incomplete).
tests/test_05_l2vpn.py
Outdated
assert ', 0% packet loss,' in result | ||
|
||
# link down | ||
h1.cmd('ip link del vlan102') |
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.
leave this to the end
tests/test_05_l2vpn.py
Outdated
h1.cmd('ip link del vlan101') | ||
|
||
# wait a few seconds for convergency | ||
time.sleep(30) |
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.
not necessary
tests/test_05_l2vpn.py
Outdated
h1.cmd('ip link del vlan100') | ||
|
||
# wait a few seconds -> there are no links left | ||
time.sleep(30) |
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.
not necessary
@italovalcy, thank you very much for your review and comments. Note that I have made a new push. |
Hi Gretel, I'm still seeing some of the comments I made last review as pending. Are you still working on those adjustments? |
Hello @italovalcy. I don't have anything pending regarding this PR, I think I have covered all your recommendations. |
tests/test_05_l2vpn.py
Outdated
assert response.status_code == 201, response.text | ||
h1.cmd('ip link add link %s name vlan101 type vlan id 101' % (h1.intfNames()[0])) | ||
h1.cmd('ip link set up vlan101') | ||
h1.cmd('ip addr add 10.1.1.1/24 dev vlan101') |
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.
Gretel, can you please update the IP address assigned to VLAN 101 to something different? Example: 10.1.2.1/24
tests/test_05_l2vpn.py
Outdated
h1.cmd('ip addr add 10.1.1.1/24 dev vlan101') | ||
h8.cmd('ip link add link %s name vlan100 type vlan id 101' % (h8.intfNames()[0])) | ||
h8.cmd('ip link set up vlan101') | ||
h8.cmd('ip addr add 10.1.1.8/24 dev vlan101') |
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.
same here
tests/test_05_l2vpn.py
Outdated
assert response.status_code == 201, response.text | ||
h1.cmd('ip link add link %s name vlan102 type vlan id 102' % (h1.intfNames()[0])) | ||
h1.cmd('ip link set up vlan102') | ||
h1.cmd('ip addr add 10.1.1.1/24 dev vlan102') |
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.
same here regarding the IP address
tests/test_05_l2vpn.py
Outdated
h1.cmd('ip addr add 10.1.1.1/24 dev vlan102') | ||
h8.cmd('ip link add link %s name vlan102 type vlan id 102' % (h8.intfNames()[0])) | ||
h8.cmd('ip link set up vlan102') | ||
h8.cmd('ip addr add 10.1.1.8/24 dev vlan102') |
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.
same here regarding the IP address
tests/test_05_l2vpn.py
Outdated
|
||
# test connectivity again | ||
result = h1.cmd('ping -c4 10.1.1.8') | ||
assert ', 0% packet loss,' in result |
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.
After testing all the connectivity, I suggest you to remove all the interfaces from h1 and h8:
h1.cmd('ip link del vlan100')
h1.cmd('ip link del vlan101')
h1.cmd('ip link del vlan102')
h8.cmd('ip link del vlan100')
h8.cmd('ip link del vlan101')
h8.cmd('ip link del vlan102')
tests/test_05_l2vpn.py
Outdated
time.sleep(30) | ||
|
||
# test connectivity again | ||
result = h1.cmd('ping -c4 10.1.1.8') |
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 suggest you to have different variables to store the ping result from each VLAN:
result_100 = h1.cmd('ping -c4 10.1.1.8')
result_101 = h1.cmd('ping -c4 10.1.2.8')
result_102 = h1.cmd('ping -c4 10.1.3.8')
@italovalcy, note that the last two asserts in this last commit are commented out, they fail. Should that be the behavior? |
Create a new tests on the L2VPN creation:
test_060_create_and_delete_l2vpn
: Create 10 l2vpn between differnet endpoints of the topology, randomly remove 5 of them, and test the connectivity between then.