-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Ondra Machacek <[email protected]>
- Loading branch information
1 parent
b842aee
commit 0c7b9c9
Showing
13 changed files
with
623 additions
and
6 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 |
---|---|---|
@@ -1 +1 @@ | ||
rhcos-live.x86_64.iso | ||
**/*iso |
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 |
---|---|---|
|
@@ -15,6 +15,11 @@ jobs: | |
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
|
||
- name: Setup libvirt | ||
run: | | ||
sudo apt update | ||
sudo apt install libvirt-dev | ||
- name: Prepare | ||
run: | | ||
make generate | ||
|
@@ -36,6 +41,11 @@ jobs: | |
- name: Check out code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup libvirt | ||
run: | | ||
sudo apt update | ||
sudo apt install libvirt-dev | ||
- name: Run golangci-lint | ||
uses: golangci/[email protected] | ||
with: | ||
|
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,63 @@ | ||
name: Run e2e test | ||
|
||
on: | ||
workflow_dispatch: | ||
push: | ||
branches: [main] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout the code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install kubectl | ||
uses: azure/setup-kubectl@v4 | ||
|
||
- name: Create k8s Kind Cluster | ||
uses: helm/kind-action@v1 | ||
with: | ||
cluster_name: kind | ||
|
||
- name: Setup libvirt | ||
run: | | ||
sudo apt update | ||
sudo apt install sshpass libvirt-dev libvirt-daemon libvirt-daemon-system | ||
sudo systemctl restart libvirtd | ||
- name: Deploy dependencies | ||
run: | | ||
kubectl create deployment registry --image=docker.io/registry | ||
kubectl create deployment vcsim --image=docker.io/vmware/vcsim | ||
kubectl wait --for=condition=Ready pods --all --timeout=240s | ||
kubectl port-forward --address 0.0.0.0 deploy/registry 5000:5000 & | ||
kubectl port-forward --address 0.0.0.0 deploy/vcsim 8989:8989 & | ||
- name: Build agent container | ||
run: | | ||
export REGISTRY_IP=$(ip addr show eth0 | grep -oP '(?<=inet\s)\d+\.\d+\.\d+\.\d+') | ||
export MIGRATION_PLANNER_AGENT_IMAGE="${REGISTRY_IP}:5000/agent" | ||
cat << EOF | sudo tee -a /etc/containers/registries.conf.d/myregistry.conf | ||
[[registry]] | ||
location = "${REGISTRY_IP}:5000" | ||
insecure = true | ||
EOF | ||
make migration-planner-agent-container | ||
podman push $MIGRATION_PLANNER_AGENT_IMAGE | ||
- name: Deploy | ||
run: | | ||
export REGISTRY_IP=$(ip addr show eth0 | grep -oP '(?<=inet\s)\d+\.\d+\.\d+\.\d+') | ||
export MIGRATION_PLANNER_AGENT_IMAGE="${REGISTRY_IP}:5000/agent" | ||
make deploy-on-kind | ||
kubectl wait --for=condition=Ready pods --all --timeout=240s | ||
kubectl port-forward --address 0.0.0.0 service/migration-planner-agent 7443:7443 & | ||
kubectl port-forward --address 0.0.0.0 service/migration-planner 3443:3443 & | ||
- name: Run test | ||
run: | | ||
sudo make integration-test PLANNER_IP=$(ip addr show eth0 | grep -oP '(?<=inet\s)\d+\.\d+\.\d+\.\d+') |
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
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
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,20 @@ | ||
# Running integration tests | ||
The integration tests are executed against deployed `planner-api`. The planner api can be deployed | ||
as container or running as binary. | ||
|
||
## Requiremets | ||
|
||
``` | ||
dnf install -y libvirt-devel | ||
sudo usermod -a -G libvirt $USER | ||
``` | ||
|
||
Running planner api, either as container or binary: | ||
``` | ||
bin/planner-api | ||
``` | ||
|
||
## Executing tests | ||
``` | ||
PLANNER_IP=1.2.3.4 make integration-tests | ||
``` |
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,34 @@ | ||
<domain type='kvm'> | ||
<name>coreos-vm</name> | ||
<memory unit='MiB'>4096</memory> | ||
<vcpu placement='static'>2</vcpu> | ||
<metadata> | ||
<libosinfo:libosinfo xmlns:libosinfo="http://libosinfo.org/xmlns/libvirt/domain/1.0"> | ||
<libosinfo:os id="http://fedoraproject.org/coreos/stable"/> | ||
</libosinfo:libosinfo> | ||
</metadata> | ||
<os> | ||
<type arch='x86_64' machine='pc-q35-6.2'>hvm</type> | ||
<boot dev='cdrom'/> | ||
</os> | ||
<cpu mode='host-passthrough' check='none' migratable='on'/> | ||
<features> | ||
<acpi/> | ||
<apic/> | ||
</features> | ||
<devices> | ||
<emulator>/usr/bin/qemu-system-x86_64</emulator> | ||
<disk type='file' device='cdrom'> | ||
<driver name='qemu' type='raw'/> | ||
<source file='/tmp/agent.iso'/> | ||
<target dev='sda' bus='sata'/> | ||
<readonly/> | ||
</disk> | ||
<interface type='network'> | ||
<source network='default'/> | ||
<model type='virtio'/> | ||
</interface> | ||
<graphics type='vnc' port='-1'/> | ||
<console type='pty'/> | ||
</devices> | ||
</domain> |
Oops, something went wrong.