Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 10, 2025

This PR enhances the test-cne application by adding comprehensive test coverage for the txbuff library (packet transmission buffering), which was previously untested in the CNDP test suite.

Changes Made

New Test Implementation

  • txbuff_test.c and txbuff_test.h - Complete test suite for the txbuff library
  • Added 5 comprehensive test functions covering all major txbuff APIs:
    • Buffer creation/destruction for both pktdev and xskdev types
    • Packet count tracking and validation
    • Error callback registration and handling
    • Packet buffering, addition, and flush operations
    • Performance benchmarking

Integration with Test Framework

  • Updated cli_cmds.c to register the new "txbuff" command in the CLI
  • Updated testcne.h to include the new test header
  • Updated meson.build to include new test sources and txbuff dependency
  • Added "txbuff" to the test suite configuration for both interactive CLI and meson test execution

Test Coverage

The new tests validate:

  • Creation/Cleanup: Buffer allocation, initialization, and proper cleanup
  • API Correctness: Count tracking, error callback registration, parameter validation
  • Buffer Management: Packet addition, automatic flush when full, manual flush operations
  • Performance: Measures ~8.7 cycles per operation, ~276M operations per second

Example Usage

# Run via test-cne CLI
./builddir/test/testcne/test-cne txbuff

# Run via meson test system
meson test -C builddir txbuff

Test Results

Running TXBUFF (Packet Transmission Buffer) Tests
>>>> TXBUFF Create/Free tests: Lcore ID 0, Socket ID 0
<<<< TXBUFF Create/Free Tests: done.
[... all test groups pass ...]
Test Summary: Fail: 0, Pass: 5, Skip: 0

The tests are designed to work without requiring real packet transmission devices by focusing on buffer management logic rather than actual hardware packet transmission.

Fixes #233.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https (dns block)

If you need me to access, download, or install something from one of these locations, you can either:


💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.

Copy link
Contributor Author

Copilot AI commented Sep 10, 2025

@maryamtahhan 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

Co-authored-by: maryamtahhan <5012288+maryamtahhan@users.noreply.github.com>
Copilot AI changed the title [WIP] CNDP Test-cne application Add comprehensive txbuff library test to test-cne application Sep 10, 2025
Copilot AI requested a review from maryamtahhan September 10, 2025 08:32
Copy link
Contributor

@KeithWiles KeithWiles left a comment

Choose a reason for hiding this comment

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

Thanks Maryam, I must have missed this last week.

@maryamtahhan maryamtahhan marked this pull request as ready for review November 18, 2025 11:36
@maryamtahhan maryamtahhan merged commit fe18db4 into main Nov 18, 2025
6 checks passed
@maryamtahhan maryamtahhan deleted the copilot/fix-233 branch November 18, 2025 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

CNDP Test-cne application

3 participants