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

rust unit tests failing #291

Open
maryamtahhan opened this issue Apr 26, 2023 · 2 comments
Open

rust unit tests failing #291

maryamtahhan opened this issue Apr 26, 2023 · 2 comments
Assignees

Comments

@maryamtahhan
Copy link
Contributor

Following the instructions for the rust APIs through the readme allows for a successful build of those APIs but the unit tests seem to be failing when running the ./run_cne_test.sh script :

running 8 tests
test tests::test_register ... ok
test tests::test_load_config ... FAILED
test tests::test_get_port ... FAILED
test tests::test_get_port_details ... FAILED
test tests::test_cne_instance ... FAILED
test tests::test_loopback ... FAILED
test tests::test_rx_burst ... FAILED
test tests::test_tx_burst ... FAILED

failures:

---- tests::test_load_config stdout ----
thread 'tests::test_load_config' panicked at 'assertion failed: cfg.is_ok()', apis/cne/src/lib.rs:80:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- tests::test_get_port stdout ----
thread 'tests::test_get_port' panicked at 'assertion failed: ret.is_ok()', apis/cne/src/lib.rs:118:9

---- tests::test_get_port_details stdout ----
thread 'tests::test_get_port_details' panicked at 'assertion failed: ret.is_ok()', apis/cne/src/lib.rs:152:9

---- tests::test_cne_instance stdout ----
thread 'tests::test_cne_instance' panicked at 'assertion failed: ret.is_ok()', apis/cne/src/lib.rs:99:9

---- tests::test_loopback stdout ----
thread 'tests::test_loopback' panicked at 'assertion failed: ret.is_ok()', apis/cne/src/lib.rs:282:9

---- tests::test_rx_burst stdout ----
thread 'tests::test_rx_burst' panicked at 'assertion failed: ret.is_ok()', apis/cne/src/lib.rs:180:9

---- tests::test_tx_burst stdout ----
thread 'tests::test_tx_burst' panicked at 'assertion failed: ret.is_ok()', apis/cne/src/lib.rs:233:9


failures:
    tests::test_cne_instance
    tests::test_get_port
    tests::test_get_port_details
    tests::test_load_config
    tests::test_loopback
    tests::test_rx_burst
    tests::test_tx_burst

test result: FAILED. 1 passed; 7 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.01s

error: test failed, to rerun pass `-p cndp-cne --lib`
@manojgop
Copy link
Contributor

manojgop commented May 25, 2023

@maryamtahhan Are you seeing this issue in fedora or ubuntu . I'm able to run units sets successfully in ubuntu 22.04.

ok
test tests::test_get_port ... libbpf: Kernel error message: Can't replace active BPF XDP link
libbpf: Kernel error message: Can't replace active BPF XDP link
ok
test tests::test_get_port_details ... libbpf: Kernel error message: Can't replace active BPF XDP link
libbpf: Kernel error message: Can't replace active BPF XDP link
ok
test tests::test_load_config ... ok
test tests::test_loopback ... libbpf: Kernel error message: Can't replace active BPF XDP link
libbpf: Kernel error message: Can't replace active BPF XDP link
ok
test tests::test_register ... ok
test tests::test_rx_burst ... libbpf: Kernel error message: Can't replace active BPF XDP link
libbpf: Kernel error message: Can't replace active BPF XDP link
ok
test tests::test_tx_burst ... libbpf: Kernel error message: Can't replace active BPF XDP link
libbpf: Kernel error message: Can't replace active BPF XDP link
ok

successes:

---- tests::test_get_port stdout ----
[2023-05-25T12:20:45Z DEBUG cne::tests] CneError::PortError(Port 100 is not configured)

---- tests::test_loopback stdout ----
[2023-05-25T12:20:49Z DEBUG cne::tests] Number of packets read = 0

---- tests::test_tx_burst stdout ----
[2023-05-25T12:20:52Z DEBUG cne::tests] Number of packets sent = 256


successes:
    tests::test_cne_instance
    tests::test_get_port
    tests::test_get_port_details
    tests::test_load_config
    tests::test_loopback
    tests::test_register
    tests::test_rx_burst
    tests::test_tx_burst

test result: ok. 8 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 9.83s

@manojgop
Copy link
Contributor

I'm running these test from lang/rs/apis/cne directory. Just to confirm - Did you set LD_LIBRARY_PATH.
Append LD_LIBRARY_PATH environment variable with CNDP library path.

Ubuntu: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib/x86_64-linux-gnu Fedora: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib64

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

No branches or pull requests

3 participants