Home | History | Annotate | Download | only in functional
      1 #!/bin/sh
      2 
      3 ################################################################################
      4 ##                                                                            ##
      5 ## Copyright (c) 2009 FUJITSU LIMITED                                         ##
      6 ##                                                                            ##
      7 ## This program is free software;  you can redistribute it and#or modify      ##
      8 ## it under the terms of the GNU General Public License as published by       ##
      9 ## the Free Software Foundation; either version 2 of the License, or          ##
     10 ## (at your option) any later version.                                        ##
     11 ##                                                                            ##
     12 ## This program is distributed in the hope that it will be useful, but        ##
     13 ## WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY ##
     14 ## or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License   ##
     15 ## for more details.                                                          ##
     16 ##                                                                            ##
     17 ## You should have received a copy of the GNU General Public License          ##
     18 ## along with this program;  if not, write to the Free Software Foundation,   ##
     19 ## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA           ##
     20 ##                                                                            ##
     21 ## Author: Li Zefan <lizf (at] cn.fujitsu.com>                                     ##
     22 ## Restructure for LTP: Shi Weihua <shiwh (at] cn.fujitsu.com>                     ##
     23 ## Added memcg enable/disable functinality: Rishikesh K Rajak		      ##
     24 ##						<risrajak (at] linux.vnet.ibm.com  ##
     25 ##                                                                            ##
     26 ################################################################################
     27 
     28 TCID="memcg_stat_rss"
     29 TST_TOTAL=10
     30 
     31 . memcg_lib.sh
     32 
     33 # Test the management and counting of memory
     34 testcase_1()
     35 {
     36 	test_mem_stat "--mmap-anon" $PAGESIZE $PAGESIZE "rss" $PAGESIZE false
     37 }
     38 
     39 testcase_2()
     40 {
     41 	test_mem_stat "--mmap-file" $PAGESIZE $PAGESIZE "rss" 0 false
     42 }
     43 
     44 testcase_3()
     45 {
     46 	test_mem_stat "--shm -k 3" $PAGESIZE $PAGESIZE "rss" 0 false
     47 }
     48 
     49 testcase_4()
     50 {
     51 	test_mem_stat "--mmap-anon --mmap-file --shm" \
     52 		$PAGESIZE $((PAGESIZE*3)) "rss" $PAGESIZE false
     53 }
     54 
     55 testcase_5()
     56 {
     57 	test_mem_stat "--mmap-lock1" $PAGESIZE $PAGESIZE "rss" $PAGESIZE false
     58 }
     59 
     60 testcase_6()
     61 {
     62 	test_mem_stat "--mmap-anon" $PAGESIZE $PAGESIZE "rss" $PAGESIZE true
     63 }
     64 
     65 testcase_7()
     66 {
     67 	test_mem_stat "--mmap-file" $PAGESIZE $PAGESIZE "rss" 0 true
     68 }
     69 
     70 testcase_8()
     71 {
     72 	test_mem_stat "--shm -k 8" $PAGESIZE $PAGESIZE "rss" 0 true
     73 }
     74 
     75 testcase_9()
     76 {
     77 	test_mem_stat "--mmap-anon --mmap-file --shm" \
     78 		$PAGESIZE $((PAGESIZE*3)) "rss" $PAGESIZE true
     79 }
     80 
     81 testcase_10()
     82 {
     83 	test_mem_stat "--mmap-lock1" $PAGESIZE $PAGESIZE "rss" $PAGESIZE true
     84 }
     85 
     86 shmmax_setup
     87 LOCAL_CLEANUP=shmmax_cleanup
     88 run_tests
     89 tst_exit
     90