diff --git a/tests/vse_sync_pp/analyzers/test_ppsdpll.py b/tests/vse_sync_pp/analyzers/test_ppsdpll.py index 28cb550..9a5f600 100644 --- a/tests/vse_sync_pp/analyzers/test_ppsdpll.py +++ b/tests/vse_sync_pp/analyzers/test_ppsdpll.py @@ -273,7 +273,231 @@ class TestMaxTimeIntervalErrorAnalyzer(TestCase, metaclass=AnalyzerTestBuilder): 'timestamp': None, 'duration': None, 'analysis': {}, - } + }, + { + 'requirements': 'G.8272/PRTC-B', + 'parameters': { + 'maximum-time-interval-error-limit/%': 100, + 'transient-period/s': 1, + 'min-test-duration/s': 1, + }, + 'rows': ( + DPLLS(Decimal('1876878.28'), 3, 3, Decimal(1)), + # oops going into freerun + DPLLS(Decimal('1876879.28'), 3, 1, Decimal(1)), + DPLLS(Decimal('1876880.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876881.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876882.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876883.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876884.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876885.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876886.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876887.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876888.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876889.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876890.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876891.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876892.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876893.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876894.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876895.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876896.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876897.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876898.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876899.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876900.28'), 3, 3, Decimal(1)), + ), + 'result': False, + 'reason': "loss of lock", + 'timestamp': Decimal('1876879.28'), + 'duration': Decimal(21), + 'analysis': { + 'mtie': { + 'units': 'ns', + 'min': 0, + 'max': 0, + 'range': 0, + 'mean': 0, + 'stddev': 0, + 'variance': 0, + }, + }, + }, + { + 'requirements': 'G.8272/PRTC-B', + 'parameters': { + 'maximum-time-interval-error-limit/%': 100, + 'transient-period/s': 1, + 'min-test-duration/s': 10, + }, + 'rows': ( + # state 2 does not cause failure + DPLLS(Decimal('1876878.28'), 3, 2, Decimal(0)), + DPLLS(Decimal('1876879.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876880.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876881.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876882.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876883.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876884.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876885.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876886.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876887.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876888.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876889.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876890.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876891.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876892.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876893.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876894.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876895.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876896.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876897.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876898.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876899.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876900.28'), 3, 3, Decimal(0)), + ), + 'result': True, + 'reason': None, + 'timestamp': Decimal('1876879.28'), + 'duration': Decimal(21), + 'analysis': { + 'mtie': { + 'units': 'ns', + 'min': 0, + 'max': 0, + 'range': 0, + 'mean': 0, + 'stddev': 0, + 'variance': 0, + }, + }, + }, + { + 'requirements': 'G.8272/PRTC-B', + 'parameters': { + 'maximum-time-interval-error-limit/%': 100, + 'transient-period/s': 1, + 'min-test-duration/s': 23, + }, + 'rows': ( + DPLLS(Decimal('1876877.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876878.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876879.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876880.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876881.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876882.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876883.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876884.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876885.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876886.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876887.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876888.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876889.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876890.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876891.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876892.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876893.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876894.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876895.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876896.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876897.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876898.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876899.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876900.28'), 3, 3, Decimal(0)), + ), + 'result': False, + 'reason': "short test duration", + 'timestamp': Decimal('1876878.28'), + 'duration': Decimal(22), + 'analysis': { + 'mtie': { + 'units': 'ns', + 'min': 0, + 'max': 0, + 'range': 0, + 'mean': 0, + 'stddev': 0, + 'variance': 0, + }, + }, + }, + { + 'requirements': 'G.8272/PRTC-B', + 'parameters': { + 'maximum-time-interval-error-limit/%': 100, + 'transient-period/s': 1, + 'min-test-duration/s': 12, + }, + 'rows': ( + DPLLS(Decimal('1876878.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876879.28'), 3, 3, Decimal(0)), + # oops, lost samples + DPLLS(Decimal('1876882.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876883.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876884.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876885.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876886.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876887.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876888.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876889.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876890.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876891.28'), 3, 3, Decimal(0)), + ), + 'result': False, + 'reason': "short test samples", + 'timestamp': Decimal('1876879.28'), + 'duration': Decimal(12), + 'analysis': { + 'mtie': { + 'units': 'ns', + 'min': 0, + 'max': 0, + 'range': 0, + 'mean': 0, + 'stddev': 0, + 'variance': 0, + }, + }, + }, + { + 'requirements': 'G.8272/PRTC-B', + 'parameters': { + 'maximum-time-interval-error-limit/%': 100, + 'transient-period/s': 1, + 'min-test-duration/s': 11, + }, + 'rows': ( + DPLLS(Decimal('1695047659.996251'), 3, 3, Decimal(1)), + DPLLS(Decimal('1695047660.996251'), 3, 3, Decimal(1)), + DPLLS(Decimal('1695047661.996251'), 3, 3, Decimal(1)), + DPLLS(Decimal('1695047662.996251'), 3, 3, Decimal(1)), + DPLLS(Decimal('1695047663.996251'), 3, 3, Decimal(1)), + DPLLS(Decimal('1695047664.996251'), 3, 3, Decimal(1)), + DPLLS(Decimal('1695047665.996251'), 3, 3, Decimal(1)), + DPLLS(Decimal('1695047666.996251'), 3, 3, Decimal(1)), + DPLLS(Decimal('1695047667.996251'), 3, 3, Decimal(1)), + DPLLS(Decimal('1695047668.996251'), 3, 3, Decimal(1)), + DPLLS(Decimal('1695047669.996251'), 3, 3, Decimal(1)), + DPLLS(Decimal('1695047670.996251'), 3, 3, Decimal(1)), + DPLLS(Decimal('1695047671.996251'), 3, 3, Decimal(1)), + DPLLS(Decimal('1695047672.996251'), 3, 3, Decimal(1)), + ), + 'result': True, + 'reason': None, + 'timestamp': '2023-09-18T14:34:20+00:00', + 'duration': Decimal(12), + 'analysis': { + 'mtie': { + 'units': 'ns', + 'min': 0, + 'max': 0, + 'range': 0, + 'mean': 0, + 'stddev': 0, + 'variance': 0, + }, + }, + }, ) @@ -314,5 +538,199 @@ class TestTimeDeviationAnalyzer(TestCase, metaclass=AnalyzerTestBuilder): 'timestamp': None, 'duration': None, 'analysis': {}, - } + }, + { + 'requirements': 'G.8272/PRTC-A', + 'parameters': { + 'time-deviation-limit/%': 100, + 'transient-period/s': 1, + 'min-test-duration/s': 19, + }, + 'rows': ( + DPLLS(Decimal('1876878.28'), 3, 3, Decimal(1)), + # state s1 causes failure + DPLLS(Decimal('1876879.28'), 3, 1, Decimal(1)), + DPLLS(Decimal('1876880.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876881.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876882.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876883.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876884.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876885.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876886.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876887.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876888.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876889.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876890.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876891.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876892.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876893.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876894.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876895.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876896.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876897.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876898.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876899.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876900.28'), 3, 3, Decimal(1)), + ), + 'result': False, + 'reason': "loss of lock", + 'timestamp': Decimal('1876879.28'), + 'duration': Decimal(21), + 'analysis': { + 'tdev': { + 'units': 'ns', + 'min': 0, + 'max': 0, + 'range': 0, + 'mean': 0, + 'stddev': 0, + 'variance': 0, + }, + }, + }, + { + 'requirements': 'G.8272/PRTC-A', + 'parameters': { + 'time-deviation-limit/%': 100, + 'transient-period/s': 1, + 'min-test-duration/s': 25, + }, + 'rows': ( + DPLLS(Decimal('1876878.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876879.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876880.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876881.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876882.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876883.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876884.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876885.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876886.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876887.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876888.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876889.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876890.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876891.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876892.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876893.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876894.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876895.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876896.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876897.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876898.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876899.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876900.28'), 3, 3, Decimal(1)), + # oops, window too short + ), + 'result': False, + 'reason': "short test duration", + 'timestamp': Decimal('1876879.28'), + 'duration': Decimal(21), + 'analysis': { + 'tdev': { + 'units': 'ns', + 'min': 0, + 'max': 0, + 'range': 0, + 'mean': 0, + 'stddev': 0, + 'variance': 0, + }, + }, + }, + { + 'requirements': 'G.8272/PRTC-A', + 'parameters': { + 'time-deviation-limit/%': 100, + 'transient-period/s': 1, + 'min-test-duration/s': 20, + }, + 'rows': ( + DPLLS(Decimal('1876878.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876879.28'), 3, 3, Decimal(0)), + # oops, missing sample + DPLLS(Decimal('1876881.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876882.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876883.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876884.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876885.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876886.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876887.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876888.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876889.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876890.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876891.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876892.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876893.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876894.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876895.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876896.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876897.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876898.28'), 3, 3, Decimal(0)), + DPLLS(Decimal('1876899.28'), 3, 3, Decimal(0)), + ), + 'result': False, + 'reason': "short test samples", + 'timestamp': Decimal('1876879.28'), + 'duration': Decimal(20), + 'analysis': { + 'tdev': { + 'units': 'ns', + 'min': 0, + 'max': 0, + 'range': 0, + 'mean': 0, + 'stddev': 0, + 'variance': 0, + }, + }, + }, + { + 'requirements': 'G.8272/PRTC-A', + 'parameters': { + 'time-deviation-limit/%': 100, + 'transient-period/s': 1, + # minimum to compute valid TDEV + 'min-test-duration/s': 19, + }, + 'rows': ( + DPLLS(Decimal('1876878.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876879.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876880.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876881.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876882.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876883.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876884.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876885.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876886.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876887.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876888.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876889.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876890.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876891.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876892.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876893.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876894.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876895.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876896.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876897.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876898.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876899.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876900.28'), 3, 3, Decimal(1)), + ), + 'result': True, + 'reason': None, + 'timestamp': Decimal('1876879.28'), + 'duration': Decimal(21), + 'analysis': { + 'tdev': { + 'units': 'ns', + 'min': 0, + 'max': 0, + 'range': 0, + 'mean': 0, + 'stddev': 0, + 'variance': 0, + }, + }, + }, )