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

Commit 15346e8

Browse files
committed
CI tester-exec.sh: reduce use of variables
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>
1 parent 2a3c71a commit 15346e8

1 file changed

Lines changed: 7 additions & 13 deletions

File tree

docker/tester-exec.sh

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ testimg() {
2121
_IMG_NAME=$1
2222
TEST_SUITE_FILE=$2
2323
TEST_CASES_FILE=$3
24-
_IMG_NAME_MACHINE=${_IMG_NAME}-${MACHINE}
2524

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

37-
FN_BASE=${_IMG_NAME_MACHINE}-${CI_BUILD_ID}
38-
FILENAME=${FN_BASE}.wic
39-
FILENAME_BMAP=${FILENAME}.bmap
40-
FILENAME_XZ=${FILENAME}.xz
41-
FILENAME_ZIP=${FILENAME}.zip
42-
36+
FILENAME=${_IMG_NAME}-${MACHINE}-${CI_BUILD_ID}.wic
4337
set +e
44-
wget ${_WGET_OPTS} ${CI_BUILD_URL}/images/${MACHINE}/${FILENAME_BMAP}
45-
wget ${_WGET_OPTS} ${CI_BUILD_URL}/images/${MACHINE}/${FILENAME_XZ} -O - | unxz - > ${FILENAME}
38+
wget ${_WGET_OPTS} ${CI_BUILD_URL}/images/${MACHINE}/${FILENAME}.bmap
39+
wget ${_WGET_OPTS} ${CI_BUILD_URL}/images/${MACHINE}/${FILENAME}.xz -O - | unxz - > ${FILENAME}
4640
if [ ! -s ${FILENAME} ]; then
47-
wget ${_WGET_OPTS} ${CI_BUILD_URL}/images/${MACHINE}/${FILENAME_ZIP}
48-
if [ -s ${FILENAME_ZIP} ]; then
49-
unzip ${FILENAME_ZIP}
41+
wget ${_WGET_OPTS} ${CI_BUILD_URL}/images/${MACHINE}/${FILENAME}.zip
42+
if [ -s ${FILENAME}.zip ]; then
43+
unzip ${FILENAME}.zip
5044
else
51-
echo "ERROR: No file ${FILENAME_XZ} or ${FILENAME_ZIP} found, can not continue."
45+
echo "ERROR: No file ${FILENAME}.xz or ${FILENAME}.zip found, can not continue."
5246
exit 1
5347
fi
5448
fi

0 commit comments

Comments
 (0)