test-auth-unit: the default Wine GTest prefix is shared, so an account that does not own it cannot run the GTests

Open
#2,879 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
bash, shell
Domain
testing, tooling

Research direction

Read tools/lib/wine_prefix.sh and its helper test, starting with wine_prefix_ensure and the default path selection. Add a test where another account owns the default prefix, then change the helper and document the WINEPREFIX override in the recipe header. Run the helper test and just test-changed as the owning and another account; done means both runs reach the GTests.

Written by the indexing model from the issue text.

Description

backlog bug

Evidence at 56c77f4aa

  • tools/lib/wine_prefix.sh:59: with WINEPREFIX unset, the default prefix is $NEVR_RUNTIME_WORK_ROOT/wine-prefix/gtest. One directory under the shared work root serves every account that runs just test-auth-unit or just test-changed.
  • The directory is owned by another account. Running just test-changed as a different account, with WINEPREFIX unset, fails the two GTests test_equip_init and test_equip_init_rules. The output reads wine: '<work root>/wine-prefix/gtest' is not owned by you, then test-auth-unit: FAIL — build/mingw-release/bin/test_equip_init.exe exited 1.
  • The helper's own check (wine_prefix_ensure, tools/lib/wine_prefix.sh:45) passes this path through: it does not check ownership, so the refusal comes from Wine, after the recipe has started the test.
  • Running the same recipe with WINEPREFIX set to a directory the running account owns passes all 41 tests of just test-changed. The helper's header (tools/lib/wine_prefix.sh:10) says a caller-set prefix wins.
  • Related: #2813 is a different refusal of another account's files (a Go test's safe.directory).

Not shown

  • Whether every account other than the owner hits this refusal, or only the accounts that run the test recipe.
  • Whether Wine's ownership check is the only reason the prefix is refused. Only the refusal text was read, not Wine's source.

Falsifier

A run of just test-changed by an account that does not own <work root>/wine-prefix/gtest, with WINEPREFIX unset, that passes test_equip_init and test_equip_init_rules and prints no is not owned by you line.

Work

  1. Test first: a case in the helper's test that makes the default prefix directory owned by another account and asserts that wine_prefix_ensure either picks a per-account prefix or stops with a line that names WINEPREFIX. The case fails on the current helper.
  2. Change tools/lib/wine_prefix.sh so the default prefix is per account (for example <work root>/wine-prefix/<account>/gtest), or so the refusal names WINEPREFIX before Wine runs.
  3. Name the WINEPREFIX override in the recipe header, with the rule that the prefix must have a z: link to /.
  4. Rerun just test-changed as the owning account and as another account; both must reach the GTests.
Dominant language
C++
Stars
3
Forks
5
Avg merge
4h 37m
Merged PRs (30d)
524

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from EchoTools/nevr-runtime

All issues in EchoTools/nevr-runtime

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.