Project

General

Profile

Actions

Task #6330

open
JF CT

Task #2975: convert unittests to new FAIL/PASS API

Convert unittests to new FAIL/PASS API - tests/stream-tcp-list.c

Task #6330: Convert unittests to new FAIL/PASS API - tests/stream-tcp-list.c

Added by Juliana Fajardini Reichow over 2 years ago. Updated over 1 year ago.

Status:
New
Priority:
Normal
Target version:
Effort:
Difficulty:
Label:
Beginner, Good First Issue, Outreachy

Description

There are some remaining unittests that were not fully converted to the FAIL/PASS API in the tests/stream-tcp-list.c .

Follow the instructions from the parent task to know how to convert them.


Related issues 2 (2 open0 closed)

Related to Suricata - Task #6489: test/stream/tcp-list: fix unittests NewOISF DevActions
Copied from Suricata - Task #6316: Convert unittests to new FAIL/PASS API - app-layer-detect-proto.cNewCommunity TicketActions

JF Updated by Juliana Fajardini Reichow over 2 years ago Actions #1

  • Copied from Task #6316: Convert unittests to new FAIL/PASS API - app-layer-detect-proto.c added

LO Updated by Liza Opar over 2 years ago Actions #2

  • Assignee changed from Community Ticket to Liza Opar

SB Updated by Shivani Bhardwaj over 2 years ago Actions #3

  • Status changed from New to Rejected
  • Label deleted (Beginner, C, Good First Issue, Outreachy)

There are no unit tests in this file.

JF Updated by Juliana Fajardini Reichow over 2 years ago Actions #4

Shivani Bhardwaj wrote in #note-3:

There are no unit tests in this file.

I apologize for the confusion this has caused. But... I'm confused.
I see unittests registered (https://github.com/OISF/suricata/blob/master/src/tests/stream-tcp-list.c#L710).

And I see that among those, some are still using return statements (cf https://github.com/OISF/suricata/blob/master/src/tests/stream-tcp-list.c#L575), instead of PASS or FAIL macros. Shouldn't those be converted, too?

SB Updated by Shivani Bhardwaj over 2 years ago Actions #5

  • Status changed from Rejected to Assigned

SB Updated by Shivani Bhardwaj over 2 years ago Actions #6

Juliana Fajardini Reichow wrote in #note-4:

Shivani Bhardwaj wrote in #note-3:

There are no unit tests in this file.

I apologize for the confusion this has caused. But... I'm confused.
I see unittests registered (https://github.com/OISF/suricata/blob/master/src/tests/stream-tcp-list.c#L710).

Apologies from me, actually. I did not see the "tests" prefix at all.
Liza, please look for the file under tests dir and continue to work on this. Sorry for the confusion created.

And I see that among those, some are still using return statements (cf https://github.com/OISF/suricata/blob/master/src/tests/stream-tcp-list.c#L575), instead of PASS or FAIL macros. Shouldn't those be converted, too?

JF Updated by Juliana Fajardini Reichow over 2 years ago Actions #7

To be fair, I think the tests in this one mostly follow a structure a bit different, but I do think at least the `return 1` calls in the tests should be converted...

LO Updated by Liza Opar over 2 years ago Actions #8

I want to run the tests in the src/test/stream-tcp-fike.c file before conversion in order to understand what im working with.
I ran cd src ,cd tests to get /src/tests#
However when i run./src/tests -u -U StreamTcpReassembleTest i get the response "permission denied"
so i tried ./src/tests/stream-tcp-list.c feedback is"nothing can be done for stream-tcp-list.c"

I tried 'make' it didnt work.

Did research and tried:
1- ./scripts/bundle.sh
2- ./autogen.sh
3- ./configure --disable-shared --enable-debug --enable-unittests
4- make doesnt run successfully.

JF Updated by Juliana Fajardini Reichow over 2 years ago Actions #9

Liza Opar wrote in #note-8:

I want to run the tests in the src/test/stream-tcp-fike.c file before conversion in order to understand what im working with.
I ran cd src ,cd tests to get /src/tests#
However when i run./src/tests -u -U StreamTcpReassembleTest i get the response "permission denied"
so i tried ./src/tests/stream-tcp-list.c feedback is"nothing can be done for stream-tcp-list.c"

I tried 'make' it didnt work.

Did research and tried:
1- ./scripts/bundle.sh
2- ./autogen.sh
3- ./configure --disable-shared --enable-debug --enable-unittests
4- make doesnt run successfully.

Hi,
- What do you mean when you say that make doesn't run successfully?
- To run our unit tests, once Suricata is compiled with the right configure flags, you can run
`src/suricata -u` to run all unittests or
`src/suricata -u -U TestName` (or ModuleName) to run a specific test or set of tests.

Does the error for Permission denied say anything else? When sharing info on errors or build failures, it is always best to copy and paste the full output, as that helps others have a better picture of what's going on. ;)

LO Updated by Liza Opar over 2 years ago Actions #10

No it doesnt. It just says permission denied.

Well when i run make i expect output but the message i get is "nothing can be done" I assume thats unsuccessful and im still missing something.

Ill be sure to provide complete error output.

JF Updated by Juliana Fajardini Reichow over 2 years ago Actions #11

Liza Opar wrote in #note-10:

No it doesnt. It just says permission denied.

Well when i run make i expect output but the message i get is "nothing can be done" I assume thats unsuccessful and im still missing something.

Ill be sure to provide complete error output.

I see. Are you running `make` from the Suricata directory?
All the commands you've listed - autogen, configure, make, and running the tests, should be run from the suricata directory.

JF Updated by Juliana Fajardini Reichow over 2 years ago Actions #12

  • Related to Task #6489: test/stream/tcp-list: fix unittests added

JF Updated by Juliana Fajardini Reichow over 2 years ago Actions #13

  • Label Beginner, Good First Issue, Outreachy added

JF Updated by Juliana Fajardini Reichow over 2 years ago Actions #14

  • Status changed from Assigned to In Review

JF Updated by Juliana Fajardini Reichow about 2 years ago Actions #15

  • Assignee changed from Liza Opar to Community Ticket

Hi there, according to our guidelines for stale tickets, I'm unassigning this ticket.

Thanks for your interest in our project, and feel free to reach out in case you have time and want to contribute to Suricata again, or if you're still working on this task! :) :)

Refer to:
https://forum.suricata.io/t/important-outreachy-contribution-phase-wrap-up-prs-claimed-tickets-and-more
https://docs.suricata.io/en/latest/devguide/contributing/contribution-process.html#stale-tickets-policy

JF Updated by Juliana Fajardini Reichow about 2 years ago Actions #16

  • Status changed from In Review to In Progress

VJ Updated by Victor Julien almost 2 years ago Actions #17

  • Target version changed from 8.0.0-beta1 to TBD

PA Updated by Philippe Antoine over 1 year ago Actions #18

  • Status changed from In Progress to New
Actions

Also available in: PDF Atom