2015-10-09 23:47:04 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# To make debugging easier
|
|
|
|
echo "KittenGroomer: in tests/check_results.sh" 1>&2
|
|
|
|
|
|
|
|
OFFSET_VFAT_NORM=$((8192 * 512))
|
|
|
|
IMAGE_DEST="testcase_dest.vfat"
|
|
|
|
|
|
|
|
if [ "$(id -u)" != "0" ]; then
|
|
|
|
echo "This script must be run as root" 1>&2
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ -z "$1" ]; then
|
|
|
|
echo "Please tell me which file type to test."
|
|
|
|
echo "t_images1"
|
|
|
|
exit
|
|
|
|
fi
|
2015-12-16 21:45:32 +01:00
|
|
|
TEST_SOURCE_TYPE=${1}
|
2015-10-09 23:47:04 +02:00
|
|
|
|
|
|
|
set -e
|
|
|
|
set -x
|
|
|
|
|
|
|
|
RESULTS_DIR="results"
|
|
|
|
|
|
|
|
# To make debugging easier
|
|
|
|
echo "Removing results from previous run." 1>&2
|
|
|
|
rm -rf actualResults/*
|
|
|
|
|
|
|
|
clean(){
|
|
|
|
umount ${RESULTS_DIR}
|
|
|
|
rm -rf ${RESULTS_DIR}
|
|
|
|
}
|
|
|
|
|
|
|
|
trap clean EXIT TERM INT
|
|
|
|
|
|
|
|
mkdir -p ${RESULTS_DIR}
|
|
|
|
|
|
|
|
# Get the run results
|
|
|
|
mount -o loop,offset=${OFFSET_VFAT_NORM} ${IMAGE_DEST} ${RESULTS_DIR}
|
|
|
|
cp -rf ${RESULTS_DIR}/* actualResults
|
|
|
|
umount ${RESULTS_DIR}
|
|
|
|
|
2015-12-16 20:56:13 +01:00
|
|
|
#TODO: Check if the results were what we expected.
|
2015-10-09 23:47:04 +02:00
|
|
|
|
|
|
|
# To make debugging easier
|
|
|
|
echo "KittenGroomer: done with tests/check_results.sh" 1>&2
|