Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions test/lima.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
images:
- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-amd64.img"
arch: "x86_64"
- location: "https://cloud-images.ubuntu.com/releases/24.04/release/ubuntu-24.04-server-cloudimg-arm64.img"
arch: "aarch64"
cpus: 2
memory: "2g"
plain: true
networks:
- socket: /var/run/socket_vmnet
provision:
- mode: system
script: |
#!/bin/bash
set -eux -o pipefail
command -v ipref3 >/dev/null 2>&1 && exit 0
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y iperf3
Comment thread
nirs marked this conversation as resolved.
probes:
- description: "iperf installed"
script: |
#!/bin/bash
set -eux -o pipefail
if ! timeout 30s bash -c "until command -v iperf3 >/dev/null 2>&1; do sleep 3; done"; then
echo >&2 "iperf3 is not installed yet"
exit 1
fi
hint: |
See "/var/log/cloud-init-output.log" in the guest
76 changes: 76 additions & 0 deletions test/perf.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
#!/bin/bash
set -e
cd "$(dirname "$0")"

TIME=${2:-30}

server_address() {
limactl shell server ip -j -4 addr show dev lima0 | jq -r '.[0].addr_info[0].local'
}

create() {
limactl create --name server --tty=false lima.yaml &
limactl create --name client --tty=false lima.yaml &
wait
}

host-to-vm() {
limactl start server
nohup limactl shell server iperf3 --server --daemon
iperf3-darwin --client $(server_address) --length 1m --time $TIME
limactl stop server
}

host-to-vm-2() {
limactl start server &
limactl start client &
wait
nohup limactl shell server iperf3 --server --daemon
Comment thread
nirs marked this conversation as resolved.
iperf3-darwin --client $(server_address) --length 1m --time $TIME
limactl stop server
limactl stop client
}

vm-to-vm() {
limactl start server &
limactl start client &
wait
nohup limactl shell server iperf3 --server --daemon
addr=$(server_address)
limactl shell client iperf3 --client $addr --length 1m --time $TIME
limactl stop server
limactl stop client
}

delete() {
limactl delete -f server
limactl delete -f client
}

case $1 in
create)
create
;;
host-to-vm)
host-to-vm
;;
host-to-vm-2)
host-to-vm-2
;;
vm-to-vm)
vm-to-vm
;;
delete)
delete
;;
*)
echo "Usage $0 command"
echo
echo "Available commands:"
echo " create create test vms"
echo " delete delete test vms"
echo " host-to-vm [TIME] test host to vm performance"
echo " host-to-vm-2 [TIME] test host to vm performance with 1 extra vm"
echo " vm-to-vm [TIME] test vm to vm performance"
;;
esac