mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-04 15:20:27 +08:00
parent
00cc43ec7e
commit
6647c407af
2 changed files with 29 additions and 9 deletions
12
.travis.yml
12
.travis.yml
|
@ -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
|
||||||
|
|
26
pm3test.sh
26
pm3test.sh
|
@ -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"
|
||||||
|
|
Loading…
Reference in a new issue