From 743867b43d6372941b999aaedee7cebc8e040213 Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Tue, 15 Oct 2024 14:02:35 -0400 Subject: [PATCH] MT#61263 add Opus MOS tests Change-Id: I566038f5fff96dbd5c1117d4016d56a4dfe72680 --- t/auto-daemon-tests.pl | 488 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 488 insertions(+) diff --git a/t/auto-daemon-tests.pl b/t/auto-daemon-tests.pl index 7f62b29f0..6b42c1fac 100755 --- a/t/auto-daemon-tests.pl +++ b/t/auto-daemon-tests.pl @@ -569,6 +569,494 @@ sub stun_succ { cmp_ok $resp->{SSRC}{0x7654321}{'average MOS'}{'round-trip time leg'}, '<', 200000 + $processing_us, 'metric matches'; + + + +($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call([qw(198.51.100.23 3016)], [qw(198.51.100.23 3017)], + [qw(198.51.100.23 3018)], [qw(198.51.100.23 3019)]); + +($port_a, $port_ax) = offer('Opus MOS basic', { }, <{SSRC}{0x1234567}{'average MOS'}{samples}, 1, 'metric matches'; +is $resp->{SSRC}{0x1234567}{'average MOS'}{MOS}, 43, 'metric matches'; +is $resp->{SSRC}{0x1234567}{'average MOS'}{jitter}, 0, 'metric matches'; +is $resp->{SSRC}{0x1234567}{'average MOS'}{'packet loss'}, 0, 'metric matches'; +cmp_ok $resp->{SSRC}{0x1234567}{'average MOS'}{'round-trip time'}, '>=', 0, 'metric matches'; +cmp_ok $resp->{SSRC}{0x1234567}{'average MOS'}{'round-trip time'}, '<', $processing_us * 2, 'metric matches'; +cmp_ok $resp->{SSRC}{0x1234567}{'average MOS'}{'round-trip time leg'}, '>=', 0, 'metric matches'; +cmp_ok $resp->{SSRC}{0x1234567}{'average MOS'}{'round-trip time leg'}, '<', $processing_us, 'metric matches'; + +is $resp->{SSRC}{0x7654321}{'average MOS'}{samples}, 1, 'metric matches'; +is $resp->{SSRC}{0x7654321}{'average MOS'}{MOS}, 43, 'metric matches'; +is $resp->{SSRC}{0x7654321}{'average MOS'}{jitter}, 0, 'metric matches'; +is $resp->{SSRC}{0x7654321}{'average MOS'}{'packet loss'}, 0, 'metric matches'; +cmp_ok $resp->{SSRC}{0x7654321}{'average MOS'}{'round-trip time'}, '>=', 0, 'metric matches'; +cmp_ok $resp->{SSRC}{0x7654321}{'average MOS'}{'round-trip time'}, '<', $processing_us * 2, 'metric matches'; +cmp_ok $resp->{SSRC}{0x7654321}{'average MOS'}{'round-trip time leg'}, '>=', 0, 'metric matches'; +cmp_ok $resp->{SSRC}{0x7654321}{'average MOS'}{'round-trip time leg'}, '<', $processing_us, 'metric matches'; + + + + + +($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call([qw(198.51.100.23 3020)], [qw(198.51.100.23 3021)], + [qw(198.51.100.23 3022)], [qw(198.51.100.23 3023)]); + +($port_a, $port_ax) = offer('Opus MOS degraded', { }, <{SSRC}{0x1234567}{'average MOS'}{samples}, 1, 'metric matches'; +is $resp->{SSRC}{0x1234567}{'average MOS'}{MOS}, 36, 'metric matches'; +is $resp->{SSRC}{0x1234567}{'average MOS'}{jitter}, 15, 'metric matches'; +is $resp->{SSRC}{0x1234567}{'average MOS'}{'packet loss'}, 3, 'metric matches'; +cmp_ok $resp->{SSRC}{0x1234567}{'average MOS'}{'round-trip time'}, '>=', 250000, 'metric matches'; +cmp_ok $resp->{SSRC}{0x1234567}{'average MOS'}{'round-trip time'}, '<', 250000 + $processing_us * 2, 'metric matches'; +cmp_ok $resp->{SSRC}{0x1234567}{'average MOS'}{'round-trip time leg'}, '>=', 130000, 'metric matches'; +cmp_ok $resp->{SSRC}{0x1234567}{'average MOS'}{'round-trip time leg'}, '<', 130000 + $processing_us, 'metric matches'; + +is $resp->{SSRC}{0x7654321}{'average MOS'}{samples}, 1, 'metric matches'; +is $resp->{SSRC}{0x7654321}{'average MOS'}{MOS}, 36, 'metric matches'; +is $resp->{SSRC}{0x7654321}{'average MOS'}{jitter}, 15, 'metric matches'; +is $resp->{SSRC}{0x7654321}{'average MOS'}{'packet loss'}, 3, 'metric matches'; +cmp_ok $resp->{SSRC}{0x7654321}{'average MOS'}{'round-trip time'}, '>=', 250000, 'metric matches'; +cmp_ok $resp->{SSRC}{0x7654321}{'average MOS'}{'round-trip time'}, '<', 250000 + $processing_us * 2, 'metric matches'; +cmp_ok $resp->{SSRC}{0x7654321}{'average MOS'}{'round-trip time leg'}, '>=', 120000, 'metric matches'; +cmp_ok $resp->{SSRC}{0x7654321}{'average MOS'}{'round-trip time leg'}, '<', 120000 + $processing_us, 'metric matches'; + + + + +($sock_a, $sock_ax, $sock_b, $sock_bx) = new_call([qw(198.51.100.23 3024)], [qw(198.51.100.23 3025)], + [qw(198.51.100.23 3026)], [qw(198.51.100.23 3027)]); + +($port_a, $port_ax) = offer('Opus MOS very degraded', { }, <{SSRC}{0x1234567}{'average MOS'}{samples}, 1, 'metric matches'; +is $resp->{SSRC}{0x1234567}{'average MOS'}{MOS}, 29, 'metric matches'; +is $resp->{SSRC}{0x1234567}{'average MOS'}{jitter}, 20, 'metric matches'; +is $resp->{SSRC}{0x1234567}{'average MOS'}{'packet loss'}, 5, 'metric matches'; +cmp_ok $resp->{SSRC}{0x1234567}{'average MOS'}{'round-trip time'}, '>=', 400000, 'metric matches'; +cmp_ok $resp->{SSRC}{0x1234567}{'average MOS'}{'round-trip time'}, '<', 400000 + $processing_us * 2, 'metric matches'; +cmp_ok $resp->{SSRC}{0x1234567}{'average MOS'}{'round-trip time leg'}, '>=', 200000, 'metric matches'; +cmp_ok $resp->{SSRC}{0x1234567}{'average MOS'}{'round-trip time leg'}, '<', 200000 + $processing_us, 'metric matches'; + +is $resp->{SSRC}{0x7654321}{'average MOS'}{samples}, 1, 'metric matches'; +is $resp->{SSRC}{0x7654321}{'average MOS'}{MOS}, 29, 'metric matches'; +is $resp->{SSRC}{0x7654321}{'average MOS'}{jitter}, 20, 'metric matches'; +is $resp->{SSRC}{0x7654321}{'average MOS'}{'packet loss'}, 5, 'metric matches'; +cmp_ok $resp->{SSRC}{0x7654321}{'average MOS'}{'round-trip time'}, '>=', 400000, 'metric matches'; +cmp_ok $resp->{SSRC}{0x7654321}{'average MOS'}{'round-trip time'}, '<', 400000 + $processing_us * 2, 'metric matches'; +cmp_ok $resp->{SSRC}{0x7654321}{'average MOS'}{'round-trip time leg'}, '>=', 200000, 'metric matches'; +cmp_ok $resp->{SSRC}{0x7654321}{'average MOS'}{'round-trip time leg'}, '<', 200000 + $processing_us, 'metric matches'; + + }