diff options
| author | David M. Syzdek <david@syzdek.net> | 2022-01-13 21:32:12 -0900 |
|---|---|---|
| committer | David M. Syzdek <david@syzdek.net> | 2022-01-13 21:32:12 -0900 |
| commit | c33c56ceeea41dcc84d54ff4ec7c49e37dfb3dda (patch) | |
| tree | 87d17123e01d1757dd233627e3ba583c45372502 /tests/test-dict-defaults.sh | |
| parent | 21f97ab98131d4841d1b199513a649f709bfa2b3 (diff) | |
| download | tinyrad-c33c56ceeea41dcc84d54ff4ec7c49e37dfb3dda.tar.gz tinyrad-c33c56ceeea41dcc84d54ff4ec7c49e37dfb3dda.tar.bz2 tinyrad-c33c56ceeea41dcc84d54ff4ec7c49e37dfb3dda.tar.xz tinyrad-c33c56ceeea41dcc84d54ff4ec7c49e37dfb3dda.zip | |
tests: renaming 'tinyrad-dict-defaults.sh' to 'test-dict-defaults.sh'
Diffstat (limited to 'tests/test-dict-defaults.sh')
| -rwxr-xr-x | tests/test-dict-defaults.sh | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/tests/test-dict-defaults.sh b/tests/test-dict-defaults.sh new file mode 100755 index 0000000..421e636 --- /dev/null +++ b/tests/test-dict-defaults.sh | |||
| @@ -0,0 +1,69 @@ | |||
| 1 | #!/bin/sh | ||
| 2 | # | ||
| 3 | # Tiny RADIUS Client Library | ||
| 4 | # Copyright (C) 2021 David M. Syzdek <david@syzdek.net>. | ||
| 5 | # All rights reserved. | ||
| 6 | # | ||
| 7 | # Redistribution and use in source and binary forms, with or without | ||
| 8 | # modification, are permitted provided that the following conditions are | ||
| 9 | # met: | ||
| 10 | # | ||
| 11 | # * Redistributions of source code must retain the above copyright | ||
| 12 | # notice, this list of conditions and the following disclaimer. | ||
| 13 | # * Redistributions in binary form must reproduce the above copyright | ||
| 14 | # notice, this list of conditions and the following disclaimer in the | ||
| 15 | # documentation and/or other materials provided with the distribution. | ||
| 16 | # * Neither the name of David M. Syzdek nor the | ||
| 17 | # names of its contributors may be used to endorse or promote products | ||
| 18 | # derived from this software without specific prior written permission. | ||
| 19 | # | ||
| 20 | # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS | ||
| 21 | # IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | ||
| 22 | # THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | ||
| 23 | # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL DAVID M SYZDEK BE LIABLE FOR | ||
| 24 | # ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL | ||
| 25 | # DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR | ||
| 26 | # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER | ||
| 27 | # CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
| 28 | # LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY | ||
| 29 | # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF | ||
| 30 | # SUCH DAMAGE. | ||
| 31 | # | ||
| 32 | |||
| 33 | CODE=0 | ||
| 34 | |||
| 35 | ./src/tinyrad-dict --dump \ | ||
| 36 | --defaults \ | ||
| 37 | 1> /tmp/tinyrad-dict-defaults1.$$ \ | ||
| 38 | 2> /dev/null | ||
| 39 | |||
| 40 | ./src/tinyrad-dict --dump \ | ||
| 41 | -D /tmp/tinyrad-dict-defaults1.$$ \ | ||
| 42 | 1> /tmp/tinyrad-dict-defaults2.$$ \ | ||
| 43 | 2> /dev/null | ||
| 44 | |||
| 45 | COUNT=$(cat /tmp/tinyrad-dict-defaults1.$$ 2> /dev/null |wc -l) | ||
| 46 | if test ${COUNT} -eq 0;then | ||
| 47 | CODE=1 | ||
| 48 | fi | ||
| 49 | |||
| 50 | COUNT=$(cat /tmp/tinyrad-dict-defaults2.$$ 2> /dev/null |wc -l) | ||
| 51 | if test ${COUNT} -eq 0;then | ||
| 52 | CODE=1 | ||
| 53 | fi | ||
| 54 | |||
| 55 | diff \ | ||
| 56 | /tmp/tinyrad-dict-defaults1.$$ \ | ||
| 57 | /tmp/tinyrad-dict-defaults2.$$ \ | ||
| 58 | 1> /dev/null \ | ||
| 59 | 2> /dev/null | ||
| 60 | if test $? -ne 0;then | ||
| 61 | CODE=1 | ||
| 62 | fi | ||
| 63 | |||
| 64 | rm -f /tmp/tinyrad-dict-defaults1.$$ | ||
| 65 | rm -f /tmp/tinyrad-dict-defaults2.$$ | ||
| 66 | |||
| 67 | exit $CODE | ||
| 68 | |||
| 69 | # end of script | ||
