Skip to content

Commit

Permalink
Merge pull request #462 from SchSeba/support_virtual_cluster
Browse files Browse the repository at this point in the history
virtual cluster e2e tests changes
  • Loading branch information
e0ne committed Sep 28, 2023
2 parents 2097c2a + 2c5fc1b commit 22c7a2e
Show file tree
Hide file tree
Showing 13 changed files with 770 additions and 22 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/virtual-cluster.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: sriov-operator-test
on: [pull_request]

jobs:
virtual-k8s-cluster:
name: k8s
runs-on: [sriov]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.20.x

- name: run test
run: make test-e2e-conformance-virtual-k8s-cluster-ci

- uses: actions/upload-artifact@v3
if: always()
with:
name: artifact
path: ./artifacts.tar.gz

virtual-ocp:
name: ocp
runs-on: [ ocp ]
steps:
- name: Check out code into the Go module directory
uses: actions/checkout@v2

- name: Set up Go 1.20
uses: actions/setup-go@v3
with:
go-version: 1.20.x

- name: run test
run: make test-e2e-conformance-virtual-ocp-cluster-ci

- uses: actions/upload-artifact@v3
if: always()
with:
name: artifact
path: ./artifacts.tar.gz
12 changes: 12 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,18 @@ deploy-setup-k8s: deploy-setup
test-e2e-conformance:
SUITE=./test/conformance ./hack/run-e2e-conformance.sh

test-e2e-conformance-virtual-k8s-cluster-ci:
./hack/run-e2e-conformance-virtual-cluster.sh

test-e2e-conformance-virtual-k8s-cluster:
SKIP_DELETE=TRUE ./hack/run-e2e-conformance-virtual-cluster.sh

test-e2e-conformance-virtual-ocp-cluster-ci:
./hack/run-e2e-conformance-virtual-ocp.sh

test-e2e-conformance-virtual-ocp-cluster:
SKIP_DELETE=TRUE ./hack/run-e2e-conformance-virtual-ocp.sh

test-e2e-validation-only:
SUITE=./test/validation ./hack/run-e2e-conformance.sh

Expand Down
1 change: 1 addition & 0 deletions deploy/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ data:
Intel_i40e_25G_SFP28: "8086 158b 154c"
Intel_i40e_10G_X710_SFP: "8086 1572 154c"
Intel_ixgbe_10G_X550: "8086 1563 1565"
Intel_ixgbe_82576: "8086 10c9 10ca"
Intel_i40e_X710_X557_AT_10G: "8086 1589 154c"
Intel_i40e_10G_X710_BACKPLANE: "8086 1581 154c"
Intel_i40e_10G_X710_BASE_T: "8086 15ff 154c"
Expand Down
1 change: 1 addition & 0 deletions deployment/sriov-network-operator/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ data:
Intel_i40e_25G_SFP28: "8086 158b 154c"
Intel_i40e_10G_X710_SFP: "8086 1572 154c"
Intel_ixgbe_10G_X550: "8086 1563 1565"
Intel_ixgbe_82576: "8086 10c9 10ca"
Intel_i40e_X710_X557_AT_10G: "8086 1589 154c"
Intel_i40e_10G_X710_BACKPLANE: "8086 1581 154c"
Intel_i40e_10G_X710_BASE_T: "8086 15ff 154c"
Expand Down
58 changes: 58 additions & 0 deletions doc/testing-virtual-machine.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
## E2E conformance test

It's possible to use QEMU to test the SR-IOV operator on a virtual kubernetes/openshift cluster.
Using the IGB model network driver allow to create virtual functions on the virtual system

## How to test

First you will need to enable the `DEV_MODE` via the operator environment variable.
Second step is to add the intel virtual nic to the supported nics configmap.

Another requirement is to load the vfio kernel module with no_iommu configuration. Example systemd:

```
[Unit]
Description=vfio no-iommu
Before=kubelet.service crio.service node-valid-hostname.service
[Service]
# Need oneshot to delay kubelet
Type=oneshot
ExecStart=/usr/bin/bash -c "modprobe vfio enable_unsafe_noiommu_mode=1"
StandardOutput=journal+console
StandardError=journal+console
[Install]
WantedBy=network-online.target
```

### Prerequisites
* kcli - deployment tool (https://github.com/karmab/kcli)
* virsh
* qemu > 8.1
* libvirt > 9
* podman
* make
* go

## Deploy the cluster

use the deployment [script](../hack/run-e2e-conformance-virtual-cluster.sh), this will deploy a k8s cluster
compile the operator images and run the e2e tests.

example:
```
SKIP_DELETE=TRUE make test-e2e-conformance-virtual-k8s-cluster
```

It's also possible to skip the tests and only deploy the cluster running

```
SKIP_TEST=TRUE SKIP_DELETE=TRUE make test-e2e-conformance-virtual-k8s-cluster
```

To use the cluster after the deployment you need to export the kubeconfig

```
export KUBECONFIG=$HOME/.kcli/clusters/virtual/auth/kubeconfig
```
Loading

0 comments on commit 22c7a2e

Please sign in to comment.