Skip to content

Commit 91bfa19

Browse files
committed
Add testcloud provisioner
This MR adds provisioning of qcow2 images via testcloud. To test with a qcow2 from url: tmt run -a provision -h testcloud --image https://kojipkgs.fedoraproject.org/compose/branched/latest-Fedora-32/compose/Cloud/x86_64/images/Fedora-Cloud-Base-32-20200301.n.0.x86_64.qcow2 To test with a local qcow2: tmt run -a provision -h testcloud --image file:///home/user/fedora.qcow2 To test with latest Rawhide: tmt run -a provision -h testcloud --image fedora tmt run -a provision -h testcloud --image rawhide tmt run -a provision -h testcloud --image fedora-rawhide Other mappings will come later, as it is a bit PITA to do .... Signed-off-by: Miroslav Vadkerti <mvadkert@redhat.com>
1 parent 0aa5d09 commit 91bfa19

File tree

6 files changed

+354
-3
lines changed

6 files changed

+354
-3
lines changed

.travis.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ python:
33
- "3.6"
44
- "3.7"
55
before_install:
6-
- "pip install -U pip setuptools virtualenv python-coveralls fmf click mock"
7-
- "sudo apt-get -y install vagrant"
6+
- "sudo apt-get -y install vagrant libvirt-dev"
7+
- "pip install -U pip setuptools virtualenv python-coveralls fmf click mock testcloud"
88
script:
99
- "coverage run --source=bin,tmt -m py.test $CAPTURE tests"
1010
after_success:

README.rst

+9
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,15 @@ Check help message of individual commands for the full list of
186186
available options.
187187

188188

189+
Requirements
190+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
191+
192+
If you will be installing tmt from source, make sure to install
193+
these additional packages on your system.
194+
195+
dnf install libvirt-devel
196+
197+
189198
Install
190199
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
191200

setup.py

+2
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,12 @@
3333
install_requires = [
3434
'fmf>=0.9.2',
3535
'click',
36+
'requests'
3637
]
3738
extras_require = {
3839
'docs': ['sphinx', 'sphinx_rtd_theme'],
3940
'tests': ['pytest', 'python-coveralls', 'mock'],
41+
'provision': ['testcloud']
4042
}
4143
extras_require['all'] = [dependency
4244
for extra in extras_require.values()

tmt.spec

+15
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ BuildRequires: python%{python3_pkgversion}-pytest
4444
BuildRequires: python%{python3_pkgversion}-click
4545
BuildRequires: python%{python3_pkgversion}-fmf
4646
BuildRequires: python%{python3_pkgversion}-mock
47+
BuildRequires: python%{python3_pkgversion}-requests
48+
BuildRequires: python%{python3_pkgversion}-testcloud
4749
%{?python_provide:%python_provide python%{python3_pkgversion}-%{name}}
4850
%if %{with oldreqs}
4951
Requires: python%{python3_pkgversion}-PyYAML
@@ -63,6 +65,15 @@ Requires: ansible podman
6365
All dependencies of the Test Management Tool required to run tests
6466
in a container environment.
6567

68+
%package testcloud
69+
Summary: Libvirt (via testcloud) provisioner for the Test Management Tool
70+
Requires: tmt == %{version}-%{release}
71+
Requires: ansible python%{python3_pkgversion}-testcloud
72+
73+
%description testcloud
74+
All dependencies of the Test Management Tool required to run tests
75+
in a libvirt environment provisioned using testcloud.
76+
6677
%package all
6778
Summary: Extra dependencies for the Test Management Tool
6879
Requires: tmt == %{version}-%{release}
@@ -126,6 +137,10 @@ export LANG=en_US.utf-8
126137
%license LICENSE
127138

128139

140+
%files testcloud
141+
%license LICENSE
142+
143+
129144
%files all
130145
%license LICENSE
131146

tmt/steps/provision/__init__.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from click import echo
99

1010
from tmt.utils import SpecificationError
11-
from tmt.steps.provision import vagrant, localhost, podman
11+
from tmt.steps.provision import vagrant, localhost, podman, testcloud
1212

1313

1414
class Provision(tmt.steps.Step):
@@ -24,6 +24,7 @@ class Provision(tmt.steps.Step):
2424
'localhost': localhost.ProvisionLocalhost,
2525
'container': podman.ProvisionPodman,
2626
'podman': podman.ProvisionPodman,
27+
'libvirt.testcloud': testcloud.ProvisionTestcloud
2728
}
2829

2930
# Default implementation for provision is a virtual machine

0 commit comments

Comments
 (0)