path: root/openbsc/tests
diff options
authorNeels Hofmeyr <>2016-12-08 23:58:31 +0100
committerHarald Welte <>2016-12-13 14:54:02 +0000
commit37f9252361c85249b59d5a9202147136782b5415 (patch)
tree231819f71697201e3bba98bf5e82bc81cc7a50eb /openbsc/tests
parent2fa74faf927ed1ca9fc311a206c1e18a7295be7a (diff)
oap_client: make use of OAP optional: disable for NULL config
When passing a NULL config to osmo_oap_client_init(), set OAP to disabled state. Along with the previous fix that ensures message rejection in the disabled state, this makes use of OAP in the GSUP client optional. oap_client_test: expect null config to set state to disabled. Related: OS#1592 Change-Id: Ie4d622fcfd24cb7d89d19f93e4b2571d8fadd1a3
Diffstat (limited to 'openbsc/tests')
2 files changed, 5 insertions, 0 deletions
diff --git a/openbsc/tests/oap/oap_client_test.c b/openbsc/tests/oap/oap_client_test.c
index ab651e63b..e6501cb6d 100644
--- a/openbsc/tests/oap/oap_client_test.c
+++ b/openbsc/tests/oap/oap_client_test.c
@@ -62,6 +62,10 @@ static void test_oap_api(void)
+ fprintf(stderr, "- NULL config should disable\n");
+ OSMO_ASSERT( oap_client_init(NULL, state) == 0 );
+ OSMO_ASSERT(state->state == OAP_DISABLED);
fprintf(stderr, "- reject messages in disabled state\n");
memset(state, 0, sizeof(*state));
memset(&oap_rx, 0, sizeof(oap_rx));
diff --git a/openbsc/tests/oap/oap_client_test.err b/openbsc/tests/oap/oap_client_test.err
index 8c538dc66..62ddc9efa 100644
--- a/openbsc/tests/oap/oap_client_test.err
+++ b/openbsc/tests/oap/oap_client_test.err
@@ -1,6 +1,7 @@
- make sure filling with zeros means uninitialized
- reject messages in uninitialized state
DLOAP Received OAP message 5, but the OAP client is not initialized
+- NULL config should disable
- reject messages in disabled state
DLOAP Received OAP message 5, but the OAP client is disabled
- invalid client_id and shared secret