Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test: skip the symlink part of test_touch_file() in GH Actions #436

Merged

Conversation

mrc0mmand
Copy link
Member

@mrc0mmand mrc0mmand commented Mar 13, 2024

Our (RHEL 8) touch_file() is not clever enough and does chmod() on a symlink, which fails with EOPNOTSUPP on newer kernels. This is not an issue on the RHEL 8 kernel, where doing chmod() on a symlink works (albeit only on tmpfs) but in GH Actions we run in a container, and with the underlying kernel doing chmod() on a symlink fails even on tmpfs:

RHEL 8:

~# mount -t tmpfs tmpfs /tmp
~# (cd /tmp; ln -s symlink dangling; ln -s /etc/os-release symlink) ~# (cd /var/tmp; ln -s symlink dangling; ln -s /etc/os-release symlink) ~# gcc -o main main.c -D_GNU_SOURCE
~# ./main /tmp/dangling
chmod(/proc/self/fd/3)=0 (0)
~# ./main /tmp/symlink
chmod(/proc/self/fd/3)=0 (0)
~# ./main /var/tmp/dangling
chmod(/proc/self/fd/3)=-1 (95)
~# ./main /var/tmp/symlink
chmod(/proc/self/fd/3)=-1 (95)

Newer kernel:

~# uname -r
6.7.4-200.fc39.x86_64
~# ./main /tmp/dangling
chmod(/proc/self/fd/3)=-1 (95)
~# ./main /tmp/symlink
chmod(/proc/self/fd/3)=-1 (95)
~# ./main /var/tmp/dangling
chmod(/proc/self/fd/3)=-1 (95)
~# ./main /var/tmp/symlink
chmod(/proc/self/fd/3)=-1 (95)

Backporting the necessary patches would be way too risky so late in the RHEL 8 cycle, so let's just skip the offending test when running in a container. This should work around this issue in GH Actions, but still run the test on C8S/RHEL8 machines.

See: #434

RHEL-only


Opening this without any tracker, since there might not be a next minor release, but we still might need the "fix" for z-streams.

@github-actions github-actions bot added tracker/missing Formerly needs-bz pr/needs-ci Formerly needs-ci pr/needs-review Formerly needs-review labels Mar 13, 2024
Copy link

github-actions bot commented Mar 13, 2024

Commit validation

Tracker - Missing issue tracker ✋

The following commits need an inspection

commit note
f021ca0 - ci: reduce ASLR entropy Missing issue tracker
Missing upstream reference ‼️
d5867f6 - test: skip the symlink part of test_touch_file() in GH Actions Missing issue tracker

Tracker validation

🔴 Missing tracker or Unknown tracker type; type: 'unknown'


Pull Request validation

Success

🟢 CI - All checks have passed
🟢 Review - Reviewed by a member
🟢 Approval - Changes were approved

@mrc0mmand mrc0mmand force-pushed the test-touch-file-symlink branch 3 times, most recently from 2f166d9 to e578600 Compare March 13, 2024 11:01
The latest GH Action runners started using 32-bit entropy for ASLR,
which makes it incompatible with llvm-14. This was fixed in later llvm
releases, but these aren't available on Ubuntu Jammy (22.04). Let's
reduce the ASLR entropy to 28-bit, which should make llvm happy again,
until the issue is resolved.

See: actions/runner-images#9491
@mrc0mmand mrc0mmand force-pushed the test-touch-file-symlink branch 3 times, most recently from 4658efa to 6d3afdf Compare March 13, 2024 11:41
@mrc0mmand
Copy link
Member Author

The first commit should be needed only for the next couple of days, until the GH Actions runners are fixed.

Our (RHEL 8) touch_file() is not clever enough and does chmod() on a
symlink, which fails with EOPNOTSUPP on newer kernels. This is not an
issue on the RHEL 8 kernel, where doing chmod() on a symlink works
(albeit only on tmpfs) but in GH Actions we run in a container, and with
the underlying kernel doing chmod() on a symlink fails even on tmpfs:

RHEL 8:
~# mount -t tmpfs tmpfs /tmp
~# (cd /tmp; ln -s symlink dangling; ln -s /etc/os-release symlink)
~# (cd /var/tmp; ln -s symlink dangling; ln -s /etc/os-release symlink)
~# gcc -o main main.c -D_GNU_SOURCE
~# ./main /tmp/dangling
chmod(/proc/self/fd/3)=0 (0)
~# ./main /tmp/symlink
chmod(/proc/self/fd/3)=0 (0)
~# ./main /var/tmp/dangling
chmod(/proc/self/fd/3)=-1 (95)
~# ./main /var/tmp/symlink
chmod(/proc/self/fd/3)=-1 (95)

Newer kernel:
~# uname -r
6.7.4-200.fc39.x86_64
~# ./main /tmp/dangling
chmod(/proc/self/fd/3)=-1 (95)
~# ./main /tmp/symlink
chmod(/proc/self/fd/3)=-1 (95)
~# ./main /var/tmp/dangling
chmod(/proc/self/fd/3)=-1 (95)
~# ./main /var/tmp/symlink
chmod(/proc/self/fd/3)=-1 (95)

Backporting the necessary patches would be way too risky so late in the
RHEL 8 cycle, so let's just skip the offending test when running in GH
Actions. To do that we have to jump through a couple of hoops, since
RHEL 8 systemd can't detect docker. Oh well.

See: redhat-plumbers#434

RHEL-only
@mrc0mmand mrc0mmand changed the title test: skip the symlink part of test_touch_file() in containers test: skip the symlink part of test_touch_file() in GH Actions Mar 13, 2024
@github-actions github-actions bot removed the pr/needs-ci Formerly needs-ci label Mar 13, 2024
@github-actions github-actions bot removed the pr/needs-review Formerly needs-review label Jun 11, 2024
@jamacku jamacku merged commit a4e0b7a into redhat-plumbers:rhel-8.10.0 Jun 25, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants