Commit Graph

1402 Commits

Author SHA1 Message Date
Fabiano Fidêncio
9db9d35198
ci: k8s: tdx: Re-enable projected-volume tests
It seems I was very lose on disabling some of the tests, and the issues
I faced could be related to other instabilities in the CI.

Let's re-enable this one, following what was done for the SEV, SNP, and
coco-qemu-dev.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-06-07 18:12:36 +02:00
Fabiano Fidêncio
f6a6cba8ca
ci: k8s: tdx: Re-enable nested-configmap-secret tests
It seems I was very lose on disabling some of the tests, and the issues
I faced could be related to other instabilities in the CI.

Let's re-enable this one, following what was done for the SEV, SNP, and
coco-qemu-dev.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-06-07 18:12:06 +02:00
Fabiano Fidêncio
957d0cccf6
ci: k8s: tdx: Re-enable inotify tests
It seems I was very lose on disabling some of the tests, and the issues
I faced could be related to other instabilities in the CI.

Let's re-enable this one, following what was done for the SEV, SNP, and
coco-qemu-dev.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-06-07 18:10:39 +02:00
Fabiano Fidêncio
fc6f662ae0
ci: k8s: tdx: Re-enable credentials-secrets tests
It seems I was very lose on disabling some of the tests, and the issues
I faced could be related to other instabilities in the CI.

Let's re-enable this one, following what was done for the SEV, SNP, and
coco-qemu-dev.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-06-07 18:08:29 +02:00
Fabiano Fidêncio
fde457589e ci: kbs: tdx: Enable basic attestation tests
Let's stop skipping the CDH tests for TDX, as know we should have an
environmemnt where it can run and should pass. :-)

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-06-07 12:18:50 +02:00
Fabiano Fidêncio
cac525059e ci: kbs: tdx: Use the hostname ip instead of localhost for the PCCS
We must ensure we use the host ip to connect to the PCCS running on the
host side, instead of using localhost (which has a different meaning
from inside the KBS pod).

The reason we're using `hostname -i` isntead of the helper functions, is
because the helper functions need the coco-kbs deployed for them to
work, and what we do is before the deployment.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-06-07 12:18:07 +02:00
Chris Porter
4172ccb3a0 CI: describe pod on k8s-create-pod wait failure
This is generally useful debug output on test failures,
and specifically this has been useful for nydus-related
issues recently.

Signed-off-by: Chris Porter <porter@ibm.com>
2024-06-05 12:37:53 -04:00
Gabriela Cervantes
264c7e9473 tests: Fix indentation in common script
This PR fixes the indentation in common script.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-06-05 15:52:40 +00:00
Fabiano Fidêncio
138ef2c55f
Merge pull request #9678 from AdithyaKrishnan/main
TEEs: Skip a few CI tests for SEV/SNP
2024-06-04 23:42:51 +02:00
GabyCT
ba30f0804a
Merge pull request #9770 from GabyCT/topic/fixvad
tests: Use variable definition for better uniformity
2024-06-04 15:23:34 -06:00
Wainer dos Santos Moschetta
af4f9afb71 kata-deploy: add PULL_TYPE handler for CRI-O
A new PULL_TYPE environment variable is recognized by the kata-deploy's
install script to allow it to configure CRIO-O for guest-pull image pulling
type.

The tests/integration/kubernetes/gha-run.sh change allows for testing it:
```
export PULL_TYPE=guest-pull
cd tests/integration/kubernetes
./gha-run.sh deploy-k8s
```

Fixes #9474
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-06-04 14:02:01 -03:00
GabyCT
6c2e8bed77
Merge pull request #9725 from 3u13r/feat/genpolicy/filter-by-runtime
genpolicy: add ability to filter for runtimeClassName
2024-06-04 10:06:14 -06:00
Gabriela Cervantes
cafba23f3e tests: Use variable definition for better uniformity
This PR replaces the name to use a variable that is already defined
to have a better uniformity across the general script.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-06-04 15:49:27 +00:00
Hyounggyu Choi
3aff6c5bd8 CI: Retry fetching node_start_time when it is empty
It was observed that the `node_start_time` value is sometimes empty,
leading to a test failure.

This commit retries fetching the value up to 3 times.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-06-04 15:41:15 +02:00
Wainer Moschetta
b5561074c3
Merge pull request #9377 from beraldoleal/yqbump
deps: bumping yq to v4.40.7
2024-06-03 14:34:58 -03:00
GabyCT
6c7affbd85
Merge pull request #9741 from GabyCT/topic/staticcheck
tests: Fix indentation in static checks script
2024-06-03 09:43:23 -06:00
Ryan Savino
72dc823059 tests: k8s: sev: snp: skip "setting sysctl" test
This test fails when using `shared_fs=none` with the nydus snapshotter.
Issue tracked here: #9666
Skipping for now.

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
2024-06-03 01:14:17 -05:00
Ryan Savino
3f3be54893 tests: k8s: sev: snp: skip initContainers shared vol test
This test is failing due to the initContainers not being properly
handled with the guest image pulling.
Issue tracked here: #9668
Skipping for now.

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
2024-06-03 01:14:17 -05:00
Ryan Savino
35dfb730ce tests: k8s: sev: snp: skip "kill all processes in container" test
This test fails when using `shared_fs=none` with the nydus napshotter,
Issue tracked here: #9664
Skipping for now.

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
2024-06-03 01:14:16 -05:00
Ryan Savino
62cc1dec4c tests: replace docker debug alpine image with ghcr
docker alpine latest image is rate limited.
Need to use ghcr.io image.

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
2024-06-03 01:14:16 -05:00
ChengyuZhu6
1820b02993 tests: replace busybox from docker with quay in guest pull
To prevent download failures caused by high traffic to the Docker image,
opt for quay.io/prometheus/busybox:latest over docker.io/library/busybox:latest .

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-06-03 01:14:16 -05:00
Ryan Savino
6c646dc96d tests: k8s: sev: snp: add runtime annotation for sev and snp
sev and snp cases added to the KATA_HYPERVISOR switch.

Signed-off-by: Ryan Savino <ryan.savino@amd.com>
2024-06-03 01:14:16 -05:00
Ryan Savino
668959408d tests: ensure kata_deploy cleanup even if namespace deletion fails
the test cluster namespace deletion failing causes kata_deploy to not get cleaned up.

Signed-Off-By: Ryan Savino <ryan.savino@amd.com>
2024-06-03 01:14:15 -05:00
Markus Rudy
13310587ed genpolicy: check requested devices
CreateContainerRequest objects can specify devices to be created inside
the guest VM. This change ensures that requested devices have a
corresponding entry in the PodSpec.

Devices that are added to the pod dynamically, for example via the
Device Plugin architecture, can be allowlisted globally by adding their
definition to the settings file.

Fixes: #9651
Signed-off-by: Markus Rudy <mr@edgeless.systems>
2024-05-31 22:05:49 +02:00
Wainer Moschetta
f093c4c190
Merge pull request #9754 from wainersm/qemu_coco_dev-enable_policy_tests
tests/k8s: enable policy tests for qemu-coco-dev
2024-05-31 15:09:25 -03:00
Beraldo Leal
53b8158a81 tests: adding debug and skip to kata-deploy
If a test is failing during setup, makes no much sense to run the suite.
Let's skip and add some debug messages.

Signed-off-by: Beraldo Leal <bleal@redhat.com>
2024-05-31 13:28:34 -04:00
Beraldo Leal
9171821d57 tests: add debug message to check return code
Lets add this message to make sure sh is starting properly.

Signed-off-by: Beraldo Leal <bleal@redhat.com>
2024-05-31 13:28:34 -04:00
Beraldo Leal
f91fbef184 tests: increase time after sh execution
Increased sleep duration to ensure the shell process starts.

Signed-off-by: Beraldo Leal <bleal@redhat.com>
2024-05-31 13:28:34 -04:00
Beraldo Leal
ba5d2e54c2 tests: remove object separation mark from eof
End of file should not end with --- mark. This will confuse tools like
yq and kubectl that might think this is another object.

Signed-off-by: Beraldo Leal <bleal@redhat.com>
2024-05-31 13:28:34 -04:00
Beraldo Leal
3e8b4806b8 tests: increase debug messages for kata-deploy
When the timeout happens we can't tell much information about the nodes.

Signed-off-by: Beraldo Leal <bleal@redhat.com>
2024-05-31 13:28:34 -04:00
Beraldo Leal
c99ba42d62 deps: bumping yq to v4.40.7
Since yq frequently updates, let's upgrade to a version from February to
bypass potential issues with versions 4.41-4.43 for now. We can always
upgrade to the newest version if necessary.

Fixes #9354
Depends-on:github.com/kata-containers/tests#5818

Signed-off-by: Beraldo Leal <bleal@redhat.com>
2024-05-31 13:28:34 -04:00
Greg Kurz
7886ed6670
Merge pull request #9751 from wainersm/k8s_print_logs_on_fail
tests/k8s: print logs on fail only (k8s-confidential-attestation.bats)
2024-05-31 14:47:27 +02:00
Fabiano Fidêncio
03a7cf4b02 ci: k8s: Skip empty dir tests also for TDX
Wainer noticed this is failing for the coco-qemu-dev case, and decided
to skip it, notifying me that he didn't fully understand why it was not
failing on TDX.

Turns out, though, this is also failing on TDX, and we need to skip it
there as well.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-31 09:59:46 +02:00
Leonard Cohnen
1d1690e2a4 genpolicy: add ability to filter for runtimeClassName
Add the CLI flag --runtime-class-names, which is used during
policy generation. For resources that can define a
runtimeClassName (e.g., Pods, Deployments, ReplicaSets,...)
the value must have any of the --runtime-class-names as
prefix, otherwise the resource is ignored.

This allows to run genpolicy on larger yaml
files defining many different resources and only generating
a policy for resources which will be deployed in a
confidential context.

Signed-off-by: Leonard Cohnen <lc@edgeless.systems>
2024-05-31 03:17:02 +02:00
Wainer dos Santos Moschetta
3333f8ddfd tests/k8s: enable policy tests for qemu-coco-dev
So qemu-coco-dev is on pair with the TEE configurations.

Fixes: #9753
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-05-30 21:51:15 -03:00
Wainer Moschetta
83fa813700
Merge pull request #9694 from wainersm/qemu_coco_dev-k8s-guest-pull
tests: enable guest-pull on all k8s tests for the qemu-coco-dev configuration
2024-05-30 21:48:11 -03:00
Wainer dos Santos Moschetta
55ae98eb28 tests/k8s: print logs on fail only (k8s-confidential-attestation.bats)
Use the variable BATS_TEST_COMPLETED which is defined by the bats framework
when the test finishes. `BATS_TEST_COMPLETED=` (empty) means the test failed,
so the node syslogs will be printed only at that condition.

Fixes: #9750
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-05-30 17:19:33 -03:00
Wainer dos Santos Moschetta
3e18fe7805 tests/k8s: skip file volume tests for qemu-coco-dev
This test fails with qemu-coco-dev configuration and guest-pull image pull.

Issue: #9667
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-05-30 14:50:59 -03:00
Wainer dos Santos Moschetta
5faf9ca344 ci: pin the nydus-snapshotter image version
It's cloning the nydus-snapshotter repo from the version specified in
versions.yaml, however, the deployment files are set to pull in the
latest version of the snapshotter image. With this version we are
pinning the image version too.

This is a temporary fix as it should be better worked out at nydus-snapshotter
project side.

Fixes: #9742
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-05-30 11:21:16 -03:00
Wainer dos Santos Moschetta
37894923c1 tests/k8s: skip empty dir volumes tests for qemu-coco-dev
This test fails with qemu-coco-dev configuration and guest-pull image pull.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-05-29 18:37:24 -03:00
Wainer dos Santos Moschetta
79a8b31ec5 tests/k8s: skip shared volume tests for qemu-coco-dev
This test fails with qemu-coco-dev configuration and guest-pull image pull.

Issue: #9668
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-05-29 18:37:24 -03:00
Wainer dos Santos Moschetta
aa1a37081e tests/k8s: skip sysctls tests for qemu-coco-dev
This test fails with qemu-coco-dev configuration and guest-pull image pull.

Issue: #9666
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-05-29 18:37:24 -03:00
Wainer dos Santos Moschetta
0e81ced9f1 tests/k8s: skip kill-all-process tests for qemu-coco-dev
This test fails with qemu-coco-dev configuration and guest-pull image pull.

Issue: #9664
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-05-29 18:37:24 -03:00
Wainer dos Santos Moschetta
18896efa3c tests/k8s: skip seccomp tests for qemu-coco-dev
This test fails with qemu-coco-dev configuration and guest-pull image pull.
Unlike other tests that I've seen failing on this scenario, k8s-seccomp.bats
fails after a couple of consecutive executions, so it's that kind of failure
that happens once in a while.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-05-29 18:37:24 -03:00
Wainer dos Santos Moschetta
b62ad71c43 tests/k8s: add runtime handler annotation for qemu-coco-dev
This will enable the k8s tests to leverage guest pulling when
PULL_TYPE=guest-pull for qemu-coco-dev runtimeclass.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-05-29 18:37:24 -03:00
Wainer dos Santos Moschetta
089c7ad84a tests/k8s: add runtime handler annotation only for guest-pull
The runtime handler annotation is required for Kubernetes <= 1.28 and
guest-pull pull type. So leverage $PULL_TYPE (which is exported by CI jobs)
to conditionally apply the annotation.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-05-29 18:37:24 -03:00
GabyCT
6d58fce4a9
Merge pull request #9677 from GabyCT/topic/memoryusags
metrics: Improve variable definition in memory usage script
2024-05-29 10:16:56 -06:00
Gabriela Cervantes
09c3e08f6a tests: Fix indentation in static checks script
This PR fixes the indentation in the static checks script.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-05-29 15:43:44 +00:00
Wainer Moschetta
9896f69827
Merge pull request #9414 from ldoktor/ci-bisection
ci.ocp: Document openshift pipeline and manual bisection
2024-05-28 11:17:09 -03:00
Fabiano Fidêncio
e81e8a4527
tests: kata-deploy: Adjust timeout
10 minutes is waay too long.  Let's give it 4 minutes only.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-27 06:23:00 +02:00
Fabiano Fidêncio
fba5793c0d
tests: kata-deploy: Run the tests from "${repo_root_dir}"
Let's see if it helps with issues like:
```
error: must build at directory: not a valid directory: evalsymlink
failure on
'"/home/runner/actions-runner/_work/kata-containers/kata-containers/tests/functional/kata-deploy/../../..//tools/packaging/kata-deploy/kata-cleanup/overlays/k0s"'
: lstat
/home/runner/actions-runner/_work/kata-containers/kata-containers/tests/functional/kata-deploy/":
no such file or directory
```

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-27 06:23:00 +02:00
Fabiano Fidêncio
8a8a7ea0e5
tests: kata-deploy: Show more logs in the setup()
This will also help us to better understand possible failures with the
CI.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-27 05:05:06 +02:00
Fabiano Fidêncio
47d9589e9b
tests: kata-deploy: Show output of passing tests
This will help us to debug failures and compare passing and failures
outputs.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-27 05:05:06 +02:00
Fabiano Fidêncio
dbd0d4a090
gha: Only do preventive cleanups for baremetal
This takes a few minutes that could be saved, so let's avoid doing this
on all the platforms, but simply do this when it's needed (the baremetal
use case).

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-27 05:05:06 +02:00
Fabiano Fidêncio
ee2ef0641c
tests: k8s: Allow passing "all" to run all the tests
Currently only "baremetal" runs all the tests, but we could easily run
"all" locally or using the github provided runners, even when not using
a "baremetal" system.

The reason I'd like to have a differentiation between "all" and
"baremetal" is because "baremetal" may require some cleanup, which "all"
can simply skip if testing against a fresh created VM.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-27 05:05:06 +02:00
Fabiano Fidêncio
556227cb51
tests: Add the possibility to deploy k0s / rke2
For now we've only exposed the option to deploy kata-deploy for k3s and
vanilla kubernetes when using containerd.

However, I do need to also deploy k0s and rke2 for an internal CI, and
having those exposed here do not hurt, and allow us to easily expand the
CI at any time in the future.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-27 05:05:06 +02:00
Fabiano Fidêncio
44d6cb7791
Merge pull request #9698 from wainersm/k8s_tests_disable_fail_fast
tests/k8s: disable "fail-fast" behavior by default
2024-05-23 18:28:00 +02:00
Fabiano Fidêncio
d9ee950d8f
Merge pull request #9696 from wainersm/skip_custom_dns_test
tests/k8s: skip custom DNS tests on confidential jobs
2024-05-22 23:57:21 +02:00
GabyCT
e08ad8d1b7
Merge pull request #9686 from GabyCT/topic/fixbootclh
metrics: Fix minvalue for boot time
2024-05-22 15:46:50 -06:00
Wainer dos Santos Moschetta
76735df427 tests/k8s: disable "fail-fast" behavior by default
The k8s test suite halts on the first failure, i.e., failing-fast. This
isn't the behavior that we used to see when running tests on Jenkins and it
seems that running the entire test suite is still the most productive way. So
this disable fail-fast by default.

However, if you still wish to run on fail-fast mode then just export
K8S_TEST_FAIL_FAST=yes in your environment.

Fixes: #9697
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-05-22 18:27:44 -03:00
Fabiano Fidêncio
8eb061cd5b
Merge pull request #9681 from GabyCT/topic/etdx
gha: Enable install kbs and coco components for TDX, but still skip the CDH test
2024-05-22 23:18:42 +02:00
Wainer dos Santos Moschetta
43766cdb96 tests/k8s: skip custom DNS tests on confidential jobs
This test has failed in confidential runtime jobs. Skip it
until we don't have a fix.

Fixes: #9663
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-05-22 17:08:22 -03:00
Fabiano Fidêncio
904370ecd6
tests: attestation: tdx: Skip test for now
Skipping the test will allow us to have the TDX CI running while we
debug the test.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-22 20:04:13 +02:00
Fabiano Fidêncio
414d716eef
tests: kbs: Enable cli installation also on CentOS
One of our machines is running CentOS 9 Stream, and we could easily
verify that we can build and install the kbs client there, thus we're
expanding the installation script to also support CentOS 9 Stream.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-22 20:01:57 +02:00
Fabiano Fidêncio
27d7f4c5b8
tests: kbs: Fix rust installation
`externals.coco-kbs.toolchain` is not defined, get the rust_version from
`externals.coco-trustee.toolchain` instead.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-22 20:01:57 +02:00
Fabiano Fidêncio
fa8b5c76b8
tests: kbs: Add more info for the TDX deployment
Ditto in the commit shortlog.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-22 20:01:57 +02:00
Fabiano Fidêncio
dbd1fa51cd
tests: kbs: Don't assume /tmp/trustee exists in the machine
Instead, check if the directory exists before pushd'ing into it.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-22 20:01:57 +02:00
Gabriela Cervantes
f698caccc0
gha: Enable install kbs and coco components for TDX
This PR enables the installation and unistallation of the kbs client
as well as general coco components needed for the TDX GHA CI.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-05-22 20:01:57 +02:00
GabyCT
eaaab19763
Merge pull request #9685 from GabyCT/topic/fixic
tests: Fix indentation in confidential common script
2024-05-22 11:53:33 -06:00
Gabriela Cervantes
29a10f1373 metrics: Fix minvalue for boot time
This PR fixes the minvalue for boot time to avoid the random failures
of the GHA CI.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-05-22 17:52:51 +00:00
Hyounggyu Choi
92101fc61f
Merge pull request #9658 from BbolroC/migrate-vfio-ap-test
CI: Migrate vfio-ap test files from tests repo
2024-05-21 20:21:09 +02:00
Gabriela Cervantes
c9e91db16f tests: Fix indentation in confidential common script
This PR fixes the indentation in the confidential common script.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-05-21 16:33:46 +00:00
Fabiano Fidêncio
8879e3bc45
Merge pull request #9452 from GabyCT/topic/tdxcoco
gha: Add support to install KBS to k8s TDX GHA workflow
2024-05-20 23:28:52 +02:00
Gabriela Cervantes
cfdef7ed5f tests/k8s: Use custom intel DCAP configuration
This PR adds the use of custom Intel DCAP configuration when
deploying the KBS.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-05-20 18:44:57 +00:00
Gabriela Cervantes
cace2fd340 metrics: Improve variable definition in memory usage script
This PR improves general format like variable definition to have
uniformity across the memory usage script.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-05-20 16:14:59 +00:00
Fabiano Fidêncio
94cff3f74e
Merge pull request #9315 from fidencio/topic/adapt-TEEs-for-shared_fs-none
TEEs: Use `shared_fs=none` for TDX
2024-05-20 17:17:36 +02:00
Fabiano Fidêncio
25c9cf32ff
Revert "ci: azure: Workaround azure cli installation script"
This reverts commit 5ff53e4d1c, as the
script was fixed by MSFT, at least according to:
https://github.com/Azure/azure-cli/issues/28984

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-20 14:38:46 +02:00
Fabiano Fidêncio
e8ebe18868
tests: k8s: tdx: Skip liveness probe test
This test doesn't fail with the guest image pulling, but it for sure
should. :-)

We can see in the bats logs, something like:
```
Events:
  Type     Reason     Age               From               Message
  ----     ------     ----              ----               -------
  Normal   Scheduled  31s               default-scheduler  Successfully assigned kata-containers-k8s-tests/liveness-exec to 984fee00bd70.jf.intel.com
  Normal   Pulled     23s               kubelet            Successfully pulled image "quay.io/prometheus/busybox:latest" in 345ms (345ms including waiting)
  Normal   Started    21s               kubelet            Started container liveness
  Warning  Unhealthy  7s (x3 over 13s)  kubelet            Liveness probe failed: cat: can't open '/tmp/healthy': No such file or directory
  Normal   Killing    7s                kubelet            Container liveness failed liveness probe, will be restarted
  Normal   Pulled     7s                kubelet            Successfully pulled image "quay.io/prometheus/busybox:latest" in 389ms (389ms including waiting)
  Warning  Failed     5s                kubelet            Error: failed to create containerd task: failed to create shim task: the file /bin/sh was not found: unknown
  Normal   Pulling    5s (x3 over 23s)  kubelet            Pulling image "quay.io/prometheus/busybox:latest"
  Normal   Pulled     4s                kubelet            Successfully pulled image "quay.io/prometheus/busybox:latest" in 342ms (342ms including waiting)
  Normal   Created    4s (x3 over 23s)  kubelet            Created container liveness
  Warning  Failed     3s                kubelet            Error: failed to create containerd task: failed to create shim task: failed to mount /run/kata-containers/f0ec86fb156a578964007f7773a3ccbdaf60023106634fe030f039e2e154cd11/rootfs to /run/kata-containers/liveness/rootfs, with error: ENOENT: No such file or directory: unknown
  Warning  BackOff    1s (x3 over 3s)   kubelet            Back-off restarting failed container liveness in pod liveness-exec_kata-containers-k8s-tests(b1a980bf-a5b3-479d-97c2-ebdb45773eff)
```

Let's skip it for now as we have an issue opened to track it down:
https://github.com/kata-containers/kata-containers/issues/9665

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-19 21:59:29 +02:00
Fabiano Fidêncio
a2c70222a8
tests: k8s: tdx: Skip initContainerd shared vol test
This is another one that is related to initContainers not being properly
handled with the guest image pulling.

Let's skip it for now as we have
https://github.com/kata-containers/kata-containers/issues/9668 to track
it down.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-19 20:58:45 +02:00
Fabiano Fidêncio
9d56145499
tests: k8s: tdx: Skip volume related tests
Similarly to firecracker, which doesn't have support for virtio-fs /
virtio-9p, TDX used with `shared_fs=none` will face the very same
limitations.

The tests affected are:
* k8s-credentials-secrets.bats
* k8s-file-volume.bats
* k8s-inotify.bats
* k8s-nested-configmap-secret.bats
* k8s-projected-volume.bats
* k8s-volume.bats

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-19 19:38:49 +02:00
Fabiano Fidêncio
606a62a0a7
tests: k8s: tdx: Skip "Setting sysctl" test
This test fails when using `shared_fs=none` with the nydus-snapshotter,
and we're tracking the issue here:
https://github.com/kata-containers/kata-containers/issues/9666

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-19 19:38:38 +02:00
Fabiano Fidêncio
937b2d5806
tests: k8s: tdx: Skip "Kill all processes in container" test
This test fails when using `shared_fs=none` with the nydus snapshotter,
and we're tracking the issue here:
https://github.com/kata-containers/kata-containers/issues/9664

For now, let's have it skipped.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-19 18:51:14 +02:00
Fabiano Fidêncio
03ce41b743
tests: k8s: tdx: Skip "Check custom dns" test
The test has been failing on TDX for a while, and an issue has been
created to track it down, see:
https://github.com/kata-containers/kata-containers/issues/9663

For now, let's have it skipped.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-19 18:51:14 +02:00
Fabiano Fidêncio
1a8a4d046d
tests: k8s: setup: Improve / Fix logs
Let's make sure the logs will print the correct annotation and its
value, instead of always mentioning "kernel" and "initrd".

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-19 18:51:14 +02:00
Fabiano Fidêncio
3f38309c39
tests: k8s: tdx: Stop running k8s-guest-pull-image.bats
We're doing that as all tests are going to be running with
`shared_fs=none`, meaning that we don't need any specific test for this
case anymore.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-19 18:51:00 +02:00
Fabiano Fidêncio
e84619d54b
tests: k8s: tdx: Add add_runtime_handler_annotations function
This function will set the needed annotation for enforcing that the
image pull will be handled by the snapshotter set for the runtime
handler, instead of using the default one.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-19 18:49:07 +02:00
Fabiano Fidêncio
5b257685d9
Merge pull request #9662 from dborquez/fix_launchtimes_timestamp_generation
Fix launch times timestamp generation.
2024-05-18 21:11:09 +02:00
David Esparza
938d3dc430
metrics: fix timestamps generation from launch times test.
Use `eval` to process the `date` command along with its parameters,
thus avoiding misinterpreting the parameters as commands.

Fixes: #9661

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2024-05-17 14:44:41 -06:00
David Esparza
bae377b42a
metrics: determine the realpath of kata-shim component.
Determine the realpath of kata-shim avoiding the check fails
in case the kata-shim is not a symlink, as was happening prior
to this commit.

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2024-05-17 14:40:02 -06:00
Fabiano Fidêncio
5ff53e4d1c
ci: azure: Workaround azure cli installation script
This is done in order to work around
https://github.com/Azure/azure-cli/issues/28984, following a suggestion
on the very same issue.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-17 20:28:24 +02:00
Hyounggyu Choi
961735a181 CI: Migrate vfio-ap test files from tests repo
An e2e test for `vfio-ap` has been conducted internally in IBM
due to the lack of publicly available test machines equipped
with a required crypto device.
The test is performed by the `tests` repository:
(i.e. 772105b560/Makefile (L144))

The community is working to integrate all tests into the `kata-containers`
repository, so the `vfio-ap` test should be part of that effort.

This commit moves a test script and Dockerfile for a test image from
the `tests` repository. We do not rename the script to `gha-run.sh`
because it is not executed by Github Actions' workflow.

You can check the test results from the s390x nightly test with the migrated files here:
https://github.com/kata-containers/kata-containers/actions/runs/9123170010/job/25100026025

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-05-17 14:59:16 +02:00
stevenhorsman
a92defdffe
tests: pull-image: Remove skips
Given that we think the containerd -> snapshotter image cache
problems have been resolved by bumping to nydus-snapshotter v0.3.13
we can try removing the skips to test this out

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-05-17 12:39:57 +02:00
stevenhorsman
7ac302e2d8
tests: Slacken guest pull rootfs count assert
- We previously have an expectation for the pause rootfs
to be pull on the host when we did a guest pull. We weren't
really clear why, but it is plausible related to the issues we had
with containerd and nydus caching. Now that is fixed we can begin
to address this with setting shared_fs=none, but let's start with
updating the rootfs host check to be not higher than expected

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-05-17 12:39:56 +02:00
Fabiano Fidêncio
67ff58251d
tests: confidential_common: Remove unneeded ensure_yq call
This test is called from `tests/integration/run_kuberentes_tests.sh`,
which already ensures that yq is installed.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-17 12:39:56 +02:00
Fabiano Fidêncio
cc874ad5e1
tests: confidential: Ensure those only run on TEEs
Running those with the non-TEE runtime classes will simply fail.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-17 12:39:56 +02:00
Fabiano Fidêncio
2bc5b1bba2
tests: pull-image: Only skip tests for TEEs
On 1423420, I've mistakenly disabled the tests entirely, for both
non-TEEs and TEEs.

This happened as I didn't realise that `confidential_setup` would take
non-TEEs into consideration. :-/

Now, let me follow-up on that and make sure that the tests will be
running on non-TEEs.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-17 12:39:56 +02:00
Fabiano Fidêncio
d875f89fa2
tests: Add is_confidential_hardware()
This function is a helper to check whether the KATA_HYPERVISOR being
used is a confidential hardware (TEE) or not, and we can use it to
skip or only run tests on those platforms when needed.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-17 12:39:56 +02:00
Fabiano Fidêncio
4a04a1f2ae
tests: Re-work confidential_setup()
Let's rename it to `is_confidential_runtime_class`, and adapt all the
places where it's called.

The new name provides a better description, leading to a better
understanding of what the function really does.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-17 12:39:56 +02:00
Lukáš Doktor
f994f79078
ci.ocp: Add steps to reproduce/bisect CI runs
in case the upstream CI fails it's useful to pin-point the PR that
caused the regression. Currently openshift-ci does not allow doing that
from their setup but we can mimic the setup on our infrastructure and
use the available kata-deploy-ci images to find the first failing one.
To help with that add a few helper scripts and a howto.

Fixes: #9228

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
2024-05-16 20:20:05 +02:00
David Esparza
029a6de52b
Merge pull request #9615 from GabyCT/topic/fixlaunchtime
metrics: Update launch times script
2024-05-16 11:28:44 -06:00
GabyCT
05cc8fae5e
Merge pull request #9610 from GabyCT/topic/fixrwfio
metrics: Fix random write value for FIO
2024-05-15 17:44:41 -06:00
Gabriela Cervantes
793a02600a metrics: Fix random write value for clh for FIO
This PR decreases the random write value for clh for FIO.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-05-15 22:13:10 +00:00
GabyCT
d752f0aa4f
Merge pull request #9627 from GabyCT/topic/ghacomk8s
gha: Fix indentation in gha run k8s common
2024-05-15 11:55:14 -06:00
GabyCT
64b915b86e
Merge pull request #9438 from GabyCT/topic/addnegativetest
tests: Add k8s negative policy test
2024-05-15 08:52:57 -06:00
Gabriela Cervantes
f20a44bba3 gha: Fix indentation in gha run k8s common
This PR fixes the indentation in gha run k8s common script
to have uniformity across the script.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-05-13 20:07:47 +00:00
Fabiano Fidêncio
9713558477
k0s: Use a different port for kube-route's metrics
kube-router decided to use :8080 for its metrics, and this seems to be a
change that affected k0s 1.30.0+, leading to kube-router pod crashing
all the time and anything can actually be started after that.

Due to this issue, let's simply use a different port (:9999) and move on
with our tests.

Fixes: #9623

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-11 23:18:20 +02:00
Gabriela Cervantes
80e551ea74 metrics: Update launch times script
This PR updates the launch times scripts by improving the variable
definition as well as trying to use the same format across all the script.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-05-09 21:29:32 +00:00
Fabiano Fidêncio
aba56a8adb
tests: measured-rootfs: Skip policy addition
Let's skip the policy addition for now, in order to get the TDX CI back
up and running, and then we can re-enable it as soon as we get
https://github.com/kata-containers/kata-containers/issues/9612 fixed.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-09 07:59:12 +02:00
Gabriela Cervantes
2fb406ed3a metrics: Fix random write value for FIO
This PR fixes the random write value for FIO for qemu by decreasing it
to avoid the random failures of the GHA CI.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-05-08 18:54:41 +00:00
Fabiano Fidêncio
142342012c
tests: pull-image: Don't run on TEEs
Let's skip those tests on TEEs as we've been facing a reasonable amount
of issues, most likely on the containerd side, related to pulling the
image on the guest.

Once we're able to fix the issues on containerd, we can get back and
re-enable those by reverting this commit.

The decision of disabling the tests for TEEs is because the machines may
end up in a state where human intervention is necessary to get them back
to a functional state, and that's really not optimal for our CI.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-05-08 18:40:22 +02:00
Fabiano Fidêncio
ddf6b367c7
Merge pull request #9568 from kata-containers/dependabot/go_modules/src/runtime/go_modules-22ef55fa20
build(deps): bump the go_modules group across 5 directories with 8 updates
2024-05-07 13:14:48 +02:00
Gabriela Cervantes
b54dc26073 gha: Enable uninstall kbs client function for coco gha workflow
This PR enables the uninstall kbs client function for coco gha tdx
workflow.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-05-06 15:55:24 +00:00
Gabriela Cervantes
506e17a60d tests: Add k8s negative policy test
This PR adds a k8s negative policy test to the confidential attestation
bats test.

Fixes #9437

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-05-06 15:28:54 +00:00
Aurélien Bombo
0cc2b07a8c tests: adapt Mariner CI to unblock CH v39 upgrade
The CH v39 upgrade in #9575 is currently blocked because of a bug in the
Mariner host kernel. To address this, we temporarily tweak the Mariner
CI to use an Ubuntu host and the Kata guest kernel, while retaining the
Mariner initrd. This is tracked in #9594.

Importantly, this allows us to preserve CI for genpolicy. We had to
tweak the default rules.rego however, as the OCI version is now
different in the Ubuntu host. This is tracked in #9593.

This change has been tested together with CH v39 in #9588.

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2024-05-03 16:29:12 +00:00
dependabot[bot]
391bc35805 build(deps): bump the go_modules group across 5 directories with 8 updates
Bumps the go_modules group with 2 updates in the /src/runtime directory: [github.com/containerd/containerd](https://github.com/containerd/containerd) and [github.com/containers/podman/v4](https://github.com/containers/podman).
Bumps the go_modules group with 4 updates in the /src/tools/csi-kata-directvolume directory: [golang.org/x/sys](https://github.com/golang/sys), google.golang.org/protobuf, [golang.org/x/net](https://github.com/golang/net) and [google.golang.org/grpc](https://github.com/grpc/grpc-go).
Bumps the go_modules group with 2 updates in the /src/tools/log-parser directory: [golang.org/x/sys](https://github.com/golang/sys) and gopkg.in/yaml.v3.
Bumps the go_modules group with 2 updates in the /tests directory: [golang.org/x/sys](https://github.com/golang/sys) and gopkg.in/yaml.v3.
Bumps the go_modules group with 2 updates in the /tools/testing/kata-webhook directory: [golang.org/x/sys](https://github.com/golang/sys) and [golang.org/x/net](https://github.com/golang/net).


Updates `github.com/containerd/containerd` from 1.7.2 to 1.7.11
- [Release notes](https://github.com/containerd/containerd/releases)
- [Changelog](https://github.com/containerd/containerd/blob/main/RELEASES.md)
- [Commits](https://github.com/containerd/containerd/compare/v1.7.2...v1.7.11)

Updates `github.com/containers/podman/v4` from 4.2.0 to 4.9.4
- [Release notes](https://github.com/containers/podman/releases)
- [Changelog](https://github.com/containers/podman/blob/v4.9.4/RELEASE_NOTES.md)
- [Commits](https://github.com/containers/podman/compare/v4.2.0...v4.9.4)

Updates `google.golang.org/protobuf` from 1.29.1 to 1.33.0

Updates `github.com/cyphar/filepath-securejoin` from 0.2.3 to 0.2.4
- [Release notes](https://github.com/cyphar/filepath-securejoin/releases)
- [Commits](https://github.com/cyphar/filepath-securejoin/compare/v0.2.3...v0.2.4)

Updates `golang.org/x/sys` from 0.15.0 to 0.19.0
- [Commits](https://github.com/golang/sys/compare/v0.15.0...v0.19.0)

Updates `google.golang.org/protobuf` from 1.31.0 to 1.33.0

Updates `golang.org/x/net` from 0.19.0 to 0.23.0
- [Commits](https://github.com/golang/net/compare/v0.19.0...v0.23.0)

Updates `google.golang.org/grpc` from 1.59.0 to 1.63.2
- [Release notes](https://github.com/grpc/grpc-go/releases)
- [Commits](https://github.com/grpc/grpc-go/compare/v1.59.0...v1.63.2)

Updates `golang.org/x/sys` from 0.0.0-20191026070338-33540a1f6037 to 0.1.0
- [Commits](https://github.com/golang/sys/compare/v0.15.0...v0.19.0)

Updates `gopkg.in/yaml.v3` from 3.0.0-20200313102051-9f266ea9e77c to 3.0.0

Updates `golang.org/x/sys` from 0.0.0-20220429233432-b5fbb4746d32 to 0.19.0
- [Commits](https://github.com/golang/sys/compare/v0.15.0...v0.19.0)

Updates `gopkg.in/yaml.v3` from 3.0.0-20210107192922-496545a6307b to 3.0.0

Updates `golang.org/x/sys` from 0.15.0 to 0.19.0
- [Commits](https://github.com/golang/sys/compare/v0.15.0...v0.19.0)

Updates `golang.org/x/net` from 0.19.0 to 0.23.0
- [Commits](https://github.com/golang/net/compare/v0.19.0...v0.23.0)

---
updated-dependencies:
- dependency-name: github.com/containerd/containerd
  dependency-type: direct:production
  dependency-group: go_modules
- dependency-name: github.com/containers/podman/v4
  dependency-type: direct:production
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-type: direct:production
  dependency-group: go_modules
- dependency-name: github.com/cyphar/filepath-securejoin
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/sys
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: google.golang.org/protobuf
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-type: direct:production
  dependency-group: go_modules
- dependency-name: google.golang.org/grpc
  dependency-type: direct:production
  dependency-group: go_modules
- dependency-name: golang.org/x/sys
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: gopkg.in/yaml.v3
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/sys
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: gopkg.in/yaml.v3
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/sys
  dependency-type: indirect
  dependency-group: go_modules
- dependency-name: golang.org/x/net
  dependency-type: indirect
  dependency-group: go_modules
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-04-30 09:46:13 +01:00
Wainer dos Santos Moschetta
631f6f6ed6 gha: switch CoCo tests on non-TEE to use qemu-coco-dev
With the addition of the 'qemu-coco-dev' runtimeClass we no longer need
to run CoCo tests on non-TEE environments with 'qemu'. As a result the
tests also no longer need to set the "io.katacontainers.config.hypervisor.image"
annotation to pods.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-04-29 05:45:11 -03:00
Hyounggyu Choi
80cb4a6c18 build: Update golang version to 1.22.2
As we have an issue with a golang version for `run-cri-containerd`,
it is required to bump the language.

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-04-26 15:50:29 +02:00
James O. D. Hunt
5bd614530f
Merge pull request #9525 from jodh-intel/gha-k8s-ch-dm
gha: Enable k8s tests for cloud hypervisor with devicemapper
2024-04-25 09:28:09 +01:00
James O. D. Hunt
ff7349b6f0 gha: Enable k8s tests for cloud hypervisor with devicemapper
Enable the k8s tests for cloud hypervisor with devicemapper.

Fixes: #9221.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Co-authored-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-04-24 16:32:51 +01:00
Dan Mihai
e5c3f5fa9b tests: no generated policy for untested platforms
Avoid auto-generating Policy on platforms that haven't been tested
yet with auto-generated Policy.

Support for auto-generated Policy on these additional platforms is
coming up in future PRs, so the tests being fixed here were
prematurely enabled.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-23 16:07:03 +00:00
Dan Mihai
ed6412b63c tests: k8s: reduce the policy tests output noise
Hide some of the kubectl output, to reduce the size and redundancy of
this output.

Fixes: #9388

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-22 19:59:33 +00:00
Dan Mihai
58e608d61a tests: remove k8s-policy-set-keys.bats
Remove k8s-policy-set-keys.bats in preparation for using the regorus
crate instead of the OPA daemon for evaluating the Agent Policy. This
test depended on sending HTTP requests to OPA.

Fixes: #9388

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-22 19:49:38 +00:00
Dan Mihai
5ceed689eb
Merge pull request #9492 from microsoft/danmihai1/pod-tests
tests: k8s: inject agent policy failures (part 3)
2024-04-17 14:01:11 -07:00
Wainer Moschetta
2d8e7933c5
Merge pull request #9461 from GabyCT/topic/uninstallkbs
tests/k8s: Add uninstall kbs client command function
2024-04-17 09:36:37 -03:00
Archana Shinde
af3b19ed18
Merge pull request #9084 from amshinde/document-intel-gpu-vfio
docs: Document Intel Discrete GPUs usage with Kata
2024-04-16 16:17:03 -07:00
Archana Shinde
973a15332a spell-check: Add missing words to spell-check
Add missing words to spell-check dictionaries

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2024-04-16 11:50:02 -07:00
Dan Mihai
2c4d1ef76b tests: k8s: inject agent policy failures (part 3)
Auto-generate the policy and then simulate attacks from the K8s
control plane by modifying the test yaml files. The policy then
detects and blocks those changes.

These test cases are using K8s Pods. Additional policy failures
are injected during CI using other types of K8s resources - e.g.,
using Jobs and Replication Controllers - from separate PRs.

Fixes: #9491

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-16 18:15:12 +00:00
GabyCT
9238daf729
Merge pull request #9464 from microsoft/danmihai1/rc-tests
tests: k8s: inject agent policy failures (part2)
2024-04-16 10:01:39 -06:00
Hyounggyu Choi
32f58abfde
Merge pull request #9403 from BbolroC/runtime-rs-ci-qemu
CI: Enable GHA cri-containerd workflow for runtime-rs with QEMU
2024-04-15 09:31:25 +02:00
Wainer Moschetta
0a04f54a8e
Merge pull request #9454 from GabyCT/topic/pulltype
gha: Define unbound PULL TYPE variable
2024-04-12 14:48:56 -03:00
Hyounggyu Choi
3c217c6c15 ci|cri-containerd: Introduce qemu-runtime-rs for KATA_HYPERVISOR
`qemu-runtime-rs` will be utilized to handle a test scenario where
the VMM is QEMU and runtime-rs is employed.

Note: Some of the tests are skipped. They are going to be reintegrated in
the follow-up PR (Check out #9375).

Fixes: #9371

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-04-12 12:25:53 +02:00
Dan Mihai
e51cbdcff9 tests: k8s: inject agent policy failures (part2)
Auto-generate the policy and then simulate attacks from the K8s
control plane by modifying the test yaml files. The policy then
detects and blocks those changes.

These test cases are using K8s Replication Controllers. Additional
policy failures will be injected using other types of K8s resources
- e.g., using Pods and/or Jobs - in separate PRs.

Fixes: #9463

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-11 21:08:53 +00:00
Wainer dos Santos Moschetta
4f74617897 tests: pass --overwrite-existing to aks get-credentials
By passing --overwrite-existing to `aks get-credentials` it will stop
asking if I want to overwrite the existing credentials. This is handy
for running the scripts locally.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-04-11 15:31:40 -03:00
Wainer dos Santos Moschetta
3508f3a43a tests/k8s: use CoCo image on guest-pull when non-TEE
When running on non-TEE environments (e.g. KATA_HYPERVISOR=qemu) the tests should
be stressing the CoCo image (/opt/kata/share/kata-containers/kata-containers-confidential.img)
although currently the default image/initrd is built to be able to do guest-pull as well.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-04-11 15:31:40 -03:00
Wainer dos Santos Moschetta
c24f13431d tests/k8s: enable guest-pull tests on non-TEE
Enabled guest-pull tests on non-TEE environment. It know requires the SNAPSHOTTER environment
variable to avoid it running on jobs where nydus-snapshotter is not installed

Fixes: #9410
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-04-11 15:31:40 -03:00
Gabriela Cervantes
5420595d03 tests/k8s: Add uninstall kbs client command function
This PR adds the function to uninstall kbs client command function
specially when we are running with baremetal devices.

Fixes #9460

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-04-11 17:06:11 +00:00
Fabiano Fidêncio
5611233ed8
Merge pull request #9439 from microsoft/danmihai1/job-tests
tests: k8s: inject agent policy failures
2024-04-11 17:21:54 +02:00
GabyCT
08dcdc62de
Merge pull request #9423 from GabyCT/topic/improvecleanup
tests: Improve the kbs_k8s_delete function
2024-04-10 14:28:21 -06:00
Gabriela Cervantes
4a2ee3670f gha: Define unbound PULL TYPE variable
This PR defines the PULL_TYPE variable to avoid failures of unbound
variable when this is being test it locally.

Fixes #9453

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-04-10 17:16:19 +00:00
GabyCT
dab837d71d
Merge pull request #9450 from GabyCT/topic/fixinnydus
gha: Fix indentation in gha run script
2024-04-10 11:07:56 -06:00
David Esparza
9e1368dbc5
Merge pull request #9391 from dborquez/add-onednn-openvino-ml-benchs
add onednn and openvino ml-benchmarks
2024-04-09 19:03:00 -06:00
Dan Mihai
ea31df8bff
Merge pull request #9185 from microsoft/saulparedes/genpolicy_add_containerd_pull
genpolicy: Add optional toggle to pull images using containerd
2024-04-09 12:29:19 -07:00
Gabriela Cervantes
6ebdcf8974 gha: Fix indentation in gha run script
This PR fixes an identation in gha run script.

Fixes #9449

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-04-09 16:37:17 +00:00
Greg Kurz
89353249fc
Merge pull request #8988 from beraldoleal/ci-docs
docs: adding an initial CI documentation
2024-04-09 18:26:15 +02:00
Dan Mihai
2252490a96 tests: k8s: inject agent policy failures
Auto-generate the policy and then simulate attacks from the K8s
control plane by modifying the test yaml files. The policy then
detects and blocks those changes.

These test cases are using K8s Jobs. Additional policy failures
will be injected using other types of K8s resources - e.g., using
Pods and/or Replication Controllers - in future PRs.

Fixes: #9406

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-09 15:36:57 +00:00
David Esparza
facf3c9364
metrics: Add onednn benchmark.
This PR adds onednn test to exercise additional ML benchmarks.

Onednn is an Intel-optimized library for Deep Neural Networks.

Fixes: #9390

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2024-04-09 09:05:51 -06:00
David Esparza
3bde511d0d
metrics: Add openvino benchmark.
This PR adds openvino test in order to exercise additional ML
benchmarks.

OpenVino bench used to optimize and deploy deep learning models.

Fixes: #9389

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2024-04-09 09:05:51 -06:00
David Esparza
b37c5f8ba1
metrics:libs: Add HTTPS and HTTP vars to docker build.
Include HTTP and HTTPS env variables in the building docker
images because they are required to download packages
such as Phoronix.

Added a restriction that verifies that docker building images
is performed as root.

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2024-04-09 09:05:51 -06:00
David Esparza
3355dd9e2b
metrics:libs: Adds a function to set new kata configuration.
Adds a function that receives as a single parameter the name of
a valid Kata configuration file which  will be established as
the default kata configuration to start kata containers.

Adds a second function that returns the path to the current
kata configuration file.

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2024-04-09 09:05:51 -06:00
David Esparza
cb4380d1c9
metrics: common: Add function to clean the cache.
The function clear the Page Cache only.

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2024-04-09 09:05:51 -06:00
David Esparza
3a419ba3b1
metrics: common: Add function to update kata config.
Add an extra function that updates kata config
to use the max num. of vcpus available and
to use the available memory in the system.

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2024-04-09 09:05:51 -06:00
Beraldo Leal
959e56525c docs: adding an initial CI documentation
This is actually a first attempt to document our CI, and all this
content was based on the document created by Fabiano Fidencio (kudos to
him). We are just moving the content and discussion from Google Docs to
here.

I used the "poetic license" to add some notes on what I believe our CI
will look like in the future.

Fixes #9006

Co-authored-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Signed-off-by: Beraldo Leal <bleal@redhat.com>
2024-04-09 09:21:47 -04:00
Saul Paredes
51498ba99a genpolicy: toggle containerd pull in tests
- Add v1 image test case
- Install protobuf-compiler in build check
- Reset containerd config to default in kubernetes test if we are testing genpolicy
- Update docker_credential crate
- Add test that uses default pull method
- Use GENPOLICY_PULL_METHOD in test

Signed-off-by: Saul Paredes <saulparedes@microsoft.com>
2024-04-08 19:28:29 -07:00
Dan Mihai
f60c9eaec3
Merge pull request #9398 from microsoft/danmihai1/policy-test-cleanup
tests: k8s: improve the Agent Policy tests
2024-04-08 15:37:07 -07:00
Gabriela Cervantes
fb4c359cc2 tests: Improve the kbs_k8s_delete function
This PR improves the kbs_k8s_delete function to verify that the
resources were properly deleted for baremetal environments.

Fixes #9379

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-04-08 18:03:07 +00:00
stevenhorsman
a284a20a14 tests: Filter CoCo tests on ppc64le/arm
- At the moment we aren't supporting ppc64le or
aarch64 for
CoCo, so filter out these tests from running

Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2024-04-08 11:38:53 +01:00
Gabriela Cervantes
6d85025e59 test/k8s: Add basic attestation test
- Add basic test case to check that a ruuning
pod can use the api-server-rest (and attestation-agent
and confidential-data-hub indirectly) to get a resource
from a remote KBS

Fixes #9057

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
Co-authored-by: Linda Yu <linda.yu@intel.com>
Co-authored-by: stevenhorsman <steven@uk.ibm.com>
Co-authored-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-04-08 11:38:53 +01:00
GabyCT
9d2c5b180e
Merge pull request #9419 from GabyCT/topic/fxlatency
metrics: Improve latency test cleanup
2024-04-05 16:31:00 -06:00
Wainer Moschetta
aae7048d4f
Merge pull request #9273 from ldoktor/kcli-coco-kbs
tests: Support for kbs setup on kcli
2024-04-05 18:55:58 -03:00
Dan Mihai
6f9f8ae285
Merge pull request #9413 from microsoft/saulparedes/ensure_unique_rg_in_gha
gha: ensure unique resource group name
2024-04-04 17:13:09 -07:00
GabyCT
80d926c357
Merge pull request #9411 from microsoft/danmihai1/k8s-job
tests: k8s-job: wait for job successful create
2024-04-04 15:14:56 -06:00
Gabriela Cervantes
8e5d401be0 metrics: Improve latency test cleanup
This PR improves the latency test cleanup in order to avoid random
failures of leaving the pods.

Fixes #9418

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-04-04 20:43:53 +00:00
Saul Paredes
f20caac1c0 gha: ensure unique resource group name
There's an rg name duplication situation that got introduced by #9385
where 2 different test runs might have same rg name.

Add back uniqueness by including the first letter of GENPOLICY_PULL_METHOD to
cluster name.

Fixes: #9412

Signed-off-by: Saul Paredes <saulparedes@microsoft.com>
2024-04-04 13:13:32 -07:00
Dan Mihai
3e72b3f360 tests: k8s-job: wait for job successful create
Don't just verify SuccessfulCreate - wait for it if needed.

Fixes: #9138

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-03 22:11:15 +00:00
Gabriela Cervantes
73f27e28d1 gha: Define GH_PR_NUMBER variable in gha run k8s common script
This PR defines the GH_PR_NUMBER variable in gha run k8s common
script to avoid failures like unbound variable when running
locally the scripts just like the GHA CI.

Fixes #9408

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-04-03 18:25:00 +00:00
Dan Mihai
f800bd86f6 tests: k8s-sandbox-vcpus-allocation.bats policy
Use the "allow all" policy for k8s-sandbox-vcpus-allocation.bats,
instead of relying on the Kata Guest image to use the same policy
as its default.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-03 03:01:33 +00:00
Dan Mihai
4211d93b87 tests: k8s-nginx-connectivity.bats policy
Use the "allow all" policy for k8s-nginx-connectivity.bats, instead of
relying on the Kata Guest image to use the same policy as its default.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-03 03:01:26 +00:00
Dan Mihai
5dcf64ef34 tests: k8s-volume.bats allow all policy
Use the "allow all" policy for k8s-volume.bats, instead of relying
on the Kata Guest image to use the same policy as its default.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-03 03:01:18 +00:00
Dan Mihai
04085d8442 tests: k8s-sysctls.bats allow all policy
Use the "allow all" policy for k8s-sysctls.bats, instead of
relying on the Kata Guest image to use the same policy as its default.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-03 03:01:10 +00:00
Dan Mihai
839993f245 tests: k8s-security-context.bats allow all policy
Use the "allow all" policy for k8s-security-context.bats, instead of
relying on the Kata Guest image to use the same policy as its default.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-03 03:01:03 +00:00
Dan Mihai
02a050b47e tests: k8s-seccomp.bats allow all policy
Use the "allow all" policy for k8s-seccomp.bats, instead of relying
on the Kata Guest image to use the same policy as its default.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-03 03:00:56 +00:00
Dan Mihai
543e40b80c tests: k8s-projected-volume.bats allow all policy
Use the "allow all" policy for k8s-projected-volume.bats, instead of
relying on the Kata Guest image to use the same policy as its default.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-03 03:00:47 +00:00
Dan Mihai
3f94e2ee1b tests: k8s-pod-quota.bats allow all policy
Use the "allow all" policy for k8s-pod-quota.bats, instead of
relying on the Kata Guest image to use the same policy as its default.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-03 03:00:37 +00:00
Dan Mihai
ba23758a42 tests: k8s-optional-empty-secret.bats policy
Use the "allow all" policy for k8s-optional-empty-secret.bats,
instead of relying on the Kata Guest image to use the same policy as
its default.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-03 03:00:30 +00:00
Dan Mihai
e4ff6b1d91 tests: k8s-measured-rootfs.bats allow all policy
Use the "allow all" policy for k8s-measured-rootfs.bats, instead of
relying on the Kata Guest image to use the same policy as its default.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-03 03:00:23 +00:00
Dan Mihai
2821326a7e tests: k8s-liveness-probes.bats allow all policy
Use the "allow all" policy for k8s-liveness-probes.bats, instead of
relying on the Kata Guest image to use the same policy as its default.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-03 03:00:15 +00:00
Dan Mihai
9af3e4cc4a tests: k8s-inotify.bats allow all policy
Use the "allow all" policy for k8s-inotify.bats, instead of relying
on the Kata Guest image to use the same policy as its default.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-03 03:00:08 +00:00
Dan Mihai
bd45e948cc tests: k8s-guest-pull-image.bats policy
Use the "allow all" policy for k8s-guest-pull-image.bats, instead of
relying on the Kata Guest image to use the same policy as its default.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-03 03:00:00 +00:00
Dan Mihai
be3797ef7c tests: k8s-footloose.bats allow all policy
Use the "allow all" policy for k8s-footloose.bats, instead of
relying on the Kata Guest image to use the same policy as its
default.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-03 02:59:50 +00:00
Dan Mihai
18f5e55667 tests: k8s-empty-dirs.bats allow all policy
Use the "allow all" policy for k8s-empty-dirs.bats, instead of
relying on the Kata Guest image to use the same policy as its
default.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-03 02:59:44 +00:00
Dan Mihai
ef22bd8a2b tests: k8s: replace run_policy_specific_tests
Check from:

- k8s-exec-rejected.bats
- k8s-policy-set-keys.bats

if policy testing is enabled or not, to reduce the complexity of
run_kubernetes_tests.sh. After these changes, there are no policy
specific commands left in run_kubernetes_tests.sh.

add_allow_all_policy_to_yaml() is moving out of run_kubernetes_tests.sh
too, but it not used yet. It will be used in future commits.

Fixes: #9395

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-03 02:59:28 +00:00
Dan Mihai
39805822fc tests: k8s: reduce policy testing complexity
Don't add the "allow all" policy to all the test YAML files anymore.

After this change, the k8s tests assume that all the Kata CI Guest
rootfs image files either:

- Don't support Agent Policy at all, or
- Include an "allow all" default policy.

This relience/assumption will be addressed in a future commit.

Fixes: #9395

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-04-02 16:18:31 +00:00
Alex Lyn
aa9cd232cd
Merge pull request #9358 from GabyCT/topic/nerdrandom
gha: Update journal log names for nerdctl artifacts
2024-04-01 09:50:16 +08:00
Steve Horsman
53fa1fd82d
Merge pull request #9349 from fidencio/topic/ci-k8s-update-cpuid
k8s: confidential: Update cpuid to its latest release
2024-03-27 16:57:36 +00:00
ChengyuZhu6
c50d3ebacc tests:k8s: Add a test to pull large images in the guest
Add a test to pull large images in the guest.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-03-27 21:58:44 +08:00
Gabriela Cervantes
a997e282be gha: Update journal log names for nerdctl artifacts
This PR updates the journal log name for nerdctl artifacts to make
sure that we have different names in case we add a parallel GHA job.

Fixes #9357

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-03-26 20:03:54 +00:00
Lukáš Doktor
a671b3fc6e
tests: Use full svc address to check kbs service
the service might not listen on the default port, use the full service
address to ensure we are talking to the right resource.

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
2024-03-26 16:59:02 +01:00
Lukáš Doktor
6b0eaca4d4
tests: Add support for nodeport ingress for the kbs setup
this can be used on kcli or other systems where cluster nodes are
accessible from all places where the tests are running.

Fixes: #9272

Signed-off-by: Lukáš Doktor <ldoktor@redhat.com>
2024-03-26 16:59:00 +01:00
Fabiano Fidêncio
cfe75f9422
k8s: confidential: Update cpuid to its latest release
Since v2.2.6 it can detect TDX guests on Azure, so let's bump it even if
Azure peer-pods are not currently used as part of our CI.

Fixes: #9348

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-03-26 10:21:12 +01:00
Gabriela Cervantes
d54cdd3f0c scripts: Fix unbound variables in k8s setup script
This PR fixes the unbound variables error when trying to run
the setup script locally in order to avoid errors.

Fixes #9328

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-03-21 19:10:16 +00:00
James O. D. Hunt
1e684f5848
Merge pull request #9259 from jodh-intel/tests-add-static-checks-announce
tests: static checker: Add announce message
2024-03-21 13:59:36 +00:00
GabyCT
03f3d3491d
Merge pull request #9265 from GabyCT/topic/fixnydusclean
gha: Fix nydus namespace clean up
2024-03-20 16:17:38 -06:00
Gabriela Cervantes
a855ecf21b gha: Update journal log names for kubernetes artifacts
This PR updates the journal log names for kubernetes artifacts
in order to make sure that we have different names when we are
running parallel GHA jobs.

Fixes #9308

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-03-20 15:44:20 +00:00
Gabriela Cervantes
4fb8f8705f gha: Fix nydus namespace clean up
This PR terminates the nydus namespace to avoid the error of
that the flag needs an argument.

Fixes #9264

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-03-20 15:41:39 +00:00
James O. D. Hunt
577abd014b tests: static checker: Add announce message
Added an announcement message to the `static-checks.sh` script. It runs
platform / architecture specific code so it would be useful to display
details of the platform the checker is running on to help with
debugging.

Fixes: #9258.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2024-03-20 13:41:26 +00:00
James O. D. Hunt
4af4a8ad2b tests: static checker: Create setup function
Move some of the common code into a setup function.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2024-03-20 11:58:28 +00:00
Fabiano Fidêncio
19eb45a27d
Merge pull request #8484 from ChengyuZhu6/guest-pull
Merge basic guest pull image code to main
2024-03-19 23:15:39 +01:00
Fabiano Fidêncio
8911d3565f
gha: tests: Filter out confidential tests for aarch64 / ppc64le
Those two architectures are not TEE capable, thus we can just skip
running those tests there.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-03-19 18:06:01 +01:00
Fabiano Fidêncio
d14e9802b6
gha: k8s: Set {https,no}_proxy correctly for TDX
This is needed as the TDX machine is hosted inside Intel and relies on
proxies in order to connect to the external world.  Not having those set
causes issues when pulling the image inside the guest.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-03-19 18:06:00 +01:00
ChengyuZhu6
e23737a103
gha: refactor code with yq for better clarity
refactor code with yq for better clarity:

Before:
```bash
yq write -i "${tools_dir}/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml"
'spec.template.spec.containers[0].env[7].value' "${KATA_HYPERVISOR}:${SNAPSHOTTER}"
```

After:
```bash
yq write -i \
  "${tools_dir}/packaging/kata-deploy/kata-deploy/base/kata-deploy.yaml" \
  'spec.template.spec.containers[0].env[7].value' \
  "${KATA_HYPERVISOR}:${SNAPSHOTTER}"
```

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-03-19 18:06:00 +01:00
ChengyuZhu6
2c0bc8855b
tests: Make sure to install yq before using it
Make sure to install yq before using it to modify YAML files.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-03-19 18:06:00 +01:00
ChengyuZhu6
c52b356482
tests: add guest pull image test
Add a test case of pulling image inside the guest for confidential
containers.

Signed-off-by: Da Li Liu <liudali@cn.ibm.com>
Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
Co-authored-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Co-authored-by: stevenhorsman <steven@uk.ibm.com>
Co-authored-by: Georgina Kinge <georgina.kinge@ibm.com>
Co-authored-by: Megan Wright <Megan.Wright@ibm.com>
2024-03-19 18:06:00 +01:00
ChengyuZhu6
e8c4effc07
tests: refactor the check for hypervisor to a function
Extract two reusable functions for confidential tests in confidential_common.sh

- check_hypervisor_for_confidential_tests: verifies if the input hypervisor supports confidential tests.
- confidential_setup: performs the common setup for confidential tests.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
Co-authored-by: stevenhorsman <steven@uk.ibm.com>
Co-authored-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Co-authored-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-03-19 18:06:00 +01:00
ChengyuZhu6
cd6a84cfc5
kata-deploy: Setting up snapshotters per runtime handler
Setting up snapshotters per runtime handler as the commit
(6cc6ca5a7f) described.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-03-19 18:05:59 +01:00
Hyounggyu Choi
b381743dd5 CI|k8s: Handle skipped tests with a comment for filter_out_per_arch
This commit updates `filter_k8s_test.sh` to handle skipped tests that
include comments. In addition to the existing parameter expansion,
the following expansions have been added:

- Removal of a comment
- Stripping of trailing spaces

Fixes: #9304

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-03-19 17:21:25 +01:00
Chelsea Mafrica
2c50d3c393
Merge pull request #9278 from wainersm/github_env_fix
tests: fix nounset error with $GITHUB_ENV
2024-03-14 16:39:13 -07:00
Dan Mihai
6094f1e31d
Merge pull request #9250 from microsoft/danmihai1/k8s-pid-ns2
tests: k8s: k8s-pid-ns.bats auto-generated policy
2024-03-14 10:10:24 -07:00
Wainer dos Santos Moschetta
981f95df55 tests: fix nounset error with $GITHUB_ENV
Initialize $GITHUB_ENV to avoid nounset error when running the scripts locally
out of Github Actions.

Fixed commit 9ba5e3d2a8

Fixes #9217
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-03-13 14:57:38 -03:00
Dan Mihai
ac27caf1b4
Merge pull request #9248 from microsoft/danmihai1/k8s-exec.bats2
tests: k8s: k8s-exec.bats auto-generated policy
2024-03-13 09:21:12 -07:00
Dan Mihai
e8c2a45ce0 tests: k8s: k8s-pid-ns.bats auto-generated policy
Auto-generate policy for k8s-pid-ns.bats.

Fixes: #9249

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-03-12 22:34:46 +00:00
Alex Lyn
a116b252c8
Merge pull request #9236 from jodh-intel/docs-improve-install-details
docs: install: Simplify instructions
2024-03-12 14:29:38 +08:00
Dan Mihai
88b7a44271 tests: k8s: k8s-exec.bats auto-generated policy
Auto-generate policy for k8s-exec.bats.

Fixes: #9247

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-03-08 17:48:20 +00:00
GabyCT
35d8f82232
Merge pull request #9242 from GabyCT/topic/enabldebugnerd
gha: Add collect artifacts step to nerdctl workflow
2024-03-07 13:34:40 -06:00
Wainer Moschetta
91998af173
Merge pull request #9114 from wainersm/ci_kbs_cli
CI: add KBS utilities for attestation tests
2024-03-07 16:34:03 -03:00
Wainer dos Santos Moschetta
8ea9ac515e tests/k8s: update kbs repository
Recently confidential-containers/kbs repository was renamed to
confidential-containers/trustee. Github will automatically resolve the
old URL but we better adjust it in code.

The trustee repository will be cloned to $COCO_TRUSTEE_DIR. Adjusted
file paths and pushd/popd's to use $COCO_KBS_DIR
($COCO_TRUSTEE_DIR/kbs).

On versions.yaml changed from `coco-kbs` to `coco-trustee` as in the
future we might need other trustee components, so keeping it generic.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-03-07 11:20:36 +00:00
Wainer dos Santos Moschetta
c669567cd3 tests/k8s: add utils to set KBS policies
Added the kbs_set_resources_policy() function to set the KBS policy. Also the
kbs_set_allow_all_resources() and kbs_set_deny_all_resources to set the
"allow all" and "deny all" policy, respectively.

Fixes #9056
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-03-07 11:20:36 +00:00
Wainer dos Santos Moschetta
6f0d38094d tests/k8s: add utils to set KBS resources
Added utility functions to manage resources in KBS:
- kbs_set_resource(), where the resource data is passed via argument
- kbs_set_resource_from_file(), where the resource data is found in a
  file

Fixes #9056
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-03-07 11:20:36 +00:00
Wainer dos Santos Moschetta
2a374422c5 tests/k8s: add function to install kbs-client
Added kbs_install_cli function to build and install the kbs-client
executable if not present into the system.

Removed the stub from gha-run.sh; now the install kbs-client in the
.github/workflows/run-kata-deploy-tests-on-aks.yaml will effectively
install the executable.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-03-07 11:20:36 +00:00
Wainer dos Santos Moschetta
e410aef4fa tests/k8s: add utils to get kbs service address
Added functions to return the service host, port or full-qualified
HTTP address, respectively, kbs_k8s_svc_host(), kbs_k8s_svc_port(),
and kbs_k8s_svc_http_addr().

Fixes #9056
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-03-07 11:20:36 +00:00
Dan Mihai
c08b696d9e tests: k8s: k8s-shared-volume generated policy
Auto-generate policy for k8s-shared-volume.bats.

Fixes: #9096

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-03-07 05:57:30 +00:00
Dan Mihai
b24758fad8 tests: k8s: k8s-scale-nginx auto-generated policy
Auto-generate policy for k8s-scale-nginx.bats.

Fixes: #9096

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-03-07 05:57:30 +00:00
Dan Mihai
af9ac8d194 tests: k8s: k8s-replication auto-generated policy
Auto-generate policy for k8s-replication.bats.

Fixes: #9096

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-03-07 05:57:30 +00:00
Dan Mihai
56689c6800 tests: k8s: k8s-qos-pods auto-generated policy
Auto-generate policy for k8s-qos-pods.bats.

Fixes: #9096

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-03-07 05:57:30 +00:00
Dan Mihai
0179f53469 tests: k8s: k8s-parallel auto-generated policy
Auto-generate policy for k8s-parallel.bats.

Fixes: #9096

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-03-07 05:57:30 +00:00
Gabriela Cervantes
94fdcda7f7 scripts: Add collect artifacts function in nerdctl gha run script
This PR adds the collect artifacts function in nerdctl gha run script.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-03-06 19:48:12 +00:00
James O. D. Hunt
b1d4cbd9d1 utils: spell-checker: Fix grep warning
Fix the `grep(1)` warning caused by the unnecessary escaping of the
hash/sharp symbol.

Fixes: #9235.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2024-03-06 13:21:15 +00:00
James O. D. Hunt
a67ed2f1c2 tests: Add k3s artifacts
The k3s distribution of k8s uses an embedded version of containerd and
configures it to log to a file, not the journal. Hence, although we
collect the journal as a test artifact, we also need to collect the
actual log files for containerd.

Also collect the k3s containerd config files to help with debugging.

Fixes: #9104.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2024-03-05 17:54:20 +00:00
Wainer dos Santos Moschetta
9ba5e3d2a8 gha: export start_time to collect artifacts properly
The jobs running on garm will collect journal information. The data gathered
is based on the time the tests started running. The $start_time is
exported on run_tests() and used in collect_artifacts(). It happens that
run_tests() and collect_artifacts() are called on different steps of the
workflow and the environment variables aren't preserved between them,
i.e, $start_time exported on the first step is not available on the
subsequents.

To solve that issue, let's save $start_time in the file pointed out by
$GITHUB_ENV that Github actions uses to export variables. In case $GITHUB_ENV is
empty then probably it is running locally outside of Github, so it won't
save the start time value.

Fixes #9217
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-03-05 12:15:20 -03:00
Greg Kurz
0320198889
Merge pull request #9206 from lifupan/main
CI: fix the issue of ci failure on crio
2024-03-05 09:52:13 +01:00
Wainer Moschetta
38088a934b
Merge pull request #9184 from wainersm/fix_kata_deploy_bats
tests/kata-deploy: fix checker for kata-deploy running
2024-03-04 20:50:37 -03:00
GabyCT
77d048da4d
Merge pull request #9065 from wainersm/ci_install_kbs
CI: Install KBS on k8s for attestation tests
2024-03-04 16:59:01 -06:00
Gabriela Cervantes
5d50262422 docs: Add general tests documentation in main README
This PR adds the general tests documentation in main README of the
kata containers repository.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-03-04 21:53:01 +00:00
Gabriela Cervantes
d5fa2bebd5 docs: Add general README for tests section
This PR adds general README documentation for the tests section
in the kata containers repository.

Fixes #9209

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-03-04 21:50:37 +00:00
GabyCT
4dea9019ab
Merge pull request #9126 from GabyCT/topic/addartifactsk
gha: Storing artifacts for logs of k8s tests garm
2024-03-04 15:41:54 -06:00
Gabriela Cervantes
fc5e040d96 scripts: Apply general fixes to variables in gha-run script
This PR applies general fixes to variables in gha-run script.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-03-04 18:54:15 +00:00
Fupan Li
07e0cf1855 CI: fix the issue of ci failure on crio
PR #8760 tentatively tried to have the shim to run in its own mount
namespace for the sake of improving isolation between the sandbox and
the host. Thus crio storage drivers shouldn't create a PRIVATE
bind mount on their home directory. Otherwise, the container's rootfs
mount wouldn't be propagated to kata runtime's mount namespace, and
kata runtime couldn't access the container's rootfs files.

So, when kata cooperated with crio, crio should set
skip_mount_home=true for its storage overlay.

Fixes: #9028

Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
2024-03-03 20:53:36 +08:00
Wainer dos Santos Moschetta
2c24977cb1 tests/k8s: allow to overwrite the cluster name
_print_cluster_name() create a string based information like the
pull request number and commit SHA. However, when you are developing the
scripts you might want to use an arbitrary name, so it was introduced
the $AKS_NAME variable that once exported it will overwrite the
generated name.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-03-02 12:42:35 -03:00
Wainer dos Santos Moschetta
5e4b7bbd04 tests/k8s: expose KBS service externally
Until this point the deployed KBS service is only reachable from within
the cluster. This introduces a generic mechanism to apply an Ingress
configuration to expose the service externally.

The first implemened ingress is for AKS. In case the HTTP application
routing isn't enabled in the cluster (this is required for ingress), an
add-on is applied.

It was added the get_cluster_specific_dns_zone() and
enable_cluster_http_application_routing() helper functions
to gha-run-k8s-common.sh.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-03-02 12:42:35 -03:00
Wainer dos Santos Moschetta
e1e0b94975 tests/k8s: introduce the CoCo kbs library
Introduce the tests/integration/kubernetes/confidential_kbs.sh library
that contains functions to manage the KBS on CI. Initially implemented
the kbs_k8s_deploy() and kbs_k8s_delete() functions to, respectively,
deploy and delete KBS on Kubernetes. Also hooked those functions in the
tests/integration/kubernetes/gha-run.sh script to follow the convention
of running commands from Github Workflows:

$ .tests/integration/kubernetes/gha-run.sh deploy-coco-kbs
$ .tests/integration/kubernetes/gha-run.sh delete-coco-kbs

Fixes #9058
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-03-02 12:39:26 -03:00
Wainer dos Santos Moschetta
6a28c94d99 tests/k8s: add a kustomize installer
Kustomize has been used on some of our internal components (e.g.
kata-deploy) to manage k8s deployments. On CI it has been used
the `sed` tool to edit kustomization.yaml files, but `kustomize` is
more suitable for that purpose. So in order to use that tool on CI
scripts in the future, this commit introduces the `install_kustomize()`
function that is going to download and install the binary in
/usr/local/bin in case it's found on $PATH.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-03-02 12:39:26 -03:00
GabyCT
4a0cfc4e3f
Merge pull request #9199 from GabyCT/topic/enablecri
gha: Enable cri-containerd tests for cloud hypervisor runtime-rs
2024-03-01 12:23:16 -06:00
Gabriela Cervantes
7299dbdb43 gha: Store journalctl logs
This PR stores the journalctl logs.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-03-01 15:17:20 +00:00
Gabriela Cervantes
342d3a320d gha: Add collect artifacts function in gha-run script
This PR adds the collect artifacts function in gha-run script for
the kubernetes tests.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-03-01 15:17:20 +00:00
Greg Kurz
dc6bda19bf
Merge pull request #9179 from gkurz/fix-k8s-sandbox-vcpus-allocation-check
tests: k8s: Adapt k8s-sandbox-vcpus-allocation.bats to kubernetes v1.29
2024-03-01 15:55:07 +01:00
Wainer dos Santos Moschetta
24c163e6e1 tests/kata-deploy: fix checker for kata-deploy running
Currently, the checking for kata-deploy is running assume that the
daemonset scheduled at least one pod, however it might not had and the
kubectl wait command fails due to "error: no matching resources found".

On CI I've observed that fail intermittently. I suspect the service
account kata-deploy-sa take a while to show up then no kata-deploy is
scheduled in meanwhile.

Changed the checker logic to use waitForProcess() to keep testing if it is
already running, or hit the timeout (still 10m).

Fixes #9183
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-02-29 22:26:27 -03:00
Gabriela Cervantes
beb592b309 gha: Enable cri-containerd tests for cloud hypervisor runtime-rs
This PR enables the cri-containerd tests for cloud hypervisor runtime-rs.

Fixes #9198

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-02-29 20:18:16 +00:00
Gabriela Cervantes
0f595cf15b gha: General variable fixes to gha-run script
This PR adds general variable fixes to gha-run script.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-02-29 18:15:27 +00:00
Greg Kurz
f3442cdef9 tests: k8s: Adapt k8s-sandbox-vcpus-allocation.bats to kubernetes v1.29
Kubernetes v1.29 introduced a new `PodReadyToStartContainers` condition
that gets inserted at index 0 in the conditions array. This means that
the expected `PodCompleted` reason can now be either at index 0 with
kubernetes v1.28 and older or at index 1 starting with kubernetes v1.29.
This is fragile at best since the `kubectl wait` doesn't allow to combine
multiple checks. Also, checking the reason is dubious as it doesn't really
tell if the pods have actually completed or not.

Check the pod phase to be `Succeeded` instead, this guarantees that :

> All containers in the Pod have terminated in success, and will not
> be restarted.

Fixes #9178

Signed-off-by: Greg Kurz <groug@kaod.org>
2024-02-29 17:00:31 +01:00
Greg Kurz
f89120662d tests: k8s: Wait for all pods concurrently
A single invocation of `kubectl wait` can handle all pods.

Signed-off-by: Greg Kurz <groug@kaod.org>
2024-02-29 17:00:31 +01:00
Gabriela Cervantes
3cd319fcc2 scripts: General fixes to the gha-run script
This PR implements general fixes to the gha-run script for the
cri-containerd tests.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-02-28 19:32:51 +00:00
Gabriela Cervantes
5a498948c8 scripts: Skip cri-containerd in gha-run script
This PR skips the cri-containerd in gha-run script for cloud hypervisor
runtime-rs.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-02-28 19:30:38 +00:00
Wainer Moschetta
c4b8270073
Merge pull request #9009 from wainersm/runk_bats
tests/runk: fix the "run ps command" flaky test
2024-02-28 15:58:36 -03:00
Wainer Moschetta
129ce84705
Merge pull request #9116 from wainersm/ci_install_kbs-workflow
gha: k8s: prepare AKS workflow to install the CoCo KBS
2024-02-28 14:43:41 -03:00
Wainer dos Santos Moschetta
b44e0c4e7c gha: k8s: prepare AKS workflow to install the CoCo KBS
Changed the "run k8s tests on AKS" workflows to get the CoCo KBS
installed so that we can run attestation tests.

The plan is to run attestation tests only on a subset of non-TEE jobs
initially, so this commit restricts to install KBS only on kata-qemu
configuration. Actually at this point it is added only stubs commands
to tests/integration/kubernetes/gha-run.sh that should be implemented
in a future commit.

Fixes #9058
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-02-27 13:51:15 -03:00
Wainer dos Santos Moschetta
0f8c36d990 tests/nydus: refactor the teardown()
This refactor the teardown() of tests/integration/nydus/nydus_tests.sh:

* Moved boilerplate code that kill process to a loop;
* Doesn't leave teardown() if a process failed to get killed, so that
  other clean up routines are ran;
* Check if the pid exist then attempt to kill the process, so avoid this
  misleading message:
```
Usage:
 kill [options] <pid> [...]

Options:
 <pid> [...]            send signal to every <pid> listed
 -<signal>, -s, --signal <signal>
                        specify the <signal> to be sent
 -q, --queue <value>    integer value to be sent with the signal
 -l, --list=[<signal>]  list all signal names, or convert one to a name
 -L, --table            list all signal names in a nice table

 -h, --help     display this help and exit
 -V, --version  output version information and exit

For more details see kill(1).
```

Fixes #8948
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-02-26 11:21:43 -03:00
Wainer dos Santos Moschetta
0f0ce9a81b tests/runk: replace the busybox image
It's recommended to avoid images from docker.io to avoid errors related
with hitting the pull limits that happens mostly on bare-metal machines.

So this replaced the docker.io's busybox with
quay.io/prometheus/busybox.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-02-26 11:11:05 -03:00
Wainer dos Santos Moschetta
bba8b5b2b4 tests/runk: fix flaky test
The "run ps command" test has failed once in a while because it doesn't
wait the sh command to start within the container, consequently `ps`
won't report the amount of lines expected.

Fixes #8975
Signed-off-by: Manabu Sugimoto <Manabu.Sugimoto@sony.com>
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-02-26 11:09:29 -03:00
Wainer dos Santos Moschetta
8a606eb94d tests/runk: convert to bats
Migrated runk tests from pure shell script to bats to be consistent with
other test suites.

The install_dependencies() will install the bats tool locally.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-02-26 11:09:23 -03:00
GabyCT
4f3c83cd12
Merge pull request #9115 from GabyCT/topic/adddief
scripts: Add an enhanced die function
2024-02-23 12:03:02 -06:00
Steve Horsman
dfa6e932bb
Merge pull request #9122 from ChengyuZhu6/snapshotter-clean
gha: try to cleanup nydus snapshotter before deploying it
2024-02-22 13:30:04 +00:00
ChengyuZhu6
8ab3894dc5 gha: try to cleanup nydus snapshotter before deploying it
CI failed to deploy nydus snapshotter because it was not cleaned up last time.
So we can try to cleanup nydus snapshotter before deploying it.

Fixes: #9121

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
Co-authored-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-22 18:51:14 +08:00
Dan Mihai
b3c3f992ab tests: k8s: common clean-up on teardown
teardown() gets executed after each test case, so there is no need to
clean-up before teardown.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:08 +00:00
Dan Mihai
9c164698d3 tests: k8s: k8s-optional-empty-configmap policy
Auto-generate policy for k8s-optional-empty-configmap.bats.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:08 +00:00
Dan Mihai
74a52c6d25 tests: k8s: k8s-oom.bats auto-generated policy
Auto-generate policy for k8s-oom.bats.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:08 +00:00
Dan Mihai
26a77d67f4 tests: k8s: k8s-number-cpus auto-generated policy
Auto-generate policy for k8s-number-cpus.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:08 +00:00
Dan Mihai
9cbdce15fd tests: k8s: k8s-memory.bats auto-generated policy
Auto-generate policy for k8s-memory.bats.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:08 +00:00
Dan Mihai
40209cc0b7 tests: k8s: k8s-limit-range auto-generated policy
Auto-generate policy for k8s-limit-range.bats.

Also, fix teardown() namespace.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:08 +00:00
Dan Mihai
df3c0318c6 tests: k8s: add set_namespace_to_policy_settings
Add set_namespace_to_policy_settings() for changing the pod namespace
in genpolicy settings.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:08 +00:00
Dan Mihai
6e14ce93c9 tests: k8s-kill-all-process-in-container policy
Auto-generate policy for k8s-kill-all-process-in-container.bats.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:07 +00:00
Dan Mihai
fad7ba0aea tests: k8s: k8s-job.bats auto-generated policy
Auto-generate policy for 8s-job.bats.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:07 +00:00
Dan Mihai
41c2bcbdc5 tests: k8s: k8s-file-volume auto-generated policy
Auto-generate policy for k8s-file-volume.bats.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:07 +00:00
Dan Mihai
81e641814f tests: k8s: k8s-cpu-ns auto-generated policy
Auto-generate policy for k8s-cpu-ns.bats.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:07 +00:00
Dan Mihai
bc6d3fc238 tests: k8s: k8s-env.bats auto-generated policy
Auto-generate policy for k8s-env.bats.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:07 +00:00
Dan Mihai
0a4fc071ac tests: k8s: k8s-custom-dns auto-generated policy
Auto-generate policy for k8s-custom-dns.bats.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:07 +00:00
Dan Mihai
f693f49e92 tests: k8s: k8s-credentials-secrets policy
Auto-generate policy for k8s-credentials-secrets.bats.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:07 +00:00
Dan Mihai
d3d27bbb5b tests: k8s: k8s-configmap auto-generated policy
Auto-generate policy for k8s-configmap.bats.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:07 +00:00
Dan Mihai
b318535536 tests: k8s: auto-generate k8s-caps.bats policy
Auto-generated policy for k8s-caps.bats.

Fixes: #9072

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-21 18:08:07 +00:00
Chelsea Mafrica
241a56989a
Merge pull request #9090 from GabyCT/topic/pulldockerimage
gha: docker: Pull docker image as part of the dependencies
2024-02-20 14:28:53 -08:00
GabyCT
64c09fe6c5
Merge pull request #9088 from GabyCT/topic/fixnydus
gha: nydus: Fix indentation in gha run script
2024-02-20 14:09:54 -06:00
Gabriela Cervantes
ff8a6fa9ef scripts: Add error script
This PR adds the error script to display the error message with
much more information to help debugging.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-02-20 18:30:03 +00:00
Gabriela Cervantes
43a46d5a6b scripts: Add an enhanced die function
This PR adds an enhanced die function in order to dump more information
in a yaml format that will help with the debugging.

Fixes #9105

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-02-20 18:27:44 +00:00
Fabiano Fidêncio
3468ac3b6e
ci: k8s: Fix checks used to skip confidential tests
This has been introduced by 53bc4a432b,
where the condition was changed.

The correct condition is:
* If the list of supported tees does not contain the kata hypervisor
  and the list of supported non tees does not contain the kata
  hypervisor.

The error is that we were checking whether kata-hypervisor would contain
the list of supported tees, and that would almost always be false
(unless in the case where the list had an one and only one element).

Fixes: #9055 -- part II

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-18 10:10:45 +01:00
Hyounggyu Choi
8b3f7f353d CI|k8s: Skip vcpu allocation test for s390x
A test `vcpu allocation k8s test` exhibits different behavior on s390x
For more details, please refer to issue #9093.
This commit is to make the test skipped until the issue is resolved on
the platform.

Fixes: #9093

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-02-15 12:26:35 +01:00
GabyCT
9cf343779f
Merge pull request #9062 from GabyCT/topic/nonteet
tests: Add ability to run non-TEE environments
2024-02-13 14:28:07 -06:00
Gabriela Cervantes
598c77409a gha: docker: Pull docker image as part of the dependencies
This PR pulls the docker image needed for the test as part of the dependencies
in order to avoid failures of timeouts mainly because the image was not
properly download it and it is unable to find it.

Fixes #9089

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-02-13 17:48:31 +00:00
Gabriela Cervantes
53bc4a432b tests: Add ability to run non-TEE environments
This PR adds the ability to run k8s confidential tests in a
non-TEE environment.

Fixes #9055

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-02-13 17:27:55 +00:00
Gabriela Cervantes
54d1f34650 gha: nydus: Fix indentation in gha run script
This PR fixes the indentation in gha run script for nydus.

Fixes #9087

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-02-13 16:53:28 +00:00
Fabiano Fidêncio
3877a9f49a
ci: Clean up kata-deploy ds before starting the tests
This will ensure no leftovers are in the node, which has been cause the
TDX CI to fail every now and then.

Fixes: #9081

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-13 14:10:44 +01:00
GabyCT
00be9ae872
Merge pull request #9070 from microsoft/danmihai1/debug-containers
tests: k8s: avoid deleting unrelated pods
2024-02-12 15:24:15 -06:00
Greg Kurz
532567bfe9
Merge pull request #8936 from fidencio/topic/fix-cri-o-ci
tests: cri-o: Use packages from pkgs.k8s.io
2024-02-12 10:04:53 +01:00
Dan Mihai
a21ca9b7c9 tests: k8s: avoid deleting unrelated pods
Delete the debugger pod created during the test, rather than already
existing debugger pods.

Also, send the output of "kubectl delete" to stderr, just in case it's
useful for debugging.

Fixes: #9069

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-09 22:48:41 +00:00
Dan Mihai
a054462eb7
Merge pull request #9051 from microsoft/danmihai1/k8s-copy-file
tests: k8s: k8s-copy-file auto-generated policy
2024-02-09 12:30:49 -08:00
ChengyuZhu6
97fbf360cc
gha: Cleanup nydus snapshotter by the daemonset
Cleanup nydus snapshotter by the daemonset.

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-02-09 14:47:13 +01:00
ChengyuZhu6
43b04fd0c0
gha: Deploy nydus snapshotter by the daemonset
We can use daemonset to deploy nydus snapshotter, which will decrease
one manual step both for Kata Containers and Confidential Containers CI.

Fixes: #8584

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-02-09 14:47:09 +01:00
Fabiano Fidêncio
344e0580ca
tests: cri-o: Use packages from pkgs.k8s.io
CRI-O has moved, for a long time, towards pkgs.k8s.io, see:
https://kubernetes.io/blog/2023/10/10/cri-o-community-package-infrastructure/

With this the OBS repo won't be used anymore.

Fixes: #8935

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-02-09 12:15:55 +01:00
Gabriela Cervantes
0b508f301b tests:k8s: make add_kernel_initrd_anotations function generic
This PR replaces the add_kernel_initrd_annotations_to_yaml function
more generic so later can be used for other components.

Fixes #9054

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-02-08 19:30:43 +00:00
Dan Mihai
f139c7dc60 tests: k8s: k8s-copy-file auto-generated policy
Auto-generate policy for k8s-copy-file.bats.

Fixes: #9050

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-08 13:26:05 +00:00
Dan Mihai
1179306afa tests: k8s: additional policy testing utilities
1. add_requests_to_policy_settings allows one or more ttrpc requests
   from the Host to the Guest. Example:

add_requests_to_policy_settings "${policy_settings_dir}" \
   "ReadStreamRequest" "WriteStreamRequest"

2. add_copy_from_host_to_policy_settings allows executing on the Guest
   the commands initiated behind the scenes by "kubectl cp" from the
   Host to the Guest. Example:

add_copy_from_host_to_policy_settings "${policy_settings_dir}"

3. add_copy_from_guest_to_policy_settings allows executing on the Guest
   the commands initiated behind the scenes by "kubectl cp" from the
   Guest to the Host. Example:

add_copy_from_guest_to_policy_settings "${policy_settings_dir}" \
   "/tmp/file.txt"

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-08 13:25:41 +00:00
Dan Mihai
2bb91c9d8f
Merge pull request #8922 from microsoft/danmihai1/k8s-attach-handlers
tests: k8s-attach-handlers auto-generated policy
2024-02-07 13:29:50 -08:00
Dan Mihai
6b5e57f7c7 tests: k8s: address PR review feedback
1. Rename install_kata_common to install_kata_core.

2. Add TODO for better way to install the Kata tools.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-07 18:51:56 +00:00
ChengyuZhu6
d0b8e6d8f3 nydus: Bump nydus snapshotter version to v0.13.7
Bump nydus snapshotter version to v0.13.7.
The new release name of nydus snapshotter is `nydus-snapshotter-v0.13.7-linux-amd64.tar.gz`,
which differs from the version used by kata (`nydus-snapshotter-v0.12.0-x86_64.tgz`).
Therefore, we need to update the script to obtain the correct nydus snapshotter name.

Fixes: #9044

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-02-07 22:17:05 +08:00
Dan Mihai
dd16bc393f tests: k8s: k8s-attach-handlers generated policy
Automatically generate the test policy for k8s-attach-handlers.bats,
if AUTO_GENERATE_POLICY is enabled.

Steps:

- Create a temporary directory for the current test and copy the
  common genpolicy settings into this new directory.

- Change genpolicy settings in the temp directory to allow the
  "kubectl exec" command that this test needs. (For CoCo, exec is
  blocked by the default policy settings)

- Auto-generate the policy for the test YAML file.

- Test as usual, using the YAML file.

- Clean-up the temporary settings described above.

Fixes: #8921

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-07 02:26:03 +00:00
Dan Mihai
0de407f8b7 tests: k8s: enable AUTO_GENERATE_POLICY
Enable AUTO_GENERATE_POLICY for one of the Kata CI K8s test platforms.
Additional platforms will be enabled after testing them.

When AUTO_GENERATE_POLICY is enabled, create genpolicy settings that
are common for all tests. Some of the tests will make temporary copies
of these common settings and customize them as needed.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-07 02:25:54 +00:00
Dan Mihai
05b2e4f606 tests: k8s: install genpolicy
Install the genpolicy app before starting test execution.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-07 02:25:42 +00:00
Dan Mihai
8aa8b70573 tests: k8s: add policy test utilities
Add script functions useful for auto-generating and testing policy.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-07 02:24:06 +00:00
Dan Mihai
24a17a2e1b tests: k8s: output the names of test files
Output the names of test files, for easier search through logs.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-07 02:23:54 +00:00
Dan Mihai
bf533de31a tests: k8s: add DEBUG support for test scripts
Make these scripts easier to debug.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-07 02:23:46 +00:00
Dan Mihai
1b4ef672ef tests: k8s: reduce namespace name duplication
1. Avoid repeating "kata-containers-k8s-tests".
2. Allow users to specify a different test namespace.
3. Introduce the TEST_CLUSTER_NAMESPACE variable, that will also be
   useful when auto-generating the Agent Policy for these tests.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-07 02:23:38 +00:00
Dan Mihai
8a5ba5fb34 tests: k8s: allow run_kubernetes_tests.sh exec
Allow everyone to directly execute run_kubernetes_tests.sh, for easier
local testing.

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-02-07 02:23:30 +00:00
GabyCT
d74b6e143f
Merge pull request #8951 from GabyCT/topic/udf
metrics: Update packages for TensorFlow ResNet Int8 Dockerfile
2024-02-06 14:29:41 -06:00
GabyCT
6337f300a8
Merge pull request #8628 from GabyCT/topic/enablek8stclh
tests: k8s: Enable tests for cloud hypervisor runtime-rs without devicemapper
2024-02-06 14:28:35 -06:00
Gabriela Cervantes
cf049fc718 k8s: Skip k8s tests that are not working
This PR skips the k8s tests that are not working with cloud hypervisor
runtime-rs with its proper issue.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-02-06 16:52:02 +00:00
Wainer Moschetta
f1ca5d1563
Merge pull request #8953 from ChengyuZhu6/ci-guest-pull
gha: Enable nydus snapshotter in CoCo ci tests
2024-02-06 09:36:59 -03:00
Wainer dos Santos Moschetta
106e1af497 cri-containerd: fix loop in TestContainerMemoryUpdate()
The loop that generate test cases for virtio-mem enabled/disabled
doesn't return the integers '1' and '0' as expected. Instead it returns
the strings '{1,' and '0}'.

Fixes #9024
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-02-05 10:59:39 -03:00
ChengyuZhu6
a214bd8d13 gha: Enable nydus snapshotter in CoCo ci tests
This PR is a split of #8585.
make the changes on the Github workflows, and the skeleton to deploy_snapshotter()
and cleanup_snapshotter() in tests/integration/kubernetes/gha-run.sh in this commit.

After initially merging this patch to trigger CI jobs for CoCo, which will begin executing
the dummy functions deploy_snapshotter() and cleanup_snapshotter(), the implementation details for these functions
remain in #8585. Our subsequent step involves transferring this logic to the PR #8484, enabling the PR to undergo CI testing prior to its merge.

Fixes: #8997

Signed-off-by: ChengyuZhu6 <chengyu.zhu@intel.com>
2024-02-05 18:51:59 +08:00
Xuewei Niu
fa01a86334
Merge pull request #9007 from wainersm/aks_delete_rg
gha: delete azure RG only if it exists
2024-02-04 16:34:17 +08:00
Wainer dos Santos Moschetta
a04b215bcc gha: delete azure RG only if it exists
delete_cluster() has tried to delete the az resources group regardless
if it exists. In some cases the result of that operation is ignored,
i.e., fail to resource group not found, but the log messages get a
little dirty. Let's delete the RG only if it exists then.

Fixes #8989
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2024-02-02 16:57:20 -03:00
Gabriela Cervantes
eb5b7d3bf8 tests: k8s: Enable tests for cloud hypervisor runtime-rs
This PR enable the k8s tests for cloud hypervisor runtime-rs.

Fixes #8627

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-02-02 17:58:58 +00:00
Amulya Meka
e4252a3fe2
Merge pull request #8957 from Amulyam24/add-k8s-test-ppc64le
gha: add kubernetes tests workflow for ppc64le
2024-02-02 10:22:00 +05:30
Aurélien Bombo
0ace31f041 ci: aks: switch from eastus2 to eastus region
This addresses an internal AKS issue that intermittently prevents
clusters from getting created. The fix has been rolled out to eastus but
not yet eastus2, so we unblock the CI by switching. No downsides in
general.

This supersedes #8990.

Fixes: #8989

Signed-off-by: Aurélien Bombo <abombo@microsoft.com>
2024-02-01 19:22:42 +00:00
Amulyam24
f8585db8d9 gha: add kubernetes tests workflow for ppc64le
This PR adds workflow for running kubernetes test suite on ppc64le.

It uses scripts to create and delete the cluster using kubeadm as none of the current cluster creation tools are supported on Power.

Fixes: #7950

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2024-02-01 12:23:11 +05:30
Gabriela Cervantes
78b517ccc8 tests: Re-arranged nerdctl tests
This PR re-arranged the nerdctl tests to avoid random failures.
In this PR first will run the tests with RunC and then with the kata hypervisor.
This PR tries to avoid the random failures that is happening with cloud-hypervisor
and clh.

Fixes #8963

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-01-30 16:07:12 +00:00
Gabriela Cervantes
31813cf8d8 metrics: Update packages for TensorFlow ResNet Int8 Dockerfile
This PR updates the required packages for the TensorFlow ResNet50
Int8 Dockerfile.

Fixes #8950

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-01-29 16:11:09 +00:00
Fabiano Fidêncio
448c0aaecb
gha: azure: Set the correct subscription to the account
Due to the changes done in the CI, we need to set the correct
subscription to be used with the account from now on, otherwise we'd end
up using CoCo subscription.

Fixes: #8946

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2024-01-29 15:00:38 +01:00
Hyounggyu Choi
ab462a4b89 tests: Add IBM SE to the basic confidential test
The existing confidential basic test titled `Test unencrypted
confidential container launch success and verify that we are
running in a secure enclave` has been updated to incorporate
IBM Secure Execution (`qemu-se`).
Previously, a secure image was absent from kata-deploy, hindering
the inclusion of IBM SE in the test.
Thanks to the #6755 update, it is now possible to test the TEE.

This modification extends the existing test by introducing
`qemu-se`. The specific changes are outlined below:

- Add an additional test `cc-se-e2e-tests` to s390x nightly
- Expansion of `REMOTE_COMMAND_PER_HYPERVISOR` for `qemu-se`
- Temporary exclusion of two test cases currently incompatible with IBM SE
(`cpu-ns` is a common issue across all TEEs, while `inotify`
will be addressed in a subsequent pull request).

Fixes: #8913

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2024-01-26 06:04:39 +01:00
GabyCT
36fc2fd83f
Merge pull request #8876 from GabyCT/topic/dockerrestfp
metrics: Update packages needed for ResNet50 FP32 Dockerfile
2024-01-25 13:51:16 -06:00
Dan Mihai
66c012d052 tests: k8s: bats --show-output-of-passing-tests
Add --show-output-of-passing-tests to the k8s integration tests. The
output of a passing test can be helpful when investigating a failure
of the same test.

Fixes: #8885

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-01-24 03:04:28 +00:00
Gabriela Cervantes
eb7e123de8 metrics: Update packages needed for ResNet50 FP32 Dockerfile
This PR updates the packages necessary to build the ResNet50 fp32
Dockerfile to run properly the benchmark.

Fixes #8875

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-01-22 16:15:36 +00:00
Dan Mihai
ea9c659d36 gha: get ready to install genpolicy
The changes to install and test genpolicy must come later, after CI
picks up these gha changes.

Fixes: #8856

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-01-19 23:37:49 +00:00
David Esparza
e11c520ffa
Merge pull request #8808 from kata-containers/memory_usage_test_skip_virtiofs_when_req
tests: Ignore virtiofs contribution to memory usage when it is disabled.
2024-01-16 16:50:06 -06:00
David Esparza
4b772d2480 tests: Ignore virtiofs contribution to memory usage when it is disabled.
This PR removes the references to virtiofs from memory average
calculation when the container uses a shared file system other than
virtiofs.

Fixes: #8807

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2024-01-15 08:07:06 -08:00
Gabriela Cervantes
dff800a8ff metrics: Remove iperf3 server protocol
This PR removes the iperf3 server protocol as this server definition is
also used for the UDP iperf3 benchmarks to avoid duplication of the
same yaml files.

Fixes #8829

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-01-15 15:44:24 +00:00
Dan Mihai
b7c31e3b98 tests: cbl-mariner: disable k8s-oom.bats
Disable k8s-oom.bats on cbl-mariner until it passes more often.

Fixes: #8824

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-01-14 17:39:25 +00:00
GabyCT
a7114a35a8
Merge pull request #8792 from GabyCT/topic/updatenhwc
metrics: Use a specific python version to run tensorflow benchmark
2024-01-12 11:24:54 -06:00
Alex.Lyn
ffcd95b6b4
Merge pull request #8737 from Apokleos/test-ci-dgb-cri-containerd
ci: enable test dragonball stability and cri-containerd
2024-01-12 11:56:22 +08:00
Gabriela Cervantes
12a41f89b1 metrics: Use a specific python version to run tensorflow benchmark
This PR uses a specific python version to run tensorflow benchmark
as it needs python 3.8 to run correctly and avoid failures.

Fixes #8791

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-01-11 22:15:31 +00:00
GabyCT
69be050ff9
Merge pull request #8657 from WenyuanLau/8656/Fix_StratoVirt_on_gha_metrics
gha: Fix the failure of gha metrics for StratoVirt
2024-01-11 11:41:25 -06:00
alex.lyn
b97efc3139 CI: enable test container memory update for dragonball
Fixes: #8746

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2024-01-11 19:07:33 +08:00
alex.lyn
6c85e95c34 CI: bugfix for dragonball when CI running with cri-containerd
Containerd runtime options with wrong setting cause it failed.
Correct it as below:
...
 [plugins.cri.containerd.runtimes.${runtime}.options]
   ConfigPath= "${KATA_CONFIG_PATH}"
...

Fixes: #8746

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2024-01-11 17:35:33 +08:00
alex.lyn
cd59d31a15 CI: make CI work for dragonball to test stability and cri-containerd
It needs to remove the skip setting, and make it work for dragonball.

Fixes: #8746

Signed-off-by: alex.lyn <alex.lyn@antgroup.com>
2024-01-11 17:35:13 +08:00
Dan Mihai
de61b4d4e2
Merge pull request #8772 from microsoft/danmihai1/wait-for-delete
tests: list the current k8s pods
2024-01-09 13:45:55 -08:00
Gabriela Cervantes
24fab19f6f tests: Remove check images function from stressng test
This PR removes the check images function from stressng test as now
it will part of the install dependencies function from gha-run script.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-01-08 17:40:39 +00:00
Gabriela Cervantes
aceba94d95 tests: Add check images as part of install dependencies
To avoid random failures while trying to build and install the stressng image,
this PR moves that step as part of the install dependencies in order to move
the stability tests and avoid timeouts.

Fixes #8787

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-01-08 17:38:14 +00:00
Dan Mihai
90c782f928 tests: list the current k8s pods
Log the list of the current pods between tests because these pods
might be related to cluster nodes occasionally running out of memory.

Fixes: #8769

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2024-01-05 16:41:43 +00:00
Gabriela Cervantes
4ad1971a0a tests: Add hypervisor component to kill kata components function
This PR adds the qemu-experimental hypervisor in the function to
kill kata components.

Fixes #8775

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-01-04 17:07:12 +00:00
GabyCT
f056ffe5ef
Merge pull request #8759 from fadecoder/update_docs_for_stratoVirt_VMM
docs: Update docs for new StratoVirt VMM introduction
2024-01-04 10:39:37 -06:00
Zhigang Wang
44b5b88f4c docs: Update docs for new StratoVirt VMM introduction
As the StratoVirt VMM has been added, we can update the docs
and make some intoduction to StratoVirt, thus users can know more
about the hypervisor choices.

Fixes: #8645

Signed-off-by: Zhigang Wang <wangzhigang17@huawei.com>
Signed-off-by: Liu Wenyuan <liuwenyuan9@huawei.com>
2024-01-04 14:26:48 +08:00
Gabriela Cervantes
4bc67dba08 metrics: Improve iperf3 cleanup
This PR improves the iperf3 cleanup to ensure all the components are
being deleted properly to avoid the random failures of leaving
the iperf3 clients on the kata metrics CI.

Fixes #8765

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2024-01-03 17:14:38 +00:00
Xuewei Niu
206ed6d77d tests: Load vhost modules explicitly while Kata installing
The default network backend of runtime-rs with Dragonball is vhost-net
after #8609 merged. The tests might be failed if vhost modules are not
loaded.

Fixes: #8717

Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
2023-12-22 11:07:37 +08:00
Dan Mihai
d916da15dd
Merge pull request #8688 from microsoft/danmihai1/k8s-confidential
tests: retry connection to pod SSH server
2023-12-20 15:01:26 -08:00
stevenhorsman
9e718b4e23 gha: kata-deploy: Add containerd status check
After kata-deploy has installed, check that the worker nodes
are still in Ready state and don't have a containerd://Unknown
container runtime versions, identicating that container isn't working
to ensure that we didn't corrupt the containerd config during kata-deploy's edits

Fixes: #8678
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
2023-12-20 09:10:43 +00:00
Dan Mihai
8aa390279e tests: retry connection to pod SSH server
To become more resilient against these kinds of errors:

deployment.apps/confidential-unencrypted created
pod/confidential-unencrypted-c5fdd6964-rrb6q condition met
ssh: connect to host 10.42.0.109 port 22: Connection refused

Fixes: #8687

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2023-12-20 02:48:05 +00:00
GabyCT
5504176e9a
Merge pull request #8699 from GabyCT/topic/fixconfidentialscript
tests: k8s: Fix indentation in confidential common script
2023-12-19 16:01:28 -06:00
Dan Mihai
551a50cd72 tests: additional run-runk logging
Add logging to run-runk, for debugging possible failures.

Fixes: #8696

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2023-12-19 14:08:01 +00:00
Gabriela Cervantes
1469a5efca tests: k8s: Fix indentation in confidential common script
This PR fixes the indentation of the confidential common
script for kubernetes tests.

Fixes #8698

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-12-18 20:25:06 +00:00
Liu Wenyuan
61fe20cf9a gha: Fix some of gha metrics failure for StratoVirt
Update the Speed & Density metric tests baseline for StratoVirt
and re-enable them, and skip other metric tests temporarily.

Fixes: #8656

Signed-off-by: Liu Wenyuan <liuwenyuan9@huawei.com>
2023-12-15 17:45:01 +08:00
GabyCT
4a49dd73db
Merge pull request #8676 from GabyCT/topic/fixins
tests: k8s: Fix indentation in setup script
2023-12-14 13:57:47 -06:00
GabyCT
7a606a19c4
Merge pull request #8659 from GabyCT/topic/improvecleanuplatency
metrics: Improve latency network cleanup
2023-12-14 13:57:28 -06:00
GabyCT
0831529279
Merge pull request #8644 from GabyCT/topic/updadockerresint
metrics: Update TensorFlow ResNet50 Int8 Dockerfile
2023-12-14 13:56:41 -06:00
Gabriela Cervantes
c92b14da97 tests: k8s: Fix indentation in setup script
This PR fixes the indentation of the kubernetes setup script.

Fixes #8675

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-12-14 16:26:22 +00:00
Gabriela Cervantes
8151117f73 metrics: Improve latency network cleanup
This PR improves the latency network cleanup by removing the pods
even if the test fails.

Fixes #8658

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-12-13 17:56:01 +00:00
Chelsea Mafrica
63636b869c static-checks: Update copyright dates
Some copyright dates were not updated with the most recent changes to
code; update them.

Fixes #8595

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2023-12-12 16:34:06 -08:00
Chelsea Mafrica
b11c772865 static-checks: Change dir for building tools
Change directory for running make due to local errors when building with
make -C.

Fixes #8595

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2023-12-12 16:34:06 -08:00
Gabriela Cervantes
23f76653e5 metrics: Update command to run the tensorflow int8 benchmark
This PR updates the command to run the tensorflow resnet50 int8 benchmark.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-12-12 16:24:09 +00:00
Gabriela Cervantes
8fd5ef7fb7 metrics: Update TensorFlow ResNet50 Int8 Dockerfile
This PR updates the TensorFlow ResNet50 Int8 Dockerfile to use the
proper python version for kata metrics.

Fixes #8643

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-12-12 16:20:56 +00:00
Chelsea Mafrica
a9d360728e static-checks: Fix directory for github labels
Fix paths for yqdir (where the install_yq.sh script currently is) so
that static checks can run without error.

Fixes #8595

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2023-12-12 02:16:35 -08:00
GabyCT
ee74fca92c
Merge pull request #8617 from GabyCT/topic/enabletestnerdctl
tests: nerdctl: Enable nerdctl tests for cloud hypervisor runtime-rs
2023-12-11 14:09:58 -06:00
David Esparza
584a26dab0
Merge pull request #8542 from dborquez/metrics_fix_deployment_cleaning
metrics: cleans k8s iperf deployment when the test finishes.
2023-12-11 13:14:39 -06:00
GabyCT
43410e1918
Merge pull request #8560 from GabyCT/topic/enablek8srs
gha: k8s: Add cloud-hypervisor (runtime-rs) support
2023-12-11 09:42:49 -06:00
James O. D. Hunt
2a35541af7
Merge pull request #8592 from jodh-intel/static-checks-try-multiple-user-agents
CI: static-checks: Try multiple user agents
2023-12-11 11:52:29 +00:00
Hyounggyu Choi
40f0c8fbb7 GHA: Use --client=true for k3s kubectl version
This is to fix a broken usage for `k3s kubectl version` by switching
an option `--short` to `--client=true`.

Fixes: #8621

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2023-12-11 08:26:39 +01:00
Gabriela Cervantes
1662a3e859 common: Add cloud hypervisor in enabling hypervisor function
This PR adds the cloud hypervisor in the enabling hypervisor function.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-12-08 21:32:00 +00:00
James O. D. Hunt
5d085a3042 CI: static-checks: Try multiple user agents
Make the URL checker cycle through a list of user agent values until we
hit one the remote server is happy with.

This is required since, unfortunately, we really, really want to check
these URLs, but some sites block clients based on their `User-Agent`
(UA) request header value. And of course, each site is different and can
change its behaviour at any time.

Our strategy therefore is to try various UA's until we find one the
server accepts:

- No explicit UA (use `curl`'s default)
- Explicitly no UA.
- A blank UA.
- Partial UA values for various CLI tools.
- Partial UA values for various console web browsers.
- Partial UA for Emacs's built-in browser.
- The existing UA which is used as a "last ditch" attempt where the UA implies multiple platforms and browser.

> **Notes:**
>
> - The "partial UA" values specify specify the UA "product" but not the
>   UA "product version": we specify `foo` and not `foo/1.2.3`). We do
>   this since most sites tested appear to not care about the version.
>   This is as expected given that the version is strictly optional (see `[*]`).
>
> - We now log all errors and display an error summary if none of the UAs
>   worked, in addition to the simple list of the URLs we believe to be
>   invalid. This should make future debugging simpler.

`[*]` - https://www.rfc-editor.org/rfc/rfc9110#section-10.1.5

Fixes: #8553.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2023-12-08 18:02:41 +00:00
James O. D. Hunt
613def0328 CI: static-checks: Move curl to a separate function
Split the call to `curl` in the URL checker out into a new
`run_url_check_cmd()` function to make `check_url()` slightly clearer.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2023-12-08 17:11:20 +00:00
James O. D. Hunt
6d859f97ee CI: static-checks: Lint fixes
Declare and then define a couple of variables separately.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2023-12-08 17:11:20 +00:00
James O. D. Hunt
efa8e6547c CI: static-checks: Check params have a value
Check that the `check_url()` parameters have a value.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2023-12-08 17:11:20 +00:00
James O. D. Hunt
563ea020b0 CI: static-checks: Fold long line
Break up a long line as little to make it easier to read.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2023-12-08 17:11:20 +00:00
James O. D. Hunt
3ad43df946 CI: static-checks: Improve markdown checker test
Only attempt to build the markdown checker if it doesn't already exist.

Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
2023-12-08 17:11:20 +00:00
Gabriela Cervantes
f3eeab10ab tests: nerdctl: Enable nerdctl tests for cloud hypervisor runtime-rs
This PR enables the nerdctl tests for cloud hypervisor runtime-rs.

Fixes #8616

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-12-08 16:12:36 +00:00
David Esparza
b2577000e7
metrics: Expose iperf3 pods over a k8s networks.
A prerequisite for measuring kata network bandwidth is
run Iperf3 tool at a the transport layer provided by a
k8s service for exposing a network where the clients
inside the cluster can use to contact Pods in the service.

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2023-12-07 18:07:05 -06:00
David Esparza
a062ba166b
metrics: cleans k8s iperf deployment when the test finishes.
This PR fixes small issues like:
1. Cleaning up the k8s environment by removing the iperf test
implementation even when the test fails.
2. Checks if the workload returned a result before generating
an empty results json file as it was bein done.
3. Removes the redundancy of calls to functions that process
subtests and should compose the results json file only when
all results are ready and not before.
4. The tcp service manifest was added to the server deployment
which targets TCP port 5201.

Fixes: #8534

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2023-12-07 18:02:39 -06:00
GabyCT
0e0a7d9410
Merge pull request #8604 from GabyCT/topic/enablenerdctlrs
gha: nerdctl: Enable cloud hypervisor runtime-rs for nerdctl CI
2023-12-07 14:35:26 -06:00
David Esparza
298be4aa1c
Merge pull request #8594 from GabyCT/topic/updatedockerfilet
metrics: Update TensorFlow ResNet FP32 dockerfile
2023-12-07 11:14:48 -06:00
Gabriela Cervantes
ce694b905b tests: Fix indentation of gha-run script
This PR fixes the indentation of gha run script.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-12-07 16:56:19 +00:00
Gabriela Cervantes
33b300431e tests: Enable but do not run k8s tests for cloud hypervisor
This PR enables but do not run k8s tests for cloud hypervisor
for runtime-rs.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-12-07 16:39:15 +00:00
Gabriela Cervantes
50a5fa9a65 tests: Enable but do not run the nerdctl tests for cloud hypervisor
This PR enables but do not run the nerdctl tests for cloud hypervisor
runtime-rs until we find out how stable they are.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-12-07 16:29:51 +00:00
Hyounggyu Choi
0d5a970e54 GHA: remove GITHUB_WORKSPACE when workflow fails due to merge conflict
It is to remove a GITHUB_WORKSPACE directory for self-hosted runners
when a workflow fails due to the merge conflict. This will prevent
the subsequent workflows from getting stuck in the same situation.

Fixes: #8600

Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2023-12-07 10:25:57 +01:00
Gabriela Cervantes
56dddab04f metrics: Update command to run tensorflow resnet fp32 benchmark
This PR updates the command needed to run the tensorflow benchmark.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-12-06 17:02:10 +00:00
Gabriela Cervantes
62fdebeeb5 metrics: Update TensorFlow ResNet FP32 dockerfile
This PR updates the python version for the TensorFlow ResNet FP32
dockerfile so the benchmark can run without issues.

Fixes #8593

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-12-06 16:53:21 +00:00
Fabiano Fidêncio
d149b9f9ca
Merge pull request #7231 from wainersm/measured_rootfs-improvements
Build for measured rootfs improvements
2023-12-05 22:20:33 +01:00
Fabiano Fidêncio
05ce52d746 devmapper: dragonball: Enable, but do not run, the tests
This will make the life easier for dragonball developers to properly
enable the tests once the tests are ready.

Fixes: #8569

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-12-05 15:29:23 +01:00
Fabiano Fidêncio
a8a156b1af stability: dragonball: Enable, but do not run, the tests
This will make the life easier for dragonball developers to properly
enable the tests once the tests are ready.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-12-05 15:29:23 +01:00
Fabiano Fidêncio
16ad721eda cri-containerd: dragonball: Enable, but do not run, the tests
This will make the life easier for dragonball developers to properly
enable the tests once the tests are ready.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-12-05 15:29:23 +01:00
GabyCT
1c00a9a6a9
Merge pull request #8524 from GabyCT/topic/addiperfinfo
docs: Update iperf3 network documentation
2023-12-04 14:03:30 -06:00
Fabiano Fidêncio
852021e416
Merge pull request #8483 from fidencio/topic/move-rust-config-files-to-subdir-based-on-jodh-approach
build/kata-deploy: Move rust runtime config files to runtime-rs directory -- based on #8445
2023-12-01 16:22:51 +01:00
Chelsea Mafrica
818b8f93b1
Merge pull request #8288 from cmaf/migrate-static-checks
Migrate static checks
2023-11-30 17:44:16 -08:00
GabyCT
2bd21f7831
Merge pull request #8531 from GabyCT/topic/fixiperfli
metrics: Fix iperf parallel bandwidth limit
2023-11-30 13:47:00 -06:00
Gabriela Cervantes
37633d3cc2 metrics: Fix iperf parallel bandwidth limit
This PR fixes the iperf parallel bandwidth limit for the kata
metrics CI.

Fixes #8530

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-11-29 19:59:45 +00:00
Dan Mihai
96deea52f2 tests: more k8s-exec-rejected debug output
Print more information useful for debugging. Also, use a separate YAML
file for this test, instead of reusing someone else's file.

Fixes: #8270

Signed-off-by: Dan Mihai <dmihai@microsoft.com>
2023-11-29 18:05:15 +00:00
Fabiano Fidêncio
8fd39d11c4 tests: Adapt enable_hypervisorto the runtime-rs config location change
As the configuration for the runtime-rs based drivers are now placed in
a different location than the golang ones, we should adapt this script
accordingly.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-11-29 14:51:35 +01:00
Fabiano Fidêncio
38183acbcb tests: Use kata-ctl instead of kata-runtime for runtime-rs
`kata-ctl` is the tool for runtime-rs, and it should be used instead of
`kata-runtime`.

`kata-ctl` requires sudo, and that's the reason it's also been added as
part of the calls.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-11-29 14:51:35 +01:00
Fabiano Fidêncio
a5a73a11cb tests: Replace kata-runtime kata-env by kata-runtime env
`kata-runtime env` is an alias for `kata-runtime kata-env, and calling
it with the `env` paramenter allows us to easily extend the scripts to
use `kata-ctl` instead of `kata-runtime` when dealing with runtime-rs.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-11-29 14:51:31 +01:00
Chelsea Mafrica
05efb23261 tests: update go.mod and go.sum
Generate a go.sum file for tests.

Fixes #8187

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2023-11-28 17:40:41 -08:00
Fabiano Fidêncio
30acb5a0c0 tests: nydus: Adapt the default config file for runtime-rs based drivers
As we've done some changes in the runtime-rs based drivers to install
their configuration into a different location, this should also be
reflected as part of this test.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-11-28 20:37:59 +01:00
Chelsea Mafrica
6d9cb9325d tests: update scripts for static checks migration
Updates to scripts for static-checks.sh functionality, including common
functions location, the move of several common functions to the existing
common.bash, adding hadolint and xurls to the versions file, and changes
to static checks for running in the main kata containers repo.

The changes to the vendor check include searching for existing go.mod
files but no other changes to expand the test.

Fixes #8187

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
2023-11-28 11:13:55 -08:00
Chelsea Mafrica
66f3944b52 tests: move github-labels to main repo
Move tool as part of static checks migration.

Fixes #8187

Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
Signed-off-by: Derek Lee <derlee@redhat.com>
Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
Signed-off-by: Graham Whaley <graham.whaley@intel.com>
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Signed-off-by: Marco Vedovati <mvedovati@suse.com>
Signed-off-by: Peng Tao <bergwolf@hyper.sh>
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2023-11-28 11:13:55 -08:00
Chelsea Mafrica
7f3c12f1dd tests: move spell check tool to main repo
Move tool as part of static checks migration.

Fixes #8187

Signed-off-by: Bo Chen <chen.bo@intel.com>
Signed-off-by: Carlos Venegas <jos.c.venegas.munoz@intel.com>
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
Signed-off-by: Dan Middleton <dan.middleton@intel.com>
Signed-off-by: Derek Lee <derlee@redhat.com>
Signed-off-by: Eric Ernst <eric.ernst@intel.com>
Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
Signed-off-by: Graham Whaley <graham.whaley@intel.com>
Signed-off-by: Hui Zhu <teawater@antfin.com>
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Signed-off-by: Jimmy Xu <xjmmyshcn@gmail.com>
Signed-off-by: Liu Xiaodong <xiaodong.liu@intel.com>
Signed-off-by: Mikko Ylinen <mikko.ylinen@intel.com>
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2023-11-28 11:13:55 -08:00
Chelsea Mafrica
8ad433d4ad tests: move markdown check tool to main repo
Move the tool as a dependency for static checks migration.

Fixes #8187

Signed-off-by: Bin Liu <bin@hyper.sh>
Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Signed-off-by: Julio Montes <julio.montes@intel.com>
2023-11-28 11:13:55 -08:00
Chelsea Mafrica
eaa6b1b274 tests: move static checks and dependencies from tests
Move static checks scripts and dependencies from tests to
kata-containers repo.

Fixes #8187

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
Signed-off-by: Bin Liu <bin@hyper.sh>
Signed-off-by: Carlos Venegas <jos.c.venegas.munoz@intel.com>
Signed-off-by: Chao Wu <chaowu@linux.alibaba.com>
Signed-off-by: Chelsea Mafrica <chelsea.e.mafrica@intel.com>
Signed-off-by: Dan Middleton <dan.middleton@intel.com>
Signed-off-by: David Gibson <david@gibson.dropbear.id.au>
Signed-off-by: Derek Lee <derlee@redhat.com>
Signed-off-by: Dov Murik <dovmurik@linux.ibm.com>
Signed-off-by: Eric Ernst <eric_ernst@apple.com>
Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Signed-off-by: Fupan Li <fupan.lfp@antgroup.com>
Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
Signed-off-by: Ganesh Maharaj Mahalingam <ganesh.mahalingam@intel.com>
Signed-off-by: Graham Whaley <graham.whaley@intel.com>
Signed-off-by: Jakob Naucke <jakob.naucke@ibm.com>
Signed-off-by: James O. D. Hunt <james.o.hunt@intel.com>
Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
Signed-off-by: Jon Olson <jonolson@google.com>
Signed-off-by: Jose Carlos Venegas Munoz <jose.carlos.venegas.munoz@intel.com>
Signed-off-by: Julio Montes <julio.montes@intel.com>
Signed-off-by: Liu Jiang <gerry@linux.alibaba.com>
Signed-off-by: Manohar Castelino <manohar.r.castelino@intel.com>
Signed-off-by: Marco Vedovati <mvedovati@suse.com>
Signed-off-by: Nitesh Konkar <niteshkonkar@in.ibm.com>
Signed-off-by: Peng Tao <bergwolf@gmail.com>
Signed-off-by: Salvador Fuentes <salvador.fuentes@intel.com>
Signed-off-by: Sebastien Boeuf <sebastien.boeuf@intel.com>
Signed-off-by: Shiming Zhang <wzshiming@foxmail.com>
Signed-off-by: Snir Sheriber <ssheribe@redhat.com>
Signed-off-by: stevenhorsman <steven@uk.ibm.com>
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Signed-off-by: Xu Wang <xu@hyper.sh>
Signed-off-by: Yang Bo <bo@hyper.sh>
Signed-off-by: Zvonko Kaiser <zkaiser@nvidia.com>
2023-11-28 11:13:55 -08:00
Gabriela Cervantes
9166d0aabb docs: Update iperf3 network documentation
This PR updates the iperf3 network documentation to include
the parallel bandwidth.

Fixes #8523

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-11-28 15:59:38 +00:00
Wainer dos Santos Moschetta
48bdca4c49 tests/k8s: add k8s-measured-rootfs.bats
Implements the following test case:

  Scenario: Check incorrect hash fails
  **Given** I have a version of kata installed that has a kernel with the
  initramfs built and config with rootfs_verity.scheme=dm-verity
  rootfs_verity.hash=<incorrect hash of rootfs> set in the kernel_params
  **When** I try and create a container a basic pod
  **Then** The pod is doesn't run
  **And**  Ideally we'd get a helpful message to indicate why

Currently on CI only qemu-tdx is built with measured
rootfs support in the kernel, so the test is restriced to that
runtimeclass.

Fixes #7415
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2023-11-28 11:21:54 -03:00
Wainer dos Santos Moschetta
1eae657b91 tests/k8s: add set_node() to lib.sh
Use this new function to set the node where the pod should be scheduled
to.

Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2023-11-28 11:21:53 -03:00
Wainer dos Santos Moschetta
c6075c8627 tests/k8s: add setup common
Bring the setup_common() from CCv0 branch test's
integration/kubernetes/confidential/tests_common.sh. It should be used
to reduce boilerplates on the setup() of the tests.

Unlike the original code, this won't export the `test_start_time` variable
as it wouldn't be accurate to grab logs from the worker nodes due
date/time mismatch between the running tests machine and the worker
node. The function export the `node` variable which holds the name of
a random node which has kata installed. Apart from that, it exports the
`node_start_time` which capture the date/time when the test started,
relative to the `node`.

Tests that should inspect the logs can schedule pods/resources to the `node`
and use `node_start_time` as the value reference to grep the logs.

Fixes #7590
Co-authored-by: stevenhorsman <steven@uk.ibm.com>
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2023-11-28 11:21:53 -03:00
Wainer dos Santos Moschetta
220a2d9a15 tests/k8s: add assert_logs_contain() to lib.sh
Bring the assert_logs_contain() from CCv0 branch tests'
integration/kubernetes/confidential/lib.sh.

Introduced the print_node_journal() which uses `kubectl debug` to print
the systemd's journal of a k8s's node.

Fixes #7590
Co-authored-by: stevenhorsman <steven@uk.ibm.com>
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2023-11-28 11:21:53 -03:00
Wainer dos Santos Moschetta
9a9c7a5c6f tests/k8s: add set_metadata_annotation() to lib.sh
This new function allow to the annotations to metadata section in a yaml
configuration file.

Co-authored-by: Ryan Savino <ryan.savino@amd.com>
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2023-11-28 11:21:53 -03:00
Wainer dos Santos Moschetta
36ea1b8ee7 tests/k8s: add new_pod_config() to lib.sh
Copied the new_pod_config() and pod-config.yaml.in from CCv0 branch
tests' integration/kubernetes/confidential/tests_common.sh and fixtures.
Unlike the original version, new_pod_config() now gets the runtimeclass
by parameter as the RUNTIMECLASS environment variable seems not broadly
used on main branch's CI.

The pod-config.yaml.in was changed as the diff shows below. In
particular the imagePullSecrets was removed to avoid it throwing a
warning on the pod's log.

```
--- a/tests/integration/kubernetes/runtimeclass_workloads/pod-config.yaml.in
+++ b/tests/integration/kubernetes/runtimeclass_workloads/pod-config.yaml.in
@@ -5,12 +5,10 @@
 apiVersion: v1
 kind: Pod
 metadata:
-  name: busybox-cc
+  name: test-e2e
 spec:
   runtimeClassName: $RUNTIMECLASS
   containers:
-  - name: nginx
+  - name: test_container
     image: $IMAGE
-    imagePullPolicy: Always
-  imagePullSecrets:
-  - name: cococred
\ No newline at end of file
+    imagePullPolicy: Always
\ No newline at end of file
```

Co-authored-by: Georgina Kinge <georgina.kinge@ibm.com>
Co-authored-by: Megan Wright <Megan.Wright@ibm.com>
Co-authored-by: stevenhorsman <steven@uk.ibm.com>
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2023-11-28 11:21:53 -03:00
Wainer dos Santos Moschetta
428daf9ebc tests/k8s: add utilities functions for the tests
The following functions were copied from CCv0's branch test's
integration/kubernetes/confidential/lib.sh. I did just smalls
refactorings (shortened their names and delinted shellcheck warnings):

- k8s_delete_all_pods_if_any_exists()
- k8s_wait_pod_be_ready()
- k8s_create_pod()
- assert_pod_fail()

Co-authored-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
Co-authored-by: Georgina Kinge <georgina.kinge@ibm.com>
Co-authored-by: Jordan Jackson <jordan.jackson@ibm.com>
Co-authored-by: Megan Wright <Megan.Wright@ibm.com>
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
Co-authored-by: Wang, Arron <arron.wang@intel.com>
2023-11-28 11:21:53 -03:00
Amulyam24
754aec02c3 gha: add cri-containerd workflow for ppc64le
This PR adds workflow to run containerd tests on Power as a part of CI migration.

Fixes: #8500

Signed-off-by: Amulyam24 <amulmek1@in.ibm.com>
2023-11-27 17:58:58 +05:30
Gabriela Cervantes
37916e7a58 metrics: Fix result finding
This PR fixes the result finding for the general throughput for
the tensorflow benchmark.

Fixes #8466

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-11-17 15:59:51 +00:00
Fabiano Fidêncio
f8322ffad2
Merge pull request #7796 from WenyuanLau/7794/StratoVirt_VMM_support
StratoVirt: add support for a lightweight VMM StratoVirt in Kata
2023-11-17 10:53:17 +01:00
Hyounggyu Choi
ffe1ea52cf tests|gha: add containerd and k8s tests for s390x
As part of the CI migration, this PR is to add workflows for containerd and k8s for s390x.

Fixes: #7930
Signed-off-by: Hyounggyu Choi <Hyounggyu.Choi@ibm.com>
2023-11-16 18:14:26 +01:00
GabyCT
8586308dcd
Merge pull request #8453 from GabyCT/topic/udpreadme
metrics: Add iperf udp information to README
2023-11-16 10:38:56 -06:00
Liu Wenyuan
c77e990c3e tests: Enable tests for StratoVirt hypervisor
This commit enables StratoVirt hypervisor to be tested in kata GHA,
incluing k8s, metrics, cri-containerd, nydus and so on.

Meanwhile, adding some unit tests for StratoVirt to make sure it works.

Fixes: #7794

Signed-off-by: Liu Wenyuan <liuwenyuan9@huawei.com>
2023-11-16 20:47:26 +08:00
Gabriela Cervantes
9cc6908b09 stability: Update stressng to run on the gha
This PR updates the stressng test to run on the gha for kata CI.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-11-15 19:34:36 +00:00
Gabriela Cervantes
9d8eb298c3 metrics: Add iperf udp information to README
This PR adds the iperf udp information to the network README
for the kata metrics CI.

Fixes #8452

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-11-15 15:22:06 +00:00
Gabriela Cervantes
4b7854b668 stability: Add missing dependencies
This PR adds missing dependencies to run stability tests.

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-11-15 14:51:14 +00:00
Gabriela Cervantes
79177bb9cb tests: Enable stressng scalability test
This PR enables the stressng scalability test for kata CI.

Fixes #8420

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-11-15 14:51:14 +00:00
Fabiano Fidêncio
fd9b6d6837
Merge pull request #7623 from fidencio/topic/runtime-improve-vcpu-allocation-on-host-side
runtime: Improve vCPU allocation for the VMMs
2023-11-14 14:10:54 +01:00
Fabiano Fidêncio
c858ea1460
Merge pull request #8174 from fidencio/topic/re-revert-8115
ci: Re-add tracing tests and move docker/nerdctl to the basic-ci-amd64.yaml file
2023-11-13 18:19:40 +01:00
David Esparza
98ec34b04c
Merge pull request #8338 from dborquez/improve_metrics_init_environment
metrics: Fix function that completely stops kata containers before running a test
2023-11-13 09:35:27 -06:00
Fabiano Fidêncio
ee17fe9d20 Revert "gha: ci: Revert tracing test PR to unbreak CI"
This reverts commit e9bd852113.
2023-11-13 15:27:39 +01:00
Fabiano Fidêncio
849253e55c tests: Add a simple test to check the VMM vcpu allocation
As we've done some changes in the VMM vcpu allocation, let's introduce
basic tests to make sure that we're getting the expected behaviour.

The test consists in checking 3 scenarios:
* default_vcpus = 0 | no limits set
  * this should allocate 1 vcpu
* default_vcpus = 0.75 | limits set to 0.25
  * this should allocate 1 vcpu
* default_vcpus = 0.75 | limits set to 1.2
  * this should allocate 2 vcpus

The tests are very basic, but they do ensure we're rounding things up to
what the new logic is supposed to do.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-11-10 18:26:01 +01:00
Fabiano Fidêncio
1a81989d20 tests: k8s: Use the "ALLOWED_HYPERVISOR_ANNOTATIONS"
The current kata-deploy code has been doing a `sed` to add allowed
hypervisor annotations, so CBL mariner can be tested with their own
kernel and initrd.

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-11-09 13:42:31 +01:00
Fabiano Fidêncio
455b7bf776 gha: k3s: Avoid unnecessary escape
There's no reason to escape the first + on the +k3s[0-9]\+ regex, as
shown here:
```sh
ubuntu@k3s:~$ /usr/local/bin/k3s kubectl version --short 2>/dev/null | \
	grep "Client Version" | \
	sed \
		-e 's/Client Version: //' \
		-e 's/+k3s[0-9]\+//'
v1.27.7
```

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-11-09 08:42:25 +01:00
Fabiano Fidêncio
e7890ee8f6 gha: Fix regex used to get kubectl version from the k3s version
It seems that with the new k3s release, they've bumped their kubectl
version from x.y.z+k3s1 to x.y.z+k3s2.

Let's ensure our regexp is more generic and future proof for such
changes.

Fixes: #8410

Signed-off-by: Fabiano Fidêncio <fabiano.fidencio@intel.com>
2023-11-09 07:08:02 +01:00
Archana Shinde
92a517156c
Merge pull request #8367 from amshinde/add-nerdctl-ipvlan-test
network: Fix network hotplug for ipvlan and macvlan endpoints for qemu and add tests
2023-11-08 11:45:13 -08:00
Xuewei Niu
136fb76222 tests: Add a integrated test for device cgroup
`TestDeviceCgroup` is added to cri-containerd's integration tests. The test
launches two containers. Each container has a block device. It checks the
validity of device cgroup.

Signed-off-by: Xuewei Niu <niuxuewei.nxw@antgroup.com>
2023-11-08 09:39:07 +08:00
Archana Shinde
c075fa6817 tests: Add test with nerdctl to verify macvlan support
Add test to verify kata supports macvlan networks.

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2023-11-07 10:13:51 -08:00
Archana Shinde
07db673eb9 tests: Add test with nerdctl to verify ipvlan support
Add test to verify kata supports ipvlan networks.
This test can be bit tricky as it requires knowledge about host interfaces
to be used as a master for the ipvlan network.
However, with github actions, we can assume interface called eth0 to be
present on the host and functioning.

Fixes: #8366

Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
2023-11-07 10:13:51 -08:00
Wainer Moschetta
949ac4d810
Merge pull request #8217 from beraldoleal/issues/8216
tests: fixes permission denied when running test
2023-11-07 12:25:23 -03:00
David Esparza
28e7b3467b
metrics: improving stop and remove running containers
This PR makes the change to using the SIGKILL signal instead
of SIGTERM to force stop each kata component before start
running any metric test.

Fixes: #8336

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2023-11-06 09:54:32 -06:00
David Esparza
c232869af9
metrics: removes double-quotes in checkemtrics when parsing results
This PR removes double quotes in jq output to return raw strings
as input of checkmetrics tool.

Fixes: #8331

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2023-10-30 09:43:03 -06:00
David Esparza
c42a2f2eda
metrics: increase the number of attempts to stop kata
This PR increases the number of attempts to stop kata components
when it is required usually before starting a metrics test.

Fixes: #8307

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2023-10-30 09:43:03 -06:00
David Esparza
1626253d9e
metrics: FIO ci test enablement
This PR enables the new FIO test based on the containerd client
which is used to track the I/O metrics in the kata-ci environment.

Additionally this PR fixes the parsing of results.

Fixes: #8199

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2023-10-30 09:42:54 -06:00
David Esparza
873386a349
metrics: update iodepth and job size fio parameters to improve workload
This PR updates the values of the fio parameters for iodepth
requests and for the number of jobs, in order to increase the
number of sequential operations.

Additionally, it adds the list of packages needed to parse the
results.

Fixes: #8198

Signed-off-by: David Esparza <david.esparza.borquez@intel.com>
2023-10-30 08:43:06 -06:00
Wainer dos Santos Moschetta
0ce0abffa6 tests/git-helper: cancel any previous rebase left halfway
In bare-metal machines the git tree might get on unstable state with the
previous rebase left halfway. So let's attempt to abort any rebase before.

Fixes #8318
Signed-off-by: Wainer dos Santos Moschetta <wainersm@redhat.com>
2023-10-26 11:50:12 -03:00
Gabriela Cervantes
2d0518cbe6 metrics: Add parallel udp iperf3 benchmark
This PR adds the parallel udp iperf3 benchmark for network metrics.

Fixes #8277

Signed-off-by: Gabriela Cervantes <gabriela.cervantes.tellez@intel.com>
2023-10-20 19:54:06 +00:00
GabyCT
8486283012
Merge pull request #8247 from GabyCT/topic/iperfudp
metrics: Add iperf udp benchmark
2023-10-20 09:21:37 -06:00
Fabiano Fidêncio
468a3e4b53
Merge pull request #8260 from gkurz/fix-8259
ci: k8s: Fix bogus firecracker check in k8s-credentials-secrets.bat
2023-10-19 23:58:22 +02:00
GabyCT
5d6bdbd0a1
Merge pull request #8241 from GabyCT/topic/enableagenttest
tests: Enable agent stability test
2023-10-19 14:12:49 -06:00