Commit Graph

454 Commits

Author SHA1 Message Date
Felix Matouschek
e2f55848c1 ci: Check if tree is clean before running other jobs
Run make format and check if the tree is still clean before running
other CI jobs.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-06-27 16:01:38 +02:00
Felix Matouschek
3261beff0a chore: Run make format
Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-06-27 16:01:38 +02:00
Felix Matouschek
d7d70125a7 chore: Add .vscode launch configs
Add vscode launch configs to debug the modules and the inventory plugin.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-06-27 15:44:21 +02:00
Felix Matouschek
35b2d3ef6b tests: Use ansible-test for integration tests
Integration tests do not work with tox, therefore use ansible-test to
run them.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-06-27 15:43:03 +02:00
kubevirt-bot
4f236a15ce Merge pull request #113 from 0xFelix/py3.10-millestone
fix(ci): Do not test ansible-core milestone with py3.10
2024-06-26 10:37:37 +02:00
Felix Matouschek
9a8cafd6b1 fix(ci): Do not test ansible-core milestone with py3.10
Python 3.10 is no longer supported by ansible-core milestone, so this
excludes it from the test matrices.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-06-26 09:37:51 +02:00
kubevirt-bot
2b8f96fce3 Merge pull request #97 from jcanocan/inventory-unit-tests
Inventory unit tests
2024-06-19 17:21:52 +02:00
Javier Cano Cano
191d0bb647 feat: run the formatter across the test inventory
It standardizes the code format across all the unit tests codebase.

Signed-off-by: Javier Cano Cano <jcanocan@redhat.com>
2024-06-19 16:57:50 +02:00
Javier Cano Cano
81fc608b44 feat: Refactor kubevirt unit test suite
It refactors the test suite to reduce the amount of fixtures used on it.

Signed-off-by: Javier Cano Cano <jcanocan@redhat.com>
2024-06-19 16:57:50 +02:00
Javier Cano Cano
d7e3ba486e test(kubevirt): add get_vmis_for_namespace missing cases.
Adds two missing execution paths when the `network_name` is provided and
when there are not VMIs to collect.

Signed-off-by: Javier Cano Cano <jcanocan@redhat.com>
2024-06-19 16:57:50 +02:00
Javier Cano Cano
3d03f8a952 test(kubevirt): add inventory unit tests
It adds unit tests for the following functions:
- set_composable_vars
- format_dynamic_api_exc

Signed-off-by: Javier Cano Cano <jcanocan@redhat.com>
2024-06-19 16:57:48 +02:00
kubevirt-bot
2606b267d4 Merge pull request #111 from 0xFelix/kc-5.0.0
chore: Ensure compatibility with kubernetes.core >=3.1.0,<6.0.0
2024-06-18 11:47:47 +02:00
Felix Matouschek
738c70073e chore: Ensure compatibility with kubernetes.core >=3.1.0,<6.0.0
Ensure compatibility with kubernetes.core >=3.1.0,<6.0.0 and update
requirements.yml.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-06-18 07:59:06 +02:00
Felix Matouschek
d55c48ede4 Merge pull request #112 from 0xFelix/ci-devel
fix(ci): Do not test ansible-core devel with py3.10

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-06-18 07:58:11 +02:00
Felix Matouschek
c4b7cc69e7 fix(ci): Do not test ansible-core devel with py3.10
Python 3.10 is no longer supported by ansible-core devel, so this
excludes it from the test matrices.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-06-18 07:56:47 +02:00
Javier Cano Cano
7abe530e94 feat: refactor add_group and add_host fixtures.
It refactors fixtures: `add_group` and `add_host` to improve fixtures
reusability in further scenarios.

Signed-off-by: Javier Cano Cano <jcanocan@redhat.com>
2024-06-17 11:58:41 +02:00
kubevirt-bot
65f4ac6602 Merge pull request #107 from jcanocan/fix-pr-96-issues
tests: Address comments of #96
2024-06-14 14:36:24 +02:00
Javier Cano Cano
a8eb5643db tests: Address comments of #96
It fixes concerns posted on
https://github.com/kubevirt/kubevirt.core/pull/96

Signed-off-by: Javier Cano Cano <jcanocan@redhat.com>
2024-06-14 11:10:26 +02:00
kubevirt-bot
020f3c1380 Merge pull request #109 from 0xFelix/improve-e2e
Bump e2e software versions
2024-06-13 11:36:24 +02:00
Felix Matouschek
634ccb8363 chore: Bump versions in hack/e2e-setup.sh
Bump the versions of installed software components during the e2e test setup
to the latest stable releases.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-06-13 11:19:20 +02:00
Felix Matouschek
1a814389fe fix: Allow running make cluster-down when binaries are missing
Swap the order of commands in hack/e2e-setup.sh, so it becomes possible
to run 'make cluster-down` when the kind/kubectl binaries are missing.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-06-13 11:18:17 +02:00
kubevirt-bot
10b34fdf24 Merge pull request #101 from 0xFelix/apache2
Change license to Apache 2.0
2024-06-13 10:24:24 +02:00
Felix Matouschek
5d31db3ea2 chore: Change license Apache 2.0
Change the license of the collection to Apache 2.0 to be compliant with
the CNCF licensing requirements.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-06-11 11:39:32 +02:00
Felix Matouschek
df629ac39e chore: Drop vendored document fragments
Drop the vendored document fragments from kubernetes.core to slightly
enhance the documented options and to allow changing the license of the
collection.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-06-11 11:39:21 +02:00
kubevirt-bot
44e84622ed Merge pull request #108 from mperetzred/kubevirt_vm_ssh_key
kubevirt_vm integration tests: changed ssh key type to RSA for FIPS mode
2024-06-10 17:56:20 +02:00
mperetz
050799a084 kubevirt_vm integration tests: changed ssh key type to RSA for FIPS mode
Signed-off-by: mperetzred <mperetz@redhat.com>
2024-06-10 16:59:04 +03:00
kubevirt-bot
5c57d623aa Merge pull request #106 from 0xFelix/fix-kubevirt-vm-verify
fix(tests,kubevirt_vm): Fix assertion in verify.yml
2024-06-06 17:35:42 +02:00
Felix Matouschek
ea8447dee8 fix(tests,kubevirt_vm): Fix assertion in verify.yml
Fix the assertion that was introduced in
2521e8ba24 by removing the superfluous 'd'
at the end of the variable names.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-06-05 16:17:31 +02:00
kubevirt-bot
520bf8d74f Merge pull request #105 from 0xFelix/runtime-2.15
chore: Update supported ansible-core versions to >=2.15
2024-06-05 09:59:43 +02:00
Felix Matouschek
fa6601cbe4 chore: Update supported ansible-core versions to >=2.15
Update the supported versions of ansible-core to >=2.15.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-06-05 09:16:56 +02:00
kubevirt-bot
92b11b5584 Merge pull request #103 from 0xFelix/ci-fixes
Make kubevirt_vm tests more robust
2024-06-04 10:37:37 +02:00
Felix Matouschek
2521e8ba24 fix(tests,kubevirt_vm): Assert there are no or expected changes
Assert there are no or expected changes in verify.yml of the kubevirt_vm
integration test. This is necessary since in downstream tests the
kubemacpool operator might add annotations to the VM which can trigger a
changed result.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-06-04 09:53:53 +02:00
Felix Matouschek
e1b2094e4e fix(tests,kubevirt_vm): Make waiting for VM more robust
This changes the runme.sh of the kubevirt_vm integration tests to retry
the connection to the VM until a login is possible. This is necessary
since it is not possible with Ansible alone to retry a task in case the
connection failed with the unreachable status. This can happen when the
sshd of the VM already accepts connections but a login is not yet
possible because the VM is still booting up.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-06-04 09:53:53 +02:00
kubevirt-bot
4205a8328d Merge pull request #104 from 0xFelix/ansible-2.17
Bump tested ansible-core versions to 2.15-2.17
2024-06-04 08:21:35 +02:00
Felix Matouschek
57b172a865 chore(ci.yml): Bump tested ansible-core versions
Bump the tested ansible-core versions in integration.yml to the
latest supported versions (2.15-2.17).

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-06-03 16:41:40 +02:00
Felix Matouschek
14e9481e19 chore(integration.yml): Bump tested ansible-core versions
Bump the tested ansible-core versions in integration.yml to the latest
supported versions (2.15-2.17).

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-06-03 16:38:42 +02:00
kubevirt-bot
d81d9b1b96 Update changelog for release 1.4.0
Signed-off-by: kubevirt-bot <kubevirtbot@redhat.com>
1.4.0
2024-05-29 14:19:45 +00:00
kubevirt-bot
3a5100fd46 Merge pull request #102 from 0xFelix/bump-1.4.0
chore: Bump version to 1.4.0
2024-05-29 16:16:41 +02:00
Felix Matouschek
b910263304 chore: Bump version to 1.4.0
Bump version and add changelog with release summary.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-05-29 16:04:16 +02:00
kubevirt-bot
d4193f1d98 Merge pull request #100 from 0xFelix/kubernetes-core-4
fix: Ensure compatibility with kubernetes.core >=3.10,<4.1.0
2024-05-29 11:24:40 +02:00
Felix Matouschek
a9c6296794 fix: Ensure compatibility with kubernetes.core >=3.10,<4.1.0
Ensure compatibility with kubernetes.core >=3.10,<4.1.0 by replacing
deprecated imports of HAS_K8S_MODULE_HELPER and k8s_import_exception.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-05-29 10:11:05 +02:00
kubevirt-bot
131aacec43 Merge pull request #95 from 0xFelix/improved-docs
Provide links for docsite and improve docs by adding markup
2024-05-17 11:26:25 +02:00
kubevirt-bot
21c9bc8d4a Merge pull request #96 from jcanocan/add-inventory-tests
Add inventory unit tests
2024-05-17 11:24:25 +02:00
Javier Cano Cano
2b8767b424 test: add kubevirt inventory unit tests
Add unit tests for the following kubevirt functions:

- get_default_host_name
- get_host_from_service
- get_port_from_service
- parse
- fetch_objects
- get_cluster_domain
- get_available_namespaces
- get_vmis_for_namespace
- get_ssh_services_for_namespace
- set_ansible_host_and_port

Signed-off-by: Javier Cano Cano <jcanocan@redhat.com>
2024-05-15 17:41:50 +02:00
Javier Cano Cano
a1b0971b7f fix(kubevirt): fix inventory labels loop
Fix the for loop ranging over vmi labels. This loop is missing the
.items() statement, which it causes the following error:

```
for key, value in vmi.metadata.labels:
ValueError: too many values to unpack (expected 2)
```

Signed-off-by: Javier Cano Cano <jcanocan@redhat.com>
2024-05-15 16:23:45 +02:00
Javier Cano Cano
48b2a81679 fix(kubevirt): comment typo
Fix a small comment typo showing `LoadBalancer` instead of `NodePort`.

Signed-off-by: Javier Cano Cano <jcanocan@redhat.com>
2024-05-15 16:12:19 +02:00
Felix Matouschek
4851e5d20d docs: Improve docs by adding markup
Improve the generated documentations by adding Ansible documentation markup
where appropriate.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-05-08 11:06:57 +02:00
Felix Matouschek
0fd9f625ee docs: Provide links for docsite
Fill in the links.yml template and provide correct links and
communication channels for the collection.

Signed-off-by: Felix Matouschek <fmatouschek@redhat.com>
2024-05-08 11:03:23 +02:00
kubevirt-bot
10d8c23138 Merge pull request #92 from jcanocan/add-template-tests
tests: add render_template unit tests
2024-04-29 10:54:05 +02:00
Javier Cano Cano
86d1d748df tests: add render_template unit tests
It adds unit tests for the render_template function. These test cases
cover all cases for non-mandatory fields in the VM template.

Signed-off-by: Javier Cano Cano <jcanocan@redhat.com>
2024-04-29 10:27:52 +02:00