Commit Graph

120 Commits

Author SHA1 Message Date
Hyeongju Johannes Lee
03fd3ebaa8 e2e,sgx: use sgx-sdk-demo app instead of busybox
Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-07-26 17:22:44 +03:00
Hyeongju Johannes Lee
56df81a53e e2e,sgx: fix linter error: shadow declaration of err
rename err as errPodNotRunning so it does not shadow the previous
declaration

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-07-26 01:10:08 +03:00
Hyeongju Johannes Lee
81b386400f e2e,sgx: divide single It() to have multiple layers
Structure is as follows:
Describe("SGX plugin")
  BeforeEach("deploys plugin")
  Context("When device resources are available")
    BeforeEach("checks if resources are available")
    It("runs a pod requesting resources")
  AfterEach("undeploys plugin")

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-07-26 01:09:58 +03:00
Hyeongju Johannes Lee
bec3dd0148 e2e: remove duplicate code of testing with operator
move duplicate code for testing plugins using operator to
operator module

replace the code for deploying operator webhook in operator module
with the code using utils.Kubectl to make simple for undeploying

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-07-25 17:45:30 +03:00
Mikko Ylinen
52d3d4abd1 operator: fix setting QAT provisioning config volumeMount
setInitContainer() adds "init-sriov-numvfs" to initContainers
but uses initcontainerName constant to search where to add
the QAT configMap volumeMount. Fix by moving all code to use
the const.

It was also noticed in the controller logs that setting Pod
Volumes is not idempotent but broken DaemonSet gets created:

""intel-device-plugins-manager: Reconciler error "err="DaemonSet.apps
\"intel-qat-plugin\" is invalid: spec.template.spec.volumes[6].name:
Duplicate value: \"qat-config\"" controller="qatdeviceplugin"
controllerGroup="deviceplugin.intel.com"

Finally, change 'qat-config' to 'intel-qat-config-volume' to
better describe that it's a volume.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2023-05-25 06:43:18 +03:00
Mikko Ylinen
c37ac008b5
Merge pull request #1411 from hj-johannes-lee/PR-2023-012
qat,e2e: fix e2e test for cy
2023-05-16 13:39:39 +03:00
Hyeongju Johannes Lee
5119cc5263 qat,e2e: fix e2e test for cy
runTests=4 is dsa test, and it does not run anything for now.
So, use runTests=1, which is symmetric test code.
In addition, make CpaSampleCode's params const and add comments
for the sample codes' param numbering.

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-05-16 02:41:13 -07:00
Mikko Ylinen
4d238959a8 envtest: disable controller metrics in tests
to mitigate spurious errors with:

E0515 15:28:06.626887 1995892 listener.go:48] "controller-runtime/metrics:
metrics server failed to listen. You may want to disable the metrics
server or use another port if it is due to conflicts" err="error lis
tening on :8080: listen tcp :8080: bind: address already in use"

disable metrics completely. Moreover, check for error value from
NewManager() before proceeding with the tests to avoid crashes.

This makes envtest more robust but the up()/down() logic needs
careful review to ensure there are no race conditions.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2023-05-16 07:07:37 +03:00
Mikko Ylinen
e428cd6c19 go.mod: update to k8s 1.27.1 and controller runtime 0.15.x
k8s 1.27.x triggers build errors on controller-runtime 0.14.x
so we will need to update to 0.15.x at the same time.

Changes include:

* k8s e2e framework moved to use Ginkgo context so we add
  test context to all our test nodes.
* adapt Ginkgo parameter modifications.
* adapt SGX admissionwebhook to InjectDecoder removal.
* adapt deviceplugins and FPGA CRDs to controller-runtime
  API changes.

Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2023-05-09 14:49:24 +03:00
Hyeongju Johannes Lee
64b3da9653 qat,e2e: add cpa-sample compress test for gen4
- add /usr/share/qat/calgary32 necessary for running dc test
to Dockerfile
- add e2e test for dc that runs cpa-sample with different
resource and command.
- remove openssl yaml file and use podSpec instead for cy test
- make a common func runCpaSampleCode for both cy and dc test
that have same process with a few differences

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-05-03 07:38:09 -07:00
Hyeongju Johannes Lee
a80744e4df qat,e2e: add dpdk crypto-perf test for gen4
In the e2e test running in CI/CD, crypto-perf cannot be run.
So, we do not make it run by default.

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-05-03 03:30:02 -07:00
Mikko Ylinen
3a4c0e574f sgx: stop using local source hooks for EPC registration
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2023-04-28 14:59:41 +03:00
Hyeongju Johannes Lee
fe8a196a8a e2e: update qat gen4 test case to deal with configMap
Add a process to create a configMap for cy service

The structure of e2e test flows is as follows:
BeforeEach(createing a configMap)
JustBeforeEach(deploying QAT plugin)
Context(
 - BeforeEach(checks if resources are available)
 - It(runs a test pod)
[- It(runs another test pod)]*
)

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-04-27 13:08:47 -07:00
Hyeongju Johannes Lee
e3e6e215b7 e2e: fix AfterEach to be in the correct location
'AfterEach' was made to prevent the failure of a plugin pod that
occurs due to 'BeforeEach' that deploys a plugin pod. If it is
inside a 'Context' it will still occur the same problem. Since
current e2e tests have one 'Context' in general, problems were not
visible, but it still have problem in logic and would cause the
same problems if more 'Contexts' are made. So, this commit fixes
'AfterEach' to be in the correct location.

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-04-24 04:08:44 -07:00
Hyeongju Johannes Lee
f51382b517 e2e: ensure device plugin gets deleted before next one is deployed
Though namespace is deleted after each It(), it does not ensure
that it is deleted. Because of this reason, device plugin did not
get deleted before the next one is deployed. This can cause a
temporary crash of the new plugin and sometimes becomes the cause
of e2e test's failure. This commit fixes it by ensuring previous
device plugin gets deleted after each run.

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-03-29 01:45:46 -07:00
Mikko Ylinen
50a7a67406
Merge pull request #1339 from hj-johannes-lee/e2e-qat-gen4-to-be-part-of-dpdk
e2e, qat: make test for gen4 to be part of dpdk
2023-03-07 11:50:35 +02:00
Hyeongju Johannes Lee
612e4bff4e
e2e, qat: make test for gen4 to be part of dpdk
Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-03-06 14:36:46 +02:00
Mikko Ylinen
3dc815cda9 deployments: fix FPGA plugin namespace
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2023-02-21 21:15:06 +02:00
Mikko Ylinen
6a840b7b95
Merge pull request #1263 from hj-johannes-lee/e2e-segmentation
e2e: make tests divided into smaller parts (DLB, DSA, IAA, QAT)
2023-02-16 14:40:08 +02:00
Hyeongju Johannes Lee
3286baadb5
e2e, qat: divide single It() to have multiple layers
Structure is as follows:
Describe("QAT plugin")
  BeforeEach("deploys plugin")
    Context("When device resources are available")
      BeforeEach("checks if resources are available")
        It("runs a pod requesting resources")
        It("runs another pod requesting resources if there is")

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-02-16 13:35:28 +02:00
Hyeongju Johannes Lee
77ad32e008
e2e, iaa: divide single It() to have multiple layers
Structure is as follows:
Describe("IAA plugin")
  Describe("without using operator")
    BeforeEach("deploys plugin")
      Context("When device resources are available")
        BeforeEach("checks if resources are available")
          It("runs a pod requesting resources")
  Describe("with using operator")
    It("deploys with operator")

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-02-16 13:35:13 +02:00
Hyeongju Johannes Lee
fc0d0b5e0c
e2e, dsa: divide single It() to have multiple layers
Structure is as follows:
Describe("DSA plugin")
  Describe("without using operator")
    BeforeEach("deploys plugin")
      Context("When device resources are available")
        BeforeEach("checks if resources are available")
          It("runs a pod requesting resources")
  Describe("with using operator")
    It("deploys with operator")

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-02-16 13:35:13 +02:00
Hyeongju Johannes Lee
b111203392
e2e, dlb: divide single It() to have multiple layers
Structure is as follows:
Describe("DLB plugin")
  BeforeEach("deploys plugin")
    Context("When device resources are available")
      BeforeEach("checks if resources are available")
        It("runs a pod requesting resources")

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2023-02-16 13:35:12 +02:00
Oleg Zhurakivskyy
0828d4a2dd e2e: sgx: Add operator test
Closes #1273

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2023-02-15 16:47:26 +02:00
Oleg Zhurakivskyy
f8ea66563e e2e: Increase nfd timeout to 300 seconds
Apparently some of simulated CI nodes have out of sync boot configuration.

In order to be able to get the configuration in sync, the e2e NFD timeout
should be increased (it takes 250-260 seconds for NFD to get up with the right
boot parameters in the simulated environments).

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2023-01-30 17:17:55 +02:00
Mikko Ylinen
5de9b50f9e e2e: double NFD startup waiting time
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2023-01-12 08:07:53 +02:00
Mikko Ylinen
ee44c5c47e
Merge pull request #1271 from hj-johannes-lee/fix-typo-from-e2e
e2e: fix typos and minor grammar issues
2022-12-14 09:23:09 +02:00
Hyeongju Johannes Lee
838bc39bc7
e2e: fix typos and minor grammar issues
finnish -> finish
check -> check if

Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2022-12-13 11:23:21 +02:00
Mikko Ylinen
10a26b8fd8
Merge pull request #1234 from hj-johannes-lee/qat-cfgServices
qat: add configuration of cfgServices to qat initcontainer
2022-12-13 08:26:13 +02:00
Hyeongju Johannes Lee
a6037eae3c
qat: add configuration of cfgServices to qat initcontainer
Signed-off-by: Hyeongju Johannes Lee <hyeongju.lee@intel.com>
2022-12-12 21:48:21 +02:00
Mikko Ylinen
34d930a567 upgrade to k8s 1.26.0-rc.1 and controller-runtime@master
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
2022-12-07 15:04:33 +02:00
Mikko Ylinen
afce0ed79c
Merge pull request #1196 from ozhuraki/e2e-operator
operator: Add e2e tests for DSA, IAA
2022-11-17 21:30:33 +02:00
Oleg Zhurakivskyy
ef7954c8e1 operator: Add e2e tests for DSA, IAA
Closes #1230

Signed-off-by: Oleg Zhurakivskyy <oleg.zhurakivskyy@intel.com>
2022-11-17 17:47:21 +02:00
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