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*)
;;
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