| #!/bin/sh |
| |
| set -e |
| set -x |
| |
| tempd="$(mktemp -d)" |
| trap "rm -rf -- '$tempd'" EXIT HUP INT TERM QUIT |
| |
| conffile="$tempd/sp-ostack-random.conf" |
| |
| rm -rf -- "$tempd" |
| test ! -e "$tempd" |
| test ! -h "$tempd" |
| |
| sp_rand_init -d "$tempd" -N |
| sp_rand_init -d "$tempd" -N | grep -Fqxe "$conffile" |
| sp_rand_init -d "$tempd" -N | grep -Eqe '^osci-1-date-[0-9]{8}-[0-9]{4}-[0-9]{4}-$' |
| |
| mkdir -- "$tempd" |
| test -d "$tempd" |
| test ! -e "$conffile" |
| test ! -h "$conffile" |
| |
| sp_rand_init -d "$tempd" -N |
| test ! -e "$conffile" |
| test ! -h "$conffile" |
| |
| sp_rand_init -d "$tempd" |
| test -f "$conffile" |
| |
| cat -- "$conffile" |
| grep -Eqe '^SP_OPENSTACK_VOLUME_PREFIX=osci-1-date-[0-9]{8}-[0-9]{4}-[0-9]{4}-$' -- "$conffile" |
| |
| sp_rand_cleanup -d "$tempd" --skip-api yes -N |
| test -f "$conffile" |
| |
| sp_rand_cleanup -d "$tempd" --skip-api yes |
| test ! -e "$conffile" |
| test ! -h "$conffile" |
| |
| rmdir -- "$tempd" |