Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests(sinsp): Fix infer_defaults_to_first_non_loopback TC #1989

Merged
merged 1 commit into from
Aug 5, 2024

Conversation

SohamM-Ibm
Copy link
Contributor

What type of PR is this?

/kind failing-test

Any specific area of the project related to this PR?

/area tests

Does this PR require a change in the driver versions?

No

What this PR does / why we need it:

We need to ensure the same byte order for all architectures, so added the Byte order modifiers.

Which issue(s) this PR fixes:

Fixes #

Special notes for your reviewer:

Does this PR introduce a user-facing change?:

NONE

Modifying parse_ipv4_addr function to ensure that the IP address is correctly parsed and combined into a 32-bit integer of the correct byte order for Big-Endian systems.

Modifying the convert_to_string function to extract the bytes in the correct order for Big-Endian systems.

Signed-off-by: Soham Munshi <Soham.Munshi@ibm.com>
@poiana
Copy link
Contributor

poiana commented Aug 2, 2024

Welcome @SohamM-Ibm! It looks like this is your first PR to falcosecurity/libs 🎉

@poiana poiana added the size/S label Aug 2, 2024
@SohamM-Ibm
Copy link
Contributor Author

The PR resolves the Test case failure observed on s390x system for sinsp_network_interfaces.infer_defaults_to_first_non_loopback while running the command - make run-unit-test-libsinsp.

[ RUN      ] sinsp_network_interfaces.infer_defaults_to_first_non_loopback
/home/test/sysdig/build/falcosecurity-libs-repo/falcosecurity-libs-prefix/src/falcosecurity-libs/userspace/libsinsp/test/ifinfo.ut.cpp:126: Failure
Expected equality of these values:
  "192.168.22.149"
  buf
    Which is: "127.0.0.1"

[  FAILED  ] sinsp_network_interfaces.infer_defaults_to_first_non_loopback (0 ms)
[----------] 6 tests from sinsp_network_interfaces (0 ms total)

@SohamM-Ibm
Copy link
Contributor Author

@Andreagit97 May you please review.

@LucaGuerra
Copy link
Contributor

/milestone 0.18.0

@poiana poiana added this to the 0.18.0 milestone Aug 5, 2024
Copy link

github-actions bot commented Aug 5, 2024

Perf diff from master - unit tests

     5.70%     -1.43%  [.] sinsp_evt::get_type
     2.58%     +0.91%  [.] sinsp_thread_manager::find_thread
     4.68%     +0.83%  [.] next
     9.17%     +0.66%  [.] sinsp_parser::reset
     1.62%     +0.66%  [.] scap_event_decode_params
     1.20%     +0.58%  [.] sinsp::fetch_next_event
     8.10%     -0.50%  [.] sinsp::next
     0.90%     +0.50%  [.] libsinsp::sinsp_suppress::process_event
     0.18%     +0.49%  [.] sinsp_container_info::sinsp_container_info
     5.34%     -0.45%  [.] sinsp_parser::process_event

Perf diff from master - scap file

     5.31%     +8.92%  [.] sinsp_filter_check::tostring
     5.20%     +7.36%  [.] sinsp_filter_check_event::extract_single
    11.55%     -4.65%  [.] next
     2.64%     +4.30%  [.] std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char const*>
    12.61%     -3.87%  [.] sinsp_filter_check::extract_nocache
     7.93%     -3.78%  [.] std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_construct<char*>
    11.83%     -3.26%  [.] sinsp_evt_formatter::tostring_withformat
     8.08%     -2.33%  [.] sinsp_filter_check::rawval_to_string
     5.59%     -2.20%  [.] scap_event_decode_params
     7.84%     -2.20%  [.] std::_Hashtable<long, std::pair<long const, std::shared_ptr<sinsp_threadinfo> >, std::allocator<std::pair<long const, std::shared_ptr<sinsp_threadinfo> > >, std::__detail::_Select1st, std::equal_to<long>, std::hash<long>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true> >::_M_find_before_node

Heap diff from master - unit tests

peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Heap diff from master - scap file

peak heap memory consumption: 0B
peak RSS (including heaptrack overhead): 0B
total memory leaked: 0B

Copy link

codecov bot commented Aug 5, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 50.98%. Comparing base (2e87063) to head (1b2f028).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #1989    +/-   ##
========================================
  Coverage   50.98%   50.98%            
========================================
  Files         310      310            
  Lines       39612    39612            
  Branches    17455    17626   +171     
========================================
  Hits        20197    20197            
- Misses      14338    14354    +16     
+ Partials     5077     5061    -16     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@Andreagit97 Andreagit97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this!
/approve

@poiana
Copy link
Contributor

poiana commented Aug 5, 2024

LGTM label has been added.

Git tree hash: 0af7d27660890d95e3f8b1a8041cbf38f969edf6

@poiana
Copy link
Contributor

poiana commented Aug 5, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Andreagit97, SohamM-Ibm

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@poiana poiana added the approved label Aug 5, 2024
@poiana poiana merged commit d22f7a4 into falcosecurity:master Aug 5, 2024
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants