Home | History | Annotate | Download | only in cpu-caps
      1 #
      2 # CDDL HEADER START
      3 #
      4 # The contents of this file are subject to the terms of the
      5 # Common Development and Distribution License (the "License").
      6 # You may not use this file except in compliance with the License.
      7 #
      8 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
      9 # or http://www.opensolaris.org/os/licensing.
     10 # See the License for the specific language governing permissions
     11 # and limitations under the License.
     12 #
     13 # When distributing Covered Code, include this CDDL HEADER in each
     14 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     15 # If applicable, add the following below this CDDL HEADER, with the
     16 # fields enclosed by brackets "[]" replaced with your own identifying
     17 # information: Portions Copyright [yyyy] [name of copyright owner]
     18 #
     19 # CDDL HEADER END
     20 #
     21 
     22 #
     23 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
     24 # Use is subject to license terms.
     25 #
     26 # ident	"@(#)README	1.2	09/01/29 SMI"
     27 #
     28 
     29 DESCRIPTION
     30 ===========
     31 
     32 This suite verifies the functionality of the CPU caps resource control
     33 technology.  CPU caps enable the administrator to restrict the amount of CPU
     34 consumption at the zone or project level and are made effective via prctl(1),
     35 zonecfg(1M), or via the project(4) file.  CPU caps will work for all scheduling
     36 classes with the exception of the realtime class.  Process running in the RT
     37 class are not subject to CPU caps. CPU caps may be used in conjunction with
     38 the cpu-shares resource control, but caps will take precedence.  Also, zone caps
     39 will take precedence over any project cap in the zone.
     40 
     41 Some of the tests examine the behavior of processes under a zone cap.  As a
     42 result, any CPU activity in the zone (global or non-global) counts against the
     43 zone cap.   Measures have been made to mitigate this as much as possible, but
     44 clearly the test suite and its processes can't run in a vaccuum. The stress
     45 tests require some human intelligence when interpreting the ouptut so they must
     46 be run manually.  In short, failures may occur due to the statistical nature of
     47 these tests.  The stress tests have been omitted from the "all" category and
     48 won't be in run in ONPIT as they have this higher propensity for false failure.
     49 Typically, a false failure can be seen in a verbose journal file and is
     50 is characterized by temporary drops in CPU usage which leads to either a high
     51 standard deviation or an artificially low mean CPU usage for the given process.
     52 If this takes place, it's recommended to verify no CPU-intesive processes exist
     53 in the zone, via prstat -m, and re-run the test.
     54 
     55 As a final note, the fewer CPUs a system has, the higher the likelihood of
     56 failure for those tests in the stress category.  This is due to the increased
     57 competition for CPU cycles.
     58 
     59 
     60 SYSTEM REQUIREMENTS
     61 ===================
     62 
     63 Due to the statistical nature of the bulk of these tests, a processor set is
     64 required.  Therefore, this test will only run a system with at least two CPUs.
     65 
     66 This test should be run on a system with at least snv_61 or S10U5 installed.
     67 For local zones testing, the system should also be able to support zones.
     68 This suite should not be executed in a local zone as the suite creates its own
     69 local zone for non-global zone testing.  The local zone installed will use
     70 /export/test_zone as its root directory and upon test suite completion, should
     71 clean up after itself.  Any changes to /etc/project should also be removed.
     72 
     73 
     74 TEST SUITE INSTALLATION
     75 =======================
     76 
     77 As root user perform the following to install the tetlite and cpu-caps test
     78 suite packages in /opt:
     79 
     80 	# pkgadd -d <package location> SUNWstc-dtet
     81 	# pkgadd -d <package location> SUNWstc-os-cpu-caps
     82 
     83 
     84 TEST SUITE EXECUTION
     85 ====================
     86 	
     87 The test suite makes use of the TET test harness.  The following steps will
     88 execute the test suite and provide a log in /var/tmp/results.<tet PID>.  The
     89 summary provided at the end of the suite execution will provide the actual
     90 logfile location.
     91 
     92 1.  Switch to root user and clear the environment variables:
     93 
     94 	$ su -
     95 
     96 2.  Export the following environment variables:
     97 
     98 	$ export TET_ROOT=/opt/SUNWstc-tetlite
     99 	$ export CTI_ROOT=${TET_ROOT}/contrib/ctitools
    100 	$ export TET_SUITE_ROOT=/opt/SUNWstc-os-cpu-caps
    101 	$ export PATH=$TET_ROOT/bin:$CTI_ROOT/bin:$PATH
    102 
    103 3.  Change directory to the cpu-caps root directory:
    104 
    105 	$ cd $TET_SUITE_ROOT
    106 
    107 4.  The following execution options are available:
    108 
    109 	$ run_test cpu-caps all			[ all functional tests ]
    110 	$ run_test cpu-caps global_zn		[ global zone tests ]
    111 	$ run_test cpu-caps real_time		[ real-time tests ]
    112 	$ run_test cpu-caps non_global_zn	[ non-global zone tests ]
    113 	$ run_test cpu-caps kstats		[ kstat tests ]
    114 	$ run_test cpu-caps stress		[ stress tests ]
    115 	$ run_test cpu-caps wad			[ all tests ]
    116 
    117 run_test may also be executed with "-v verbose=true" for more verbose output.
    118 If it's desired to redirect the output of the logfile to standard out, execute
    119 run_test with the "-j -" option. For example:
    120 
    121 	$ run_test -v verbose=true cpu-caps all
    122 	$ run_test -j - cpu-caps global_zn
    123 	$ run_test -v verbose=true cpu-caps kstats
    124 
    125 The lowest level entity that can be executed is the "invocable component" as
    126 defined in each test case file ("tc_*").  For example, if it is desired to
    127 only run test purposes 1 and 3 (tp_001 and tp_003) in the global tests, use
    128 the following command:
    129 
    130 	$ run_test cpu-caps global_zn:1,3
    131 
    132 
    133 TEST SUITE BUILDING
    134 ===================
    135 
    136 The test suite build should not be done as root user.
    137 
    138 1.  Export the following environment variables:
    139     (Note. TET_SUITE_ROOT is set to the source path)
    140 
    141 	$ export TET_ROOT=/opt/SUNWstc-tetlite
    142 	$ export CTI_ROOT=${TET_ROOT}/contrib/ctitools
    143 	$ export TET_SUITE_ROOT=<local directory>/usr/src/suites/os
    144 	$ export PATH=$TET_ROOT/bin:$CTI_ROOT/bin:$PATH
    145 
    146 2.  Change directory to the cpu-caps root directory:
    147 
    148 	$ cd $TET_SUITE_ROOT/cpu-caps
    149 
    150 3.  Clear out any old bits and build new package:
    151 
    152 	$ /usr/ccs/bin/make clobber
    153 	$ /usr/ccs/bin/make package
    154