Skip to content

Commit 31df03b

Browse files
committed
Remove tmux
1 parent c4360c5 commit 31df03b

File tree

3 files changed

+32
-42
lines changed

3 files changed

+32
-42
lines changed

.github/actions/riot/action.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@ description: Install and build RIOT dependencies
33
runs:
44
using: "composite"
55
steps:
6-
- name: Install packages
7-
run: |
8-
apt update
9-
apt install -y --no-install-recommends tmux
10-
shell: bash
11-
126
- name: Cache RIOT
137
id: cache-riot
148
uses: actions/cache@v4

test/platform/riot/coap_channel_federated_test/receiver/main.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55

66
#define REMOTE_PROTOCOL_FAMILY AF_INET6
77

8-
void lf_exit(void);
9-
108
typedef struct {
119
int size;
1210
char msg[512];

test/platform/riot/coap_channel_federated_test/run.sh

Lines changed: 32 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -9,49 +9,47 @@ make BOARD=native PORT=tap0 all -C ./sender
99
# Build receiver
1010
make BOARD=native PORT=tap1 all -C ./receiver
1111

12-
SESSION_NAME="federated_coap_test"
13-
14-
SENDER_EXIT_CODE_TMP_FILE_PATH=/tmp/${SESSION_NAME}_sender_exit_code
15-
RECEIVER_EXIT_CODE_TMP_FILE_PATH=/tmp/${SESSION_NAME}_receiver_exit_code
16-
17-
# Init error code variables
18-
echo "1" > $SENDER_EXIT_CODE_TMP_FILE_PATH
19-
echo "1" > $RECEIVER_EXIT_CODE_TMP_FILE_PATH
20-
21-
# Run the sender
22-
tmux new-session -d -s "$SESSION_NAME" "bash -c './sender/bin/native/*.elf tap0; echo \$? > $SENDER_EXIT_CODE_TMP_FILE_PATH'"
12+
# Start the sender with a 13-second timeout
13+
timeout 13 ./sender/bin/native/*.elf tap0 &
14+
pid1=$!
2315

16+
# Wait for 3 seconds
2417
sleep 3
2518

26-
# Run the receiver
27-
tmux split-window -h -t $SESSION_NAME "bash -c './receiver/bin/native/*.elf tap1; echo \$? > $RECEIVER_EXIT_CODE_TMP_FILE_PATH'"
19+
# Start the receiver with a 10-second timeout
20+
timeout 10 ./receiver/bin/native/*.elf tap1 &
21+
pid2=$!
2822

23+
# Wait for both binaries to complete or timeout
24+
wait $pid1
25+
exit_code_sender=$?
2926

30-
# Attach to the tmux session
31-
# Attach to the session for 5 seconds
32-
{
33-
sleep 10 && tmux detach-client -s $SESSION_NAME
34-
} &
35-
tmux attach-session -t $SESSION_NAME
27+
wait $pid2
28+
exit_code_receiver=$?
3629

37-
# Check if the tmux session is still running
38-
if tmux has-session -t $SESSION_NAME; then
39-
tmux kill-session -t $SESSION_NAME
40-
echo "Error: coap_channel_federated_test timed out"
41-
exit 1
30+
echo "Test completed"
31+
32+
# Check if timeout occurred
33+
if [ $exit_code_sender -eq 124 ]; then
34+
echo "Error sender timed out"
35+
echo "Test failed"
36+
exit 1
4237
else
43-
echo "Test completed: tmux session has terminated."
44-
sender_exit_code=$(<"$SENDER_EXIT_CODE_TMP_FILE_PATH")
45-
receiver_exit_code=$(<"$RECEIVER_EXIT_CODE_TMP_FILE_PATH")
38+
echo "Exit code of sender: $exit_code_sender"
39+
fi
4640

47-
echo Sender exit code: $sender_exit_code
48-
echo Receiver exit code: $receiver_exit_code
41+
if [ $exit_code_receiver -eq 124 ]; then
42+
echo "Error receiver timed out"
43+
echo "Test failed"
44+
exit 1
45+
else
46+
echo "Exit code of receiver: $exit_code_receiver"
47+
fi
4948

50-
if [[ $receiver_exit_code -ne 0 ]]; then
51-
echo "Error: Receiver received wrong message text"
52-
exit 1
53-
fi
49+
# Check exit code
50+
if [[ $exit_code_receiver -ne 0 ]]; then
51+
echo "Error: Receiver received wrong message text"
52+
exit 1
5453
fi
5554

5655
echo "All tests passed."
57-

0 commit comments

Comments
 (0)