dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/onomondo-eim/+/43921?usp=email )
Change subject: onomondo_eim_app: use individual instance name per HTTP server
......................................................................
onomondo_eim_app: use individual instance name per HTTP server
The functions cowboy:start_clear and cowboy:start_tls get an
instance name (atom) as the first parameter. This instance
name must be unique. We mostly start the ESipa interface with
HTTPs enabled and the REST interface with HTTPs disabled, so
we get unique instance names in that case by chance. As soon
as we switch to HTTP on the ESipa interface as well, the eIM
crashes on startup, because the instance name
"http_listener_esipa" is used twice (and it's also a wrong
name in the case of the REST api). Let's ensure that each
HTTP(s) server gehts an indvidual instance name based on the
interface name.
Change-Id: I43be5666658c407fa1c1fe1a93ae61e428393218
Related: SYS#8287
---
M src/onomondo_eim_app.erl
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/onomondo-eim refs/changes/21/43921/1
diff --git a/src/onomondo_eim_app.erl b/src/onomondo_eim_app.erl
index a8614d7..688f83a 100644
--- a/src/onomondo_eim_app.erl
+++ b/src/onomondo_eim_app.erl
@@ -13,7 +13,7 @@
start_http_server(true, Ip, Port, _Cert, _Key, Dispatch, Middlewares, InterfaceName) ->
logger:notice("Starting ~s HTTP server at ~p:~p...~n", [InterfaceName, Ip, Port]),
cowboy:start_clear(
- http_listener_esipa,
+ list_to_atom("http_listener_" ++ InterfaceName),
[
{ip, Ip},
{port, Port}
@@ -35,7 +35,7 @@
% implementation still lacks SNI support. The effort required to add SNI support should be manageable as Cowboy
% offers SNI support (sni_fun).
cowboy:start_tls(
- https_listener_esipa,
+ list_to_atom("https_listener_" ++ InterfaceName),
[
{ip, Ip},
{port, Port},
--
To view, visit https://gerrit.osmocom.org/c/onomondo-eim/+/43921?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: onomondo-eim
Gerrit-Branch: master
Gerrit-Change-Id: I43be5666658c407fa1c1fe1a93ae61e428393218
Gerrit-Change-Number: 43921
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
dexter has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43820?usp=email )
Change subject: eIM_Tests: remove code dup in f_esipa_transceive
......................................................................
eIM_Tests: remove code dup in f_esipa_transceive
In f_esipa_transceive we check if the response returned from
f_esipa_receive is the one we expect. But we can also pass the
expected response template to f_esipa_receive and let
f_esipa_receive perform the check.
Change-Id: I11f0b7bcf1bf8c763e6915eda34c3ede2a9a5c94
Related: SYS#8203
---
M eim/eIM_Tests.ttcn
1 file changed, 1 insertion(+), 8 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, approved
jolly: Looks good to me, but someone else must approve
diff --git a/eim/eIM_Tests.ttcn b/eim/eIM_Tests.ttcn
index 7888885..8675c99 100644
--- a/eim/eIM_Tests.ttcn
+++ b/eim/eIM_Tests.ttcn
@@ -478,15 +478,8 @@
private function f_esipa_transceive(EsipaMessageFromIpaToEim esipa_req,
template EsipaMessageFromEimToIpa expected_esipa_res := omit)
runs on eIM_ConnHdlr return template EsipaMessageFromEimToIpa {
- var template EsipaMessageFromEimToIpa esipa_res
f_esipa_send(esipa_req);
- esipa_res := f_esipa_receive();
- if (not istemplatekind(expected_esipa_res, "omit")) {
- if (not match(valueof(esipa_res), expected_esipa_res)) {
- setverdict(fail, "unexpected response from eIM on ESipa");
- }
- }
- return esipa_res;
+ return f_esipa_receive(expected_esipa_res);
}
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/43820?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I11f0b7bcf1bf8c763e6915eda34c3ede2a9a5c94
Gerrit-Change-Number: 43820
Gerrit-PatchSet: 5
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: jolly <andreas(a)eversberg.eu>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>