CESNET / netopeer2

NETCONF toolset
BSD 3-Clause "New" or "Revised" License
296 stars 187 forks source link

subscribe --begin --end of netopeer2-cli can't setup true subscribe stream time #1446

Closed robert1030 closed 11 months ago

robert1030 commented 1 year ago

netopeer2-cli ver: 2.0.72 libsysrepo ver: 2.2.73 libyang ver: 2.1.80

subscribe stream command:

subscribe --begin 2023-07-26T16:22:30Z --end 2023-07-26T16:24:30Z --stream NETCONF

Result:

notification (2023-07-26T16:20:30.042960326+00:00)
<replayComplete xmlns="urn:ietf:params:xml:ns:netmod:notification"/>

OK
> 
notification (2023-07-26T16:20:30.050390880+00:00)
<notificationComplete xmlns="urn:ietf:params:xml:ns:netmod:notification"/>

Expected: Netconf notification should start_time: 2023-07-26T16:22:30 Netconf notification should stop_time: 2023-07-26T16:24:30

Ovserved Netconf notification -> start now((2023-07-26T16:20:30.042960326+00:00)), end now(2023-07-26T16:20:30.050390880+00:00)

michalvasko commented 11 months ago

Well, I think this can be interpreted in two ways. From the RFC eventTime:

The time the event was generated by the event source.

Since there were no notifications to be replayed, the event source (NETCONF server) generated both the notifications immediately.

robert1030 commented 11 months ago

Hi Michalvasko: I try netconf notification StopTime by yangcli-pro (yumapro-sdk-basic), ver: 20.10-12.2 create-subscription stream=NETCONF startTime=2022-12-31T00:00:00Z stopTime=2023-08-04T09:50:30Z,

  Incoming notification for session 1 [default]:
  notification {
      eventTime 2023-08-04T09:48:29.939985026+00:00 <= Start at current time
      replayComplete {
      }
  }
  When the time is up, the DUT interrupt ends the notification of RFC5277
  Incoming notification for session 1 [default]:
  notification {
      eventTime 2023-08-04T09:50:30.158500342+00:00
      notificationComplete {
      }
  }

Switch doesn't chang any configuration by netconf during wait stoptime is up, so no any event be send by switch, but yangcli-pro subscribe stream doesn't be stop at immediately.

The problem can't reproduced at yangcli-pro

michalvasko commented 11 months ago

Sorry, I misunderstood the problem and it turns out the issue was at netopeer2-cli and you not reading the expected format of the timestamp. In any case, it should now work in the latest devel branch with the same commands you have used.

robert1030 commented 11 months ago

Hi michalvasko: After updating netopeer2, libnetconf2, sysrepo, libyang to "devel" branch, the problem can't be reproduced, but the solution should be merg to master branch, because devel = not stable.

michalvasko commented 11 months ago

The devel branch should be merged into master soon.