Added presence pjsua unit tests
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@2025 74dad513-b988-da41-8d7b-12977e46ad98
diff --git a/pjsip-apps/src/test-pjsua/scripts-call/100_simplecall.py b/pjsip-apps/src/test-pjsua/scripts-call/100_simplecall.py
index 1bfb960..517483b 100644
--- a/pjsip-apps/src/test-pjsua/scripts-call/100_simplecall.py
+++ b/pjsip-apps/src/test-pjsua/scripts-call/100_simplecall.py
@@ -1,10 +1,12 @@
-# $Id:$
-#
-import inc_cfg
-
-# Simple call
-config = inc_cfg.CallConfig(
- title = "Basic call",
- callee_cfg = inc_cfg.Config(arg="--null-audio"),
- caller_cfg = inc_cfg.Config(arg="--null-audio")
- )
+# $Id:$
+#
+from inc_cfg import *
+
+# Simple call
+test_param = TestParam(
+ "Basic call",
+ [
+ InstanceParam("callee", "--null-audio --max-calls=1"),
+ InstanceParam("caller", "--null-audio --max-calls=1")
+ ]
+ )
diff --git a/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_0_1.py b/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_0_1.py
index 69651c8..bf40f0b 100644
--- a/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_0_1.py
+++ b/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_0_1.py
@@ -1,10 +1,11 @@
-# $Id:$
-#
-import inc_cfg
-
-# Simple call
-config = inc_cfg.CallConfig(
- title = "Callee=no SRTP, caller=optional SRTP",
- callee_cfg = inc_cfg.Config(arg="--null-audio"),
- caller_cfg = inc_cfg.Config(arg="--null-audio --use-srtp=1 --srtp-secure=0")
- )
+# $Id:$
+#
+from inc_cfg import *
+
+test_param= TestParam(
+ "Callee=no SRTP, caller=optional SRTP",
+ [
+ InstanceParam("callee", "--null-audio --max-calls=1"),
+ InstanceParam("caller", "--null-audio --use-srtp=1 --srtp-secure=0 --max-calls=1")
+ ]
+ )
diff --git a/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_1_0.py b/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_1_0.py
index cd9d50b..7fe8b61 100644
--- a/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_1_0.py
+++ b/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_1_0.py
@@ -1,10 +1,11 @@
-# $Id:$
-#
-import inc_cfg
-
-# Simple call
-config = inc_cfg.CallConfig(
- title = "Callee=optional SRTP, caller=no SRTP",
- callee_cfg = inc_cfg.Config(arg="--null-audio --use-srtp=1 --srtp-secure=0"),
- caller_cfg = inc_cfg.Config(arg="--null-audio")
- )
+# $Id:$
+#
+from inc_cfg import *
+
+test_param = TestParam(
+ "Callee=optional SRTP, caller=no SRTP",
+ [
+ InstanceParam("callee", "--null-audio --use-srtp=1 --srtp-secure=0 --max-calls=1"),
+ InstanceParam("caller", "--null-audio --max-calls=1")
+ ]
+ )
diff --git a/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_1_1.py b/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_1_1.py
index 2a8ece5..9091584 100644
--- a/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_1_1.py
+++ b/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_1_1.py
@@ -1,10 +1,11 @@
-# $Id:$
-#
-import inc_cfg
-
-# Simple call
-config = inc_cfg.CallConfig(
- title = "Callee=optional SRTP, caller=optional SRTP",
- callee_cfg = inc_cfg.Config(arg="--null-audio --use-srtp=1 --srtp-secure=0"),
- caller_cfg = inc_cfg.Config(arg="--null-audio --use-srtp=1 --srtp-secure=0")
- )
+# $Id:$
+#
+from inc_cfg import *
+
+test_param = TestParam(
+ "Callee=optional SRTP, caller=optional SRTP",
+ [
+ InstanceParam("callee", "--null-audio --use-srtp=1 --srtp-secure=0 --max-calls=1"),
+ InstanceParam("caller", "--null-audio --use-srtp=1 --srtp-secure=0 --max-calls=1")
+ ]
+ )
diff --git a/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_1_2.py b/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_1_2.py
index 7752293..03f5886 100644
--- a/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_1_2.py
+++ b/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_1_2.py
@@ -1,10 +1,11 @@
# $Id$
#
-import inc_cfg
+from inc_cfg import *
-# Simple call
-config = inc_cfg.CallConfig(
- title = "Callee=optional SRTP, caller=mandatory SRTP",
- callee_cfg = inc_cfg.Config(arg="--null-audio --use-srtp=1 --srtp-secure=0"),
- caller_cfg = inc_cfg.Config(arg="--null-audio --use-srtp=2 --srtp-secure=0")
+test_param = TestParam(
+ "Callee=optional SRTP, caller=mandatory SRTP",
+ [
+ InstanceParam("callee", "--null-audio --use-srtp=1 --srtp-secure=0 --max-calls=1"),
+ InstanceParam("caller", "--null-audio --use-srtp=2 --srtp-secure=0 --max-calls=1")
+ ]
)
diff --git a/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_2_1.py b/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_2_1.py
index 8c46b93..16341eb 100644
--- a/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_2_1.py
+++ b/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_2_1.py
@@ -1,10 +1,12 @@
# $Id$
#
-import inc_cfg
+from inc_cfg import *
# Simple call
-config = inc_cfg.CallConfig(
- title = "Callee=mandatory SRTP, caller=optional SRTP",
- callee_cfg = inc_cfg.Config(arg="--null-audio --use-srtp=2 --srtp-secure=0"),
- caller_cfg = inc_cfg.Config(arg="--null-audio --use-srtp=1 --srtp-secure=0")
+test_param = TestParam(
+ "Callee=mandatory SRTP, caller=optional SRTP",
+ [
+ InstanceParam("callee", "--null-audio --use-srtp=2 --srtp-secure=0 --max-calls=1"),
+ InstanceParam("caller", "--null-audio --use-srtp=1 --srtp-secure=0 --max-calls=1")
+ ]
)
diff --git a/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_2_2.py b/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_2_2.py
index b03978d..9ec2ab6 100644
--- a/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_2_2.py
+++ b/pjsip-apps/src/test-pjsua/scripts-call/150_srtp_2_2.py
@@ -1,10 +1,11 @@
# $Id$
#
-import inc_cfg
+from inc_cfg import *
-# Simple call
-config = inc_cfg.CallConfig(
- title = "Callee=mandatory SRTP, caller=mandatory SRTP",
- callee_cfg = inc_cfg.Config(arg="--null-audio --use-srtp=2 --srtp-secure=0"),
- caller_cfg = inc_cfg.Config(arg="--null-audio --use-srtp=2 --srtp-secure=0")
+test_param = TestParam(
+ "Callee=mandatory SRTP, caller=mandatory SRTP",
+ [
+ InstanceParam("callee", "--null-audio --use-srtp=2 --srtp-secure=0 --max-calls=1"),
+ InstanceParam("caller", "--null-audio --use-srtp=2 --srtp-secure=0 --max-calls=1")
+ ]
)
diff --git a/pjsip-apps/src/test-pjsua/scripts-call/200_tcp.py b/pjsip-apps/src/test-pjsua/scripts-call/200_tcp.py
index 0c96c46..52b5f35 100644
--- a/pjsip-apps/src/test-pjsua/scripts-call/200_tcp.py
+++ b/pjsip-apps/src/test-pjsua/scripts-call/200_tcp.py
@@ -1,11 +1,12 @@
# $Id$
#
-import inc_cfg
+from inc_cfg import *
# TCP call
-config = inc_cfg.CallConfig(
- title = "TCP transport",
- callee_cfg = inc_cfg.Config(arg="--null-audio --no-udp"),
- caller_cfg = inc_cfg.Config(arg="--null-audio --no-udp")
+test_param = TestParam(
+ "TCP transport",
+ [
+ InstanceParam("callee", "--null-audio --no-udp", uri_param=";transport=tcp --max-calls=1"),
+ InstanceParam("caller", "--null-audio --no-udp --max-calls=1")
+ ]
)
-config.uri_param = ";transport=tcp"
diff --git a/pjsip-apps/src/test-pjsua/scripts-call/300_ice_0_1.py b/pjsip-apps/src/test-pjsua/scripts-call/300_ice_0_1.py
index f95cba7..fb0b9de 100644
--- a/pjsip-apps/src/test-pjsua/scripts-call/300_ice_0_1.py
+++ b/pjsip-apps/src/test-pjsua/scripts-call/300_ice_0_1.py
@@ -1,10 +1,12 @@
-# $Id:$
+# $Id$
#
-import inc_cfg
+from inc_cfg import *
# ICE mismatch
-config = inc_cfg.CallConfig(
- title = "Callee=no ICE, caller=use ICE",
- callee_cfg = inc_cfg.Config(arg="--null-audio"),
- caller_cfg = inc_cfg.Config(arg="--null-audio --use-ice")
+test_param = TestParam(
+ "Callee=no ICE, caller=use ICE",
+ [
+ InstanceParam("callee", "--null-audio --max-calls=1"),
+ InstanceParam("caller", "--null-audio --use-ice --max-calls=1")
+ ]
)
diff --git a/pjsip-apps/src/test-pjsua/scripts-call/300_ice_1_0.py b/pjsip-apps/src/test-pjsua/scripts-call/300_ice_1_0.py
index c4dbe9b..ef800e7 100644
--- a/pjsip-apps/src/test-pjsua/scripts-call/300_ice_1_0.py
+++ b/pjsip-apps/src/test-pjsua/scripts-call/300_ice_1_0.py
@@ -1,10 +1,12 @@
-# $Id:$
+# $Id$
#
-import inc_cfg
-
+from inc_cfg import *
+
# ICE mismatch
-config = inc_cfg.CallConfig(
- title = "Callee=use ICE, caller=no ICE",
- callee_cfg = inc_cfg.Config(arg="--null-audio --use-ice"),
- caller_cfg = inc_cfg.Config(arg="--null-audio")
+test_param = TestParam(
+ "Callee=use ICE, caller=no ICE",
+ [
+ InstanceParam("callee", "--null-audio --use-ice --max-calls=1"),
+ InstanceParam("caller", "--null-audio --max-calls=1")
+ ]
)
diff --git a/pjsip-apps/src/test-pjsua/scripts-call/300_ice_1_1.py b/pjsip-apps/src/test-pjsua/scripts-call/300_ice_1_1.py
index 19a3232..0bf8cc1 100644
--- a/pjsip-apps/src/test-pjsua/scripts-call/300_ice_1_1.py
+++ b/pjsip-apps/src/test-pjsua/scripts-call/300_ice_1_1.py
@@ -1,10 +1,12 @@
-# $Id:$
+# $Id$
#
-import inc_cfg
+from inc_cfg import *
# ICE mismatch
-config = inc_cfg.CallConfig(
- title = "Callee=use ICE, caller=use ICE",
- callee_cfg = inc_cfg.Config(arg="--null-audio --use-ice"),
- caller_cfg = inc_cfg.Config(arg="--null-audio --use-ice")
+test_param = TestParam(
+ "Callee=use ICE, caller=use ICE",
+ [
+ InstanceParam("callee", "--null-audio --use-ice --max-calls=1"),
+ InstanceParam("caller", "--null-audio --use-ice --max-calls=1")
+ ]
)