Merge "Update PTP API ref and unit tests"

This commit is contained in:
Zuul 2020-02-26 20:15:32 +00:00 committed by Gerrit Code Review
commit ea87911c84
2 changed files with 24 additions and 1 deletions

View File

@ -4467,6 +4467,17 @@ badMediaType (415)
"uuid":"70649b44-b462-445a-9fa5-9233a1b5842d"
}
*******************************
Applies the PTP configuration
*******************************
.. rest_method:: POST /v1/ptp/apply
**Normal response codes**
204
-------------
External OAM
-------------

View File

@ -47,7 +47,7 @@ class PTPTestCase(base.FunctionalTest):
self.ptp = self.dbapi.ptp_get_one()
self.ptp_uuid = self.ptp.uuid
def _get_path(self, ptp_id):
def _get_path(self, ptp_id=None):
if ptp_id:
path = '/ptp/' + ptp_id
else:
@ -124,3 +124,15 @@ class PTPModifyTestCase(PTPTestCase):
dbutils.create_test_interface(**interface)
self.modify_ptp_failure(self.transport_udp, "Invalid system configuration for UDP based PTP transport")
class PTPApplyTestCase(PTPTestCase):
def setUp(self):
super(PTPApplyTestCase, self).setUp()
def test_apply_ptp(self):
# This is basically a null operation for the API but we should test that the function exists
apply_path = self._get_path() + "/apply"
# The apply takes no parameters
response = self.post_json(apply_path, {})
self.assertEqual(http_client.NO_CONTENT, response.status_int)