-
Notifications
You must be signed in to change notification settings - Fork 0
91 lines (88 loc) · 2.92 KB
/
integration.yaml
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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# SPDX-FileCopyrightText: The vmnet-helper authors
# SPDX-License-Identifier: Apache-2.0
---
name: Integration
on:
pull_request:
push:
branches:
- main
jobs:
example:
name: Example
# macos-15 (arm64) does not support nested virtualization yet.
runs-on: macos-13
strategy:
fail-fast: false
matrix:
driver: [vfkit, qemu]
connection: [fd, socket]
exclude:
- driver: qemu
connection: socket
steps:
- name: Host info
run: |
uname -a
sw_vers
ifconfig
- name: Install requirements
run: brew install meson qemu cdrtools coreutils tree
- name: Inspect qemu
# Looking up both prefixes to make it eaier to port to arm64 in the future.
run: |
tree -h /usr/local/share/qemu || true
tree -h /opt/homebrew/share/qemu || true
- name: Install vfkit
if: matrix.driver == 'vfkit'
run: |
curl -LO https://github.com/crc-org/vfkit/releases/download/v0.6.0/vfkit
sudo install vfkit /usr/local/bin/
- name: Checkout source
uses: actions/checkout@v4
- name: Build vmnet-helper
run: |
meson setup build
meson compile -C build
- name: Install vmnet-helper
run: |
sudo meson install -C build
sudo install -m 0640 sudoers.d/vmnet-helper /etc/sudoers.d/
- name: Ensure bootpd is enabled
run: |
fw=/usr/libexec/ApplicationFirewall/socketfilterfw
sudo $fw --remove /usr/libexec/bootpd
sudo $fw --add /usr/libexec/bootpd
sudo $fw --unblock /usr/libexec/bootpd
- name: Ensure public key
run: |
ssh-keygen -q -N "" </dev/zero
- name: Create virtual env
run: |
python3 -m venv .venv
.venv/bin/pip install pyyaml
- name: Start example VM
run: |
source .venv/bin/activate
./example test --driver ${{ matrix.driver }} --connection ${{ matrix.connection }} -v &
vm="$HOME/.vmnet-helper/vms/test"
if ! timeout 5m bash -c "until test -f "$vm/ip-address"; do sleep 3; done"; then
echo >&2 "Timeout waiting for $vm/ip-address"
exit 1
fi
- name: Inspect example VM
if: always()
run: |
tree -h ~/.vmnet-helper
head -n 500 ~/.vmnet-helper/vms/test/*.log /var/db/dhcpd_leases || true
- name: Prepare example VM
run: |
vm_ip=$(cat $HOME/.vmnet-helper/vms/test/ip-address)
ssh_cmd="ssh -o StrictHostKeyChecking=no ubuntu@$vm_ip"
$ssh_cmd sudo apt-get update -y
$ssh_cmd sudo DEBIAN_FRONTEND=noninteractive apt-get install -y iperf3
$ssh_cmd sudo systemctl start iperf3.service
- name: Run iperf3
run: |
vm_ip=$(cat $HOME/.vmnet-helper/vms/test/ip-address)
iperf3-darwin -c $vm_ip