git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] tests: A new test prereq for testing chmod -w as root

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 4, 2010, 19:13 UTC
Message-ID
<7veieefaym.fsf@alter.siamese.dyndns.org>
In-Reply-To
<1280934026-25658-1-git-send-email-avarab@gmail.com>
Ævar Arnfjörð Bjarmason  <avarab@gmail.com> writes:
> Some tests depend on not being able to read files after chmod -w. This
> doesn't work when running the tests as root.
Obviously you meant s/read/write/ or "chmod -r" ;-)

We discussed this prerequisite in the past as "SANITY", in the dual sense that (1) nobody sane should be running tests as root and (2) for root many normal assumptions programs make do not hold. If we throw out the former by saying that it is safe to run tests under fakeroot, we would need something like this patch to cover the latter. The patch is a step in the right direction.

Having said that.

I wonder if we want to be so specific, as your patch does, to single out "you can write even to a-w file" aspect of rootness, or just want to cover the rootness more broadly so that other rooty conditions like "if you can read even an a-r file, then the assumptions the test makes will not hold" and "if you can kill other's processes, ...ditto..." can also be covered with a single prerequisite token.

Also I think there was a discussion and proposed patch to support more than one prerequisite tokens, concatenated with "," or something, like:

    test_expect_success POSIXPERM,SANITY 'notice unwritable repo' '
        ... test that depends on posixperm and not running
        ... as root comes here
    '
so that you don't have to invent permutations of prerequisite tokens.
Thanks.
Previous: Ævar Arnfjörð BjarmasonNext: Ævar Arnfjörð Bjarmason
Message 2 of 7 in “tests: A new test prereq for testing chmod -w as root”
  1. tests: A new test prereq for testing chmod -w as rootÆvar Arnfjörð Bjarmason, Aug 4, 2010
  2. Junio C HamanoAug 4, 2010
  3. Ævar Arnfjörð BjarmasonAug 4, 2010
  4. Jonathan NiederAug 4, 2010
  5. tests: A SANITY test prereq for testing if we're rootÆvar Arnfjörð Bjarmason, Aug 6, 2010
  6. Junio C HamanoAug 9, 2010
  7. Ævar Arnfjörð BjarmasonAug 9, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.