-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest-binary.sh
More file actions
executable file
·60 lines (55 loc) · 1.63 KB
/
test-binary.sh
File metadata and controls
executable file
·60 lines (55 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/bin/bash
set -e
# Configuration
CONTAINER_NAME="tessera-fuzzer"
IMAGE_NAME="tessera-node:fuzzer"
TARGET_SOCK="/tmp/tessera_fuzzer.sock"
VECTOR_PATH=${2:-"storage"} # Default to "storage" if not provided
DURATION=${1:-60}
# JAM-spec Docker performance args (identical to conformance script)
DOCKER_ARGS=(
--rm
--name "$CONTAINER_NAME"
--user "$(id -u):$(id -g)"
--platform linux/amd64
--cpuset-cpus=0-17
--cpu-shares=2048
--memory=8g
--memory-swap=8g
--shm-size=1g
--ulimit "nofile=65536:65536"
--ulimit "nproc=32768:32768"
--sysctl "net.core.somaxconn=65535"
--sysctl "net.ipv4.tcp_tw_reuse=1"
--security-opt seccomp=unconfined
--security-opt apparmor=unconfined
--cap-add SYS_NICE
--cap-add SYS_RESOURCE
--cap-add IPC_LOCK
-v /tmp:/tmp
-v "${PWD}/dist:/tessera"
-v "${PWD}/test-suites/ext/jam-conformance/test-vectors/traces:/test-vectors"
-w /tessera
)
cleanup() {
docker kill $CONTAINER_NAME 2>/dev/null || true
rm -f $TARGET_SOCK
}
trap cleanup EXIT INT TERM
case "${1:-test}" in
"build")
docker build -f Dockerfile.tessera-bin-test -t $IMAGE_NAME .
;;
"test")
echo "Testing tessera-node with vector path: $VECTOR_PATH"
echo "${DOCKER_ARGS[@]}"
sudo chrt -f 99 nice -n -20 ionice -c1 -n0 taskset -c 0-32 \
docker run -e JAM_LOG_LEVEL=critical "${DOCKER_ARGS[@]}" "$IMAGE_NAME" ./tessera-node --import "/test-vectors/$VECTOR_PATH"
;;
*)
echo "Usage: $0 [build|test|clean] [traces_name]"
echo "Example: $0 test storage"
echo "Example: $0 test refine"
echo "Default vector_path: storage"
;;
esac