]>
git.ipfire.org Git - thirdparty/util-linux.git/blob - tests/ts/ipcs/mk-rm-msg
25460e25d208ccd2fbed11332dceb86d38a18901
3 # This file is part of util-linux.
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.
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.
15 TS_TOPDIR
="${0%/*}/../.."
18 .
$TS_TOPDIR/functions.sh
21 ts_check_test_command
"$TS_CMD_IPCS"
22 ts_check_test_command
"$TS_CMD_IPCMK"
23 ts_check_test_command
"$TS_CMD_IPCRM"
25 .
$TS_SELF/functions.sh
27 rm -f $TS_OUTDIR/id-msg
28 $TS_CMD_IPCMK -Q 2>>$TS_OUTPUT | ipcmk_output_handler
$TS_OUTPUT $TS_OUTDIR/id-msg
29 $TS_CMD_IPCS -q -i "$(cat $TS_OUTDIR/id-msg)" |\
30 grep -c "^Message Queue msqid=$(cat $TS_OUTDIR/id-msg)$" >>$TS_OUTPUT
31 $TS_CMD_IPCRM -q $
(cat $TS_OUTDIR/id-msg
) >>$TS_OUTPUT 2>&1
33 rm -f $TS_OUTDIR/id-msg
34 $TS_CMD_IPCMK -Q 2>>$TS_OUTPUT | ipcmk_output_handler
$TS_OUTPUT $TS_OUTDIR/id-msg
37 awk -v id=$(cat $TS_OUTDIR/id-msg) '{if ($2 == id){print $1}}'
40 rm -f $TS_OUTDIR/id-msg