-
Notifications
You must be signed in to change notification settings - Fork 146
Migrate renode test to new container #754
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -12,10 +12,40 @@ jobs: | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - uses: actions/checkout@v4 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| with: | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| submodules: true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| - name: Workaround for sources.list | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| run: | | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| set -euxo pipefail | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| apt-cache policy | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| grep -RInE '^(deb|Types|URIs)' /etc/apt || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| shopt -s nullglob | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sudo sed -i \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| /etc/apt/sources.list || true | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for f in /etc/apt/sources.list.d/*.list; do | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sudo sed -i \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "$f" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| for f in /etc/apt/sources.list.d/*.sources; do | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sudo sed -i \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -e "s|https\?://azure\.archive\.ubuntu\.com|http://mirror.arizona.edu|g" \ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| "$f" | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| done | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| if grep -qE '^[[:space:]]*https?://azure\.archive\.ubuntu\.com/ubuntu/?' /etc/apt/apt-mirrors.txt; then | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| sudo sed -i 's|https\?://azure\.archive\.ubuntu\.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/apt-mirrors.txt | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+25
to
+42
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| -e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \ | |
| /etc/apt/sources.list || true | |
| for f in /etc/apt/sources.list.d/*.list; do | |
| sudo sed -i \ | |
| -e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \ | |
| "$f" | |
| done | |
| for f in /etc/apt/sources.list.d/*.sources; do | |
| sudo sed -i \ | |
| -e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|http://mirror.arizona.edu/ubuntu/|g" \ | |
| -e "s|https\?://azure\.archive\.ubuntu\.com|http://mirror.arizona.edu|g" \ | |
| "$f" | |
| done | |
| if grep -qE '^[[:space:]]*https?://azure\.archive\.ubuntu\.com/ubuntu/?' /etc/apt/apt-mirrors.txt; then | |
| sudo sed -i 's|https\?://azure\.archive\.ubuntu\.com/ubuntu/|http://mirror.arizona.edu/ubuntu/|g' /etc/apt/apt-mirrors.txt | |
| -e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|https://mirror.arizona.edu/ubuntu/|g" \ | |
| /etc/apt/sources.list || true | |
| for f in /etc/apt/sources.list.d/*.list; do | |
| sudo sed -i \ | |
| -e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|https://mirror.arizona.edu/ubuntu/|g" \ | |
| "$f" | |
| done | |
| for f in /etc/apt/sources.list.d/*.sources; do | |
| sudo sed -i \ | |
| -e "s|https\?://azure\.archive\.ubuntu\.com/ubuntu/?|https://mirror.arizona.edu/ubuntu/|g" \ | |
| -e "s|https\?://azure\.archive\.ubuntu\.com|https://mirror.arizona.edu|g" \ | |
| "$f" | |
| done | |
| if grep -qE '^[[:space:]]*https?://azure\.archive\.ubuntu\.com/ubuntu/?' /etc/apt/apt-mirrors.txt; then | |
| sudo sed -i 's|https\?://azure\.archive\.ubuntu\.com/ubuntu/|https://mirror.arizona.edu/ubuntu/|g' /etc/apt/apt-mirrors.txt |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -29,14 +29,16 @@ | |
| void uart_init(void) | ||
| { | ||
| UART0_BAUDRATE = BAUD_115200; | ||
| UART0_ENABLE = 1; | ||
| UART0_ENABLE = 4; | ||
| } | ||
|
Comment on lines
31
to
33
|
||
|
|
||
| static volatile uint8_t uart_tx_buf; | ||
|
|
||
| static void uart_write_char(char c) | ||
| { | ||
| uart_tx_buf = c; | ||
| UART0_EVENT_ENDTX = 0; | ||
|
|
||
| UART0_TXD_PTR = (uint32_t)(&c); | ||
| UART0_TXD_PTR = (uint32_t)&uart_tx_buf; | ||
| UART0_TXD_MAXCOUNT = 1; | ||
| UART0_TASK_STARTTX = 1; | ||
| while(UART0_EVENT_ENDTX == 0) | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -4,25 +4,22 @@ declare -r HOST_TEST_RESULTS_PATH=${HOST_ROOT_DIR}/test_results | |||||||||
| declare -r HOST_LOG_PATH=${HOST_TEST_RESULTS_PATH} | ||||||||||
| declare -r HOST_LOG_FILENAME=${HOST_LOG_PATH}/logs.txt | ||||||||||
|
|
||||||||||
| declare -r DOCKER_TAG=renode_nrf52 | ||||||||||
| declare -r DOCKER_IMAGE="${DOCKER_IMAGE:-ghcr.io/wolfssl/wolfboot-ci-renode:latest}" | ||||||||||
|
||||||||||
| declare -r DOCKER_IMAGE="${DOCKER_IMAGE:-ghcr.io/wolfssl/wolfboot-ci-renode:latest}" | |
| declare -r DOCKER_IMAGE="${DOCKER_IMAGE:-ghcr.io/wolfssl/wolfboot-ci-renode:1.15.3}" |
Copilot
AI
Apr 16, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The docker run command redirects output as 2>&1 > ..., which sends stderr to the original stdout and only stdout to the file. If the intention is to capture both streams in logs.txt (as implied by later cat ${HOST_LOG_FILENAME}), swap the redirection order (or use &>), so stderr is also written to the log file.
| /bin/bash -c "tools/scripts/renode-test-update.sh $@ 2>&1 > ${DOCKER_TEST_RESULTS_PATH}/logs.txt" | |
| /bin/bash -c "tools/scripts/renode-test-update.sh $@ > ${DOCKER_TEST_RESULTS_PATH}/logs.txt 2>&1" |
Copilot
AI
Apr 16, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/bin/bash -c "tools/scripts/renode-test-update.sh $@ ..." interpolates the host script’s arguments directly into a shell command string without escaping. This allows accidental breakage (spaces/quotes) and also enables command injection if an argument contains shell metacharacters. Prefer passing arguments to docker run as real argv (avoid bash -c), or ensure each argument is safely shell-escaped before building the command string.
| /bin/bash -c "tools/scripts/renode-test-update.sh $@ 2>&1 > ${DOCKER_TEST_RESULTS_PATH}/logs.txt" | |
| /bin/bash -c 'tools/scripts/renode-test-update.sh "$@" > '"${DOCKER_TEST_RESULTS_PATH}"'/logs.txt 2>&1' -- "$@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This workflow rewrites Ubuntu apt sources from
https://...to anhttp://mirror. Even though apt verifies signed repositories, keeping HTTPS avoids unnecessary downgrade/MITM risk and aligns with the default secure transport. If the mirror supports it, preferhttps://mirror.arizona.edu/...(or another HTTPS mirror) rather than HTTP.