MaxScale/server/core/test/test_maxpasswd.sh
Johan Wikman f152c118cb Name core tests consistently
Now, given a concept xyz,
* the main test file is called test_xyz.cc
* the executable is called test_xyz, and
* the ctest test is called text_xyz.
2017-11-10 14:45:54 +02:00

26 lines
479 B
Bash
Executable File

#!/bin/bash
# Create a temporary directory: /tmp/tmp.<random>
SECRETS_DIR=`mktemp -d`
# Generate a .secrets file.
../maxkeys ${SECRETS_DIR} || exit 1
# Generate a key.
KEY=`../maxpasswd ${SECRETS_DIR} dummy`
# Remove the temporary directory.
rm -rf ${SECRETS_DIR}
# Get the length of the generated KEY.
LENGTH=${#KEY}
if [ ${LENGTH} -eq 32 ]
then
# Exactly 32 characters => Ok!
exit 0
else
# Something else; chances are maxpasswd outputs garbage.
exit 1
fi