mirror of
https://github.com/asterinas/asterinas.git
synced 2025-06-20 13:06:33 +00:00
19 lines
400 B
Bash
Executable File
19 lines
400 B
Bash
Executable File
#!/bin/sh
|
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
set -e
|
|
|
|
# Function to stop the guest VM
|
|
stop_guest() {
|
|
echo "Stopping guest VM..."
|
|
pgrep qemu | xargs kill
|
|
}
|
|
|
|
# Trap EXIT signal to ensure guest VM is stopped on script exit
|
|
trap stop_guest EXIT
|
|
|
|
# Run apache bench
|
|
/usr/local/redis/bin/redis-benchmark -n 100000 -c 20 -t get
|
|
|
|
# The trap will automatically stop the guest VM when the script exits |