]>
Commit | Line | Data |
---|---|---|
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 | ||
15 | TS_TOPDIR="${0%/*}/../.." | |
16 | TS_DESC="uuidgen" | |
17 | ||
18 | . $TS_TOPDIR/functions.sh | |
19 | ts_init "$*" | |
20 | ||
21 | ts_check_test_command "$TS_HELPER_UUID_PARSER" | |
22 | ts_check_test_command "$TS_CMD_UUIDGEN" | |
23 | ||
24 | OUTPUT_FILE="$(mktemp "${TS_OUTDIR}/uuidgenXXXXXXXXXXXXX")" | |
25 | ||
26 | test_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 | ||
38 | test_flag -r | |
39 | test_flag -t | |
40 | test_flag --random | |
41 | test_flag --time | |
42 | ||
43 | rm -f "$OUTPUT_FILE" | |
44 | ||
45 | ts_finalize |