Commit Graph

137 Commits

Author SHA1 Message Date
Ed Bartosh
3e12ebb6d2 e2e-iaa: increase test timeout 2022-11-17 13:20:08 +02:00
Oleg Zhurakivskyy
a4a2aae88c e2e: Deploy NFD in BeforeSuite
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2022-11-09 14:25:31 +02:00
Oleg Zhurakivskyy
ad68e998b1 iaa: Switch to device type "iaa"
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2022-10-28 10:51:18 +03:00
Hyeongju Johannes Lee
3c8fe3adfa e2e: add securityContext check to see if rootfs is read-only
Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2022-10-13 15:39:59 +03:00
Hyeongju Johannes Lee
11b04425c2 dlb: add initcontainer to plugin
initcontainer enables vfs and configures vfs
 - only first pf is used to configure a vf
 - only one vf is configured from the pf
add dlb-initcontainer kustomize overlay
update CRD to have initImage
implment operator to run initcontainer
update e2e test to run initcontainer overlay
update envtest to test initimage

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2022-10-06 17:11:03 +03:00
Ed Bartosh
d4025ed64d
Merge pull request #1127 from ozhuraki/e2e-qat
qat: Add e2e tests
2022-09-03 08:11:42 +03:00
Oleg Zhurakivskyy
c142f6864f qat: Add e2e tests
Closes #950

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-09-02 13:11:45 +03:00
Jason Culligan
b21152c83f e2e: update testssl.parameters and logging
Added testssl.sh switches to add more tests

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
Signed-off-by: Jason Culligan <jason.culligan@intel.com>
2022-09-01 07:45:22 +03:00
Tuomas Katila
2fb11eccba e2e: Remove unnecessary namespace arguments from KubectlOrDie calls
Signed-off-by: Tuomas Katila <tuomas.katila@intel.com>
2022-08-31 17:09:47 +03:00
Mikko Ylinen
611b4d3a18
Merge pull request #1077 from ozhuraki/envtest-crud-and-upgrade
envtest: Fix upgrade test fail when the tests for CRUD operations fail
2022-08-24 08:58:30 +03:00
Mikko Ylinen
78cbebf20f e2e: fix SGX test flakiness
Due to a regression in k8s.io@v1.25, WaitForPodsWithLabelRunningReady()
ignored user provided timeout and defaulted to 60s. In some cases, NFD
needs more than that to the tests fail.

Workaround the problem by moving to use WaitForPodsRunningReady() with
minPods=2 (nfd-master and at least one nfd-worker).

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-08-23 20:01:01 +03:00
Oleg Zhurakivskyy
b6934336a3 envtest: Fix upgrade test fail when the tests for CRUD operations fail
Closes #912

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2022-08-23 19:29:45 +03:00
Mikko Ylinen
9130c5e28e DROP: increase e2e-sgx timeout
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-08-15 13:55:17 +03:00
Mikko Ylinen
50b985dde5 bump go mod version to 1.18 and move to k8s.io v1.25.0-rc.0
the e2e framework in v1.25 also reguires us to move to gingko/v2
so make that change too.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-08-15 13:54:02 +03:00
Mikko Ylinen
c1056e6b2f fixup: testssl: check SWEET32
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-06-20 21:22:40 +03:00
Mikko Ylinen
f9ca36cc26 set TLSMinVersion for webhook servers
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-06-20 19:04:50 +03:00
Ed Bartosh
7f415f54a1 e2e-dlb: make tests working in Simics
- used different pods for PF and VF workloads
- increased waiting timeout to 200s
- used 'epoll' waiting mode for test apps
- decreased amount of packets from 128 to 8 for test apps
- output pod logs
- done small code optimisations

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2022-06-17 14:22:33 +03:00
Ed Bartosh
43da11571b Makefile: add e2e-dlb target
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2022-06-09 20:18:56 +03:00
Oleg Zhurakivskyy
f1ec14d106 iaa: Add e2e tests
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2022-06-09 15:00:25 +03:00
Oleg Zhurakivskyy
710aaaee23 dsa: Add e2e tests
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2022-06-01 11:25:12 +03:00
Mikko Ylinen
8d20c62833 e2e: expect test workloads to finish successfully
WaitForFinish waits for pod to finish running, regardless of
success or failure. WaitForSuccess waits for pod to succeed
which is what we expect from our test workloads that try
to use the devices.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-05-19 14:14:11 +03:00
Mikko Ylinen
cbc521e505 move to k8s.io v1.24.0-rc.1
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-04-27 09:26:07 +03:00
Mikko Ylinen
3b857f878a e2e: utils: fix WaitForNodesWithResource timeout
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-04-26 13:55:22 +03:00
Hyeongju Johannes Lee
d3c8063ff3 qat: implement preferredAllocation policies
Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2022-04-07 14:14:00 +03:00
Mikko Ylinen
c34eb51ebe
Merge pull request #915 from hj-johannes-lee/qat-initimage
qat: add initimage to plugin
2022-03-31 17:26:00 +03:00
Hyeongju Johannes Lee
df419b3a82 qat: add initimage to plugin
Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2022-03-30 13:46:42 -07:00
Mikko Ylinen
cfd5d8e3da envtest: drop deprecated strings.Title()
Go 1.18 deprecates strings.Title() which triggers linter
failures for us. Move to use "cases" as the recommended
replacement (to keep the existing functionality).

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-03-29 08:03:18 +03:00
Hyeongju Johannes Lee
8ca5200c43 envtest: add more tests for DaemonSets
Add tests if args, initImage, nodeSelector are set as intended

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2022-03-10 17:03:33 +02:00
Ed Bartosh
6b27cf1f7c Implement IAA plugin, operator, demo
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2022-03-04 15:58:42 +02:00
Ed Bartosh
d4966e089c
Merge pull request #857 from ozhuraki/operator-upgrade
operator: Support upgrade of plugins
2022-02-18 17:55:53 +02:00
Oleg Zhurakivskyy
9475b43f55 envtest: Add tests for upgrade
Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2022-02-18 12:52:55 +02:00
Mikko Ylinen
72c4552253 deployments: move SGX NFD config to an NFD kustomize overlay
Start using the newly created NodeFeatureRule configs with SGX.
This allows to drop the custom worker config.

Additionally, split the example NFD deployment into two steps

1) plain NFD (+SGX json patches)
2) NodeFeatureRule creation

NodeFeatureRule creation is not guaranteed to succeed when it's
part of the same kustomization with the CRD creation. Users may
also have NFD already running so allowing 2) alone works better
in that scenario.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-02-18 11:17:57 +02:00
Mikko Ylinen
b01b4c8550 e2e/sgx: increase epc registration check timeout
The NFD worker sleep timout is 60s by default so there are changes
we'll miss getting the sgx.intel.com/epc extended resource registered
before the timeout.

Increase the timeout so that at least two NFD worker labeling rounds
are included.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-01-13 10:51:18 +02:00
Ukri Niemimuukko
5e3f26f25b add device check to gpu e2e test and e2e-gpu makefile target
Signed-off-by: Ukri Niemimuukko <ukri.niemimuukko@intel.com>
2022-01-11 17:56:42 +02:00
Eduard Bartosh
f01fb6e8c6 e2e/sgx: refer resources in the error messages
Signed-off-by: Eduard Bartosh <eduard.bartosh@intel.com>
2021-12-23 00:47:11 +02:00
Ed Bartosh
a695a5937f
Merge pull request #818 from mythi/PR-2021-075
e2e: sgx: fix NFD and webhook deployment
2021-12-22 12:18:38 +02:00
Mikko Ylinen
7c381097c0 qat: add kustomize overlay for e2e tests
e2e combines all existing overlays: apparmor, debug, and sriov_numfs.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2021-12-22 11:51:32 +02:00
Mikko Ylinen
cdd7ca8376 e2e: split NFD and SGX webhook away from SGX plugin deployment
Previously, the SGX plugin deployment pulled in NFD and
SGX webhook as well. This triggered kustomize issues when
trying to get everything under the same namespace.

This commit splits the three deployments into their own steps.
It allows to keep the static parts part of [Before|After]Each
and helps to build SGX plugin/application test cases more
easily.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2021-12-22 11:22:14 +02:00
Mikko Ylinen
8784eb057c sgx: fix volumeMounts mutation
The changes made by addVolumeMount() were overriden when the
intermediate container variable was assigned to the pod and
thus the volumeMount changes were lost.

Fix it by making the volumeMount changes to the intermediate
container that is then assigned to the final pod.

Also, make the latest e2e test case to use the
checkMutatedVolumes() helper and fix the illegal Volume
name.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
2021-12-21 13:32:50 +02:00
Ismo Puustinen
f6a107a9c1 sgx-webook: add tests for Volume and VolumeMount creation.
Signed-off-by: Ismo Puustinen <ismo.puustinen@intel.com>
2021-12-20 02:41:30 -08:00
Ed Bartosh
cec004c398 lint: enable wsl check
Fixes: #392

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2021-12-17 11:48:48 +02:00
Mikko Ylinen
1c3017dd39 e2e: wait longer in DeployWebhook
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2021-12-09 18:01:33 +02:00
Ed Bartosh
23193879c9
Merge pull request #770 from hj-johannes-lee/e2e-dlb
e2e: add dlb test
2021-12-02 12:51:34 +02:00
Hyeongju Johannes Lee
91e1877180 e2e: add dlb test
Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2021-12-02 01:14:17 -08:00
Ed Bartosh
b1c52850fe
Merge pull request #760 from hj-johannes-lee/envtest
envtest: add DlbDevicePlugin tests
2021-11-29 14:46:03 +02:00
Hyeongju Johannes Lee
f6c3f17549 ci: use 1.22.1 ver of K8s instead of 1.20.2
Update suite_test to support kubernetes 1.21+ version

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2021-11-26 05:02:09 -08:00
Hyeongju Johannes Lee
66fd91a695 envtest: add DlbDevicePlugin tests
Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2021-11-25 09:23:08 -08:00
Ed Bartosh
c4d5fea228 e2e: run FPGA tests in CI environment
- don't delete deployment as it may not exist
- set restart policy to Never to avoid running the same tests many times

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2021-11-02 11:52:06 +02:00
Ed Bartosh
cce590ee50 e2e: increase WaitForFinish timeout
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2021-10-21 09:22:04 +03:00
Ed Bartosh
9360745ae5 e2e: increase WaitForSuccess timeout
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2021-10-20 11:48:47 +03:00
Ed Bartosh
a6078aa65d e2e: increase WaitForPodsWithLabelRunningReady timeout
Current timeout is too small and causes test failures
in CI environment.

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2021-10-20 11:46:58 +03:00
Mikko Ylinen
caa6f260dd e2e: qat: use sriov_numvfs overlay in tests
To simplify the e2e node setup, change the QAT tests to deploy with
the sriov_numvfs overlay.

Moreover, as we are seeing the vfio-pci driver becoming built-in and
requiring opt-in parameters depending on the kernel version, it's
better to move the vfio-pci initcontainer step(s) to kernel cmdline/
modules-load.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2021-10-19 14:32:06 +03:00
Mikko Ylinen
e5c15e4004 e2e: fix securityContext checks
Unset fields are not 'false' but a nil pointer. Fix the
securityContext checks to take this into account.

Fixes: "e2e: add a test to check that plugins ReadOnlyRootfs is enabled"

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2021-10-19 14:30:27 +03:00
Ed Bartosh
5af85a785f qat: copy annotations
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2021-09-22 11:27:24 +03:00
Dmitry Rozhkov
941b19b4aa e2e: fix linter warnings 2021-09-06 10:17:31 +03:00
Dmitry Rozhkov
155ad68801
Merge pull request #682 from mythi/PR-2021-041
e2e improvements
2021-09-03 14:38:00 +03:00
Hyeongju Johannes Lee
4bc70ac544 Add goerr113 linter check
Add goerr113 lintercheck
Fix the usage of fmt.Errorf() by wrapping errors
Fix the usage of errors.New()
2021-09-03 11:02:14 +03:00
Mikko Ylinen
8c6b8ceb69 e2e: add a test to check that plugins ReadOnlyRootfs is enabled
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2021-08-31 15:20:23 +03:00
Mikko Ylinen
9b687401b8 e2e: add tests for SGX Admission Webhook
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2021-08-31 15:20:23 +03:00
Mikko Ylinen
b66b217f06 move to k8s.io v1.21.1 and controller-runtime v0.9.0
with the updated controller-runtime, new ginkgo is pulled in and it
warns about a few to-be-deprecated functions. This commit fixes those
too as they were rather small changes.

Smalle delay is added AfterEach() device plugin controller test as
they became flaky after the envtest updates (DaemonSet deletion failed).

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2021-06-09 16:36:05 +03:00
Mikko Ylinen
facb4214a2 tree-wide: drop deprecated io/ioutil
Go 1.16 release notes announced the deprecation of io/ioutil [1]. It's easy
for us to move to use what is was recommended so just do it.

[1] https://golang.org/doc/go1.16#ioutil

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2021-06-02 13:41:15 +03:00
Mikko Ylinen
37618d4f85 operator: move deviceplugin/v1 CRDs to cluster scope
The device plugins daemonsets are cluster wide and currently only
one device plugin instance per device is possible so making the
corresponding deviceplugin/v1 CRDs non-namespaced (i.e., scope: cluster)
fits better.

Previously, the device plugin daemonset was deployed in the same
namespace as the CR for that device but with the cluster scoped CRDs
we default to use the same namespace as the operator, unless overridden
via DEVICEPLUGIN_NAMESPACE env variable or a command line parameter
to operator manager deployment.

Three additional changes in this commit:
- enable DSA envtest tests
- update controller-runtime to v0.8.1
- change device plugin envtest suite to use klog/v2

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2021-02-11 11:41:47 +02:00
Ed Bartosh
884f8e3dfe operator: add DSA support
Fixes: #443

Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2021-02-09 02:13:27 +02:00
Dmitry Shmulevich
3c3a3d1145 added implementation of EPC extended resource advertiser
Signed-off-by: Dmitry Shmulevich <dmitry.shmulevich@gmail.com>
2021-02-04 17:35:17 -08:00
Mikko Ylinen
0892a34705 move to k8s.io v1.20.x and klog/v2 v2.4.0
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2021-01-21 15:34:39 +02:00
Dmitry Rozhkov
5f0da56045 Upgrade to k8s v1.19.3 2020-11-10 16:09:20 +02:00
Mikko Ylinen
161298190f sgx: make SGX NFD kustomization overlay independent
With the addition of SGX webhook in the operator, full SGX stack
depends on having the operator deployed first. SgxDevicePlugin CRD
is set to get intel-sgx-plugin and intel-sgx-initcontainer deployed
by the operator.

As a pre-requisite, node-feature-discovery must be deployed but it
is currently deployed via sgx_plugin kustomization overlay only.

It's better to allow NFD with the SGX specific settings deployed with
a kustomization of its own.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2020-10-23 12:44:36 +03:00
Mikko Ylinen
883775c973 SGX: add basic e2e tests
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2020-09-21 13:19:52 +03:00
Mikko Ylinen
33a4f8f546 sgx: add SgxDevicePlugin CRD and admission webhook
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2020-09-10 15:31:26 +03:00
Dmitry Rozhkov
be713f1c8b lint: enable errcheck 2020-08-28 16:14:14 +03:00
Dmitry Rozhkov
200e2f8181 operator: add simple FPGA operator combined with FPGA webhook 2020-08-18 17:32:23 +03:00
Ed Bartosh
4794072273
Merge pull request #422 from rojkov/fpga-kubebuilder
fpga webhook: reimplement to use kubebuilder framework
2020-08-18 13:31:31 +03:00
Dmitry Rozhkov
a62c6f7d5e fpga webhook: reimplement to use kubebuilder framework
Simplify upgrade procedure to newer versions of kubernetes by relying on the
kubebuilder framework rather than using codegen directly.

Closes #377
2020-08-17 12:09:03 +03:00
Ed Bartosh
49d3514e46 e2e: fix FPGA tests
Fixes: #419
2020-07-02 23:12:34 +03:00
Dmitry Rozhkov
e87d94d4fb fpga: finalize plugin kustomization
closes #318
2020-07-01 11:57:45 +03:00
Mikko Ylinen
2f16509fe3
Merge pull request #376 from rojkov/operator-v3
operator: initial version with gpu and qat controllers
2020-06-25 15:49:49 +03:00
Dmitry Rozhkov
6b2fa0a264 operator: initial version with gpu and qat controllers 2020-06-25 13:48:41 +03:00
Dmitry Rozhkov
7177409f19 fpga webhook: rework deployment to use kustomize
Contributes to #318
2020-06-23 15:53:36 +03:00
Dmitry Rozhkov
70f862f2aa add golangci linter
In this initial commit the following checks are disabled due to
excessive amount of changes required:
- dupl (duplicate code)
- funlen (function length)
- goerr113 (errors handling expressions)
- gomnd (magic numbers)
- gosec (security)
- nakedret (naked returns)
- wsl (forces to use empty lines)
- errcheck (checking for unchecked errors)
- staticcheck (static analysis)
2020-06-08 14:01:13 +03:00
Ed Bartosh
8d6afae23d fpga: update e2e tests to work with mode-less webhook
Signed-off-by: Ed Bartosh <eduard.bartosh@intel.com>
2020-04-29 11:59:50 +03:00
Dmitry Rozhkov
99fcb69d33 fpga: compress fpga AF resource names 2020-04-29 11:59:50 +03:00
Dmitry Rozhkov
6c2eacfae5 webhook: remove mode of operation
fpga: make AFU resource name 63 char long

webhook: drop mode from README

webhook: extend mappings description

webhook: tighten CRD definitions

webhook: drop mapping to non-existing afuId

explicitly state mappings names can be in any format

use consistent terminology across fpga webhook and plugin
2020-04-22 13:55:43 +03:00
Dmitry Rozhkov
8fc187f4d8 move to k8s v1.18.2 release
Also fix the plugins and e2e tests
2020-04-17 12:40:18 +03:00
Ed Bartosh
3cb9bd228f implement e2e tests for FPGA plugin
implemented e2e tests for preprogrammed(af) and
orchestrated(region) plugin modes.
2020-04-09 17:04:13 +03:00
Dmitry Rozhkov
e1ccdf5ae7 e2e: add enable-experimental feature gate enabling QAT out-of-tree driver test 2020-02-13 14:51:44 +02:00
Dmitry Rozhkov
43af3a054b e2e test: reimplement with K8s testing framework
Also add a test for the QAT device plugin in kernel mode.

Contributes to #253
2020-02-13 14:51:44 +02:00
Dmitry Rozhkov
0d538383bf add e2e tests for fpga_admissionwebhook
The tests can be run with

  $ make test-e2e

Closes #158
2020-01-17 14:23:47 +02:00