All of lore.kernel.org
 help / color / mirror / Atom feed
From: Cyril Hrubis <chrubis@suse.cz>
To: ltp@lists.linux.it
Subject: [LTP] [PATCH v5] Test ioctl syscall for NS_GET_* requests
Date: Fri, 12 Apr 2019 16:33:19 +0200	[thread overview]
Message-ID: <20190412143318.GA29856@haruka.lan> (raw)
In-Reply-To: <20190411192534.30525-1-fedebonfi95@gmail.com>

Hi!
> About the unshare call, I removed it entirely since placing it in the setup() caused: 
> 
> ioctl_ns05.c:35: BROK: fork() failed: ENOMEM
> 
> This seems to originate from the fact that unsharing in setup didn't make the testing framework reap forked processes correctly, since every forked test run after the setup thinks to have pid 0. So when it checks if the pid is different from the initial pid (also 0) it finds them equal. This is of course as I understood the problem, and being a beginner with the framework I'm not entirely sure.
> 
> To solve the issue I did what I was doing in ioctl_ns06.c (ex number 7), directly calling clone() and not unshare() and then fork().
> 
> Let me know if you like this solution, and thanks again

Applied with a minor change, thanks.

The comment in ioctl_ns05.c was speaking about unshare so I changed it to:

diff --git a/testcases/kernel/syscalls/ioctl/ioctl_ns05.c b/testcases/kernel/syscalls/ioctl/ioctl_ns05.c
index 5d89c03b0..add6980bb 100644
--- a/testcases/kernel/syscalls/ioctl/ioctl_ns05.c
+++ b/testcases/kernel/syscalls/ioctl/ioctl_ns05.c
@@ -6,10 +6,9 @@
 /*
  * Test ioctl_ns with NS_GET_PARENT request.
  *
- * After the call to unshare with the CLONE_NEWPID flag,
- * next new child is created in a new pid namespace. That's checked by
- * comparing its /proc/self/ns/pid symlink and the parent's one.
- * Also child thinks its pid is 1.
+ * Child cloned with the CLONE_NEWPID flag is created in a new pid namespace.
+ * That's checked by comparing its /proc/self/ns/pid symlink and the parent's
+ * one. Also child thinks its pid is 1.
  *
  */
 #define _GNU_SOURCE


-- 
Cyril Hrubis
chrubis@suse.cz

  reply	other threads:[~2019-04-12 14:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-24 20:29 [LTP] [PATCH v1] Test ioctl syscall for NS_GET_* requests YourName
2019-03-04 16:16 ` Cyril Hrubis
2019-03-11  7:25   ` [LTP] [PATCH v2] " Federico Bonfiglio
2019-03-18 14:22     ` Cyril Hrubis
2019-03-18 15:30     ` Cyril Hrubis
2019-03-19 18:09       ` [LTP] [PATCH v3] " Federico Bonfiglio
2019-03-26 19:20         ` Cyril Hrubis
2019-03-28 20:22           ` [LTP] [PATCH v4 1/2] include/SAFE_UNSHARE() macro added Federico Bonfiglio
2019-04-03 15:19             ` Cyril Hrubis
2019-03-28 20:22           ` [LTP] [PATCH v4 2/2] Test ioctl syscall for NS_GET_* requests Federico Bonfiglio
2019-04-03 15:22             ` Cyril Hrubis
2019-04-11 19:25               ` [LTP] [PATCH v5] " Federico Bonfiglio
2019-04-12 14:33                 ` Cyril Hrubis [this message]
2019-05-06 10:14                   ` [LTP] NS_* ioctl commands fail in 32bit compat mode (-m32) Richard Palethorpe
2019-05-06 10:39                     ` Richard Palethorpe
2019-05-13  9:00                       ` Cyril Hrubis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190412143318.GA29856@haruka.lan \
    --to=chrubis@suse.cz \
    --cc=ltp@lists.linux.it \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.