From: Aleksander Mistewicz Date: Thu, 22 Sep 2016 09:18:02 +0000 (+0200) Subject: Add destination argument to ssh_copy and sdb_copy X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F62%2F89462%2F5;p=tools%2Ftestlab%2Fmajor.git Add destination argument to ssh_copy and sdb_copy It is optional and defaults to "/tmp/smoke.sh". Change-Id: I74db36b9f0066925854fae3d0b4d9079bcfb2f6b Signed-off-by: Aleksander Mistewicz --- diff --git a/tct/conf/conf.sh b/tct/conf/conf.sh index 7ff317e..9f38ecb 100755 --- a/tct/conf/conf.sh +++ b/tct/conf/conf.sh @@ -14,14 +14,16 @@ # Syntax is: # conf_device $ID $NATIVE_TCT_REPO -# copy_ssh $IP $FILE -# copy_sdb $ID $FILE +# copy_ssh $IP $FILE [$DEST] +# copy_sdb $ID $FILE [$DEST] # # conf_device runs install script from Native TCT repository and copies files # required by TCT in order to properly test the image on a target device. # # Author: Aleksander Mistewicz +DEFAULT_DEST="/tmp/smoke.sh" + conf_device() { ID="$1" NATIVE_TCT_REPO="$2" @@ -58,11 +60,13 @@ conf_device() { copy_ssh() { IP="$1" FILE="$2" + DEST="$3" test -n "${IP}" || die "Missing argument: ip" test -n "${FILE}" || die "Missing argument: file" + test -n "${DEST}" || DEST="${DEFAULT_DEST}" COUNT=1 while ! timeout 60 sshpass -p 'tizen' scp -F "${TESTLAB_SCRIPTS}/conf/ssh_config" \ - "${FILE}" "root@${IP}:/tmp/smoke.sh" + "${FILE}" "root@${IP}:${DEST}" do echo "SSH connection to ${IP} failed: retrying" >&2 if [ ${COUNT} -ge 6 ] @@ -76,7 +80,9 @@ copy_ssh() { copy_sdb() { ID="$1" FILE="$2" + DEST="$3" test -n "${ID}" || die "Missing argument: id" test -n "${FILE}" || die "Missing argument: file" - sdb -s "${ID}" push "${FILE}" "/tmp/smoke.sh" || die "SDB copy failed!" + test -n "${DEST}" || DEST="${DEFAULT_DEST}" + sdb -s "${ID}" push "${FILE}" "${DEST}" || die "SDB copy failed!" }