devstack/tests/test_worlddump.sh
Federico Ressi 21a10d3499 Use python3 as default python command
After Python 2 is getting unsupported, new distros
like CentOS 8 and RHEL8 have stopped providing 'python'
package forcing user to decide which alternative to
use by installing 'python2' or 'python3.x' package
and then setting python alternative.

This change is intended to make using python3 command as
much as possible and use it as default 'python' alternative
where needed.

The final goals motivating this change are:
 - stop using python2 as much as possible
 - help adding support for CentOS 8 and RHEL8

Change-Id: I1e90db987c0bfa6206c211e066be03ea8738ad3f
2020-02-17 17:03:47 +00:00

36 lines
673 B
Bash
Executable File

#!/bin/bash
# Simple test of worlddump.py
TOP=$(cd $(dirname "$0")/.. && pwd)
source $TOP/tests/unittest.sh
OUT_DIR=$(mktemp -d)
${PYTHON} $TOP/tools/worlddump.py -d $OUT_DIR
if [[ $? -ne 0 ]]; then
fail "worlddump failed"
else
# worlddump creates just one output file
OUT_FILE=($OUT_DIR/*.txt)
if [ ! -r $OUT_FILE ]; then
failed "worlddump output not seen"
else
passed "worlddump output $OUT_FILE"
if [[ $(stat -c %s $OUT_DIR/*.txt) -gt 0 ]]; then
passed "worlddump output is not zero sized"
fi
# put more extensive examination here, if required.
fi
fi
rm -rf $OUT_DIR
report_results