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

LTP testcases pty01, ptem01 and setpgid01 fail under kirk #28

Closed
jstancek opened this issue Dec 4, 2024 · 4 comments
Closed

LTP testcases pty01, ptem01 and setpgid01 fail under kirk #28

jstancek opened this issue Dec 4, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@jstancek
Copy link
Member

jstancek commented Dec 4, 2024

Before test kirk executes setsid(), which breaks these 3 tests at the moment, on 6.13.0-0.rc1 kernel:

==== setpgid01 ====
command: setpgid01 
setpgid01    1  TFAIL  :  setpgid01.c:87: test setpgid(202199, 202199) fail: TEST_ERRNO=EPERM(1): Operation not permitted
setpgid01    2  TPASS  :  test setpgid(0, 0) success

Duration: 0.004s



@pevik pevik added the bug Something isn't working label Dec 4, 2024
@pevik pevik pinned this issue Dec 4, 2024
@acerv acerv self-assigned this Dec 4, 2024
@metan-ucw
Copy link
Member

This is easily reproducible with just setsid ./setpgid01 and the failure is caused by the fact that we are not supposed to change the pgid of a session leader and we get EPERM. I guess that this can be fixed as a byproduct of a test conversion to the new test library since the new test library forks first then executes the child.

@acerv
Copy link
Collaborator

acerv commented Dec 4, 2024

A related update to the host.py file is here: acerv/kirk@8dad37c

I will convert also the tests to the new library in order to make them work properly.

pevik pushed a commit to pevik/ltp that referenced this issue Dec 16, 2024
Test used to fail when running inside an executor that is setting a
new session via setsid(). By using the new LTP library, we fix this
issue since it forks parent first, then execute it, enabling any
setsid() to be run in the main process before execution.

Fixes: linux-test-project/kirk#28
Signed-off-by: Andrea Cervesato <[email protected]>
pevik pushed a commit to pevik/ltp that referenced this issue Dec 16, 2024
Fix test failure when running inside a new session via setsid() and
start spliting its internal tests cases implementations into multiple
files.

Fixes: linux-test-project/kirk#28
Signed-off-by: Andrea Cervesato <[email protected]>
pevik pushed a commit to pevik/ltp that referenced this issue Dec 16, 2024
Rewrite part of the code using the new LTP library and fix the execution
of the test inside a new session via setsid(). The test is now split
into multiple files, instead of having multiple test* functions
executing all in one file.

Fixes: linux-test-project/kirk#28
Signed-off-by: Andrea Cervesato <[email protected]>
@pevik
Copy link
Member

pevik commented Dec 16, 2024

Andrea sent patchset fixing LTP: https://patchwork.ozlabs.org/project/ltp/list/?series=436226&state=.

pevik pushed a commit to pevik/ltp that referenced this issue Jan 8, 2025
Test used to fail when running inside an executor that is setting a
new session via setsid(). By using the new LTP library, we fix this
issue since it forks parent first, then execute it, enabling any
setsid() to be run in the main process before execution.

Fixes: linux-test-project/kirk#28
Reviewed-by: Petr Vorel <[email protected]>
Signed-off-by: Andrea Cervesato <[email protected]>
Reviewed-by: Cyril Hrubis <[email protected]>
pevik pushed a commit to pevik/ltp that referenced this issue Jan 8, 2025
Fix test failure when running inside a new session via setsid() and
start spliting its internal tests cases implementations into multiple
files.

Fixes: linux-test-project/kirk#28
Reviewed-by: Petr Vorel <[email protected]>
Signed-off-by: Andrea Cervesato <[email protected]>
pevik pushed a commit to pevik/ltp that referenced this issue Jan 8, 2025
Rewrite part of the code using the new LTP library and fix the execution
of the test inside a new session via setsid(). The test is now split
into multiple files, instead of having multiple test* functions
executing all in one file.

Fixes: linux-test-project/kirk#28
Signed-off-by: Andrea Cervesato <[email protected]>
acerv added a commit to acerv/ltp that referenced this issue Jan 9, 2025
Following tests are failing when running on a new session started with
setsid command/syscall: pty01, ptem01, setpgid01.

Tihs patch-set refactor them in order to fix this issue. Some tests like
pty01 and ptem01 have been split into multiple files due to their
complexity.

To: [email protected]
Fixes: linux-test-project/kirk#28
Signed-off-by: Andrea Cervesato <[email protected]>

---
Changes in v3:
- EDITME: describe what is new in this series revision.
- EDITME: use bulletpoints and terse descriptions.
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- add SAFE_PTSNAME macro
- ptem01: check ptsname() with TBROK
- Link to v1: https://lore.kernel.org/r/[email protected]

--- b4-submit-tracking ---
# This section is used internally by b4 prep for tracking purposes.
{
  "series": {
    "revision": 3,
    "change-id": "20241204-fix_setsid_tests-876a46267285",
    "prefixes": [],
    "history": {
      "v1": [
        "[email protected]"
      ],
      "v2": [
        "[email protected]"
      ]
    }
  }
}
acerv added a commit to acerv/ltp that referenced this issue Jan 9, 2025
Test used to fail when running inside an executor that is setting a
new session via setsid(). By using the new LTP library, we fix this
issue since it forks parent first, then execute it, enabling any
setsid() to be run in the main process before execution.

Fixes: linux-test-project/kirk#28
Reviewed-by: Petr Vorel <[email protected]>
Reviewed-by: Cyril Hrubis <[email protected]>
Signed-off-by: Andrea Cervesato <[email protected]>
acerv added a commit to acerv/ltp that referenced this issue Jan 9, 2025
Fix test failure when running inside a new session via setsid() and
start spliting its internal tests cases implementations into multiple
files.

Fixes: linux-test-project/kirk#28
Reviewed-by: Petr Vorel <[email protected]>
Signed-off-by: Andrea Cervesato <[email protected]>
acerv added a commit to acerv/ltp that referenced this issue Jan 9, 2025
Rewrite part of the code using the new LTP library and fix the execution
of the test inside a new session via setsid(). The test is now split
into multiple files, instead of having multiple test* functions
executing all in one file.

Fixes: linux-test-project/kirk#28
Signed-off-by: Andrea Cervesato <[email protected]>
acerv added a commit to linux-test-project/ltp that referenced this issue Jan 17, 2025
Fix test failure when running inside a new session via setsid() and
start spliting its internal tests cases implementations into multiple
files.

Fixes: linux-test-project/kirk#28
Reviewed-by: Petr Vorel <[email protected]>
Reviewed-by: Cyril Hrubis <[email protected]>
Signed-off-by: Andrea Cervesato <[email protected]>
acerv added a commit to linux-test-project/ltp that referenced this issue Jan 17, 2025
Rewrite part of the code using the new LTP library and fix the execution
of the test inside a new session via setsid(). The test is now split
into multiple files, instead of having multiple test* functions
executing all in one file.

Fixes: linux-test-project/kirk#28
Reviewed-by: Cyril Hrubis <[email protected]>
Signed-off-by: Andrea Cervesato <[email protected]>
@pevik
Copy link
Member

pevik commented Jan 17, 2025

Thanks for fixing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants