-
Notifications
You must be signed in to change notification settings - Fork 109
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
114d3f4
commit 38c75fd
Showing
6 changed files
with
5,118 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Pull request integration tests on VM | ||
|
||
on: | ||
push: | ||
branches: [ 'main', 'release-*' ] | ||
pull_request: | ||
branches: [ 'main', 'release-*' ] | ||
|
||
jobs: | ||
test: | ||
name: test | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
go: [ '1.22' ] | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Go | ||
uses: actions/setup-go@v3 | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- name: Clean up disk space | ||
run: | | ||
docker system prune -af | ||
docker volume prune -f | ||
- name: Install QEMU | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y --no-install-recommends qemu-utils qemu-system-x86 | ||
- name: Run VM integration tests | ||
run: | | ||
sudo make -C test/vm | ||
sudo make -C test/vm change-owner | ||
timeout-minutes: 60 | ||
- name: Upload integration test logs | ||
uses: actions/upload-artifact@v3 | ||
if: always() | ||
with: | ||
name: Test Logs | ||
path: | | ||
testoutput/*.log | ||
testoutput/kind | ||
- name: Report coverage | ||
uses: codecov/codecov-action@v4 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
with: | ||
file: ./testoutput/itest-covdata.txt | ||
flags: integration-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
FROM alpine:latest | ||
|
||
ARG target=run-integration-test-vm | ||
|
||
RUN apk update | ||
RUN apk add --no-cache openrc | ||
RUN apk add --no-cache go | ||
RUN apk add --no-cache docker | ||
RUN apk add --no-cache docker-compose | ||
RUN apk add --no-cache git | ||
RUN apk add --no-cache make | ||
RUN apk add --no-cache agetty | ||
RUN apk add --no-cache openssh | ||
RUN apk add --no-cache shadow | ||
RUN ssh-keygen -A | ||
|
||
RUN echo "root:root" | chpasswd | ||
RUN sed -i 's/^#PermitRootLogin .*/PermitRootLogin yes/' /etc/ssh/sshd_config | ||
|
||
RUN rc-update add localmount default | ||
RUN rc-update add docker default | ||
RUN rc-update add sshd default | ||
|
||
RUN echo ttyS0::respawn:/sbin/agetty --autologin root ttyS0 vt100 >> /etc/inittab | ||
|
||
RUN mkdir -p /overlay/upper/testoutput /overlay/work | ||
RUN mkdir /build | ||
RUN mkdir /beyla | ||
|
||
RUN cat <<EOF >> /etc/fstab | ||
beyla /beyla 9p trans=virtio,version=9p2000.L 0 0 | ||
overlay /build overlay lowerdir=/beyla,upperdir=/overlay/upper,workdir=/overlay/work 0 0 | ||
tmpfs /tmp tmpfs rw,nodev,nosuid 0 0 | ||
devpts /dev/pts devpts defaults 0 0 | ||
tmpfs /run tmpfs defaults,size=4G 0 0 | ||
testout /build/testoutput 9p trans=virtio,version=9p2000.L 0 0 | ||
EOF | ||
|
||
RUN echo export GOPATH=/run/go >> /etc/profile | ||
RUN echo export GOCACHE=/run/goache >> /etc/profile | ||
|
||
RUN echo beyla > /etc/hostname | ||
|
||
RUN cat <<EOF > /etc/network/interfaces | ||
auto eth0 | ||
iface eth0 inet dhcp | ||
|
||
auto lo | ||
iface lo inet loopback | ||
EOF | ||
|
||
RUN rc-update add networking default | ||
|
||
RUN cat <<EOF > /etc/init.d/startup | ||
#!/sbin/openrc-run | ||
|
||
command="sh /startup.sh" | ||
EOF | ||
|
||
RUN chmod +x /etc/init.d/startup | ||
|
||
RUN rc-update add startup default | ||
|
||
RUN cat <<EOF > /startup.sh | ||
#!/bin/sh | ||
|
||
cd /build && make $target | ||
poweroff | ||
EOF | ||
|
||
RUN chmod +x /startup.sh |
Oops, something went wrong.