Repository navigation
Added integration test scaffold & local dev environment #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 16 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
8799ad2
KVM
lukasfrank 615194b
install ch
lukasfrank 5babc21
Init test
lukasfrank 15937ca
Merge branch 'main' into check/kvm
lukasfrank fa9f1e1
Tests
lukasfrank 1cbee6b
Fix go versions
lukasfrank 007852c
DEV VM
lukasfrank c0bd838
DEV VM
lukasfrank b3e1343
Fix format
lukasfrank aeb8ecf
handle no socked found
lukasfrank 6d6738c
wait for event
lukasfrank efc0a2f
fix shutdown of controllers
lukasfrank 1e366eb
fix socket permission
lukasfrank eddc592
Minimal test
lukasfrank 9fd43fa
Add new lines to the file endings
friegger ba89958
Merge remote-tracking branch 'origin/main' into check/kvm
friegger 4850535
PR Review
lukasfrank File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,84 @@ | ||
| name: Run integration tests | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [labeled, synchronize, reopened] | ||
| paths-ignore: | ||
| - 'docs/**' | ||
|
|
||
| jobs: | ||
| integration-tests: | ||
| runs-on: ubuntu-22.04 | ||
|
|
||
| if: contains(github.event.pull_request.labels.*.name, 'integration-tests') | ||
|
|
||
| steps: | ||
| - name: Checkout repository | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Setup go | ||
| uses: actions/setup-go@v6 | ||
| with: | ||
| go-version-file: 'go.mod' | ||
|
|
||
| - name: Install dependencies | ||
| run: | | ||
| set -x | ||
|
|
||
| if [ ! -e /dev/kvm ]; then | ||
| echo "KVM not available" | ||
| exit 1 | ||
| fi | ||
|
|
||
| sudo apt-get update -qq | ||
| sudo apt-get install -y --no-install-recommends \ | ||
| ca-certificates libc-bin gcc cpu-checker | ||
| sudo update-ca-certificates | ||
| sudo rm -rf /var/lib/apt/lists | ||
|
|
||
| # curl -L "https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/v51.1/cloud-hypervisor-static-aarch64" -o "cloud-hypervisor" | ||
| # curl -L "https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/v51.1/ch-remote-static-aarch64" -o "ch-remote" | ||
|
lukasfrank marked this conversation as resolved.
Resolved
|
||
|
|
||
| sudo curl -L "https://github.com/cloud-hypervisor/cloud-hypervisor/releases/download/v51.1/cloud-hypervisor-static" -o "/usr/local/bin/cloud-hypervisor" | ||
|
|
||
| # sudo curl -L "https://github.com/cloud-hypervisor/rust-hypervisor-firmware/releases/download/0.5.0/hypervisor-fw-aarch64" -o "/usr/local/bin/hypervisor-fw" | ||
| sudo curl -L "https://github.com/cloud-hypervisor/rust-hypervisor-firmware/releases/download/0.5.0/hypervisor-fw" -o "/usr/local/bin/hypervisor-fw" | ||
|
|
||
| sudo chmod a+x /usr/local/bin/cloud-hypervisor | ||
| # chmod a+x /usr/local/bin/ch-remote | ||
|
|
||
| # Create chp group and user | ||
| if ! getent group chp > /dev/null 2>&1; then | ||
| sudo groupadd -g 65532 chp | ||
| fi | ||
| if ! getent passwd chp > /dev/null 2>&1; then | ||
| sudo useradd -u 65532 -g chp -s /sbin/nologin -M -d /nonexistent chp | ||
| fi | ||
|
|
||
| sudo usermod -aG kvm chp | ||
|
|
||
| # Create storage directory | ||
| sudo mkdir -p /var/lib/chp | ||
| sudo mkdir -p /run/chp/ch | ||
| sudo chown chp:chp /var/lib/chp | ||
| sudo chmod 0755 /var/lib/chp | ||
| sudo chown chp:chp /run/chp/ch | ||
| sudo chmod 0755 /run/chp/ch | ||
| echo "CH_SOCKET_DIR=/run/chp/ch/" >> $GITHUB_ENV | ||
|
|
||
| sudo -u chp /usr/local/bin/cloud-hypervisor --api-socket /run/chp/ch/01.sock -v & | ||
| sudo -u chp /usr/local/bin/cloud-hypervisor --api-socket /run/chp/ch/02.sock -v & | ||
|
|
||
| sleep 2 | ||
|
|
||
| # Make sockets accessible to runner | ||
| sudo chmod o+rw /run/chp/ch/*.sock | ||
|
|
||
| sudo ls -la /run/chp/ch | ||
|
|
||
|
|
||
| - name: Run integration tests | ||
| run: | | ||
| sudo kvm-ok | ||
| sudo /usr/local/bin/cloud-hypervisor --version | ||
| make integration-tests | ||
This file contains hidden or 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 hidden or 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 hidden or 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
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.