dexter submitted this change.

View Change

Approvals: osmith: Looks good to me, approved Jenkins Builder: Verified
testenv: add alternate config to test JSON ESipa bindings

The testsuite normally tests the eIM using the ASN.1 ESipa bindings
(generic). In order to be able to automatically test the JSON ESipa
bindings as well, let's add a testenv configuration (esipa-json)
to the testsuite.

Related SYS#8100

Change-Id: Ic5b16d14cc675335356cd25367d44c3f9744b186
---
M eim/eIM_Tests.cfg
A eim/eIM_Tests_esipa-json.cfg
M eim/prepare.sh
C eim/testenv_esipa-json.cfg
R eim/testenv_generic.cfg
5 files changed, 29 insertions(+), 5 deletions(-)

diff --git a/eim/eIM_Tests.cfg b/eim/eIM_Tests.cfg
index 00e7187..0222276 100644
--- a/eim/eIM_Tests.cfg
+++ b/eim/eIM_Tests.cfg
@@ -14,7 +14,7 @@

[MODULE_PARAMETERS]
eIM_Tests.mp_restop_path := "./restop.py"
-eIM_Tests.mp_esipa_json := false;
+eIM_Tests.mp_esipa_json := false

[MAIN_CONTROLLER]

diff --git a/eim/eIM_Tests_esipa-json.cfg b/eim/eIM_Tests_esipa-json.cfg
new file mode 100644
index 0000000..3944857
--- /dev/null
+++ b/eim/eIM_Tests_esipa-json.cfg
@@ -0,0 +1,22 @@
+[ORDERED_INCLUDE]
+# Common configuration, shared between test suites
+"../Common.cfg"
+# testsuite specific configuration, not expected to change
+"./eIM_Tests.default"
+
+# Local configuration below
+
+[LOGGING]
+
+[TESTPORT_PARAMETERS]
+system.HTTP_server_port.KEYFILE := "alttest.key"
+system.HTTP_server_port.CERTIFICATEFILE := "alttest.crt"
+
+[MODULE_PARAMETERS]
+eIM_Tests.mp_restop_path := "./restop.py"
+eIM_Tests.mp_esipa_json := true
+
+[MAIN_CONTROLLER]
+
+[EXECUTE]
+eIM_Tests.control
diff --git a/eim/prepare.sh b/eim/prepare.sh
index 2ed06f0..abaff47 100755
--- a/eim/prepare.sh
+++ b/eim/prepare.sh
@@ -1,9 +1,11 @@
#!/bin/sh -ex
+TESTSUITE_CONFIG="$1"

# Set mp_restop_path
RESTOP="$TESTENV_SRC_DIR"/onomondo-eim/contrib/rest_api_usage_example/restop.py
test -e "$RESTOP"
+test -e "$TESTSUITE_CONFIG"
sed \
-i \
"s,^eIM_Tests\.mp_restop_path := .*,eIM_Tests.mp_restop_path := \"$RESTOP\"," \
- eIM_Tests.cfg
+ $TESTSUITE_CONFIG
diff --git a/eim/testenv.cfg b/eim/testenv_esipa-json.cfg
similarity index 80%
copy from eim/testenv.cfg
copy to eim/testenv_esipa-json.cfg
index b375fec..90dd2ad 100644
--- a/eim/testenv.cfg
+++ b/eim/testenv_esipa-json.cfg
@@ -1,8 +1,8 @@
[testsuite]
program=eIM_Tests
-config=eIM_Tests.cfg
+config=eIM_Tests_esipa-json.cfg
copy=../ipad/example_ca/pki/private/alttest.key ../ipad/example_ca/pki/issued/alttest.crt
-prepare=prepare.sh
+prepare=prepare.sh eIM_Tests_esipa-json.cfg

[eim]
program=onomondo-eim -c "$TESTENV_INSTALL_DIR"/etc/osmocom/onomondo-eim.config -r "$TESTENV_INSTALL_DIR"/usr/lib/onomondo-eim -m ./mnesia_db -l debug
diff --git a/eim/testenv.cfg b/eim/testenv_generic.cfg
similarity index 90%
rename from eim/testenv.cfg
rename to eim/testenv_generic.cfg
index b375fec..27db67e 100644
--- a/eim/testenv.cfg
+++ b/eim/testenv_generic.cfg
@@ -2,7 +2,7 @@
program=eIM_Tests
config=eIM_Tests.cfg
copy=../ipad/example_ca/pki/private/alttest.key ../ipad/example_ca/pki/issued/alttest.crt
-prepare=prepare.sh
+prepare=prepare.sh eIM_Tests.cfg

[eim]
program=onomondo-eim -c "$TESTENV_INSTALL_DIR"/etc/osmocom/onomondo-eim.config -r "$TESTENV_INSTALL_DIR"/usr/lib/onomondo-eim -m ./mnesia_db -l debug

To view, visit change 43534. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ic5b16d14cc675335356cd25367d44c3f9744b186
Gerrit-Change-Number: 43534
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier@sysmocom.de>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>