Peter Pentchev | d00519f | 2021-11-08 01:17:13 +0200 | [diff] [blame^] | 1 | #!/bin/sh |
| 2 | |
| 3 | set -e |
| 4 | set -x |
| 5 | |
| 6 | tempd="$(mktemp -d)" |
| 7 | trap "rm -rf -- '$tempd'" EXIT HUP INT TERM QUIT |
| 8 | |
| 9 | conffile="$tempd/sp-ostack-random.conf" |
| 10 | |
| 11 | rm -rf -- "$tempd" |
| 12 | test ! -e "$tempd" |
| 13 | test ! -h "$tempd" |
| 14 | |
| 15 | sp_rand_init -d "$tempd" -N |
| 16 | sp_rand_init -d "$tempd" -N | grep -Fqxe "$conffile" |
| 17 | sp_rand_init -d "$tempd" -N | grep -Eqe '^osci-1-date-[0-9]{8}-[0-9]{4}-[0-9]{4}-$' |
| 18 | |
| 19 | mkdir -- "$tempd" |
| 20 | test -d "$tempd" |
| 21 | test ! -e "$conffile" |
| 22 | test ! -h "$conffile" |
| 23 | |
| 24 | sp_rand_init -d "$tempd" -N |
| 25 | test ! -e "$conffile" |
| 26 | test ! -h "$conffile" |
| 27 | |
| 28 | sp_rand_init -d "$tempd" |
| 29 | test -f "$conffile" |
| 30 | |
| 31 | cat -- "$conffile" |
| 32 | grep -Eqe '^SP_OPENSTACK_VOLUME_PREFIX=osci-1-date-[0-9]{8}-[0-9]{4}-[0-9]{4}-$' -- "$conffile" |
| 33 | |
| 34 | sp_rand_cleanup -d "$tempd" --skip-api yes -N |
| 35 | test -f "$conffile" |
| 36 | |
| 37 | sp_rand_cleanup -d "$tempd" --skip-api yes |
| 38 | test ! -e "$conffile" |
| 39 | test ! -h "$conffile" |
| 40 | |
| 41 | rmdir -- "$tempd" |