|
|
|
@ -94,6 +94,63 @@ TestNGCPDomainPrefs = {} --class
|
|
|
|
|
assertEquals(sr.pv.get("$xavp(domain[1]=>sst_refresh_method)"), "UPDATE_FALLBACK_INVITE")
|
|
|
|
|
assertItemsEquals(keys, {"sst_enable", "sst_refresh_method"})
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function TestNGCPDomainPrefs:test_clean()
|
|
|
|
|
local xavp = NGCPXAvp:new('callee','domain',{})
|
|
|
|
|
xavp("testid",1)
|
|
|
|
|
xavp("foo","foo")
|
|
|
|
|
assertEquals(sr.pv.get("$xavp(domain[1]=>testid)"),1)
|
|
|
|
|
assertEquals(sr.pv.get("$xavp(domain[1]=>foo)"),"foo")
|
|
|
|
|
assertEquals(sr.pv.get("$xavp(domain[0]=>dummy)"),"caller")
|
|
|
|
|
self.d:clean()
|
|
|
|
|
assertFalse(sr.pv.get("$xavp(domain[0]=>dummy)"))
|
|
|
|
|
assertFalse(sr.pv.get("$xavp(domain[1]=>dummy)"))
|
|
|
|
|
assertFalse(sr.pv.get("$xavp(domain)"))
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function TestNGCPDomainPrefs:test_callee_clean()
|
|
|
|
|
local callee_xavp = NGCPXAvp:new('callee','domain',{})
|
|
|
|
|
callee_xavp("testid",1)
|
|
|
|
|
callee_xavp("foo","foo")
|
|
|
|
|
local caller_xavp = NGCPXAvp:new('caller','domain',{})
|
|
|
|
|
caller_xavp("other",1)
|
|
|
|
|
caller_xavp("otherfoo","foo")
|
|
|
|
|
assertEquals(sr.pv.get("$xavp(domain[1]=>testid)"),1)
|
|
|
|
|
assertEquals(sr.pv.get("$xavp(domain[1]=>foo)"),"foo")
|
|
|
|
|
assertEquals(sr.pv.get("$xavp(domain[0]=>dummy)"),"caller")
|
|
|
|
|
assertEquals(sr.pv.get("$xavp(domain[0]=>other)"),1)
|
|
|
|
|
assertEquals(sr.pv.get("$xavp(domain[0]=>otherfoo)"),"foo")
|
|
|
|
|
assertEquals(sr.pv.get("$xavp(domain[1]=>dummy)"),"callee")
|
|
|
|
|
self.d:clean('callee')
|
|
|
|
|
assertEquals(sr.pv.get("$xavp(domain[0]=>dummy)"),'caller')
|
|
|
|
|
assertFalse(sr.pv.get("$xavp(domain[1]=>testid)"))
|
|
|
|
|
assertFalse(sr.pv.get("$xavp(domain[1]=>foo)"))
|
|
|
|
|
assertEquals(sr.pv.get("$xavp(domain[0]=>other)"),1)
|
|
|
|
|
assertEquals(sr.pv.get("$xavp(domain[0]=>otherfoo)"),"foo")
|
|
|
|
|
assertEquals(sr.pv.get("$xavp(domain[1]=>dummy)"),"callee")
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
function TestNGCPDomainPrefs:test_caller_clean()
|
|
|
|
|
local callee_xavp = NGCPXAvp:new('callee','domain',{})
|
|
|
|
|
callee_xavp("testid",1)
|
|
|
|
|
callee_xavp("foo","foo")
|
|
|
|
|
local caller_xavp = NGCPXAvp:new('caller','domain',{})
|
|
|
|
|
caller_xavp("other",1)
|
|
|
|
|
caller_xavp("otherfoo","foo")
|
|
|
|
|
assertEquals(sr.pv.get("$xavp(domain[1]=>testid)"),1)
|
|
|
|
|
assertEquals(sr.pv.get("$xavp(domain[1]=>foo)"),"foo")
|
|
|
|
|
assertEquals(sr.pv.get("$xavp(domain[0]=>dummy)"),"caller")
|
|
|
|
|
assertEquals(sr.pv.get("$xavp(domain[0]=>other)"),1)
|
|
|
|
|
assertEquals(sr.pv.get("$xavp(domain[0]=>otherfoo)"),"foo")
|
|
|
|
|
assertEquals(sr.pv.get("$xavp(domain[1]=>dummy)"),"callee")
|
|
|
|
|
self.d:clean('caller')
|
|
|
|
|
assertEquals(sr.pv.get("$xavp(domain[0]=>dummy)"),'caller')
|
|
|
|
|
assertFalse(sr.pv.get("$xavp(domain[0]=>other)"))
|
|
|
|
|
assertFalse(sr.pv.get("$xavp(domain[0]=>otherfoo)"))
|
|
|
|
|
assertEquals(sr.pv.get("$xavp(domain[1]=>testid)"),1)
|
|
|
|
|
assertEquals(sr.pv.get("$xavp(domain[1]=>foo)"),"foo")
|
|
|
|
|
assertEquals(sr.pv.get("$xavp(domain[1]=>dummy)"),"callee")
|
|
|
|
|
end
|
|
|
|
|
-- class TestNGCPDomainPrefs
|
|
|
|
|
|
|
|
|
|
---- Control test output:
|
|
|
|
|