Skip to contentSkip to conversation

add new syscall test for setns(2)

PATCH Applied Jan Stancek 3 participants 7 messages Feb 18, 2013 – Feb 19, 2013

lore
Share & tools
lore
#0 lore raw

v3 cover add new syscall test for setns(2)

changes in v3:
- added missing "void" to functions without parameters
- INIT_NS_TYPE macro converted to function
- use ltp_syscall in setup()

Jan Stancek (3):
setns: setup directory at kernel/syscalls/setns
setns: add new syscall test setns01
setns: add new syscall test setns02

 runtest/syscalls                          |    3 +
 testcases/kernel/syscalls/.gitignore      |    2 +
 testcases/kernel/syscalls/setns/Makefile  |   23 +++
 testcases/kernel/syscalls/setns/setns.h   |   88 +++++++++++
 testcases/kernel/syscalls/setns/setns01.c |  240 +++++++++++++++++++++++++++++
 testcases/kernel/syscalls/setns/setns02.c |  231 +++++++++++++++++++++++++++
 6 files changed, 587 insertions(+), 0 deletions(-)
 create mode 100644 testcases/kernel/syscalls/setns/Makefile
 create mode 100644 testcases/kernel/syscalls/setns/setns.h
 create mode 100644 testcases/kernel/syscalls/setns/setns01.c
 create mode 100644 testcases/kernel/syscalls/setns/setns02.c

------------------------------------------------------------------------------
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials, tech docs, whitepapers, evaluation guides, and opinion stories. Check out the most recent posts - join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#1 lore raw

PATCH v3 1/3 setns: setup directory at kernel/syscalls/setns

---
 testcases/kernel/syscalls/setns/Makefile |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
 create mode 100644 testcases/kernel/syscalls/setns/Makefile
testcases/kernel/syscalls/setns/Makefile new file +23 -0
new file mode 100644
index 0000000..f1b5129
@@ -0,0 +1,23 @@
+#
+#  Copyright (C) 2013 Linux Test Project, Inc.
+#
+#  This program is free software;  you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation; either version 2 of the License, or
+#  (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY;  without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See
+#  the GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program;  if not, write to the Free Software
+#  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+
+top_srcdir		?= ../../../..
+
+include $(top_srcdir)/include/mk/testcases.mk
+CPPFLAGS                += -Wno-unused-function
+include $(top_srcdir)/include/mk/generic_leaf_target.mk
Signature · 13 lines
1.7.1


------------------------------------------------------------------------------
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Applied
#2 lore raw

Re: [LTP] [PATCH v3 1/3] setns: setup directory at kernel/syscalls/setns

Quoted 5 lines · Jan Stancek
---
 testcases/kernel/syscalls/setns/Makefile |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)
 create mode 100644 testcases/kernel/syscalls/setns/Makefile

Applied, thank you.

Wanlong Gao

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#3 lore raw

PATCH v3 2/3 setns: add new syscall test setns01

In reply to Jan Stancek

errno tests for setns(2) - reassociate thread with a namespace

---
 runtest/syscalls                          |    2 +
 testcases/kernel/syscalls/.gitignore      |    1 +
 testcases/kernel/syscalls/setns/setns.h   |   88 +++++++++++
 testcases/kernel/syscalls/setns/setns01.c |  240 +++++++++++++++++++++++++++++
 4 files changed, 331 insertions(+), 0 deletions(-)
 create mode 100644 testcases/kernel/syscalls/setns/setns.h
 create mode 100644 testcases/kernel/syscalls/setns/setns01.c
runtest/syscalls +2 -0
index db5a075..a881479 100644
@@ -962,6 +962,8 @@ setitimer01 setitimer01
 setitimer02 setitimer02
 setitimer03 setitimer03
 
+setns01 setns01
+
 setpgid01 setpgid01
 setpgid02 setpgid02
 setpgid03 setpgid03
testcases/kernel/syscalls/.gitignore +1 -0
index d661159..4b8bb94 100644
@@ -764,6 +764,7 @@
 /setitimer/setitimer01
 /setitimer/setitimer02
 /setitimer/setitimer03
+/setns/setns01
 /setpgid/setpgid01
 /setpgid/setpgid02
 /setpgid/setpgid03
testcases/kernel/syscalls/setns/setns.h new file +88 -0

88 lines not on this page · raw message

testcases/kernel/syscalls/setns/setns01.c new file +240 -0

240 lines not on this page · raw message

Signature · 13 lines
1.7.1


------------------------------------------------------------------------------
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#4 lore raw

Re: [LTP] [PATCH v3 2/3] setns: add new syscall test setns01

Hi!

testcases/kernel/syscalls/setns/setns01.c line 116

Quoted 4 lines
testcases/kernel/syscalls/setns/setns01.c new file +4 -0
+static void setup1(struct testcase_t *t, int i)
+{
+	t->ns_type = ns_types[i];
+	t->fd = open("dummy", O_CREAT);

While I tried to compile this code, I've got error as open with O_CREAT is required to pass the mode.

Quoted 4 lines
testcases/kernel/syscalls/setns/setns01.c new file +4 -0
+	if (t->fd == -1)
+		tst_brkm(TFAIL|TERRNO, cleanup, "setup1:open failed");
+	unlink("dummy");
+}
Signature · 13 lines
Cyril Hrubis
[email protected]

------------------------------------------------------------------------------
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#5 lore raw

PATCH v3 3/3 setns: add new syscall test setns02

In reply to Jan Stancek

functional test for setns(2) - reassociate thread with a namespace involving CLONE_NEWIPC and CLONE_NEWUTS.

---
 runtest/syscalls                          |    1 +
 testcases/kernel/syscalls/.gitignore      |    1 +
 testcases/kernel/syscalls/setns/setns02.c |  231 +++++++++++++++++++++++++++++
 3 files changed, 233 insertions(+), 0 deletions(-)
 create mode 100644 testcases/kernel/syscalls/setns/setns02.c
runtest/syscalls +1 -0
index a881479..c70bcbd 100644
@@ -963,6 +963,7 @@ setitimer02 setitimer02
 setitimer03 setitimer03
 
 setns01 setns01
+setns02 setns02
 
 setpgid01 setpgid01
 setpgid02 setpgid02
testcases/kernel/syscalls/.gitignore +1 -0
index 4b8bb94..ce62f3f 100644
@@ -765,6 +765,7 @@
 /setitimer/setitimer02
 /setitimer/setitimer03
 /setns/setns01
+/setns/setns02
 /setpgid/setpgid01
 /setpgid/setpgid02
 /setpgid/setpgid03
testcases/kernel/syscalls/setns/setns02.c new file +231 -0

231 lines not on this page · raw message

Signature · 13 lines
1.7.1


------------------------------------------------------------------------------
The Go Parallel Website, sponsored by Intel - in partnership with Geeknet, 
is your hub for all things parallel software development, from weekly thought 
leadership blogs to news, videos, case studies, tutorials, tech docs, 
whitepapers, evaluation guides, and opinion stories. Check out the most 
recent posts - join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Applied
#6 lore raw

Re: [LTP] [PATCH v3 3/3] setns: add new syscall test setns02

Quoted 4 lines · Jan Stancek

functional test for setns(2) - reassociate thread with a namespace involving CLONE_NEWIPC and CLONE_NEWUTS.

Applied, thank you.

Wanlong Gao

------------------------------------------------------------------------------
Everyone hates slow websites. So do we.
Make your web apps faster with AppDynamics
Download AppDynamics Lite for free today:
http://p.sf.net/sfu/appdyn_d2d_feb
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list