Check PTP_SYS_OFFSET ioctl
Check that PTP_SYS_OFFSET
ioctl can be used to obtain samples of PTP device time and system time at the same moment.
Scenarios: X3-PTP006.
Find out PTP device associated with the IUT interface, call open() to get its FD.
Call ioctl (
PTP_SYS_OFFSET
) on the PTP device FD asking for n_samples samples.Compute average difference between consecutive pairs of timestamps obtained from
PTP_SYS_OFFSET
. Check that difference between every such pair is very close to that average.Estimate offset between PTP and system clocks with help of two consecutive clock_gettime() calls. Check that this estimate is close to the average difference between timestamps pairs obtained from
PTP_SYS_OFFSET
.
Yurij Plotnikov Yurij.Plotnikov@arknetworks.am
Parameters:
env |
Testing environment: |
n_samples |
How many samples to request from PTP_SYS_OFFSET |