Skip to content

Commit

Permalink
Make the remote spawner an optional plugin with RPM packaging
Browse files Browse the repository at this point in the history
Signed-off-by: Cleber Rosa <crosa@redhat.com>
  • Loading branch information
clebergnu authored and pevogam committed Oct 16, 2023
1 parent 600b8c1 commit 51ecca1
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 2 deletions.
1 change: 1 addition & 0 deletions optional_plugins/spawner_remote/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
102.0
File renamed without changes.
48 changes: 48 additions & 0 deletions optional_plugins/spawner_remote/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/bin/env python3
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
#
# See LICENSE for more details.
#
# Copyright: Red Hat Inc. 2023
# Author: Cleber Rosa <crosa@redhat.com>

import os

from setuptools import setup

# Handle systems with setuptools < 40
try:
from setuptools import find_namespace_packages
except ImportError:
packages = ["avocado_spawner_remote"]
else:
packages = find_namespace_packages(include=["avocado_spawner_remote"])

BASE_PATH = os.path.dirname(__file__)
with open(os.path.join(BASE_PATH, "VERSION"), "r", encoding="utf-8") as version_file:
VERSION = version_file.read().strip()


setup(
name="avocado-framework-plugin-spawner-remote",
version=VERSION,
description="Remote (host) based spawner",
author="Avocado Developers",
author_email="avocado-devel@redhat.com",
url="http://avocado-framework.github.io/",
packages=packages,
include_package_data=True,
install_requires=[f"avocado-framework=={VERSION}", "aexpect>=1.6.2"],
test_suite="tests",
entry_points={
"avocado.plugins.init": ["remote = avocado_spawner_remote:RemoteSpawnerInit"],
"avocado.plugins.spawner": ["remote = avocado_spawner_remote:RemoteSpawner"],
},
)
20 changes: 20 additions & 0 deletions python-avocado.spec
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ BuildRequires: python3-docutils
BuildRequires: python3-lxml
BuildRequires: python3-psutil
BuildRequires: python3-setuptools
BuildRequires: python3-aexpect

%if ! 0%{?rhel}
%if ! 0%{?fedora} > 35
Expand Down Expand Up @@ -131,6 +132,9 @@ popd
pushd optional_plugins/result_upload
%py3_build
popd
pushd optional_plugins/spawner_remote
%py3_build
popd
rst2man man/avocado.rst man/avocado.1

%install
Expand Down Expand Up @@ -166,6 +170,9 @@ popd
pushd optional_plugins/result_upload
%py3_install
popd
pushd optional_plugins/spawner_remote
%py3_install
popd
mkdir -p %{buildroot}%{_mandir}/man1
install -m 0644 man/avocado.1 %{buildroot}%{_mandir}/man1/avocado.1
mkdir -p %{buildroot}%{_pkgdocdir}
Expand Down Expand Up @@ -230,6 +237,7 @@ PATH=%{buildroot}%{_bindir}:%{buildroot}%{_libexecdir}/avocado:$PATH \
%exclude %{python3_sitelib}/avocado_framework_plugin_golang*
%exclude %{python3_sitelib}/avocado_framework_plugin_ansible*
%exclude %{python3_sitelib}/avocado_framework_plugin_result_upload*
%exclude %{python3_sitelib}/avocado_framework_plugin_spawner_remote*
%exclude %{python3_sitelib}/tests*

%package -n python3-avocado-common
Expand Down Expand Up @@ -374,6 +382,18 @@ a dedicated sever.
%{python3_sitelib}/avocado_result_upload*
%{python3_sitelib}/avocado_framework_plugin_result_upload*

%package -n python3-avocado-plugins-spawner-remote
Summary: Avocado Plugin to spawn tests on a remote host
License: GPLv2+
Requires: python3-avocado == %{version}-%{release}

%description -n python3-avocado-plugins-spawner-remote
This optional plugin is intended to spawn tests on a remote host.

%files -n python3-avocado-plugins-spawner-remote
%{python3_sitelib}/avocado_spawner_remote*
%{python3_sitelib}/avocado_framework_plugin_spawner_remote*

%package -n python3-avocado-examples
Summary: Avocado Test Framework Example Tests
License: GPLv2+
Expand Down
2 changes: 0 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -368,7 +368,6 @@ def run(self):
"run = avocado.plugins.run:RunInit",
"podman = avocado.plugins.spawners.podman:PodmanSpawnerInit",
"lxc = avocado.plugins.spawners.lxc:LXCSpawnerInit",
"remote = avocado.plugins.spawners.remote:RemoteSpawnerInit",
"nrunner = avocado.plugins.runner_nrunner:RunnerInit",
"testlogsui = avocado.plugins.testlogs:TestLogsUIInit",
"human = avocado.plugins.human:HumanInit",
Expand Down Expand Up @@ -459,7 +458,6 @@ def run(self):
"process = avocado.plugins.spawners.process:ProcessSpawner",
"podman = avocado.plugins.spawners.podman:PodmanSpawner",
"lxc = avocado.plugins.spawners.lxc:LXCSpawner",
"remote = avocado.plugins.spawners.remote:RemoteSpawner",
],
"avocado.plugins.cache": [
"requirement = avocado.plugins.requirement_cache:RequirementCache",
Expand Down

0 comments on commit 51ecca1

Please sign in to comment.