Debian Codegraph @

tests/ts/ipcs/mk-rm-msg

raw symbols SCIP
1 #!/bin/bash
2
3 # This file is part of util-linux.
4 #
5 # This file is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9 #
10 # This file is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
14
15 TS_TOPDIR="${0%/*}/../.."
16 TS_DESC="mk-rm-msg"
17
18 . "$TS_TOPDIR"/functions.sh
19 ts_init "$*"
20
21 ts_check_test_command "$TS_CMD_IPCS"
22 ts_check_test_command "$TS_CMD_IPCMK"
23 ts_check_test_command "$TS_CMD_IPCRM"
24 ts_check_test_command "$TS_HELPER_SYSINFO"
25
26 . "$TS_SELF"/functions.sh
27
28 rm -f $TS_OUTDIR/id-msg
29 $TS_CMD_IPCMK --queue 2>>$TS_OUTPUT | ipcmk_output_handler $TS_OUTPUT $TS_OUTDIR/id-msg
30 $TS_CMD_IPCS --queues --id "$(cat $TS_OUTDIR/id-msg)" |\
31 grep -c "^Message Queue msqid=$(cat $TS_OUTDIR/id-msg)$" >>$TS_OUTPUT
32 $TS_CMD_IPCRM -q "$(cat $TS_OUTDIR/id-msg)" >> $TS_OUTPUT 2>> $TS_ERRLOG
33
34 rm -f $TS_OUTDIR/id-msg
35 $TS_CMD_IPCMK -Q 2>>$TS_OUTPUT | ipcmk_output_handler $TS_OUTPUT $TS_OUTDIR/id-msg
36 $TS_CMD_IPCRM -Q "$(
37 $TS_CMD_IPCS -q |
38 awk -v id="$(cat $TS_OUTDIR/id-msg)" '{if ($2 == id){print $1}}' |
39 uniq
40 )" >> $TS_OUTPUT 2>> $TS_ERRLOG
41
42 rm -f $TS_OUTDIR/id-msg
43
44 ts_finalize