From 6647c407af9084a0b20fedf750a2d6c8b07361ad Mon Sep 17 00:00:00 2001 From: Oleg Moiseenko <807634+merlokk@users.noreply.github.com> Date: Sun, 18 Aug 2019 20:56:38 +0300 Subject: [PATCH] ios (#337) retry for hardnested added `make all v=1` for linux --- .travis.yml | 12 ++++++++++-- pm3test.sh | 26 +++++++++++++++++++------- 2 files changed, 29 insertions(+), 9 deletions(-) diff --git a/.travis.yml b/.travis.yml index a533910d8..a1c5a6866 100644 --- a/.travis.yml +++ b/.travis.yml @@ -42,7 +42,7 @@ install: brew install --HEAD proxmark3; elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then make clean; - make all; + make all V=1; fi before_script: @@ -50,8 +50,16 @@ before_script: script: ## start and run a test script - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then + if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then proxmark3 -h ; +# cd /Users/travis/Library/Caches/Homebrew/proxmark3--git; +# chmod +x pm3test.sh; +# pwd; +# ls -la; +# cd client; +# ls-la; +# cd ..; +# ./pm3test.sh; elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then ./pm3test.sh; fi diff --git a/pm3test.sh b/pm3test.sh index 09cc6b6cc..e127944f6 100644 --- a/pm3test.sh +++ b/pm3test.sh @@ -8,34 +8,46 @@ C_GREEN='\033[0;32m' C_BLUE='\033[0;34m' C_NC='\033[0m' # No Color +# title, file name or file wildcard to check function CheckFileExist() { if [ -f "$2" ]; then echo -e "$1 ${C_GREEN}[OK]${C_NC}" - return 0 + return 0 fi if ls $2 1> /dev/null 2>&1; then echo -e "$1 ${C_GREEN}[OK]${C_NC}" - return 0 + return 0 fi echo -e "$1 ${C_RED}[Fail]${C_NC}" return 1 } +# title, command line, check result, repeat several times if failed function CheckExecute() { - if eval "$2 | grep -q '$3'"; then - echo -e "$1 ${C_GREEN}[OK]${C_NC}" - return 0 + if [ $4 ]; then + local RETRY="1 2 3 e" + else + local RETRY="e" fi + for I in $RETRY + do + if eval "$2 | grep -q '$3'"; then + echo -e "$1 ${C_GREEN}[OK]${C_NC}" + return 0 + fi + if [ ! $I == "e" ]; then echo "retry $I"; fi + done + echo -e "$1 ${C_RED}[Fail]${C_NC}" return 1 } -printf "\n${C_BLUE}RRG Proxmark3 test tool ${C_NC}\n\n" +printf "\n${C_BLUE}RRG/Iceman Proxmark3 test tool ${C_NC}\n\n" if [ "$TRAVIS_COMMIT" ]; then if [ "$TRAVIS_PULL_REQUEST" == "false" ]; then @@ -63,7 +75,7 @@ while true; do if ! CheckExecute "hf mf offline text" "./client/proxmark3 -c 'hf mf'" "at_enc"; then break; fi - if ! CheckExecute "hf mf hardnested test" "./client/proxmark3 -c 'hf mf hardnested t 1 000000000000'" "found:"; then break; fi + if ! CheckExecute "hf mf hardnested test" "./client/proxmark3 -c 'hf mf hardnested t 1 000000000000'" "found:" "repeat"; then break; fi if ! CheckExecute "emv test" "./client/proxmark3 -c 'emv test'" "Test(s) \[ OK"; then break; fi printf "\n${C_GREEN}Tests [OK]${C_NC}\n\n"