Skip to content

tests: Remove LD_PREOAD from csplit-io-err.sh - #148

Closed
oech3 wants to merge 3 commits into
coreutils:masterfrom
oech3:patch-1
Closed

tests: Remove LD_PREOAD from csplit-io-err.sh#148
oech3 wants to merge 3 commits into
coreutils:masterfrom
oech3:patch-1

Conversation

@oech3

@oech3 oech3 commented Dec 26, 2025

Copy link
Copy Markdown
Contributor

Experimental uutils/coreutils#9853

@oech3

oech3 commented Dec 26, 2025

Copy link
Copy Markdown
Contributor Author

I'm bit confused because test expects csplit: write error for 'xx01': No space left on device.
But both of uutils/coreutils#9853 and uutils/coreutils#9832 seems not for the case.

cc @ChrisDryden

@oech3

oech3 commented Dec 26, 2025

Copy link
Copy Markdown
Contributor Author

It seems this test is just avoiding root or unshare by LD_PRELOAD.
I can see expected message on a small tmpfs.

@oech3
oech3 marked this pull request as draft December 26, 2025 08:38
Comment thread tests/csplit/csplit-io-err.sh Outdated
if ! test -w /dev/full || ! test -c /dev/full; then
skip_ '/dev/full is required'
fi
require_root_

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So a root constraint is better (less coupled) than LD_PRELOAD for uutils testing.
Fair enough

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose strace might be an option too:
seq 10 | strace -o /dev/null -e inject='write:error=EIO:when=1..2' csplit - 1

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems uu-csplitcausing panic by strace...

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems uu-csplitcausing panic by strace...

Sounds like a bug in uu-csplit

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm if this test requires root then that is a disadvantage.
Also this "error on write" case is handled by the symlink to /dev/full trick.
I.e. we should probably replace this test with the just created csplit-io-err-2.sh

@oech3 oech3 Dec 27, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Message is bit different with csplit-io-err-2.sh. But if you think so, I'll just override.
Keeping old commit hash at 3827f37

Comment thread tests/csplit/csplit-io-err.sh Outdated
@oech3

oech3 commented Dec 26, 2025

Copy link
Copy Markdown
Contributor Author

In my thought, we needs 3 tests with different results and dependencies:

  1. csplit-io-error.sh: On tmpfs (needs root or unshare).
  2. ln -s /dev/full xx01 (needs /dev/full)
  3. dmsetup (needs root and dmsetup)

I don't know how many dmsetup portable (this is 1st test using it).

@oech3

oech3 commented Dec 26, 2025

Copy link
Copy Markdown
Contributor Author

@ChrisDryden Would you curl -L https://raw.githubusercontent.com/oech3/coreutils-1/refs/heads/patch-1/tests/csplit/csplit-io-err.sh at uutils/coreutils#9855 keeping draft?

Comment thread tests/csplit/csplit-io-err.sh Outdated
mkdir small || framework_failure_
mount -t tmpfs -o size=1k tmpfs small || skip_ 'Unable to mount small tmpfs'

cleanup_() { umount small; rm -d small }

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing a semicolon here after small

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than that the test works when running on my PR

@pixelb

pixelb commented Dec 27, 2025

Copy link
Copy Markdown
Member

Committed at 1b46778

@pixelb pixelb closed this Dec 27, 2025
@oech3
oech3 deleted the patch-1 branch December 27, 2025 13:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants