Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: odd ATF failure for sh: ulimit_redirection_interaction failed



    Date:        Thu, 11 Mar 2021 15:11:15 -0800
    From:        "Greg A. Woods" <woods%planix.ca@localhost>
    Message-ID:  <m1lKUSZ-0036x9C@more.local>

  | My build (for amd64) of very recent -current sources (2021/03/08)
  | exhibit an odd failure in the ATF tests for /bin/sh.

I'm not seeing that, and nor is the b5 testbed, not even in the recent
amd64 test run that had hundreds of test failures (rather than the "normal"
approx 20).

  | From glancing through the test script I'm not sure quite what's
  | happening, though I've not tried to dig much deeper yet.

Edit the "binary" test (the one that is actually run, it is just a sh
script, so editing is not an issue, you can even use emacs...) that
is .../tests/bin/sh/t_redir

Look for the
	ulimit_redirection_interaction_body()
	{

function definition ('u' is at the margin), which is closely followed by

		        cat <<- 'DONE' > helper.sh

Immediately after that line, add
				set -X
(indentation is irrelevant).

The run the test again, and ...

  | From the log:

should show much more relevant information.

Alternatively, you could change the test invocation line at the
end of that function:

	atf_check -s exit:0 -o empty -e empty ${TEST_SH} helper.sh
into
	atf_check -s exit:0 -o empty -e empty ${TEST_SH} -X helper.sh

Both versions should do much the same thing (doing both changes would
also work, but just makes the shell do a little more work for no
benefit at all).

If there is too much output to manage, that means that the failure
is happening well into the helper.sh script, use the first form and
just move the set -X line lower and lower till it becomes manageable,
or it is so low that it is below where things fail.

In this (in all of this test really) it is assumed that TEST_SH (in 
evnironment) is either unset, or is /bin/sh - the set of options for
ulimit is not yet standardized anywhere, and "-n" is not the one which is.

The -X should allow...

  | tc-se:stderr:
  | tc-se:helper.sh: 1: Invalid argument

to reveal just what is producing that error message (what is invalid).

You don't have to run all the tests, just in that directory
(tests/bin/sh) run:
	atf-run t_redir | tee /tmp/atf-log | atf-report
(or however you normally run it, just in the sh test dir, and with the
test name added).

If you have "unusual" settings for your resource limits, that might
also affect that test.   It is also possible a strange setting for
ENV (in your environment) may be an issue, but if that were the case,
I'd assume lots more tests would also fail.

kre

ps: if you want to test /bin/ksh sometime, just be in
	tests/bin/sh
and do (from any Bourne style shell, if you're using csh you'd need to adapt)
	TEST_SH=/bin/ksh atf-run | ...
and observe...   (but note that the dotcmd set of tests are yet to
be converted to use TEST_SH, those always test /bin/sh).




Home | Main Index | Thread Index | Old Index