Upload Tizen:Base source
[framework/base/util-linux-ng.git] / tests / ts / ipcs / limits
1 #!/bin/bash
2
3 #
4 # Copyright (C) 2007 Karel Zak <kzak@redhat.com>
5 #
6 # This file is part of util-linux-ng.
7 #
8 # This file is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
12 #
13 # This file is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
17 #
18
19 TS_TOPDIR="$(dirname $0)/../.."
20 TS_DESC="limits overflow"
21
22 . $TS_TOPDIR/functions.sh
23
24 ts_init "$*"
25 ts_skip_nonroot
26
27 . $TS_SELF/functions.sh
28
29 ts_log "load original values"
30 for i in $IPCS_IDX; do
31         SHM_ORG[$i]=$(cat ${IPCS_PROCFILES[$i]})
32 done >> $TS_OUTPUT
33
34 ts_log "check for difference between kernel and IPC"
35 ipcs_limits_check >> $TS_OUTPUT
36
37 ts_log "maximalize kernel setting"
38 for i in $IPCS_IDX; do
39         echo ${IPCS_LIMITS[$i]} >> ${IPCS_PROCFILES[$i]}
40 done >> $TS_OUTPUT
41
42 ts_log "re-check for difference between kernel and IPC"
43 ipcs_limits_check >> $TS_OUTPUT
44
45 ts_log "write original values to kernel"
46 for i in $IPCS_IDX; do
47         echo ${SHM_ORG[$i]} >> ${IPCS_PROCFILES[$i]}
48 done >> $TS_OUTPUT
49
50 ts_finalize
51