Public bug reported:

Since 0.12.0-1ubuntu1, the package build runs none of the integration
tests in tests/tests.rs, which hold the tests of every utility.

0.12.0 added the test binary_name_execfn_fallback to
tests/test_util_name.rs
(https://github.com/uutils/coreutils/pull/12553). It copies the
coreutils binary into a memfd and runs it through /proc/self/fd/N and
/dev/fd/N with argv[0] set to "true". require-utility-to-be-invoked-at-
matching-path.patch makes coreutils exit when the file name of
/proc/self/exe differs from the requested utility, and for a memfd that
name is "memfd:a (deleted)":

  Security violation: Requested utility `true` does not match executable name:
    /memfd:a (deleted)

Built from the 0.12.0-1ubuntu2 source, the test fails, and it passes
once the check of that patch is removed. The patch already ignores three
env tests for the same reason ("we enforce argv[0] matching
/proc/self/exe, so cannot override in argv[0] only"), but not this test,
which is new in 0.12.0.

cargo test stops at the first test binary with a failing test, and
tests/test_util_name.rs runs before tests/tests.rs, so the test step
ends there. The amd64 build log of 0.12.0-1ubuntu2 has no "Running
tests/tests.rs":

       Running tests/test_util_name.rs 
(target/release/deps/test_util_name-86aac22497ed9365)
  ...
  test binary_name_execfn_fallback ... FAILED
  ...
  test result: FAILED. 7 passed; 1 failed; 2 ignored; 0 measured; 1 filtered 
out; finished in 0.17s

  error: test failed, to rerun pass `--test test_util_name`

https://launchpad.net/ubuntu/+source/rust-
coreutils/0.12.0-1ubuntu2/+build/33803294

The build of 0.12.0-1ubuntu1 ends the same way:
https://launchpad.net/ubuntu/+source/rust-
coreutils/0.12.0-1ubuntu1/+build/33608245

In 0.11.0-2ubuntu2, which does not have the test yet, tests/tests.rs
ran, with 5724 passed and 5 failed:
https://launchpad.net/ubuntu/+source/rust-
coreutils/0.11.0-2ubuntu2/+build/33603731

Two changes would let all tests run again:

1. Ignore binary_name_execfn_fallback in 
require-utility-to-be-invoked-at-matching-path.patch, as the patch does for the 
env tests.
2. Pass --no-fail-fast in override_dh_auto_test, before the skip list, so that 
a failing test in one test binary no longer keeps the following test binaries 
from running:

     TEST_NO_FAIL_FAST="--no-fail-fast -- --skip
test_dd::test_stdin_stdout_skip_w_multiplier \

   debian/rules ignores the result of the tests anyway (test||true).

** Affects: rust-coreutils (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2174403

Title:
  Build runs none of tests/tests.rs since 0.12.0:
  binary_name_execfn_fallback fails with require-utility-to-be-invoked-
  at-matching-path.patch

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/rust-coreutils/+bug/2174403/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to