mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-05 23:52:27 +08:00
pm3_tests: cover cmd/lua/py scripts (python support autodetected)
This commit is contained in:
parent
0749117f0b
commit
f125cddc3a
1 changed files with 15 additions and 4 deletions
|
@ -173,14 +173,15 @@ function CheckExecute() {
|
||||||
fi
|
fi
|
||||||
|
|
||||||
printf "%-40s" "$1 "
|
printf "%-40s" "$1 "
|
||||||
|
RESULT=0
|
||||||
|
|
||||||
if $SLOWTEST && ! $SLOWTESTS; then
|
if $SLOWTEST && ! $SLOWTESTS; then
|
||||||
echo -e "[ ${C_YELLOW}SKIPPED${C_NC} ] ( slow )"
|
echo -e "[ ${C_YELLOW}SKIPPED${C_NC} ] ( slow )"
|
||||||
return 0
|
return $RESULT
|
||||||
fi
|
fi
|
||||||
if $GPUTEST && ! $GPUTESTS; then
|
if $GPUTEST && ! $GPUTESTS; then
|
||||||
echo -e "[ ${C_YELLOW}SKIPPED${C_NC} ] ( gpu )"
|
echo -e "[ ${C_YELLOW}SKIPPED${C_NC} ] ( gpu )"
|
||||||
return 0
|
return $RESULT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
for I in $RETRY
|
for I in $RETRY
|
||||||
|
@ -188,11 +189,12 @@ function CheckExecute() {
|
||||||
RES=$(eval "$2")
|
RES=$(eval "$2")
|
||||||
if echo "$RES" | grep -q "$3"; then
|
if echo "$RES" | grep -q "$3"; then
|
||||||
echo -e "[ ${C_GREEN}OK${C_NC} ] ${C_OK}"
|
echo -e "[ ${C_GREEN}OK${C_NC} ] ${C_OK}"
|
||||||
return 0
|
return $RESULT
|
||||||
fi
|
fi
|
||||||
if [ ! $I == "e" ]; then echo "retry $I"; fi
|
if [ ! $I == "e" ]; then echo "retry $I"; fi
|
||||||
done
|
done
|
||||||
|
|
||||||
|
RESULT=1
|
||||||
if $IGNOREFAILURE; then
|
if $IGNOREFAILURE; then
|
||||||
echo -e "[ ${C_YELLOW}IGNORED${C_NC} ]"
|
echo -e "[ ${C_YELLOW}IGNORED${C_NC} ]"
|
||||||
return 0
|
return 0
|
||||||
|
@ -200,7 +202,7 @@ function CheckExecute() {
|
||||||
|
|
||||||
echo -e "[ ${C_RED}FAIL${C_NC} ] ${C_FAIL}"
|
echo -e "[ ${C_RED}FAIL${C_NC} ] ${C_FAIL}"
|
||||||
echo -e "Execution trace:\n$RES"
|
echo -e "Execution trace:\n$RES"
|
||||||
return 1
|
return $RESULT
|
||||||
}
|
}
|
||||||
|
|
||||||
echo -e "\n${C_BLUE}RRG/Iceman Proxmark3 test tool ${C_NC}\n"
|
echo -e "\n${C_BLUE}RRG/Iceman Proxmark3 test tool ${C_NC}\n"
|
||||||
|
@ -360,6 +362,15 @@ while true; do
|
||||||
if ! CheckExecute "proxmark multi stdin 3/4" "echo -e 'rem foo\nrem bar;quit' |$CLIENTBIN" "remark: foo"; then break; fi
|
if ! CheckExecute "proxmark multi stdin 3/4" "echo -e 'rem foo\nrem bar;quit' |$CLIENTBIN" "remark: foo"; then break; fi
|
||||||
if ! CheckExecute "proxmark multi stdin 4/4" "echo -e 'rem foo\nrem bar;quit' |$CLIENTBIN" "remark: bar"; then break; fi
|
if ! CheckExecute "proxmark multi stdin 4/4" "echo -e 'rem foo\nrem bar;quit' |$CLIENTBIN" "remark: bar"; then break; fi
|
||||||
|
|
||||||
|
echo -e "\n${C_BLUE}Testing scripts:${C_NC}"
|
||||||
|
if ! CheckExecute "script run cmdscript" "$CLIENTBIN -c 'script run example.cmd'" "remark: world"; then break; fi
|
||||||
|
if ! CheckExecute "script run luascript" "$CLIENTBIN -c 'script run data_hex_crc -b 010203040506070809'" "CDMA2000.*7B02"; then break; fi
|
||||||
|
|
||||||
|
CheckExecute ignore "check Python support" "$CLIENTBIN -c 'hw version'" "Python script.*present"
|
||||||
|
if [ $RESULT -eq 0 ]; then
|
||||||
|
if ! CheckExecute "script run pyscript" "$CLIENTBIN -c 'script run parity.py 10 1234'" "Even parity"; then break; fi
|
||||||
|
fi
|
||||||
|
|
||||||
echo -e "\n${C_BLUE}Testing data manipulation:${C_NC}"
|
echo -e "\n${C_BLUE}Testing data manipulation:${C_NC}"
|
||||||
if ! CheckExecute "reveng readline test" "$CLIENTBIN -c 'reveng -h;reveng -D'" "CRC-64/GO-ISO"; then break; fi
|
if ! CheckExecute "reveng readline test" "$CLIENTBIN -c 'reveng -h;reveng -D'" "CRC-64/GO-ISO"; then break; fi
|
||||||
if ! CheckExecute "reveng -g test" "$CLIENTBIN -c 'reveng -g abda202c'" "CRC-16/ISO-IEC-14443-3-A"; then break; fi
|
if ! CheckExecute "reveng -g test" "$CLIENTBIN -c 'reveng -g abda202c'" "CRC-16/ISO-IEC-14443-3-A"; then break; fi
|
||||||
|
|
Loading…
Reference in a new issue