################################################################################
##                                                                            ##
## Copyright (c) International Business Machines  Corp., 2007                 ##
##                                                                            ##
## 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA    ##
##                                                                            ##
################################################################################

This contains five tests for the uts namespace unsharing functionality.

To enable this functionality, you currently must use a -mm kernel (see
kernel.org). Then to run these tests, just type

	sh runutstest.sh

The tests are intended to do the following:

test 1: check that after fork, two children see the same utsname
	P1: A=gethostname
	P2: B=gethostname
	Ensure(A==B)
test 2: check that after fork, two children are in the same utsname namespace.
	P1: sethostname(newname); A=gethostname
	P2: (wait); B=gethostname
	Ensure (A==B)

test 3: check that after unshare, processes are in different utsname namespaces.
	P1: A=gethostname; unshare(utsname); sethostname(newname); C=gethostname
	P2: B=gethostname; (wait); (wait); D=gethostname
	Ensure (A==B && A==D && C!=D)

test 4: similar to test 3, but other child changes hostname.
	P1: A=gethostname; unshare(utsname); (wait); C=gethostname
	P2: B=gethostname; (wait); sethostname(newname); D=gethostname
	Ensure (A==B && A==C && C!=D)

test 5: check that unsharing utsname without required permissions (CAP_SYS_AUDIT)
	fails.
	P1: A=gethostname; unshare(utsname) without suff. perms; (wait); C=gethostname
	P2: B=gethostname; (wait); sethostname(newname); D=gethostname
	Ensure (A==B==C==D) and state is ok.
