Skip to content
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

Open
wants to merge 14 commits into
base: main
Choose a base branch
from

Conversation

gretelliz
Copy link
Contributor

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.

@gretelliz gretelliz requested a review from italovalcy November 25, 2024 14:51
Copy link
Collaborator

@italovalcy italovalcy left a 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

@gretelliz
Copy link
Contributor Author

Thank you very much @italovalcy. Please, note that I have made changes based on your comments.

@gretelliz gretelliz requested a review from italovalcy December 2, 2024 16:14
Copy link
Collaborator

@italovalcy italovalcy left a 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!

Comment on lines 281 to 283
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",},],}
Copy link
Collaborator

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"}
            ]
        }

Comment on lines 294 to 296
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",},],}
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here

Comment on lines 306 to 308
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",},],}
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here

Comment on lines 324 to 325
# wait a few seconds for convergency
time.sleep(30)
Copy link
Collaborator

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

Copy link
Contributor Author

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.

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
Copy link
Collaborator

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).

assert ', 0% packet loss,' in result

# link down
h1.cmd('ip link del vlan102')
Copy link
Collaborator

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

h1.cmd('ip link del vlan101')

# wait a few seconds for convergency
time.sleep(30)
Copy link
Collaborator

Choose a reason for hiding this comment

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

not necessary

h1.cmd('ip link del vlan100')

# wait a few seconds -> there are no links left
time.sleep(30)
Copy link
Collaborator

Choose a reason for hiding this comment

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

not necessary

@italovalcy italovalcy mentioned this pull request Dec 12, 2024
@gretelliz
Copy link
Contributor Author

@italovalcy, thank you very much for your review and comments. Note that I have made a new push.

@gretelliz gretelliz requested a review from italovalcy December 12, 2024 22:12
@italovalcy
Copy link
Collaborator

@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?

@gretelliz
Copy link
Contributor Author

Hello @italovalcy. I don't have anything pending regarding this PR, I think I have covered all your recommendations.

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')
Copy link
Collaborator

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

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')
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here

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')
Copy link
Collaborator

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

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')
Copy link
Collaborator

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


# test connectivity again
result = h1.cmd('ping -c4 10.1.1.8')
assert ', 0% packet loss,' in result
Copy link
Collaborator

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')

time.sleep(30)

# test connectivity again
result = h1.cmd('ping -c4 10.1.1.8')
Copy link
Collaborator

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')

@gretelliz
Copy link
Contributor Author

@italovalcy, note that the last two asserts in this last commit are commented out, they fail. Should that be the behavior?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants