Use new version of tct/resource_locking script 64/79764/7
authorAleksander Mistewicz <a.mistewicz@samsung.com>
Tue, 12 Jul 2016 16:09:35 +0000 (18:09 +0200)
committerAleksander Mistewicz <a.mistewicz@samsung.com>
Fri, 7 Oct 2016 15:13:09 +0000 (17:13 +0200)
Change-Id: Ie684ba0aecf2f6ab76da3a9a95560d29c6c4c549
Signed-off-by: Aleksander Mistewicz <a.mistewicz@samsung.com>
tsp/scripts/common_prep_flash_conf.sh

index c904ace..09d8d03 100755 (executable)
@@ -43,17 +43,11 @@ else
 fi
 
 # Lock resource
-if [ "${FAIL_CNT}" -ge 1 ]; then
-    SDMUX="`${TESTLAB_MAJOR}/tct/resource_locking.sh failed_${TARGET}`"
-else
-    SDMUX="`${TESTLAB_MAJOR}/tct/resource_locking.sh ${TARGET}`"
-fi
+SDMUX="$(python "${TESTLAB_MAJOR}/tct/resource_locking.py" --retrylock "${TARGET}")"
 if [ -z "${SDMUX}" ]; then
     echo "Failed to allocate SD MUX device." >> sysctl.result
     exit 1
 fi
-UUID_FILE="/var/tmp/uuid-${SDMUX}"
-lockfile-create --use-pid --retry 12 "${UUID_FILE}"
 
 case "$TARGET" in
     *odroid*)
@@ -64,7 +58,12 @@ case "$TARGET" in
         ;;
 esac
 
-lockfile-remove "${UUID_FILE}"
+if grep -q "Testing failed." sysctl.result
+then
+    python "${TESTLAB_MAJOR}/tct/resource_locking.py" --unlockfailed "${SDMUX}"
+else
+    python "${TESTLAB_MAJOR}/tct/resource_locking.py" --unlock "${SDMUX}"
+fi
 
 echo "sdmux used: ${SDMUX}" >> sysctl.result