testcloud 0.11.7__tar.gz → 0.12.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (66) hide show
  1. testcloud-0.12.0/.fmf/version +1 -0
  2. testcloud-0.12.0/.github/workflows/release.yml +48 -0
  3. testcloud-0.12.0/.packit.yaml +94 -0
  4. {testcloud-0.11.7/testcloud.egg-info → testcloud-0.12.0}/PKG-INFO +36 -23
  5. {testcloud-0.11.7 → testcloud-0.12.0}/README.md +26 -14
  6. {testcloud-0.11.7 → testcloud-0.12.0}/docs/source/conf.py +2 -1
  7. testcloud-0.12.0/docs/source/develop.rst +108 -0
  8. testcloud-0.12.0/packaging/rpm/testcloud.spec +127 -0
  9. testcloud-0.12.0/packaging/rpm/testcloud.sysusers +1 -0
  10. testcloud-0.12.0/plans/tmt.fmf +20 -0
  11. testcloud-0.12.0/plans/unit.fmf +8 -0
  12. testcloud-0.12.0/pyproject.toml +45 -0
  13. {testcloud-0.11.7 → testcloud-0.12.0}/requirements.txt +1 -0
  14. testcloud-0.12.0/test/tmt/regular-user/data/.fmf/version +1 -0
  15. testcloud-0.12.0/test/tmt/regular-user/data/main.fmf +22 -0
  16. testcloud-0.12.0/test/tmt/regular-user/main.fmf +8 -0
  17. testcloud-0.12.0/test/tmt/regular-user/test.sh +26 -0
  18. testcloud-0.12.0/test/unit/main.fmf +7 -0
  19. testcloud-0.12.0/test/unit/test_fedora.py +75 -0
  20. testcloud-0.12.0/test/unit/test_util.py +19 -0
  21. {testcloud-0.11.7 → testcloud-0.12.0}/testcloud/__init__.py +3 -3
  22. {testcloud-0.11.7 → testcloud-0.12.0}/testcloud/cli.py +12 -0
  23. {testcloud-0.11.7 → testcloud-0.12.0}/testcloud/config.py +2 -2
  24. {testcloud-0.11.7 → testcloud-0.12.0}/testcloud/distro_utils/centos.py +1 -2
  25. {testcloud-0.11.7 → testcloud-0.12.0}/testcloud/distro_utils/debian.py +1 -1
  26. {testcloud-0.11.7 → testcloud-0.12.0}/testcloud/distro_utils/fedora.py +58 -15
  27. {testcloud-0.11.7 → testcloud-0.12.0}/testcloud/domain_configuration.py +32 -0
  28. {testcloud-0.11.7 → testcloud-0.12.0}/testcloud/image.py +2 -9
  29. {testcloud-0.11.7 → testcloud-0.12.0}/testcloud/instance.py +18 -13
  30. {testcloud-0.11.7 → testcloud-0.12.0}/testcloud/util.py +11 -0
  31. {testcloud-0.11.7 → testcloud-0.12.0}/tox.ini +0 -7
  32. testcloud-0.11.7/PKG-INFO +0 -466
  33. testcloud-0.11.7/pyproject.toml +0 -2
  34. testcloud-0.11.7/setup.cfg +0 -4
  35. testcloud-0.11.7/setup.py +0 -72
  36. testcloud-0.11.7/testcloud.egg-info/SOURCES.txt +0 -48
  37. testcloud-0.11.7/testcloud.egg-info/dependency_links.txt +0 -1
  38. testcloud-0.11.7/testcloud.egg-info/entry_points.txt +0 -3
  39. testcloud-0.11.7/testcloud.egg-info/requires.txt +0 -7
  40. testcloud-0.11.7/testcloud.egg-info/top_level.txt +0 -1
  41. {testcloud-0.11.7 → testcloud-0.12.0}/.gitignore +0 -0
  42. {testcloud-0.11.7 → testcloud-0.12.0}/LICENSE +0 -0
  43. {testcloud-0.11.7 → testcloud-0.12.0}/conf/99-testcloud-nonroot-libvirt-access.rules +0 -0
  44. {testcloud-0.11.7 → testcloud-0.12.0}/conf/settings-example.py +0 -0
  45. {testcloud-0.11.7 → testcloud-0.12.0}/conf/testcloud +0 -0
  46. {testcloud-0.11.7 → testcloud-0.12.0}/docs/LICENSE +0 -0
  47. {testcloud-0.11.7 → testcloud-0.12.0}/docs/Makefile +0 -0
  48. {testcloud-0.11.7 → testcloud-0.12.0}/docs/source/api.rst +0 -0
  49. {testcloud-0.11.7 → testcloud-0.12.0}/docs/source/indepth.rst +0 -0
  50. {testcloud-0.11.7 → testcloud-0.12.0}/docs/source/index.rst +0 -0
  51. {testcloud-0.11.7 → testcloud-0.12.0}/manpages/testcloud.1 +0 -0
  52. {testcloud-0.11.7 → testcloud-0.12.0}/run_testcloud.py +0 -0
  53. {testcloud-0.11.7 → testcloud-0.12.0}/test/__init__.py +0 -0
  54. {testcloud-0.11.7/test → testcloud-0.12.0/test/unit}/test_cli.py +0 -0
  55. {testcloud-0.11.7/test → testcloud-0.12.0/test/unit}/test_config.py +0 -0
  56. {testcloud-0.11.7/test → testcloud-0.12.0/test/unit}/test_image.py +0 -0
  57. {testcloud-0.11.7/test → testcloud-0.12.0/test/unit}/test_instance.py +0 -0
  58. {testcloud-0.11.7 → testcloud-0.12.0}/testcloud/distro_utils/__init__.py +0 -0
  59. {testcloud-0.11.7 → testcloud-0.12.0}/testcloud/distro_utils/alma.py +0 -0
  60. {testcloud-0.11.7 → testcloud-0.12.0}/testcloud/distro_utils/misc.py +0 -0
  61. {testcloud-0.11.7 → testcloud-0.12.0}/testcloud/distro_utils/oracle.py +0 -0
  62. {testcloud-0.11.7 → testcloud-0.12.0}/testcloud/distro_utils/rocky.py +0 -0
  63. {testcloud-0.11.7 → testcloud-0.12.0}/testcloud/distro_utils/ubuntu.py +0 -0
  64. {testcloud-0.11.7 → testcloud-0.12.0}/testcloud/exceptions.py +0 -0
  65. {testcloud-0.11.7 → testcloud-0.12.0}/testcloud/sql.py +0 -0
  66. {testcloud-0.11.7 → testcloud-0.12.0}/testcloud/workarounds.py +0 -0
@@ -0,0 +1 @@
1
+ 1
@@ -0,0 +1,48 @@
1
+ name: release
2
+ run-name: Release ${{ inputs.ref || github.ref_name }}
3
+
4
+ on:
5
+ release:
6
+ types: [published]
7
+ workflow_dispatch:
8
+ inputs:
9
+ ref:
10
+ type: string
11
+ description: 'Tag to release'
12
+ required: true
13
+
14
+ permissions: {}
15
+
16
+ jobs:
17
+ build:
18
+ runs-on: ubuntu-latest
19
+ steps:
20
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
21
+ with:
22
+ ref: ${{ inputs.ref }}
23
+ persist-credentials: false
24
+ - uses: hynek/build-and-inspect-python-package@2abe76da66d0a6a4a227101f9348ee855797cfa5 # v3.0.1
25
+
26
+ deploy:
27
+ needs: [build]
28
+ runs-on: ubuntu-latest
29
+ environment:
30
+ name: pypi
31
+ url: https://pypi.org/p/testcloud
32
+ permissions:
33
+ id-token: write
34
+ attestations: write
35
+
36
+ steps:
37
+ - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1
38
+ with:
39
+ name: Packages
40
+ path: dist
41
+
42
+ - name: Generate artifact attestation for sdist and wheel
43
+ uses: actions/attest-build-provenance@0f67c3f4856b2e3261c31976d6725780e5e4c373 # v4.1.1
44
+ with:
45
+ subject-path: "dist/*"
46
+
47
+ - name: Publish to PyPI
48
+ uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
@@ -0,0 +1,94 @@
1
+ ---
2
+
3
+ specfile_path: packaging/rpm/testcloud.spec
4
+ files_to_sync:
5
+ - src: packaging/rpm/
6
+ dest: ./
7
+ delete: true
8
+ filters:
9
+ - "protect .git*"
10
+ - "protect sources"
11
+ - "protect changelog"
12
+ - .packit.yaml
13
+
14
+ upstream_package_name: testcloud
15
+ downstream_package_name: testcloud
16
+
17
+ upstream_project_url: https://github.com/teemtee/testcloud
18
+ issue_repository: https://github.com/teemtee/testcloud
19
+
20
+ srpm_build_deps:
21
+ - hatch
22
+ - python3-hatch-vcs
23
+
24
+ actions:
25
+ create-archive:
26
+ - hatch build -t sdist
27
+ - bash -c "echo dist/testcloud-$PACKIT_PROJECT_VERSION.tar.gz"
28
+ get-current-version:
29
+ - hatch version
30
+
31
+ targets: &all-targets
32
+ - fedora-all
33
+ - epel-9
34
+ - epel-10
35
+
36
+ # Common definitions
37
+ _:
38
+ # Copr jobs under the packit project
39
+ - &copr-under-packit
40
+ job: copr_build
41
+ additional_repos:
42
+ - copr://@teemtee/stable
43
+
44
+ # Copr jobs under the teemtee project
45
+ - &copr-under-teemtee
46
+ <<: *copr-under-packit
47
+ list_on_homepage: true
48
+ preserve_project: true
49
+ owner: "@teemtee"
50
+
51
+ jobs:
52
+ # Build pull requests
53
+ - <<: *copr-under-packit
54
+ trigger: pull_request
55
+
56
+ # Build commits merged to main to latest
57
+ - <<: *copr-under-teemtee
58
+ trigger: commit
59
+ branch: main
60
+ project: latest
61
+ release_suffix: "{PACKIT_PROJECT_BRANCH}"
62
+
63
+ # Build released bits to stable
64
+ - <<: *copr-under-teemtee
65
+ trigger: release
66
+ project: stable
67
+
68
+ # Test pull requests
69
+ - job: tests
70
+ trigger: pull_request
71
+
72
+ # Propose downstream pull requests
73
+ - job: propose_downstream
74
+ trigger: release
75
+ dist_git_branches:
76
+ rawhide:
77
+ fast_forward_merge_into:
78
+ - fedora-branched
79
+ - epel-10
80
+ - epel-9
81
+
82
+ # Create koji builds
83
+ - job: koji_build
84
+ trigger: commit
85
+ allowed_pr_authors: ["packit", "all_committers"]
86
+ dist_git_branches: *all-targets
87
+
88
+ # Create bodhi updates
89
+ - job: bodhi_update
90
+ trigger: commit
91
+ dist_git_branches:
92
+ - fedora-branched
93
+ - epel-10
94
+ - epel-9
@@ -1,19 +1,20 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.5
2
2
  Name: testcloud
3
- Version: 0.11.7
3
+ Version: 0.12.0
4
4
  Summary: A tool to download and boot cloud images locally, with an easy to use API.
5
- Home-page: https://pagure.io/testcloud
6
- Author: Mike Ruckman
7
- Author-email: roshi@fedoraproject.org
8
- License: GPLv2+
9
- Description-Content-Type: text/markdown
5
+ Project-URL: Homepage, https://github.com/teemtee/testcloud
6
+ Author-email: Mike Ruckman <roshi@fedoraproject.org>
7
+ License-Expression: GPL-2.0-or-later
10
8
  License-File: LICENSE
9
+ Requires-Python: >=3.9
10
+ Requires-Dist: fedora-distro-aliases>=1.5
11
11
  Requires-Dist: libvirt-python
12
+ Requires-Dist: packaging
12
13
  Requires-Dist: peewee
13
14
  Requires-Dist: requests
14
- Requires-Dist: packaging
15
15
  Provides-Extra: image-resolve-caching
16
- Requires-Dist: requests_cache>=1.2; extra == "image-resolve-caching"
16
+ Requires-Dist: requests-cache>=1.2; extra == 'image-resolve-caching'
17
+ Description-Content-Type: text/markdown
17
18
 
18
19
  # testcloud
19
20
 
@@ -129,7 +130,7 @@ the **virt-manager** tool.
129
130
 
130
131
  Instances can be created with a different architecture than the host architecture. You'll need to have a proper
131
132
  qemu binary installed for this to work (eg. qemu-system-aarch64-core for aarch64 on x86_64 on Fedora). Supported
132
- architectures in testcloud are: x86_64, aarch64, ppc64le, and s390x. Any combinations of these are supported.
133
+ architectures in testcloud are: x86_64, aarch64, ppc64le, s390x, and riscv64. Any combinations of these are supported.
133
134
 
134
135
  Some examples:
135
136
 
@@ -148,6 +149,11 @@ $ testcloud create centos-stream --arch x86_64
148
149
  $ testcloud create fedora:rawhide --arch ppc64le
149
150
  ```
150
151
 
152
+ ```
153
+ # Debian riscv64 on x86_64 (or any other)
154
+ $ testcloud create debian:13 --arch riscv64
155
+ ```
156
+
151
157
  ### Starting, stopping, and removing an instance
152
158
 
153
159
  Instances can be started and stopped using the `instance` interface of
@@ -435,21 +441,28 @@ This is a good place to contribute if you\'re looking to help out.
435
441
 
436
442
  ### Releasing
437
443
 
438
- Testcloud is being released to all stable Fedora releases, EPEL branches, and PyPi.
444
+ Testcloud is being released to all stable Fedora releases, EPEL branches, and PyPI.
439
445
  The release process can be summed up to these steps:
440
446
 
441
- 1. A batch of changes has accumulated
442
- 2. Testsuite sanity is verified (via either tox or pytest)
443
- 3. Documentation is verified up-to-date (README.md, docs/, manpages/)
444
- 4. Compatibility with tmt is verified
445
- 5. `__version__` is updated in `testcloud/__init__.py`, `version` is updated in `docs/source/conf.py`
446
- 6. Version bumps are commited, pushed, a new tag is pushed to this repository
447
- 7. A new version is uploaded on PyPi:
448
- ```
449
- python3 setup.py sdist bdist_wheel && twine upload dist/*
450
- ```
451
- 8. Resulting .tar.gz is copied to the dist-git, and build are submitted to all of the stable Fedoras and EPELs
452
- 9. New bodhi builds are queued into the -testing repositories
447
+ * Make sure the documentation is up-to-date (README.md, docs, manpages)
448
+ * Add release notes as needed and commit as `Release x.y.z`
449
+ * Push changes, create a release pull request, make sure all tests pass, merge
450
+ * Tag the commit with `x.y.z`, push tags using `git push --tags`
451
+ * Create a new [github release](https://github.com/teemtee/testcloud/releases/) based on the tag above
452
+ * Mention the most important changes in the release name, do not include version
453
+ * Push the `Generate release notes` button to create the content, publish the release
454
+ * Check Fedora [pull requests](https://src.fedoraproject.org/rpms/testcloud/pull-requests) and review proposed changes
455
+ * Make sure that tests pass and merge individual pull requests
456
+ * Close the corresponding [release milestone](https://github.com/teemtee/testcloud/milestones)
457
+
458
+ ### Releases
459
+
460
+ #### 0.12.0
461
+
462
+ * Add support for the RISC-V architecture
463
+ * Replace deprecated oraculum with `fedora-distro-aliases`
464
+ * Run `chcon` only on systems where SELinux is enabled
465
+ * Enable pull request testing and automate releases
453
466
 
454
467
  ### Issue Tracking and Roadmap
455
468
 
@@ -112,7 +112,7 @@ the **virt-manager** tool.
112
112
 
113
113
  Instances can be created with a different architecture than the host architecture. You'll need to have a proper
114
114
  qemu binary installed for this to work (eg. qemu-system-aarch64-core for aarch64 on x86_64 on Fedora). Supported
115
- architectures in testcloud are: x86_64, aarch64, ppc64le, and s390x. Any combinations of these are supported.
115
+ architectures in testcloud are: x86_64, aarch64, ppc64le, s390x, and riscv64. Any combinations of these are supported.
116
116
 
117
117
  Some examples:
118
118
 
@@ -131,6 +131,11 @@ $ testcloud create centos-stream --arch x86_64
131
131
  $ testcloud create fedora:rawhide --arch ppc64le
132
132
  ```
133
133
 
134
+ ```
135
+ # Debian riscv64 on x86_64 (or any other)
136
+ $ testcloud create debian:13 --arch riscv64
137
+ ```
138
+
134
139
  ### Starting, stopping, and removing an instance
135
140
 
136
141
  Instances can be started and stopped using the `instance` interface of
@@ -418,21 +423,28 @@ This is a good place to contribute if you\'re looking to help out.
418
423
 
419
424
  ### Releasing
420
425
 
421
- Testcloud is being released to all stable Fedora releases, EPEL branches, and PyPi.
426
+ Testcloud is being released to all stable Fedora releases, EPEL branches, and PyPI.
422
427
  The release process can be summed up to these steps:
423
428
 
424
- 1. A batch of changes has accumulated
425
- 2. Testsuite sanity is verified (via either tox or pytest)
426
- 3. Documentation is verified up-to-date (README.md, docs/, manpages/)
427
- 4. Compatibility with tmt is verified
428
- 5. `__version__` is updated in `testcloud/__init__.py`, `version` is updated in `docs/source/conf.py`
429
- 6. Version bumps are commited, pushed, a new tag is pushed to this repository
430
- 7. A new version is uploaded on PyPi:
431
- ```
432
- python3 setup.py sdist bdist_wheel && twine upload dist/*
433
- ```
434
- 8. Resulting .tar.gz is copied to the dist-git, and build are submitted to all of the stable Fedoras and EPELs
435
- 9. New bodhi builds are queued into the -testing repositories
429
+ * Make sure the documentation is up-to-date (README.md, docs, manpages)
430
+ * Add release notes as needed and commit as `Release x.y.z`
431
+ * Push changes, create a release pull request, make sure all tests pass, merge
432
+ * Tag the commit with `x.y.z`, push tags using `git push --tags`
433
+ * Create a new [github release](https://github.com/teemtee/testcloud/releases/) based on the tag above
434
+ * Mention the most important changes in the release name, do not include version
435
+ * Push the `Generate release notes` button to create the content, publish the release
436
+ * Check Fedora [pull requests](https://src.fedoraproject.org/rpms/testcloud/pull-requests) and review proposed changes
437
+ * Make sure that tests pass and merge individual pull requests
438
+ * Close the corresponding [release milestone](https://github.com/teemtee/testcloud/milestones)
439
+
440
+ ### Releases
441
+
442
+ #### 0.12.0
443
+
444
+ * Add support for the RISC-V architecture
445
+ * Replace deprecated oraculum with `fedora-distro-aliases`
446
+ * Run `chcon` only on systems where SELinux is enabled
447
+ * Enable pull request testing and automate releases
436
448
 
437
449
  ### Issue Tracking and Roadmap
438
450
 
@@ -12,6 +12,7 @@
12
12
  # All configuration values have a default; values that are commented out
13
13
  # serve to show the default.
14
14
 
15
+ import importlib.metadata
15
16
  import sys
16
17
  import os
17
18
 
@@ -55,7 +56,7 @@ copyright = "2016-2024, testCloud devs"
55
56
  # built documents.
56
57
  #
57
58
  # The short X.Y version.
58
- version = "0.11.7"
59
+ version = importlib.metadata.version("testcloud")
59
60
  # The full version, including alpha/beta/rc tags.
60
61
  release = version
61
62
 
@@ -0,0 +1,108 @@
1
+ .. _development:
2
+
3
+ =====================
4
+ Testcloud Development
5
+ =====================
6
+
7
+ To develop **testcloud**, you need to perform a more complicated process to install all its dependencies, download the source code and perform a set-up.
8
+
9
+ Prerequisites
10
+ =============
11
+ #. Install the dependencies for testcloud.
12
+
13
+ .. code-block:: bash
14
+
15
+ $ sudo dnf builddep testcloud
16
+
17
+ #. Start ``libvirtd``.
18
+
19
+ .. code-block:: bash
20
+
21
+ $ sudo systemctl start libvirtd
22
+
23
+ #. Add the ``testcloud`` group to the system.
24
+
25
+ .. code-block:: bash
26
+
27
+ $ sudo groupadd testcloud
28
+
29
+ #. Add a user into the ``testcloud`` group.
30
+
31
+ .. code-block:: bash
32
+
33
+ $ sudo usermod -a -G testcloud $USER
34
+
35
+ #. Log out of the system and log in again to update the group information on your user or use a login shell on a different terminal.
36
+
37
+ .. code-block:: bash
38
+
39
+ $ su - $USER
40
+
41
+ Installation
42
+ ============
43
+
44
+ #. Clone the testcloud repository.
45
+
46
+ .. code-block:: bash
47
+
48
+ $ git clone https://pagure.io/testcloud.git
49
+
50
+ #. Create the application directories.
51
+
52
+ .. code-block:: bash
53
+
54
+ $ sudo mkdir -p -m 775 /var/lib/testcloud
55
+
56
+ $ sudo mkdir -p -m 775 /var/lib/testcloud/instances
57
+
58
+ $ sudo mkdir -p -m 775 /var/lib/testcloud/backingstores
59
+
60
+ #. Change ownership on these directories to enable their use with testcloud.
61
+
62
+ .. code-block:: bash
63
+
64
+ $ sudo chown qemu:testcloud /var/lib/testcloud
65
+
66
+ $ sudo chown qemu:testcloud /var/lib/testcloud/instances
67
+
68
+ $ sudo chown qemu:testcloud /var/lib/testcloud/backingstores
69
+
70
+ #. Copy the ``.rules`` file to the ``polkit`` rules.
71
+
72
+ .. code-block:: bash
73
+
74
+ $ sudo cp conf/99-testcloud-nonroot-libvirt-access.rules /etc/polkit-1/rules.d/
75
+
76
+
77
+ Running testcloud
78
+ =================
79
+
80
+ #. Navigate to your testcloud git repository.
81
+
82
+ .. code-block:: bash
83
+
84
+ $ cd testcloud
85
+
86
+ #. Execute the ``run_testcloud.py`` script to run the testcloud. You can use any options as with the regular installation, for example:
87
+
88
+ .. code-block:: bash
89
+
90
+ $ ./run_testcloud.py instance create ...
91
+
92
+ .. tip::
93
+
94
+ Alternatively, you can use **pip** to install testcloud onto the system and then use it like it has been installed normally.
95
+ To do it, use the ``pip3 install -e . --user`` command in the project directory.
96
+
97
+
98
+ Testing
99
+ =======
100
+
101
+ There is a small test suite that you can run using ``tox``, to start the tests:
102
+
103
+ .. code-block:: bash
104
+
105
+ $ tox
106
+
107
+ Thank you very much for contributions.
108
+
@@ -0,0 +1,127 @@
1
+ %if 0%{?rhel} <= 9
2
+ %global _sysusersdir /usr/lib/sysusers.d
3
+ %endif
4
+
5
+ Name: testcloud
6
+ Version: 0.0.0
7
+ Release: %autorelease
8
+ Summary: Tool for running cloud images locally
9
+
10
+ License: GPL-2.0-or-later
11
+ URL: https://github.com/teemtee/testcloud
12
+ Source0: %{pypi_source testcloud}
13
+ Source1: testcloud.sysusers
14
+
15
+ ExclusiveArch: %{kernel_arches} noarch
16
+ BuildArch: noarch
17
+
18
+ BuildRequires: systemd-rpm-macros
19
+ %{?sysusers_requires_compat}
20
+
21
+ Requires: polkit
22
+
23
+ Recommends: edk2-ovmf
24
+
25
+ Requires: python3-%{name} = %{version}-%{release}
26
+
27
+ %description
28
+ testcloud is a relatively simple system which is capable of booting images
29
+ designed for cloud systems on a local system with minimal configuration.
30
+ testcloud is designed to be (and remain) somewhat simple, trading fancy cloud
31
+ system features for ease of use and sanity in development.
32
+
33
+ %package -n python3-%{name}
34
+ Summary: Python 3 interface to testcloud
35
+
36
+ BuildRequires: bash-completion
37
+ BuildRequires: python3-devel
38
+ BuildRequires: python3-pytest
39
+
40
+ Requires: acl
41
+ Requires: genisoimage
42
+ Requires: libvirt-daemon
43
+ Requires: libvirt-daemon-config-network
44
+ Requires: libvirt-daemon-driver-qemu
45
+ Requires: libvirt-daemon-driver-storage-core
46
+ Requires: python3-fedora-distro-aliases
47
+ Recommends: butane
48
+ Suggests: python3-libguestfs
49
+ Suggests: libguestfs-tools-c
50
+
51
+ %description -n python3-%{name}
52
+ Python 3 interface to testcloud.
53
+
54
+ %pre
55
+ %sysusers_create_compat %{SOURCE1}
56
+
57
+ %prep
58
+ %autosetup -n %{name}-%{version} -p1
59
+ # Drop coverage testing
60
+ sed -i 's/ --cov-report=term-missing --cov testcloud//g' tox.ini
61
+
62
+ %generate_buildrequires
63
+ %pyproject_buildrequires
64
+
65
+ %build
66
+ export SETUPTOOLS_SCM_PRETEND_VERSION=%{version}
67
+ %pyproject_wheel
68
+
69
+ %install
70
+ %pyproject_install
71
+ %pyproject_save_files testcloud
72
+
73
+ # man page
74
+ mkdir -p %{buildroot}%{_mandir}/man1
75
+ install -pm 644 manpages/testcloud.1 %{buildroot}%{_mandir}/man1
76
+
77
+ # bash completion
78
+ mkdir -p %{buildroot}%{_datadir}/bash-completion/completions
79
+ install -pm 644 conf/testcloud %{buildroot}%{_datadir}/bash-completion/completions/testcloud
80
+
81
+ # configuration files
82
+ mkdir -p %{buildroot}%{_sysconfdir}/testcloud/
83
+ install conf/settings-example.py %{buildroot}%{_sysconfdir}/testcloud/settings.py
84
+
85
+ # Create running directory for testcloud
86
+ install -d %{buildroot}%{_sharedstatedir}/testcloud/
87
+
88
+ # backingstores dir
89
+ install -d %{buildroot}/%{_sharedstatedir}/testcloud/backingstores
90
+
91
+ # instance dir
92
+ install -d %{buildroot}/%{_sharedstatedir}/testcloud/instances
93
+
94
+ # create polkit rules dir and install polkit rule
95
+ mkdir -p %{buildroot}%{_sysconfdir}/polkit-1/rules.d
96
+ install conf/99-testcloud-nonroot-libvirt-access.rules %{buildroot}%{_sysconfdir}/polkit-1/rules.d/99-testcloud-nonroot-libvirt-access.rules
97
+
98
+ # sysusers conf file for creation of testcloud group
99
+ install -p -m644 -D %{SOURCE1} %{buildroot}%{_sysusersdir}/%{name}.conf
100
+
101
+ %check
102
+ %pyproject_check_import
103
+ %pytest
104
+
105
+ %files
106
+ %doc README.md
107
+ %{_mandir}/man1/testcloud.1*
108
+ %license LICENSE
109
+
110
+ %dir %{_sysconfdir}/testcloud
111
+ %dir %attr(0775, qemu, testcloud) %{_sharedstatedir}/testcloud
112
+ %dir %attr(0775, qemu, testcloud) %{_sharedstatedir}/testcloud/backingstores
113
+ %dir %attr(0775, qemu, testcloud) %{_sharedstatedir}/testcloud/instances
114
+
115
+ %attr(0644, root, root) %{_sysconfdir}/polkit-1/rules.d/99-testcloud-nonroot-libvirt-access.rules
116
+
117
+ %config(noreplace) %{_sysconfdir}/testcloud/settings.py
118
+ %{_bindir}/testcloud
119
+ %{_bindir}/t7d
120
+ %{_datadir}/bash-completion/completions/testcloud
121
+
122
+ %{_sysusersdir}/%{name}.conf
123
+
124
+ %files -n python3-%{name} -f %{pyproject_files}
125
+
126
+ %changelog
127
+ %autochangelog
@@ -0,0 +1 @@
1
+ g testcloud -
@@ -0,0 +1,20 @@
1
+ summary: Integration testing with tmt
2
+
3
+ discover:
4
+ how: fmf
5
+ test: /test/tmt
6
+
7
+ provision:
8
+ how: virtual
9
+ memory: 4096
10
+
11
+ execute:
12
+ how: tmt
13
+
14
+ adjust:
15
+ - provision:
16
+ hardware:
17
+ virtualization:
18
+ is-supported: true
19
+ memory: ">= 8 GB"
20
+ when: trigger == commit
@@ -0,0 +1,8 @@
1
+ summary: Run unit tests
2
+
3
+ discover:
4
+ how: fmf
5
+ test: /test/unit
6
+
7
+ execute:
8
+ how: tmt
@@ -0,0 +1,45 @@
1
+ [build-system]
2
+ requires = ["hatchling", "hatch-vcs"]
3
+ build-backend = "hatchling.build"
4
+
5
+ [project]
6
+ name = "testcloud"
7
+ dynamic = ["version"]
8
+ description = "A tool to download and boot cloud images locally, with an easy to use API."
9
+ readme = "README.md"
10
+ license = "GPL-2.0-or-later"
11
+ requires-python = ">=3.9"
12
+ authors = [
13
+ {name = "Mike Ruckman", email = "roshi@fedoraproject.org"},
14
+ ]
15
+ dependencies = [
16
+ "libvirt-python",
17
+ "peewee",
18
+ "requests",
19
+ "packaging",
20
+ "fedora-distro-aliases>=1.5",
21
+ ]
22
+
23
+ [project.optional-dependencies]
24
+ image_resolve_caching = ["requests_cache>=1.2"]
25
+
26
+ [project.scripts]
27
+ testcloud = "testcloud.cli:main"
28
+ t7d = "testcloud.cli:main"
29
+
30
+ [project.urls]
31
+ Homepage = "https://github.com/teemtee/testcloud"
32
+
33
+ [tool.hatch.version]
34
+ source = "vcs"
35
+ raw-options.version_scheme = "release-branch-semver"
36
+ raw-options.git_describe_command = [
37
+ "git", "describe", "--dirty", "--tags", "--long",
38
+ "--abbrev=9", "--match", "*[0-9]*",
39
+ ]
40
+
41
+ [tool.black]
42
+ line-length=140
43
+
44
+ [tool.pytest.ini_options]
45
+ testpaths = ["test"]
@@ -4,6 +4,7 @@
4
4
  libvirt-python
5
5
  requests
6
6
  peewee
7
+ fedora-distro-aliases>=1.5
7
8
  #guestfs - after it is on pypi ( https://bugzilla.redhat.com/show_bug.cgi?id=1075594 )
8
9
 
9
10
  # Test suite requirements
@@ -0,0 +1,22 @@
1
+ /plan:
2
+ discover:
3
+ how: fmf
4
+ provision:
5
+ how: virtual
6
+ execute:
7
+ how: tmt
8
+
9
+ /fedora:
10
+ provision+:
11
+ image: fedora
12
+ environment:
13
+ EXPECTED: Fedora Linux
14
+
15
+ /centos:
16
+ provision+:
17
+ image: centos-stream-10
18
+ environment:
19
+ EXPECTED: CentOS Stream
20
+
21
+ /test:
22
+ test: grep "$EXPECTED" /etc/os-release
@@ -0,0 +1,8 @@
1
+ summary: Regular user can provision a guest
2
+ description:
3
+ Provision a fedora and centos-stream guest using a
4
+ short name under a regular user and run a simple check.
5
+ test: ./test.sh
6
+ framework: beakerlib
7
+ require: tmt+provision-virtual
8
+ duration: 20m