diff --git a/.github/ISSUE_TEMPLATE/checklist-for-release.md b/.github/ISSUE_TEMPLATE/checklist-for-release.md index 534124ca9..aada17dd8 100644 --- a/.github/ISSUE_TEMPLATE/checklist-for-release.md +++ b/.github/ISSUE_TEMPLATE/checklist-for-release.md @@ -11,7 +11,7 @@ assignees: doegox, iceman1001 - [ ] `make style` - [ ] `make miscchecks` -- [ ] `make clean; make host CC=clang CXX=clang++ LD=clang++` on recent Debian or Ubuntu +- [ ] `make clean; make -j host CC=clang CXX=clang++ LD=clang++` on recent Debian or Ubuntu - [ ] `mymanualchecks.sh` - [ ] `mycppcheck.sh` no alarming warning? - [ ] `tools/build_all_firmwares.sh` check that the script contains all standalone modes then compile all standalone modes (linux only) @@ -44,7 +44,7 @@ Run `tools/release_tests.sh` on: - [ ] Ubuntu 25.10 - [ ] OSX (MacPorts) - [ ] OSX (Homebrew) -- [ ] Termux +- [ ] Termux cf `docker/termux-README.md` - [ ] Android cmake cross-compilation ? # creating release diff --git a/docker/README.md b/docker/README.md new file mode 100644 index 000000000..cbf521148 --- /dev/null +++ b/docker/README.md @@ -0,0 +1,7 @@ +# Docker tests + +Usage: +- enter one of the subfolders +- `../build.sh` to build the docker image +- `../run.sh` to run a container and get a shell +- `../run.sh tests` to run a container and execute its `run_tests.sh` diff --git a/docker/build-all.sh b/docker/build-all.sh index 999d6ef26..db61e734f 100755 --- a/docker/build-all.sh +++ b/docker/build-all.sh @@ -1,6 +1,6 @@ #!/bin/bash -for os in archlinux debian-13-trixie debian-13-trixie-arm64 debian-13-trixie-armhf debian-14-forky fedora-41 fedora-42 fedora-43 homebrew kali opensuse-leap opensuse-tumbleweed parrot-core-latest ubuntu-24.04 ubuntu-24.10 ubuntu-25.04; do +for os in archlinux debian-13-trixie debian-13-trixie-arm64 debian-13-trixie-armhf debian-14-forky fedora-41 fedora-42 fedora-43 homebrew kali opensuse-leap opensuse-tumbleweed parrot-core-latest ubuntu-22.04 ubuntu-24.04 ubuntu-24.10 ubuntu-25.04 ubuntu-25.10; do echo -e "\n\n================= Building for $os ======================\n" ( cd $os && ../build.sh ) done diff --git a/docker/debian-13-trixie-arm64/README.md b/docker/debian-13-trixie-arm64/README.md index 68cc52712..485f84893 100644 --- a/docker/debian-13-trixie-arm64/README.md +++ b/docker/debian-13-trixie-arm64/README.md @@ -1,4 +1,4 @@ -# Notes to install corss-platform support +# Notes to install cross-platform support ``` sudo apt install qemu-user qemu-user-binfmt binfmt-support ``` diff --git a/docker/debian-13-trixie-arm64/run_tests.sh b/docker/debian-13-trixie-arm64/run_tests.sh index 8d31f8332..c8febcc29 100755 --- a/docker/debian-13-trixie-arm64/run_tests.sh +++ b/docker/debian-13-trixie-arm64/run_tests.sh @@ -2,14 +2,25 @@ # This script is to be run from proxmark root folder inside the docker env # docker/debian-13-trixie-arm64/run_tests.sh; +# sudo not supported in this docker image, update packages before running as rrg user +if [ "$EUID" -eq 0 ]; then + apt update && sudo apt upgrade -y +fi + +# Re-execute the script as rrg user if not already running as rrg +if [[ $(id -un) != rrg ]]; then + script_path=$(readlink -f -- "${BASH_SOURCE[0]}") + working_directory=$(pwd -P) + exec su - rrg -c 'cd "$1" && exec bash "$2" "${@:3}"' bash \ + "$working_directory" "$script_path" "$@" +fi + # Check that we are not running as root if [ "$EUID" -eq 0 ]; then echo "Error: This script should not be run as root" >&2 exit 1 fi -# sudo not supported in this docker image, update packages before running as rrg user -# sudo apt update && sudo apt upgrade -y git config --global --add safe.directory /home/rrg/proxmark3 tools/release_tests.sh # beeps diff --git a/docker/debian-13-trixie-armhf/README.md b/docker/debian-13-trixie-armhf/README.md index aceaf5c44..351349fb5 100644 --- a/docker/debian-13-trixie-armhf/README.md +++ b/docker/debian-13-trixie-armhf/README.md @@ -1,4 +1,4 @@ -# Notes to install corss-platform support +# Notes to install cross-platform support ``` sudo apt install qemu-user qemu-user-binfmt binfmt-support ``` diff --git a/docker/debian-13-trixie-armhf/run_tests.sh b/docker/debian-13-trixie-armhf/run_tests.sh index bb0e350e0..eb9ff714b 100755 --- a/docker/debian-13-trixie-armhf/run_tests.sh +++ b/docker/debian-13-trixie-armhf/run_tests.sh @@ -2,15 +2,25 @@ # This script is to be run from proxmark root folder inside the docker env # docker/debian-13-trixie-armhf/run_tests.sh; +# sudo not supported in this docker image, update packages before running as rrg user +if [ "$EUID" -eq 0 ]; then + apt update && sudo apt upgrade -y +fi + +# Re-execute the script as rrg user if not already running as rrg +if [[ $(id -un) != rrg ]]; then + script_path=$(readlink -f -- "${BASH_SOURCE[0]}") + working_directory=$(pwd -P) + exec su - rrg -c 'cd "$1" && exec bash "$2" "${@:3}"' bash \ + "$working_directory" "$script_path" "$@" +fi + # Check that we are not running as root if [ "$EUID" -eq 0 ]; then echo "Error: This script should not be run as root" >&2 exit 1 fi -# sudo not supported in this docker image, update packages before running as rrg user -# sudo apt update && sudo apt upgrade -y - git config --global --add safe.directory /home/rrg/proxmark3 tools/release_tests.sh # beeps diff --git a/docker/run.sh b/docker/run.sh index df178fb6c..0af9b49c8 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -11,4 +11,9 @@ if [ -n "$UART_PORT" ]; then else DEV="" fi -docker run $DEV $DOCKER_PLATFORM --volume="$(pwd)/../..:/home/rrg/proxmark3" -w /home/rrg/proxmark3 --net=host --rm -it "$DOCKER_IMAGE" +TEST_PATH=$(basename $(pwd -L)) +DOCKER_COMMAND=() +if [ "$1" = "tests" ]; then + DOCKER_COMMAND=("docker/$TEST_PATH/run_tests.sh") +fi +docker run $DEV $DOCKER_PLATFORM --volume="$(pwd)/../..:/home/rrg/proxmark3" -w /home/rrg/proxmark3 --net=host --rm -it "$DOCKER_IMAGE" "${DOCKER_COMMAND[@]}" diff --git a/tools/pm3_tests.sh b/tools/pm3_tests.sh index 80df512c1..135dc2a76 100755 --- a/tools/pm3_tests.sh +++ b/tools/pm3_tests.sh @@ -338,7 +338,7 @@ while true; do if ! CheckFileExist "staticnested_2x1nt_rf08s exists" "$STATICNESTED2X1NTBIN"; then break; fi if ! CheckFileExist "staticnested_2x1nt_rf08s_1key exists" "$STATICNESTED2X11KNTBIN"; then break; fi # very slow one... - if ! CheckExecute slow "staticnested_0nt test" "$STATICNESTED0NTBIN a13e4902 2e9e49fc 1111 . 7bfc7a5b 1110 a17e4902 50f2abc2 1101; rm keys.dic" "Key ffffffffffff found in 3 arrays"; then break; fi +# if ! CheckExecute slow "staticnested_0nt test" "$STATICNESTED0NTBIN a13e4902 2e9e49fc 1111 . 7bfc7a5b 1110 a17e4902 50f2abc2 1101; rm keys.dic" "Key ffffffffffff found in 3 arrays"; then break; fi if ! CheckExecute "staticnested_1nt 1/2 test" "$STATICNESTED1NTBIN 5c467f63 0 456ace4e da53428d 1001" "found 19823 keys"; then break; fi if ! CheckExecute "staticnested_1nt 2/2 test" "$STATICNESTED1NTBIN 5c467f63 0 e56f9fa2 7a9616b6 1110" "found 34531 keys"; then break; fi if ! CheckExecute "staticnested_2nt test" "$STATICNESTED2NTBIN 461dce03 7eef3586 7fa28c7e 322bc14d 7f62b3d6" "\[ 2 \].*ffffffffff40.*"; then break; fi