From 347af170f9cf1fd49be2a52107f0594d9d4b8ba8 Mon Sep 17 00:00:00 2001 From: David Sullivan Date: Tue, 25 Feb 2020 21:13:59 -0500 Subject: [PATCH] Update PTP API ref and unit tests Add the PTP apply function to the API ref and the unit tests. Story: 2006759 Task: 38848 Change-Id: Iae3cc9e90b653fd92a83a0d9a216d87016cf4c6c Signed-off-by: David Sullivan --- api-ref/source/api-ref-sysinv-v1-config.rst | 11 +++++++++++ sysinv/sysinv/sysinv/sysinv/tests/api/test_ptp.py | 14 +++++++++++++- 2 files changed, 24 insertions(+), 1 deletion(-) diff --git a/api-ref/source/api-ref-sysinv-v1-config.rst b/api-ref/source/api-ref-sysinv-v1-config.rst index d50b91c065..06bded0975 100644 --- a/api-ref/source/api-ref-sysinv-v1-config.rst +++ b/api-ref/source/api-ref-sysinv-v1-config.rst @@ -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 ------------- diff --git a/sysinv/sysinv/sysinv/sysinv/tests/api/test_ptp.py b/sysinv/sysinv/sysinv/sysinv/tests/api/test_ptp.py index 0d7a490716..0fd0c3969a 100644 --- a/sysinv/sysinv/sysinv/sysinv/tests/api/test_ptp.py +++ b/sysinv/sysinv/sysinv/sysinv/tests/api/test_ptp.py @@ -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)