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

E2e tests #9

Merged
merged 7 commits into from
Dec 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 38 additions & 0 deletions tests/test_05_l2vpn.py
Original file line number Diff line number Diff line change
Expand Up @@ -341,3 +341,41 @@ def test_060_link_convergency_with_l2vpn_with_alternative_paths(self):
time.sleep(30)
result = h1.cmd('ping -c4 10.1.1.8')
assert ', 100% packet loss,' in result

def test_070_create_l2vpn_invalid_body(self):
"""Test the return code 400: Request does not have a valid JSON for creating an L2VPN"""
api_url = SDX_CONTROLLER + '/l2vpn/1.0'
payload = {
"name": "Test L2VPN request",
"endpoints": [
{
"port_id": "urn:sdx:port:ampath.net:Ampath",
"vlan": 1,
},
{
"port_id": "urn:sdx:port:tenet.ac.za:Tenet03:50",
"vlan": 1,
},
],
}
response = requests.post(api_url, json=payload)
assert response.status_code == 400, response.text

def test_071_create_l2vpn_request_not_compatible(self):
"""Test the return code 402: Request not compatible for creating an L2VPN"""
api_url = SDX_CONTROLLER + '/l2vpn/1.0'
payload = {
"name": "Test L2VPN request",
"endpoints": [
{
"port_id": "urn:sdx:port:ampath.net:Ampath",
"vlan": "any",
},
{
"port_id": "urn:sdx:port:tenet.ac.za:Tenet03:50",
"vlan": "any",
},
],
}
response = requests.post(api_url, json=payload)
assert response.status_code == 402, response.text