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'; + + }