O-RAN timing API subscription to "/././sync" is not supported

Bug #2009188 reported by Andre Mauricio Zelak
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
StarlingX
Fix Released
Medium
Andre Mauricio Zelak

Bug Description

Brief Description
-----------------
Subscription to "/././sync" is no supported in ptp-notification application.

Severity
--------
Minor

Steps to Reproduce
------------------
Enter ptp-client shell and send a HTTP request.

curl -v -d '{"ResourceAddress": "/././sync", "EndpointUri": "http://127.0.0.1:9090/v2/resource_status/ptp"}' -H 'Content-Type: application/json' -X POST http://127.0.0.1:${SIDECAR_API_PORT}/ocloudNotifications/v2/subscriptions |python -m json.tool

Expected Behavior
------------------
A subscription to /sync would deliver notifications for all types of synchronization events implemented by the synchronization subsystem. Since this cover all notification, individual subscriptions will be ignored.

Actual Behavior
----------------
Subscription to "/././sync" is not supported.

Reproducibility
---------------
Always

System Configuration
--------------------
All configurations with PTP configuration, ptp-notification app and client.

Branch/Pull Time/Commit
-----------------------
commit: be93e2251be721ffdbeba8110ef56deeaab36658

Last Pass
---------
N/A

Timestamp/Logs
--------------
root@notification-demo-ptp-notification-demo-6864f558bd-c9rp7:/opt# curl --path-as-is -v -d ' {"ResourceAddress": "/././sync", "EndpointUri": "http://127.0.0.1:9090/v2/resource_status/ptp"}

' -H 'Content-Type: application/json' -X POST http://127.0.0.1:${SIDECAR_API_PORT}
/ocloudNotifications/v2/subscriptions |python -m json.tool

Note: Unnecessary use of -X or --request, POST is already inferred.
* Trying 127.0.0.1:8080...
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> POST /ocloudNotifications/v2/subscriptions HTTP/1.1
> Host: 127.0.0.1:8080
> User-Agent: curl/7.74.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 95
>
} [95 bytes data]
* upload completely sent off: 95 out of 95 bytes
* Mark bundle as not supporting multiuse
* HTTP 1.0, assume close after body
< HTTP/1.0 400 Bad Request
< Date: Wed, 28 Sep 2022 19:38:51 GMT
< Server: WSGIServer/0.2 CPython/3.6.8
< Content-Length: 158
< Content-Type: application/json
<
{ [158 bytes data]
100 253 100 158 100 95 2430 1461 --:--:-- --:--:-- --:--:-- 3892
* Closing connection 0
{
    "faultcode": "Client",
    "faultstring": "The server could not comply with the request since it is either malformed or otherwise incorrect.",
    "debuginfo": null
}

error log from demo vdu

2022-09-28 19:38:51,760 [ERROR ] [wsme.api][MainThread] Server-side error: "'NotificationParent' object has no attribute 'output'". Detail:
Traceback (most recent call last):

  File "/usr/local/lib/python3.9/dist-packages/wsmeext/pecan.py", line 82, in callfunction
    result = f(self, *args, **kwargs)

  File "/opt/api/api/controllers/root.py", line 101, in post
    for instance in notification.output:

AttributeError: 'NotificationParent' object has no attribute 'output'

2022-09-28 19:38:51,760 [ERROR ] [pecan.commands.serve][MainThread] "POST /v2/resource_status/ptp HTTP/1.1" 500 114

Test Activity
-------------
Feature Testing

Workaround
----------
None

Changed in starlingx:
assignee: nobody → Andre Mauricio Zelak (azelak)
Changed in starlingx:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ptp-notification-armada-app (master)
Ghada Khalil (gkhalil)
Changed in starlingx:
importance: Undecided → Medium
tags: added: stx.9.0 stx.networking
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ptp-notification-armada-app (master)

Reviewed: https://review.opendev.org/c/starlingx/ptp-notification-armada-app/+/876415
Committed: https://opendev.org/starlingx/ptp-notification-armada-app/commit/1ac45c8f432113b7f22d35a8c7a898f1d9dd51d7
Submitter: "Zuul (22348)"
Branch: master

commit 1ac45c8f432113b7f22d35a8c7a898f1d9dd51d7
Author: Andre Mauricio Zelak <email address hidden>
Date: Fri Mar 3 15:10:15 2023 -0300

    Add support to '/sync' aka sync all subscription

    When adding a new subscription check for an existing matching one,
    considering the source uri hierachy. Deny a new individual
    if there is already a sync all subscription, and deny
    a new sync all if there is already an invidual one.

    After a new sync all subscription is created a set of event messages
    are sent to the client containing the initial state of each source
    down in the hierarchy. And, every time one of the source states changes
    a new message is sent.

    Test Plan:
    PASS: Build the container images
    PASS: Mannually deploy them and test with v2 client
    PASS: Create a '/././sync' subscription and check the event messages
    PASS: Check current subscription list
    PASS: Change GNSS sync state and check the event messages
    PASS: Attempt to create a new individual subscription and
          check it fails
    PASS: Delete the '/././sync' subscription
    PASS: Check current subscription list again

    Closes-bug: 2009188

    Signed-off-by: Andre Mauricio Zelak <email address hidden>
    Change-Id: I90b642e73f30fb1798f4a93ab5313411c177949c

Changed in starlingx:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.