Project

General

Profile

Actions

Task #6330

open

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

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

Added by Juliana Fajardini Reichow about 1 year ago. Updated 3 months 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
Actions #1

Updated by Juliana Fajardini Reichow about 1 year ago

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

Updated by Liza Opar about 1 year ago

  • Assignee changed from Community Ticket to Liza Opar
Actions #3

Updated by Shivani Bhardwaj about 1 year ago

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

There are no unit tests in this file.

Actions #4

Updated by Juliana Fajardini Reichow about 1 year ago

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?

Actions #5

Updated by Shivani Bhardwaj about 1 year ago

  • Status changed from Rejected to Assigned
Actions #6

Updated by Shivani Bhardwaj about 1 year ago

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?

Actions #7

Updated by Juliana Fajardini Reichow about 1 year ago

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...

Actions #8

Updated by Liza Opar about 1 year ago

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.

Actions #9

Updated by Juliana Fajardini Reichow about 1 year ago

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. ;)

Actions #10

Updated by Liza Opar about 1 year ago

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.

Actions #11

Updated by Juliana Fajardini Reichow about 1 year ago

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.

Actions #12

Updated by Juliana Fajardini Reichow about 1 year ago

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

Updated by Juliana Fajardini Reichow almost 1 year ago

  • Label Beginner, Good First Issue, Outreachy added
Actions #14

Updated by Juliana Fajardini Reichow almost 1 year ago

  • Status changed from Assigned to In Review
Actions #15

Updated by Juliana Fajardini Reichow 10 months ago

  • 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

Actions #16

Updated by Juliana Fajardini Reichow 10 months ago

  • Status changed from In Review to In Progress
Actions #17

Updated by Victor Julien 5 months ago

  • Target version changed from 8.0.0-beta1 to TBD
Actions #18

Updated by Philippe Antoine 3 months ago

  • Status changed from In Progress to New
Actions

Also available in: Atom PDF