Skip to content
This repository has been archived by the owner on Aug 5, 2022. It is now read-only.

Commit

Permalink
CI tester-exec.sh: reduce use of variables
Browse files Browse the repository at this point in the history
If a variable is used only once, or just decodes part of name
by adding it as part of variable name, it is not really helpful.
Reduce amount of lines by not defining such variables.

Signed-off-by: Olev Kartau <olev.kartau@intel.com>
  • Loading branch information
okartau committed Apr 10, 2017
1 parent 2a3c71a commit 15346e8
Showing 1 changed file with 7 additions and 13 deletions.
20 changes: 7 additions & 13 deletions docker/tester-exec.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ testimg() {
_IMG_NAME=$1
TEST_SUITE_FILE=$2
TEST_CASES_FILE=$3
_IMG_NAME_MACHINE=${_IMG_NAME}-${MACHINE}

# Get test suite
wget ${_WGET_OPTS} ${TEST_SUITE_FOLDER_URL}/${_IMG_NAME}/${TEST_SUITE_FILE}
Expand All @@ -34,21 +33,16 @@ testimg() {
cp $HOME/.config.ini.wlan ${_WLANCONF}
chmod 644 ${_WLANCONF}

FN_BASE=${_IMG_NAME_MACHINE}-${CI_BUILD_ID}
FILENAME=${FN_BASE}.wic
FILENAME_BMAP=${FILENAME}.bmap
FILENAME_XZ=${FILENAME}.xz
FILENAME_ZIP=${FILENAME}.zip

FILENAME=${_IMG_NAME}-${MACHINE}-${CI_BUILD_ID}.wic
set +e
wget ${_WGET_OPTS} ${CI_BUILD_URL}/images/${MACHINE}/${FILENAME_BMAP}
wget ${_WGET_OPTS} ${CI_BUILD_URL}/images/${MACHINE}/${FILENAME_XZ} -O - | unxz - > ${FILENAME}
wget ${_WGET_OPTS} ${CI_BUILD_URL}/images/${MACHINE}/${FILENAME}.bmap
wget ${_WGET_OPTS} ${CI_BUILD_URL}/images/${MACHINE}/${FILENAME}.xz -O - | unxz - > ${FILENAME}
if [ ! -s ${FILENAME} ]; then
wget ${_WGET_OPTS} ${CI_BUILD_URL}/images/${MACHINE}/${FILENAME_ZIP}
if [ -s ${FILENAME_ZIP} ]; then
unzip ${FILENAME_ZIP}
wget ${_WGET_OPTS} ${CI_BUILD_URL}/images/${MACHINE}/${FILENAME}.zip
if [ -s ${FILENAME}.zip ]; then
unzip ${FILENAME}.zip
else
echo "ERROR: No file ${FILENAME_XZ} or ${FILENAME_ZIP} found, can not continue."
echo "ERROR: No file ${FILENAME}.xz or ${FILENAME}.zip found, can not continue."
exit 1
fi
fi
Expand Down

0 comments on commit 15346e8

Please sign in to comment.