[PATCH libosmo-netif 10/18] tests: osmux: adapt it to use the new circuit API

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/OpenBSC@lists.osmocom.org/.

pablo at gnumonks.org pablo at gnumonks.org
Tue Jul 21 14:23:25 UTC 2015


From: Pablo Neira Ayuso <pablo at soleta.eu>

This also introduces a spare circuit that contains no voice data to test
bandwidth preallocation through the new osmux dummy frame type.
---
 tests/osmux/osmux_test.c |   13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/tests/osmux/osmux_test.c b/tests/osmux/osmux_test.c
index dae9aa2..1b87db7 100644
--- a/tests/osmux/osmux_test.c
+++ b/tests/osmux/osmux_test.c
@@ -135,6 +135,13 @@ int main(void)
 	/* If the test takes longer than 10 seconds, abort it */
 	alarm(10);
 
+	for (i = 0; i < 2; i++)
+		osmux_xfrm_input_open_circuit(&h_input, i, 0);
+
+	/* Add two circuits with dummy padding */
+	osmux_xfrm_input_open_circuit(&h_input, 2, 1);
+	osmux_xfrm_input_open_circuit(&h_input, 3, 1);
+
 	for (i=1; i<64; i++) {
 		msg = msgb_alloc(1500, "test");
 		if (!msg)
@@ -178,6 +185,12 @@ int main(void)
 			k = 0;
 		}
 	}
+
+	for (i = 0; i < 4; i++)
+		osmux_xfrm_input_close_circuit(&h_input, i);
+
+	osmux_xfrm_input_fini(&h_input);
+
 	fprintf(stdout, "OK: Test passed\n");
 	return EXIT_SUCCESS;
 }
-- 
1.7.10.4




More information about the OpenBSC mailing list