From patchwork Tue Jul 21 14:23:25 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pablo Neira Ayuso X-Patchwork-Id: 498250 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.osmocom.org (unknown [IPv6:2a01:4f8:191:444b::2:7]) by ozlabs.org (Postfix) with ESMTP id 79B6D140777 for ; Wed, 22 Jul 2015 00:25:02 +1000 (AEST) Received: from lists.osmocom.org (lists.osmocom.org [144.76.43.76]) by lists.osmocom.org (Postfix) with ESMTP id 3B4D4851C; Tue, 21 Jul 2015 14:24:56 +0000 (UTC) X-Original-To: openbsc@lists.osmocom.org Delivered-To: openbsc@lists.osmocom.org Received: from mail.us.es (mail.us.es [193.147.175.20]) by lists.osmocom.org (Postfix) with ESMTP id 803998445 for ; Tue, 21 Jul 2015 14:24:44 +0000 (UTC) Received: (qmail 7815 invoked from network); 21 Jul 2015 16:18:04 +0200 Received: from unknown (HELO us.es) (192.168.2.12) by us.es with SMTP; 21 Jul 2015 16:18:04 +0200 Received: (qmail 3863 invoked by uid 507); 21 Jul 2015 14:18:04 -0000 X-Qmail-Scanner-Diagnostics: from 127.0.0.1 by antivirus2 (envelope-from , uid 501) with qmail-scanner-2.10 (clamdscan: 0.98.7/20703. spamassassin: 3.4.0. Clear:RC:1(127.0.0.1):SA:0(-103.2/7.5):. Processed in 1.763704 secs); 21 Jul 2015 14:18:04 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on antivirus2 X-Spam-Level: X-Spam-Status: No, score=-103.2 required=7.5 tests=BAYES_50,SMTPAUTH_US, USER_IN_WHITELIST autolearn=disabled version=3.4.0 X-Spam-ASN: AS12715 87.216.0.0/16 X-Envelope-From: pablo@gnumonks.org Received: from unknown (HELO antivirus2) (127.0.0.1) by us.es with SMTP; 21 Jul 2015 14:18:02 -0000 Received: from 192.168.1.13 (192.168.1.13) by antivirus2 (F-Secure/fsigk_smtp/412/antivirus2); Tue, 21 Jul 2015 16:18:02 +0200 (CEST) X-Virus-Status: clean(F-Secure/fsigk_smtp/412/antivirus2) Received: (qmail 12823 invoked from network); 21 Jul 2015 16:18:02 +0200 Received: from 129.166.216.87.static.jazztel.es (HELO salvia.here) (pneira@us.es@87.216.166.129) by mail.us.es with SMTP; 21 Jul 2015 16:18:02 +0200 From: pablo@gnumonks.org To: openbsc@lists.osmocom.org Subject: [PATCH libosmo-netif 10/18] tests: osmux: adapt it to use the new circuit API Date: Tue, 21 Jul 2015 16:23:25 +0200 Message-Id: <1437488613-3943-11-git-send-email-pablo@gnumonks.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1437488613-3943-1-git-send-email-pablo@gnumonks.org> References: <1437488613-3943-1-git-send-email-pablo@gnumonks.org> X-BeenThere: openbsc@lists.osmocom.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Development of the OpenBSC GSM base station controller List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: openbsc-bounces@lists.osmocom.org Sender: "OpenBSC" From: Pablo Neira Ayuso 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; }