diff --git a/src/vse_sync_pp/analyzers/analyzer.py b/src/vse_sync_pp/analyzers/analyzer.py index 32886e5..95ae1fc 100644 --- a/src/vse_sync_pp/analyzers/analyzer.py +++ b/src/vse_sync_pp/analyzers/analyzer.py @@ -260,6 +260,8 @@ def test(self, data): return (False, "short test duration") if len(data) - 1 < self._duration_min: return (False, "short test samples") + if len(data.timestamp.diff().astype(float).round(0).tail(-1).unique()) > 1: + return (False, "missing test samples") return (True, None) def explain(self, data): diff --git a/tests/vse_sync_pp/analyzers/test_gnss.py b/tests/vse_sync_pp/analyzers/test_gnss.py index 5979463..f0f68dd 100644 --- a/tests/vse_sync_pp/analyzers/test_gnss.py +++ b/tests/vse_sync_pp/analyzers/test_gnss.py @@ -185,6 +185,38 @@ class TestTimeErrorAnalyzer(TestCase, metaclass=AnalyzerTestBuilder): }, }, }, + { + 'requirements': 'G.8272/PRTC-A', + 'parameters': { + 'time-error-limit/%': 100, + 'transient-period/s': 1, + 'min-test-duration/s': 4, + }, + 'rows': ( + TERR(Decimal(0), 0, 5), + TERR(Decimal(1), 0, 5), + TERR(Decimal(2), 0, 5), + TERR(Decimal(3), 0, 5), + # oops, missing sample + TERR(Decimal(5), 0, 5), + TERR(Decimal(6), 0, 5), + ), + 'result': False, + 'reason': "missing test samples", + 'timestamp': Decimal(1), + 'duration': Decimal(5), + 'analysis': { + 'terror': { + 'units': 'ns', + 'min': 0, + 'max': 0, + 'range': 0, + 'mean': 0, + 'stddev': 0, + 'variance': 0, + }, + }, + }, { 'requirements': 'G.8272/PRTC-A', 'parameters': { diff --git a/tests/vse_sync_pp/analyzers/test_phc2sys.py b/tests/vse_sync_pp/analyzers/test_phc2sys.py index c0571f9..c9ca2fb 100644 --- a/tests/vse_sync_pp/analyzers/test_phc2sys.py +++ b/tests/vse_sync_pp/analyzers/test_phc2sys.py @@ -185,6 +185,38 @@ class TestTimeErrorAnalyzer(TestCase, metaclass=AnalyzerTestBuilder): }, }, }, + { + 'requirements': 'workload/RAN', + 'parameters': { + 'time-error-limit/%': 100, + 'transient-period/s': 1, + 'min-test-duration/s': 4, + }, + 'rows': ( + TERR(Decimal(0), 0, 's2', 620), + TERR(Decimal(1), 0, 's2', 620), + TERR(Decimal(2), 0, 's2', 620), + TERR(Decimal(3), 0, 's2', 620), + # oops, missing sample + TERR(Decimal(5), 0, 's2', 620), + TERR(Decimal(6), 0, 's2', 620), + ), + 'result': False, + 'reason': "missing test samples", + 'timestamp': Decimal(1), + 'duration': Decimal(5), + 'analysis': { + 'terror': { + 'units': 'ns', + 'min': 0, + 'max': 0, + 'range': 0, + 'mean': 0, + 'stddev': 0, + 'variance': 0, + }, + }, + }, { 'requirements': 'workload/RAN', 'parameters': { diff --git a/tests/vse_sync_pp/analyzers/test_ppsdpll.py b/tests/vse_sync_pp/analyzers/test_ppsdpll.py index 59c3d80..ebe2411 100644 --- a/tests/vse_sync_pp/analyzers/test_ppsdpll.py +++ b/tests/vse_sync_pp/analyzers/test_ppsdpll.py @@ -204,6 +204,37 @@ class TestTimeErrorAnalyzer(TestCase, metaclass=AnalyzerTestBuilder): }, }, }, + { + 'requirements': 'G.8272/PRTC-B', + 'parameters': { + 'time-error-limit/%': 100, + 'transient-period/s': 1, + 'min-test-duration/s': 3, + }, + 'rows': ( + DPLLS(Decimal('1876878.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876879.28'), 3, 3, Decimal(1)), + # oops, lost sample + DPLLS(Decimal('1876881.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876882.28'), 3, 3, Decimal(1)), + DPLLS(Decimal('1876883.28'), 3, 3, Decimal(1)), + ), + 'result': False, + 'reason': "missing test samples", + 'timestamp': Decimal('1876879.28'), + 'duration': Decimal(4), + 'analysis': { + 'terror': { + 'units': 'ns', + 'min': 1, + 'max': 1, + 'range': 0, + 'mean': 1, + 'stddev': 0, + 'variance': 0, + }, + }, + }, { 'requirements': 'G.8272/PRTC-B', 'parameters': { diff --git a/tests/vse_sync_pp/analyzers/test_ts2phc.py b/tests/vse_sync_pp/analyzers/test_ts2phc.py index 4e241a8..cc4a8ef 100644 --- a/tests/vse_sync_pp/analyzers/test_ts2phc.py +++ b/tests/vse_sync_pp/analyzers/test_ts2phc.py @@ -185,6 +185,38 @@ class TestTimeErrorAnalyzer(TestCase, metaclass=AnalyzerTestBuilder): }, }, }, + { + 'requirements': 'G.8272/PRTC-A', + 'parameters': { + 'time-error-limit/%': 100, + 'transient-period/s': 1, + 'min-test-duration/s': 4, + }, + 'rows': ( + TERR(Decimal(0), 0, 's2'), + TERR(Decimal(1), 0, 's2'), + TERR(Decimal(2), 0, 's2'), + TERR(Decimal(3), 0, 's2'), + # oops, missing sample + TERR(Decimal(5), 0, 's2'), + TERR(Decimal(6), 0, 's2'), + ), + 'result': False, + 'reason': "missing test samples", + 'timestamp': Decimal(1), + 'duration': Decimal(5), + 'analysis': { + 'terror': { + 'units': 'ns', + 'min': 0, + 'max': 0, + 'range': 0, + 'mean': 0, + 'stddev': 0, + 'variance': 0, + }, + }, + }, { 'requirements': 'G.8272/PRTC-A', 'parameters': {