alias tspoll="TS_SOCKET=/tmp/socket.tl-master-poll tsp"
alias tsmaster="TS_SOCKET=/tmp/socket.tl-master tsp"
alias tspwb="TS_SOCKET=/tmp/socket.tl-pwb tsp"
+
+tsrun_target() {
+ test -n "$1" || die "Missing argument: target"
+ SOCK="/tmp/socket.tl-runner-$1"
+ shift
+ TS_SOCKET="$SOCK" tsp $@
+}
+
+check_diff() {
+ DIFF_FILE="$1"
+ JOB_NR="$2"
+ test -n "$1" || die "Missing argument: diff file"
+ test -n "$2" || die "Missing argument: build nr"
+ test -n "${TSP_DIR}" || die "Missing environment variable: TSP_DIR"
+ if grep -q "identical" "${DIFF_FILE}"
+ then
+ echo "Image is unchanged in respect to snapshot"
+ nr=`tspwb -L PUBLISH sh ${TSP_DIR}/jobs/publish.sh ${JOB_NR}`
+ return 1
+ fi
+}
--- /dev/null
+#!/bin/sh
+
+# Copyright (c) 2016 Samsung Electronics Co., Ltd All Rights Reserved
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Author: Aleksander Mistewicz <a.mistewicz@samsung.com>
+
+export TSP_DIR="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P)/.."
+
+. "${TSP_DIR}/common.sh"
+
+test -n "$1" || die "Missing argument: build nr"
+
+WORKDIR="${HOME}/ws/img_test/$1"
+WORKDIR_REMOTE="${HOME}/ws/img_test_remote/$1"
+DWN_WORKDIR="${HOME}/ws/dwn/$1"
+case "$0" in
+ *odroid*)
+ TARGET="odroid"
+ ;;
+ *minnow*)
+ TARGET="minnow"
+ ;;
+esac
+PROJECT_FILE="${DWN_WORKDIR}/project-${TARGET}.conf"
+DIFF_FILE="${DWN_WORKDIR}/diff-${TARGET}.report"
+mkdir -p "${WORKDIR}"
+cd "${WORKDIR}"
+if $(check_diff "${DIFF_FILE}" "$1");
+then
+ echo "Add ${TARGET}_prep_flash_conf job to the queue"
+ tsrun_target $TARGET -L "$(echo "$TARGET" | tr 'a-z' 'A-Z')_PREPARE_FLASH_CONF" \
+ sh "${TSP_DIR}/jobs/${TARGET}_prep_flash_conf.sh" "$1"
+fi