-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
executable file
·36 lines (23 loc) · 882 Bytes
/
test.sh
File metadata and controls
executable file
·36 lines (23 loc) · 882 Bytes
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
#!/bin/bash
LOG_DIR="./valgrind_logs"
# Create log directory if it doesn't exist
mkdir -p "$LOG_DIR"
# Clear any previous log files
rm -f "$LOG_DIR"/*
./ibmtpm1682/src/tpm_server -rm &> "$LOG_DIR/tpm_server.log" &
sleep 1
log_file="$LOG_DIR/daa_valgrind.log"
binary="./build/daa"
echo "Running Valgrind on $binary..."
# Run Valgrind with specified options, save output to log file
valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes \
--verbose "$binary" 2321 &> "$log_file"
# Check if any errors were reported
if grep -q "ERROR SUMMARY: [^0]" "$log_file"; then
echo "Valgrind reported errors for daa (see $log_file)"
else
echo "No errors detected for daa."
fi
echo "Valgrind checks completed. Logs are saved in $LOG_DIR."
ps aux | grep tpm_server | grep -v grep | awk '{print $2}' | xargs kill -9
echo "Killed tpm_server process."