Project

General

Profile

Actions

Bug #1740

closed

add unit tests for queue_seqdel() and callers

Added by neels almost 8 years ago. Updated almost 5 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Start date:
06/01/2016
Due date:
% Done:

100%

Spec Reference:

Description

See http://lists.osmocom.org/pipermail/osmocom-net-gprs/2016-May/000616.html
and following mails in this thread.

diff --git a/gtp/queue.c b/gtp/queue.c
index 5b4d849..fbfa1ec 100644
--- a/gtp/queue.c
+++ b/gtp/queue.c
@@ -105,8 +105,7 @@ static int queue_seqdel(struct queue_t *queue, struct qmsg_t *qmsg)
              printf("Begin queue_seqdel seq = %d\n", (int)qmsg->seq);

      for (qmsg2 = queue->hashseq[hash]; qmsg2; qmsg2 = qmsg2->seqnext) {
-             /* FIXME: this is always true !?! */
-             if (qmsg == qmsg) {
+             if (qmsg == qmsg2) {

queue_seqdel() is/was fundamentally broken.
We want unit tests for

  • queue_seqdel()
  • queue_freemsg()
  • queue_freemsg_seq()

as well as

  • gtp_conf()
  • gtp_retrans()

Related issues

Related to OsmoGGSN (former OpenGGSN) - Bug #3997: Retransmit queue is not clearedResolvedpespin05/11/2019

Actions
Actions #1

Updated by pespin almost 5 years ago

I recently added TTCN3 tests for those. It's difficult to cover 100% cases with that kind of tests but at least it tests some basic stuff around it is working (like retransmission of request and response messages).

Actions #2

Updated by pespin almost 5 years ago

  • Related to Bug #3997: Retransmit queue is not cleared added
Actions #3

Updated by pespin almost 5 years ago

  • Status changed from New to Feedback
  • Assignee set to pespin
  • % Done changed from 0 to 90

Submitted a bunch of tests for this one:

remote: https://gerrit.osmocom.org/c/osmo-ggsn/+/14555 cosmetic: gtp: queue: remove trailing whitespace
remote: https://gerrit.osmocom.org/c/osmo-ggsn/+/14556 gtp: Add missing headers
remote: https://gerrit.osmocom.org/c/osmo-ggsn/+/14557 gtp: queue.c: Document queue APIs
remote: https://gerrit.osmocom.org/c/osmo-ggsn/+/14558 gtp: queue: Add unit test queue_test

Actions #4

Updated by pespin almost 5 years ago

  • Status changed from Feedback to Resolved
  • % Done changed from 90 to 100

Merged, closing.

Actions

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 48.8 MB)