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

in 2.19.2 t0061-run-command FAILs if . is in $PATH

From
H.Merijn Brand <h.m.brand@xs4all.nl>
Date
Nov 28, 2018, 09:05 UTC
Message-ID
<20181128100517.28d44804@pc09.procura.nl>

the test is explicitely checking that it should not find runnable scripts outside $PATH, *assuming* $PATH does not have . in it

Having '.' in $PATH can be seen as a bad idea (and it most likely is), but the tests should either remove '.' from $PATH before testing or ignore that fail if $PATH does have '.', as it is not illegal

$ git-2.19.2/t 504 > prove -v t0061-run-command.sh
t0061-run-command.sh ..
ok 1 - start_command reports ENOENT (slash)
ok 2 - start_command reports ENOENT (no slash)
ok 3 - run_command can run a command
ok 4 - run_command is restricted to PATH
ok 5 - run_command can run a script without a #! line
ok 6 - run_command does not try to execute a directory
ok 7 - run_command passes over non-executable file
ok 8 - run_command reports EACCES
ok 9 - unreadable directory in PATH
ok 10 - run_command runs in parallel with more jobs available than tasks
ok 11 - run_command runs in parallel with as many jobs as tasks
ok 12 - run_command runs in parallel with more tasks than jobs available
ok 13 - run_command is asked to abort gracefully
ok 14 - run_command outputs
ok 15 - GIT_TRACE with environment variables
# passed all 15 test(s)
1..15
ok
All tests successful.
Files=1, Tests=15,  1 wallclock secs ( 0.04 usr  0.01 sys +  0.26 cusr  0.07 csys =  0.38 CPU)
Result: PASS

$ env PATH="$PATH"":." prove -v t0061-run-command.sh t0061-run-command.sh .. ok 1 - start_command reports ENOENT (slash) ok 2 - start_command reports ENOENT (no slash) ok 3 - run_command can run a command not ok 4 - run_command is restricted to PATH # # write_script should-not-run <<-\EOF && # echo yikes # EOF # test_must_fail test-tool run-command run-command should-not-run # ok 5 - run_command can run a script without a #! line ok 6 - run_command does not try to execute a directory ok 7 - run_command passes over non-executable file ok 8 - run_command reports EACCES ok 9 - unreadable directory in PATH ok 10 - run_command runs in parallel with more jobs available than tasks ok 11 - run_command runs in parallel with as many jobs as tasks ok 12 - run_command runs in parallel with more tasks than jobs available ok 13 - run_command is asked to abort gracefully ok 14 - run_command outputs ok 15 - GIT_TRACE with environment variables # failed 1 among 15 test(s) 1..15 Dubious, test returned 1 (wstat 256, 0x100) Failed 1/15 subtests

Test Summary Report
-------------------
t0061-run-command.sh (Wstat: 256 Tests: 15 Failed: 1)
  Failed test:  4
  Non-zero exit status: 1
Files=1, Tests=15,  1 wallclock secs ( 0.03 usr  0.00 sys +  0.24 cusr  0.07 csys =  0.34 CPU)
Result: FAIL
-- 
H.Merijn Brand  http://tux.nl   Perl Monger  http://amsterdam.pm.org/
using perl5.00307 .. 5.29   porting perl5 on HP-UX, AIX, and openSUSE
http://mirrors.develooper.com/hpux/        http://www.test-smoke.org/
http://qa.perl.org   http://www.goldmark.org/jeff/stupid-disclaimers/
Next: Johannes Schindelin
Message 1 of 4 in “in 2.19.2 t0061-run-command FAILs if . is in $PATH”
  1. H.Merijn BrandNov 28, 2018
  2. Johannes SchindelinNov 28, 2018
  3. Junio C HamanoNov 29, 2018
  4. Johannes SchindelinNov 29, 2018

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.