-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
109 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +0,0 @@ | ||
# coding: utf-8 | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). # noqa: E501 | ||
OpenAPI spec version: 2.0.0 | ||
OpenAPI spec version: 1.0.0 | ||
Contact: [email protected] | ||
Generated by: https://github.com/swagger-api/swagger-codegen.git | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). # noqa: E501 | ||
OpenAPI spec version: 2.0.0 | ||
OpenAPI spec version: 1.0.0 | ||
Contact: [email protected] | ||
Generated by: https://github.com/swagger-api/swagger-codegen.git | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). # noqa: E501 | ||
OpenAPI spec version: 2.0.0 | ||
OpenAPI spec version: 1.0.0 | ||
Contact: [email protected] | ||
Generated by: https://github.com/swagger-api/swagger-codegen.git | ||
""" | ||
|
@@ -44,10 +44,35 @@ def test_getconnection_by_id(self): | |
|
||
def test_place_connection(self): | ||
"""Test case for place_connection | ||
Place an connection request from the SDX-Controller # noqa: E501 | ||
""" | ||
pass | ||
p1 = sdx_lc_client.Port( | ||
id="n1:p1", name="p1", short_name="eth1", node="n1", status="UP" | ||
) | ||
p2 = sdx_lc_client.Port( | ||
id="n2:p1", name="p2", short_name="eth2", node="n2", status="UP" | ||
) | ||
timestmp = "2021-06-24T00:05:23+04:00" | ||
connection_body = sdx_lc_client.Connection( | ||
id="test1", | ||
name="test1", | ||
ingress_port=p1, | ||
egress_port=p2, | ||
start_time=timestmp, | ||
end_time=timestmp, | ||
) | ||
try: | ||
# create a connection | ||
# logger.warning(connection_body) | ||
api_response = self.api.place_connection(connection_body) | ||
print(api_response) | ||
# logger.warning(api_response) | ||
except ApiException as e: | ||
print(e) | ||
# logger.warning("Exception when calling ConnectionApi->place_experiment: %s\n" % e) | ||
return False | ||
|
||
return True | ||
|
||
|
||
if __name__ == "__main__": | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). # noqa: E501 | ||
OpenAPI spec version: 2.0.0 | ||
OpenAPI spec version: 1.0.0 | ||
Contact: [email protected] | ||
Generated by: https://github.com/swagger-api/swagger-codegen.git | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). # noqa: E501 | ||
OpenAPI spec version: 2.0.0 | ||
OpenAPI spec version: 1.0.0 | ||
Contact: [email protected] | ||
Generated by: https://github.com/swagger-api/swagger-codegen.git | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). # noqa: E501 | ||
OpenAPI spec version: 2.0.0 | ||
OpenAPI spec version: 1.0.0 | ||
Contact: [email protected] | ||
Generated by: https://github.com/swagger-api/swagger-codegen.git | ||
""" | ||
|
@@ -15,9 +15,9 @@ | |
import unittest | ||
|
||
import sdx_lc_client | ||
from sdx_lc_client.models.link_measurement_period import ( | ||
from sdx_lc_client.models.link_measurement_period import ( # noqa: E501 | ||
LinkMeasurementPeriod, | ||
) # noqa: E501 | ||
) | ||
from sdx_lc_client.rest import ApiException | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). # noqa: E501 | ||
OpenAPI spec version: 2.0.0 | ||
OpenAPI spec version: 1.0.0 | ||
Contact: [email protected] | ||
Generated by: https://github.com/swagger-api/swagger-codegen.git | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). # noqa: E501 | ||
OpenAPI spec version: 2.0.0 | ||
OpenAPI spec version: 1.0.0 | ||
Contact: [email protected] | ||
Generated by: https://github.com/swagger-api/swagger-codegen.git | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). # noqa: E501 | ||
OpenAPI spec version: 2.0.0 | ||
OpenAPI spec version: 1.0.0 | ||
Contact: [email protected] | ||
Generated by: https://github.com/swagger-api/swagger-codegen.git | ||
""" | ||
|
@@ -30,10 +30,33 @@ def tearDown(self): | |
|
||
def test_add_node(self): | ||
"""Test case for add_node | ||
add a new node to the topology # noqa: E501 | ||
""" | ||
pass | ||
p1 = sdx_lc_client.Port( | ||
id="n1:p1", name="p1", short_name="eth1", node="n1", status="UP" | ||
) | ||
p2 = sdx_lc_client.Port( | ||
id="n2:p1", name="p2", short_name="eth2", node="n2", status="UP" | ||
) | ||
ps = [] | ||
ps.append(p1) | ||
# ps.append(p2) | ||
lt = sdx_lc_client.Location( | ||
address="miami", latitude=-28.51107891831147, longitude=-79.57947854792273 | ||
) | ||
node_body = sdx_lc_client.Node(id="test1", name="test1", location=lt, ports=ps) | ||
try: | ||
# create a connection | ||
# logger.warning(connection_body) | ||
api_response = self.api.add_node(node_body) | ||
print(api_response) | ||
# logger.warning(api_response) | ||
except ApiException as e: | ||
print(e) | ||
# logger.warning("Exception when calling ConnectionApi->place_experiment: %s\n" % e) | ||
return False | ||
|
||
return True | ||
|
||
def test_delete_node(self): | ||
"""Test case for delete_node | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). # noqa: E501 | ||
OpenAPI spec version: 2.0.0 | ||
OpenAPI spec version: 1.0.0 | ||
Contact: [email protected] | ||
Generated by: https://github.com/swagger-api/swagger-codegen.git | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). # noqa: E501 | ||
OpenAPI spec version: 2.0.0 | ||
OpenAPI spec version: 1.0.0 | ||
Contact: [email protected] | ||
Generated by: https://github.com/swagger-api/swagger-codegen.git | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). # noqa: E501 | ||
OpenAPI spec version: 2.0.0 | ||
OpenAPI spec version: 1.0.0 | ||
Contact: [email protected] | ||
Generated by: https://github.com/swagger-api/swagger-codegen.git | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). # noqa: E501 | ||
OpenAPI spec version: 2.0.0 | ||
OpenAPI spec version: 1.0.0 | ||
Contact: [email protected] | ||
Generated by: https://github.com/swagger-api/swagger-codegen.git | ||
""" | ||
|
@@ -30,10 +30,48 @@ def tearDown(self): | |
|
||
def test_add_topology(self): | ||
"""Test case for add_topology | ||
Send a new topology to SDX-LC # noqa: E501 | ||
""" | ||
pass | ||
p1 = sdx_lc_client.Port( | ||
id="n1:p1", name="p1", short_name="eth1", node="n1", status="UP" | ||
) | ||
p2 = sdx_lc_client.Port( | ||
id="n2:p1", name="p2", short_name="eth2", node="n2", status="UP" | ||
) | ||
ps = [] | ||
ps.append(p1) | ||
ps.append(p2) | ||
lt = sdx_lc_client.Location(address="miami") | ||
node = sdx_lc_client.Node(id="node1", name="node1", location=lt, ports=ps) | ||
ns = [] | ||
ns.append(node) | ||
|
||
link = sdx_lc_client.Link(id="link1", name="link1", ports=ps) | ||
ls = [] | ||
ls.append(link) | ||
|
||
timestmp = "2021-06-24T04:56:07+00:00" | ||
topology_body = sdx_lc_client.Topology( | ||
id="topology1", | ||
name="topology1", | ||
nodes=ns, | ||
links=ls, | ||
version=1, | ||
time_stamp=timestmp, | ||
) | ||
|
||
try: | ||
# create a connection | ||
# logger.warning(connection_body) | ||
api_response = self.api.add_topology(topology_body) | ||
print(api_response) | ||
# logger.warning(api_response) | ||
except ApiException as e: | ||
print(e) | ||
# logger.warning("Exception when calling ConnectionApi->place_experiment: %s\n" % e) | ||
return False | ||
|
||
return True | ||
|
||
def test_delete_topology(self): | ||
"""Test case for delete_topology | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). # noqa: E501 | ||
OpenAPI spec version: 2.0.0 | ||
OpenAPI spec version: 1.0.0 | ||
Contact: [email protected] | ||
Generated by: https://github.com/swagger-api/swagger-codegen.git | ||
""" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
You can find out more about Swagger at [http://swagger.io](http://swagger.io) or on [irc.freenode.net, #swagger](http://swagger.io/irc/). # noqa: E501 | ||
OpenAPI spec version: 2.0.0 | ||
OpenAPI spec version: 1.0.0 | ||
Contact: [email protected] | ||
Generated by: https://github.com/swagger-api/swagger-codegen.git | ||
""" | ||
|