Add tsp/jobs/common_prep_flash_conf.sh 46/71246/9
authorAleksander Mistewicz <a.mistewicz@samsung.com>
Thu, 5 May 2016 09:59:37 +0000 (11:59 +0200)
committerAleksander Mistewicz <a.mistewicz@samsung.com>
Thu, 23 Jun 2016 15:05:14 +0000 (17:05 +0200)
Change-Id: I3f50c72a8f5b4ea2943828109fd6defa5114f3ca
Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
tsp/common.sh
tsp/jobs/common_prep_flash_conf.sh [new file with mode: 0755]
tsp/jobs/minnow_prep_flash_conf.sh [new symlink]
tsp/jobs/odroid_prep_flash_conf.sh [new symlink]

index b93534c..2c5f883 100755 (executable)
@@ -29,3 +29,4 @@ die() {
 
 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"
diff --git a/tsp/jobs/common_prep_flash_conf.sh b/tsp/jobs/common_prep_flash_conf.sh
new file mode 100755 (executable)
index 0000000..fd8b663
--- /dev/null
@@ -0,0 +1,78 @@
+#!/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*)
+        BOOT_IMG="`ls ${DWN_WORKDIR}/tizen-common_*-boot-*.tar.gz`"
+        USERSPACE_IMG="`ls ${DWN_WORKDIR}/tizen-common_*-wayland-*.tar.gz`"
+        TARGET="odroid"
+        ;;
+    *minnow*)
+        USERSPACE_IMG="`ls ${DWN_WORKDIR}/tizen-common_*-wayland-*-sda.raw.bz2`"
+        USERSPACE_IMG_BMAP="`ls ${DWN_WORKDIR}/tizen-common_*-wayland-*-sda.bmap`"
+        TARGET="minnow"
+        ;;
+esac
+
+FAIL_CNT="$2"
+test -n "${FAIL_CNT}" || FAIL_CNT=0
+
+if [ "$FAIL_CNT" -ge 2 ]; then
+    # Trigger publish job
+    tspwb -L PUBLISH sh ${TSP_DIR}/jobs/publish.sh $1
+    exit 0
+fi
+
+# Create and clean required directories on remote machine (tl-runner)
+ssh tl-runner "rm -rf \"${WORKDIR_REMOTE}\"; mkdir -p \"${WORKDIR_REMOTE}\""
+
+# Copy required files
+scp "${BOOT_IMG}" "${USERSPACE_IMG}" "${USERSPACE_IMG_BMAP}" tl-runner:"${WORKDIR_REMOTE}/"
+
+echo "start remote script"
+ssh tl-runner "TARGET=${TARGET} FAIL_CNT=${FAIL_CNT} WORKDIR_REMOTE=${WORKDIR_REMOTE} sh -s --" \
+    < "${TSP_DIR}/scripts/${TARGET}_prep_flash_conf.sh"
+echo "finish remote script"
+
+# Copy the results
+scp tl-runner:"${WORKDIR_REMOTE}/sysctl.result" .
+
+if [ "$FAIL_CNT" -ge 1 ]; then
+    echo "RETRIGGERED: ${FAIL_CNT}" >> sysctl.result
+fi
+
+# Check if they have run successfully, otherwise reschedule the job
+if grep -q "Testing failed." sysctl.result
+then
+    echo "Retrigger..."
+    tsrun_target ${TARGET} -L "RETRIGGERED_$(echo "$TARGET" | tr 'a-z' 'A-Z')_PREPARE_FLASH_CONF" \
+        sh "${TSP_DIR}/jobs/${TARGET}_prep_flash_conf.sh" $1 $(($FAIL_CNT + 1))
+    exit 0
+fi
+
+# Trigger publish job
+tspwb -L PUBLISH sh ${TSP_DIR}/jobs/publish.sh $1
diff --git a/tsp/jobs/minnow_prep_flash_conf.sh b/tsp/jobs/minnow_prep_flash_conf.sh
new file mode 120000 (symlink)
index 0000000..6c42dc8
--- /dev/null
@@ -0,0 +1 @@
+common_prep_flash_conf.sh
\ No newline at end of file
diff --git a/tsp/jobs/odroid_prep_flash_conf.sh b/tsp/jobs/odroid_prep_flash_conf.sh
new file mode 120000 (symlink)
index 0000000..6c42dc8
--- /dev/null
@@ -0,0 +1 @@
+common_prep_flash_conf.sh
\ No newline at end of file