]> git.ipfire.org Git - thirdparty/util-linux.git/blame - tests/ts/uuid/uuidgen
cleanup: Remove some spurious spaces
[thirdparty/util-linux.git] / tests / ts / uuid / uuidgen
CommitLineData
4bd90ec8
SK
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
15TS_TOPDIR="${0%/*}/../.."
16TS_DESC="uuidgen"
17
18. $TS_TOPDIR/functions.sh
19ts_init "$*"
20
21ts_check_test_command "$TS_HELPER_UUID_PARSER"
22ts_check_test_command "$TS_CMD_UUIDGEN"
23
24OUTPUT_FILE="$(mktemp "${TS_OUTDIR}/uuidgenXXXXXXXXXXXXX")"
25
26test_flag() {
27 echo "option: $1" >> $TS_OUTPUT
28 $TS_CMD_UUIDGEN $1 > "$OUTPUT_FILE" 2>>$TS_OUTPUT
29 ret=$?
cbf858aa 30 $TS_HELPER_UUID_PARSER "$OUTPUT_FILE" >> $TS_OUTPUT 2>> $TS_ERRLOG
2bb3aa36 31 if [ $? -ne 0 ] || [ $ret -ne 0 ]; then
4bd90ec8 32 echo "something wrong with $OUTPUT_FILE" >> $TS_OUTPUT
cbf858aa 33 cat $OUTPUT_FILE >> $TS_OUTPUT 2>> $TS_ERRLOG
4bd90ec8
SK
34 fi
35 echo "return values: $ret and $?" >> $TS_OUTPUT
36}
37
38test_flag -r
39test_flag -t
40test_flag --random
41test_flag --time
42
43rm -f "$OUTPUT_FILE"
44
45ts_finalize