mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
parent
00cc43ec7e
commit
6647c407af
2 changed files with 29 additions and 9 deletions
26
pm3test.sh
26
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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue