1*49cdfc7eSAndroid Build Coastguard Worker################################################################################ 2*49cdfc7eSAndroid Build Coastguard Worker## ## 3*49cdfc7eSAndroid Build Coastguard Worker## Copyright (c) International Business Machines Corp., 2007 ## 4*49cdfc7eSAndroid Build Coastguard Worker## ## 5*49cdfc7eSAndroid Build Coastguard Worker## This program is free software; you can redistribute it and#or modify ## 6*49cdfc7eSAndroid Build Coastguard Worker## it under the terms of the GNU General Public License as published by ## 7*49cdfc7eSAndroid Build Coastguard Worker## the Free Software Foundation; either version 2 of the License, or ## 8*49cdfc7eSAndroid Build Coastguard Worker## (at your option) any later version. ## 9*49cdfc7eSAndroid Build Coastguard Worker## ## 10*49cdfc7eSAndroid Build Coastguard Worker## This program is distributed in the hope that it will be useful, but ## 11*49cdfc7eSAndroid Build Coastguard Worker## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ## 12*49cdfc7eSAndroid Build Coastguard Worker## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License ## 13*49cdfc7eSAndroid Build Coastguard Worker## for more details. ## 14*49cdfc7eSAndroid Build Coastguard Worker## ## 15*49cdfc7eSAndroid Build Coastguard Worker## You should have received a copy of the GNU General Public License ## 16*49cdfc7eSAndroid Build Coastguard Worker## along with this program; if not, write to the Free Software ## 17*49cdfc7eSAndroid Build Coastguard Worker## Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ## 18*49cdfc7eSAndroid Build Coastguard Worker## ## 19*49cdfc7eSAndroid Build Coastguard Worker################################################################################ 20*49cdfc7eSAndroid Build Coastguard Worker 21*49cdfc7eSAndroid Build Coastguard WorkerPIDNS testcases Overview: 22*49cdfc7eSAndroid Build Coastguard Worker 23*49cdfc7eSAndroid Build Coastguard Worker A pid namespace is a view of particular set of tasks on the system. For processes, a process may have pid 1234 in one namespace, but have pid 1 in another.This allows processes to use process ids which are in use in other pid namespaces, without having to worry about what pids exist in other namespaces. 24*49cdfc7eSAndroid Build Coastguard Worker 25*49cdfc7eSAndroid Build Coastguard Worker"A process has a pid in every ancestor pid namespaces up to the initial pid namespace. If process B is in a child namespace relative to process A, then process A will see process B by the pid which is valid in process A's pid namespace." 26*49cdfc7eSAndroid Build Coastguard Worker 27*49cdfc7eSAndroid Build Coastguard Worker"Another way of specifying process visibility, then is that process A will see all tasks which have a valid pid in process A's pid namespace." 28*49cdfc7eSAndroid Build Coastguard Worker 29*49cdfc7eSAndroid Build Coastguard Worker 30*49cdfc7eSAndroid Build Coastguard Worker 31*49cdfc7eSAndroid Build Coastguard WorkerTestcases: 32*49cdfc7eSAndroid Build Coastguard Worker 33*49cdfc7eSAndroid Build Coastguard Worker1> Check the process id of container after cloning as 1. 34*49cdfc7eSAndroid Build Coastguard Worker2> After creation of container the PID Namespace of the container should have the parent group id as 1 and also session id as 1. 35*49cdfc7eSAndroid Build Coastguard Worker3> Create container: pass the parent namespacei id: mount /proc directory: check parent namespace id inside container: if it is exiting then PASS otherwise FAIL. 36*49cdfc7eSAndroid Build Coastguard Worker 37*49cdfc7eSAndroid Build Coastguard WorkerCheck for PIDNS enablement: from 2.6.24 kernel version. 38