retry for hardnested
added `make all v=1` for linux
This commit is contained in:
Oleg Moiseenko 2019-08-18 20:56:38 +03:00 committed by GitHub
parent 00cc43ec7e
commit 6647c407af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 29 additions and 9 deletions

View file

@ -42,7 +42,7 @@ install:
brew install --HEAD proxmark3; brew install --HEAD proxmark3;
elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
make clean; make clean;
make all; make all V=1;
fi fi
before_script: before_script:
@ -50,8 +50,16 @@ before_script:
script: script:
## start and run a test script ## start and run a test script
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
proxmark3 -h ; 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 elif [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
./pm3test.sh; ./pm3test.sh;
fi fi

View file

@ -8,34 +8,46 @@ C_GREEN='\033[0;32m'
C_BLUE='\033[0;34m' C_BLUE='\033[0;34m'
C_NC='\033[0m' # No Color C_NC='\033[0m' # No Color
# title, file name or file wildcard to check
function CheckFileExist() { function CheckFileExist() {
if [ -f "$2" ]; then if [ -f "$2" ]; then
echo -e "$1 ${C_GREEN}[OK]${C_NC}" echo -e "$1 ${C_GREEN}[OK]${C_NC}"
return 0 return 0
fi fi
if ls $2 1> /dev/null 2>&1; then if ls $2 1> /dev/null 2>&1; then
echo -e "$1 ${C_GREEN}[OK]${C_NC}" echo -e "$1 ${C_GREEN}[OK]${C_NC}"
return 0 return 0
fi fi
echo -e "$1 ${C_RED}[Fail]${C_NC}" echo -e "$1 ${C_RED}[Fail]${C_NC}"
return 1 return 1
} }
# title, command line, check result, repeat several times if failed
function CheckExecute() { function CheckExecute() {
if eval "$2 | grep -q '$3'"; then if [ $4 ]; then
echo -e "$1 ${C_GREEN}[OK]${C_NC}" local RETRY="1 2 3 e"
return 0 else
local RETRY="e"
fi 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}" echo -e "$1 ${C_RED}[Fail]${C_NC}"
return 1 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_COMMIT" ]; then
if [ "$TRAVIS_PULL_REQUEST" == "false" ]; 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 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 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" printf "\n${C_GREEN}Tests [OK]${C_NC}\n\n"