mirror of
https://github.com/rosenpass/rosenpass.git
synced 2025-12-12 15:49:22 -08:00
ci: fixup regression test
Signed-off-by: Paul Spooren <mail@aparcar.org>
This commit is contained in:
@@ -1,33 +1,33 @@
|
|||||||
#!/bin/bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
iterations=$1
|
iterations="$1"
|
||||||
sleep_time=$2
|
sleep_time="$2"
|
||||||
|
|
||||||
PWD=$(pwd)
|
PWD="$(pwd)"
|
||||||
EXEC=$PWD/target/release/rosenpass
|
EXEC="$PWD/target/release/rosenpass"
|
||||||
LOGS=$PWD/output/logs
|
LOGS="$PWD/output/logs"
|
||||||
|
|
||||||
mkdir -p output/logs
|
mkdir -p "$LOGS"
|
||||||
|
|
||||||
run_command() {
|
run_command() {
|
||||||
local file=$1
|
local file=$1
|
||||||
local log_file="$2"
|
local log_file="$2"
|
||||||
($EXEC exchange-config $file 2>&1 | sed "s/^/[$2] /" | tee -a $log_file) &
|
("$EXEC" exchange-config "$file" 2>&1 | tee -a "$log_file") &
|
||||||
echo $!
|
echo $!
|
||||||
}
|
}
|
||||||
|
|
||||||
pids=()
|
pids=()
|
||||||
|
|
||||||
(cd output/dut && run_command "configs/dut-$iterations.toml" "dut.log") & piddut=$!
|
(cd output/dut && run_command "configs/dut-$iterations.toml" "$LOGS/dut.log")
|
||||||
for (( x=0; x<$iterations; x++ )); do
|
for (( x=0; x<iterations; x++ )); do
|
||||||
(cd output/ate && run_command "configs/ate-$x.toml" "ate-$x.log") & pids+=($!)
|
(cd output/ate && run_command "configs/ate-$x.toml" "$LOGS/ate-$x.log") & pids+=($!)
|
||||||
done
|
done
|
||||||
|
|
||||||
sleep $sleep_time
|
sleep "$sleep_time"
|
||||||
|
|
||||||
lsof -i :9999 | awk 'NR!=1 {print $2}' | xargs kill
|
lsof -i :9999 | awk 'NR!=1 {print $2}' | xargs kill
|
||||||
|
|
||||||
for (( x=0; x<$iterations; x++ )); do
|
for (( x=0; x<iterations; x++ )); do
|
||||||
port=$((x + 50000))
|
port=$((x + 50000))
|
||||||
lsof -i :$port | awk 'NR!=1 {print $2}' | xargs kill
|
lsof -i :$port | awk 'NR!=1 {print $2}' | xargs kill
|
||||||
done
|
done
|
||||||
|
|||||||
2
.github/workflows/regressions.yml
vendored
2
.github/workflows/regressions.yml
vendored
@@ -17,3 +17,5 @@ jobs:
|
|||||||
- run: python misc/generate_configs.py
|
- run: python misc/generate_configs.py
|
||||||
- run: chmod +x .ci/run-regression.sh
|
- run: chmod +x .ci/run-regression.sh
|
||||||
- run: .ci/run-regression.sh 100 20
|
- run: .ci/run-regression.sh 100 20
|
||||||
|
- run: |
|
||||||
|
[ $(ls -1 output/ate/out | wc -l) -eq 100 ]
|
||||||
|
|||||||
Reference in New Issue
Block a user