Debian Codegraph @

tests/ts/ipcs/limits

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2
3 #
4 # Copyright (C) 2007 Karel Zak <[email protected]>
5 #
6 # This file is part of util-linux.
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="${0%/*}/../.."
20 TS_DESC="limits overflow"
21
22 . "$TS_TOPDIR"/functions.sh
23 ts_init "$*"
24
25 ts_check_test_command "$TS_CMD_IPCS"
26 ts_check_test_command "$TS_HELPER_SYSINFO"
27
28 ts_skip_nonroot
29 ts_check_prog "bc"
30
31 . "$TS_SELF"/functions.sh
32
33 testscip-shell system . . test. -w /proc/sys/kernel/shmallscip-shell filesystem . . `/proc/sys/kernel/shmall`. || ts_skip "/proc/sys/kernel not writablescip-shell filesystem . . `/proc/sys/kernel not writable`."
34
35 ts_lock "ipcslimits"
36
37 ts_log "load original values"
38 for i in $IPCS_IDX; do
39 SHM_ORG[$i]=$(catscip-shell system . . cat. ${IPCS_PROCFILES[$i]})
40 done >> $TS_OUTPUT
41
42 ts_log "maximize kernel setting"
43 for i in $IPCS_IDX; do
44 echoscip-shell system . . echo. ${IPCS_LIMITS[$i]} >> ${IPCS_PROCFILES[$i]}
45 done >> $TS_OUTPUT
46
47 ts_log "check for difference between kernel and IPC"
48 ipcs_limits_check >> $TS_OUTPUT
49
50 ts_log "write original values to kernel"
51 for i in $IPCS_IDX; do
52 echoscip-shell system . . echo. ${SHM_ORG[$i]} >> ${IPCS_PROCFILES[$i]}
53 done >> $TS_OUTPUT
54
55 ts_finalize
56