Page MenuHomePhabricator

test: USDT tracepoint interface tests
ClosedPublic

Authored by Fabien on Dec 2 2022, 20:36.

Details

Reviewers
PiRK
Group Reviewers
Restricted Project
Commits
rABC7415dd1f910d: test: USDT tracepoint interface tests
Summary
This adds functional tests for the USDT tracepoints added in #22006 and #22902. This partially fixes #23296. The tests are probably skipped on most systems as these tests require:

    a Linux system with a kernel that supports BPF (and available kernel headers)
    that Bitcoin Core is compiled with tracepoints for USDT support (default when compiled with depends)
    bcc installed
    the tests are run with a privileged user that is able to e.g. do BPF syscalls and load BPF maps

Backport of core#24358 and core#25528 for the test fixes.

Depends on D12737.

Note that:

  • We don't run it on CI (yet)
  • We need to prune more blocks to trigger the expected flush event as our block files are smaller
  • The 3 tests succeed on my machine, but the runner returns an error because I got compilation warnings that print to stderr
Test Plan

With tracing enabled:

sudo ./test/functional/test_runner.py interface_usdt_net
sudo ./test/functional/test_runner.py interface_usdt_utxocache
sudo ./test/functional/test_runner.py interface_usdt_validation

ninja check-functional

Check the tests are skipped as expected when not run as root.

Diff Detail

Event Timeline

Fabien requested review of this revision.Dec 2 2022, 20:36
PiRK requested changes to this revision.Dec 3 2022, 16:03
PiRK added a subscriber: PiRK.
PiRK added inline comments.
test/functional/interface_usdt_utxocache.py
7

This should probably be changed to the Bitcoin ABC url, as the API is a bit different for the type of the coin value.

This revision now requires changes to proceed.Dec 3 2022, 16:03

Fix the url. I'll fix the doc (wrong amount type) in a follow-up

This revision is now accepted and ready to land.Dec 5 2022, 07:08
This revision was automatically updated to reflect the committed changes.