No test suite run at built time nor as autopkgtest

Bug #2055309 reported by Paul Mars
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libtracefs (Ubuntu)
Fix Released
High
Adrien Nader

Bug Description

Track the addition of a test suite to be run at built time and during autopkgtest.

Related branches

Revision history for this message
Paul Mars (upils) wrote :

I have a patch to run tests in autopkgtest but these tests are failing. I checked and they are failing without any change on my side.

2 out of 36 tests are failing. I will try to diagnose these failures.

# sudo ./utest/trace-utest

     CUnit - A unit testing framework for C - Version 2.1-3
     http://cunit.sourceforge.net/

Memory mapped buffers not supported

Suite: tracefs library
  Test: Test tracefs/debugfs mounting ...passed
  Test: trace cpu read ...passed
  Test: trace cpu read_buf_percent ...FAILED
    1. tracefs-utest.c:1333 - data->done == false
    2. tracefs-utest.c:1359 - data->done == true
    3. tracefs-utest.c:1301 - kbuf != NULL
    4. tracefs-utest.c:1359 - data->done == true
    5. tracefs-utest.c:1301 - kbuf != NULL
    6. tracefs-utest.c:1359 - data->done == true
    7. tracefs-utest.c:1301 - kbuf != NULL
    8. tracefs-utest.c:1359 - data->done == true
    9. tracefs-utest.c:1301 - kbuf != NULL
  Test: trace cpu pipe ...passed
  Test: trace pid events filter ...passed
  Test: trace pid function filter ...passed
  Test: trace sql ...passed
  Test: trace sql trace onmax ...passed
  Test: trace sql trace onchange ...passed
  Test: trace sql snapshot onmax ...passed
  Test: trace sql snapshot onchange ...passed
  Test: trace sql save onmax ...passed
  Test: trace sql save onchange ...passed
  Test: trace sql trace and snapshot onmax ...passed
  Test: trace sql trace and snapshot onchange ...passed
  Test: tracing file / directory APIs ...passed
  Test: instance file / directory APIs ...passed
  Test: instance file descriptor ...passed
  Test: instance reset ...passed
  Test: systems and events APIs ...passed
  Test: tracefs_iterate_snapshot_events API ...passed
  Test: tracefs_iterate_raw_events API ...passed
  Test: Follow events ...passed
  Test: Follow events clear ...passed
  Test: tracefs_tracers API ...passed
  Test: tracefs_local events API ...passed
  Test: tracefs_instances_walk API ...passed
  Test: tracefs_get_clock API ...passed
  Test: tracing on / off ...passed
  Test: tracing options ...passed
  Test: custom system directory ...passed
  Test: ftrace marker ...passed
  Test: kprobes ...passed
  Test: synthetic events ...passed
  Test: eprobes ...passed
  Test: uprobes ...FAILED
    1. tracefs-utest.c:2205 - ret == 0
    2. tracefs-utest.c:2205 - ret == 0

Run Summary: Type Total Ran Passed Failed Inactive
              suites 1 1 n/a 0 0
               tests 36 36 34 2 0
             asserts 32600531 32600531 32600520 11 n/a

Elapsed time = 30.844 seconds

Revision history for this message
Paul Mars (upils) wrote :

I spent some time investigating today the uprobes tests failure. I understand these test fail because the call to tracefs_event_enable() in check_probes returns -1. It also encounters errno=524, which is (apparently) the err number returned by seccomp when failing to load a filter. (see https://github.com/moby/moby/issues/45498)

Going deeper, I found this is failing because instance_file_write is trying to write a file in /sys/kernel/tracing/instances/cunit_test_iter/events/utest/utest_u/ (and creating the directory).

I understand /sys/kernel/tracing is mounted as a tracefs. I am reading about it to understand what is going on.

Revision history for this message
Adrien Nader (adrien) wrote :

I carried this forward.

In a Noble LXD container, the test setup doesn't work.

In a Noble LXD VM, three tests fail: tracefs_iterate_snapshot_events, , and uprobes.

The first and second tests fail because they try to sched_setaffinity() across 8 cores which the VM host has but the VM itself has only one core exposed and this API returns EINVAL. I'll have a very quick look to see if the CPU detection logic can be changed. Otherwise we won't ever be able to rely on these tests.

The third also fails on my Mantic machine. I cannot create the directory mentioned by Paul anywhere it seems.

Adrien Nader (adrien)
Changed in libtracefs (Ubuntu):
assignee: nobody → Adrien Nader (adrien-n)
status: New → In Progress
milestone: none → ubuntu-24.04
Adrien Nader (adrien)
Changed in libtracefs (Ubuntu):
importance: Undecided → High
Revision history for this message
Lukas Märdian (slyon) wrote :

This is a MIR requirement, see bug #2051925

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libtracefs - 1.8.0-1ubuntu1

---------------
libtracefs (1.8.0-1ubuntu1) noble; urgency=medium

  * Remove "patches/" from .gitignore
  * Bump libtraceevent-dev Build-Depends to >= 1:1.8.0
  * Only use online CPUs during tests
    - d/p/testsuite-use-only-online-cpus.patch
  * Return an error from trace-utest if one of the tests failed:
    - d/p/testsuite-return-error-when-tests-failed.patch
  * Build and run the upstream testsuite (as root) during build
  * Run the upstream test suite during autopkgtest (requires root and VM)
    (LP: #2055309)
    - Build autopkgtest testsuite against installed library
    - Ignore CI-incompatible test failures in CI
    - Add d/tests/autopkgtest-specific.patch to support required changes

 -- Adrien Nader <email address hidden> Tue, 16 Apr 2024 22:25:06 +0200

Changed in libtracefs (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.