Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

requirements: Add all mandatory requirements #1142

Merged
merged 6 commits into from
Aug 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
include README.rst
include LICENSE
recursive-include avocado_vt/conf.d *
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,12 @@ develop:
$(PYTHON) setup.py develop $(PYTHON_DEVELOP_ARGS)

link: develop
for CONF in etc/avocado/conf.d/*; do\
[ -d "../$(AVOCADO_DIRNAME)/avocado/etc/avocado/conf.d" ] && ln -srf $(CURDIR)/$$CONF ../$(AVOCADO_DIRNAME)/avocado/$$CONF || true;\
[ -d "../$(AVOCADO_DIRNAME)/etc/avocado/conf.d" ] && ln -srf $(CURDIR)/$$CONF ../$(AVOCADO_DIRNAME)/$$CONF || true;\
done

unlink:
$(PYTHON) setup.py develop --uninstall $(PYTHON_DEVELOP_ARGS)
for CONF in etc/avocado/conf.d/*; do\
# For compatibility reasons remove old symlinks
for NAME in $$(ls -1 avocado_vt/conf.d); do\
CONF="etc/avocado/conf.d/$$NAME";\
[ -L ../$(AVOCADO_DIRNAME)/avocado/$$CONF ] && rm -f ../$(AVOCADO_DIRNAME)/avocado/$$CONF || true;\
[ -L ../$(AVOCADO_DIRNAME)/$$CONF ] && rm -f ../$(AVOCADO_DIRNAME)/$$CONF || true;\
done
2 changes: 1 addition & 1 deletion Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ source-release: clean
git archive --prefix="$(ARCHIVE_BASE_NAME)-$(VERSION)/" -o "SOURCES/$(ARCHIVE_BASE_NAME)-$(VERSION).tar.gz" $(VERSION)

install:
$(PYTHON) setup.py install --root $(DESTDIR) $(COMPILE)
$(PYTHON) -m pip install --root $(DESTDIR) .

srpm: source
if test ! -d BUILD/SRPM; then mkdir -p BUILD/SRPM; fi
Expand Down
22 changes: 15 additions & 7 deletions avocado-plugins-vt.spec
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
Summary: Avocado Virt Test Plugin
Name: avocado-plugins-vt
Version: 70.0
Release: 0%{?gitrel}%{?dist}
Release: 2%{?gitrel}%{?dist}
License: GPLv2
Group: Development/Tools
URL: http://avocado-framework.readthedocs.org/
Expand Down Expand Up @@ -130,16 +130,18 @@ Xunit output, among others.
%{__python2} setup.py install --root %{buildroot} --skip-build
%if %{with_python3}
%{__python3} setup.py install --root %{buildroot} --skip-build
%{__mkdir} -p %{buildroot}/etc/avocado/conf.d
%{__mv} %{buildroot}%{python2_sitelib}/avocado_vt/conf.d/* %{buildroot}/etc/avocado/conf.d
%endif

%files -n python2-%{name}
%defattr(-,root,root,-)
%dir /etc/avocado
%dir /etc/avocado/conf.d
%config(noreplace)/etc/avocado/conf.d/vt.conf
%dir %{_sysconfdir}/avocado
%dir %{_sysconfdir}/avocado/conf.d
%config(noreplace)%{_sysconfdir}/avocado/conf.d/*.conf
%doc README.rst LICENSE
%{python2_sitelib}/avocado_vt*
%{python2_sitelib}/avocado_plugins_vt*
%{python2_sitelib}/avocado_framework_plugins_vt*
%{python2_sitelib}/virttest*
%{_datadir}/avocado-plugins-vt/backends/*
%{_datadir}/avocado-plugins-vt/shared/*
Expand All @@ -150,10 +152,10 @@ Xunit output, among others.
%defattr(-,root,root,-)
%dir /etc/avocado
%dir /etc/avocado/conf.d
%config(noreplace)/etc/avocado/conf.d/vt.conf
%config(noreplace)%{_sysconfdir}/avocado/conf.d/*.conf
%doc README.rst LICENSE
%{python3_sitelib}/avocado_vt*
%{python3_sitelib}/avocado_plugins_vt*
%{python3_sitelib}/avocado_framework_plugins_vt*
%{python3_sitelib}/virttest*
%{_datadir}/avocado-plugins-vt/backends/*
%{_datadir}/avocado-plugins-vt/shared/*
Expand All @@ -162,6 +164,12 @@ Xunit output, among others.


%changelog
* Wed Aug 14 2019 Lukas Doktor <[email protected]> - 70.0-2
- Change the way config files are packaged

* Wed Aug 14 2019 Lukas Doktor <[email protected]> - 70.0-1
- Rename package to "avocado_framework_plugins_vt"

* Wed Jun 26 2019 Cleber Rosa <[email protected]> - 70.0-0
- New release

Expand Down
File renamed without changes.
File renamed without changes.
33 changes: 33 additions & 0 deletions avocado_vt/plugins/vt_settings.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# 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. 2018
# Author: Lukas Doktor <[email protected]>

"""
Avocado plugin that extends the settings path of our config paths
"""

import os
from pkg_resources import resource_filename
from pkg_resources import resource_listdir

from avocado.core.plugin_interfaces import Settings


class VTSettings(Settings):

def adjust_settings_paths(self, paths):
base = resource_filename('avocado_vt', 'conf.d')
for path in [os.path.join(base, conf)
for conf in resource_listdir('avocado_vt', 'conf.d')
if conf.endswith('.conf')]:
paths.insert(0, path)
2 changes: 1 addition & 1 deletion contrib/packages/debian/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ all:
prepare-source:
# build the source package in the parent directory
# then rename it to project_version.orig.tar.gz
dch -D "vivid" -M -v "$(VERSION)" "Automated (make builddeb) build."
dch -D "bionic" -M -v "$(VERSION)" "Automated (make builddeb) build."
$(PYTHON) setup.py sdist $(COMPILE) --dist-dir=../ --prune
rename -f 's/$(PROJECT)-(.*)\.tar\.gz/$(PROJECT)_$$1\.orig\.tar\.gz/' ../*

Expand Down
53 changes: 41 additions & 12 deletions docs/source/GetStartedGuide.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,59 @@ Getting Started

The first step towards using Avocado-VT is, quite obviously, installing it.

Installing Avocado
==================

Start by following the instructions on `this link <http://avocado-framework.readthedocs.org/en/latest/GetStartedGuide.html#installing-avocado>`__.

Installing Avocado-VT
Installing Avocado-vt
=====================

Having installed Avocado, you should already have the right repos enabled.
Avocado-vt is an Avocado plugin, therefor you are going to need both in
order to be able to execute the tests. Usually the packaging mechanism
should take care of the deps, but when package is not available for
your distro, you need to start by installing Avocado, steps are
`described here <http://avocado-framework.readthedocs.org/en/latest/GetStartedGuide.html#installing-avocado>`__.

.. note:: If you use avocado from sources, use `make link` as described `here <http://avocado-framework.readthedocs.io/en/latest/ContributionGuide.html#hacking-and-using-avocado>`__.

Fedora and Enterprise Linux
---------------------------
Fedora and Red Hat Enterprise Linux
-----------------------------------

Installing Avocado-VT on Fedora or Enterprise Linux is a matter of
installing the `avocado-plugins-vt` package. Install it with::

$ yum install avocado-plugins-vt

Which takes care of all the dependencies (python and non-python ones).

Installing via PIP
------------------

Pip is useful when it comes to python dependencies, but it fails
in non-python ones. List of non-python requirements based on Fedora
package names is::

$ dnf install xz tcpdump iproute iputils gcc glibc-headers nc git python-netaddr

Then you can get Avocado-vt via pip::

$ pip install git+https://github.com/avocado-framework/avocado-vt

Or by manually cloning it from github::

$ git clone https://github.com/avocado-framework/avocado-vt
$ cd avocado-vt
$ pip install .

It's recommended to use ``pip`` even for local install as it treats
requirements differently and the use of ``python setup.py install``
might fail.

Using Avocado-vt from sources
-----------------------------

If you intend use avocado from sources, clone it into the same parent dir
as Avocado sources and use ``make link`` from the Avocado sources dir.
Details about this can be found `here <http://avocado-framework.readthedocs.io/en/latest/ContributionGuide.html#hacking-and-using-avocado>`__.

.. _run_bootstrap:

Bootstrapping Avocado-VT
------------------------
========================

After the package, a bootstrap process must be run. Choose your test backend
(qemu, libvirt, v2v, openvswitch, etc) and run the `vt-bootstrap` command. Example::
Expand Down
4 changes: 0 additions & 4 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1 @@
autotest>=0.16.2; python_version < '3.0'
aexpect>1.5.0
simplejson>=3.5.3
netaddr>=0.7.18
netifaces>=0.10.5
66 changes: 40 additions & 26 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,7 @@ def add_files(level=[]):
os.path.isfile(path)]
return [((get_dir(installed_location, level)), files_found)]

data_files = [(get_dir(['etc', 'avocado', 'conf.d']),
['etc/avocado/conf.d/vt.conf'])]

data_files += add_files(["test-providers.d"])
data_files = add_files(["test-providers.d"])
data_files_dirs = ['backends', 'shared']

for data_file_dir in data_files_dirs:
Expand All @@ -79,25 +76,42 @@ def pre_post_plugin_type():
return 'avocado.plugins.job.prepost'


setup(name='avocado-plugins-vt',
version=VERSION,
description='Avocado Virt Test Compatibility Layer plugin',
author='Avocado Developers',
author_email='[email protected]',
url='http://github.com/avocado-framework/avocado-vt',
packages=find_packages(exclude=('selftests*',)),
package_data={"virttest": ["*.*"]},
data_files=get_data_files(),
entry_points={
'avocado.plugins.cli': [
'vt-list = avocado_vt.plugins.vt_list:VTLister',
'vt = avocado_vt.plugins.vt:VTRun',
],
'avocado.plugins.cli.cmd': [
'vt-bootstrap = avocado_vt.plugins.vt_bootstrap:VTBootstrap',
],
pre_post_plugin_type(): [
'vt-joblock = avocado_vt.plugins.vt_joblock:VTJobLock',
],
},
)
if __name__ == "__main__":
clebergnu marked this conversation as resolved.
Show resolved Hide resolved
requirements = ["netifaces", "aexpect", "netaddr", "simplejson"]
if sys.version_info[:2] >= (2, 7):
requirements.append("avocado-framework>=68.0")
else:
# Latest py2 supported stevedore is 1.10.0, need to limit it here
# as older avocado versions were not limiting it.
# Note: Avocado 70+ doesn't require stevedore and older Avocado
# can use whatever version of stevedore on py3
requirements.append("stevedore>=1.8.0,<=1.10.0")
requirements.append("avocado-framework>=68.0,<70.0")

setup(name='avocado-framework-plugins-vt',
version=VERSION,
description='Avocado Plugin for Virtualization Testing',
author='Avocado Developers',
author_email='[email protected]',
url='http://github.com/avocado-framework/avocado-vt',
packages=find_packages(exclude=('selftests*',)),
package_data={"virttest": ["*.*"]},
data_files=get_data_files(),
include_package_data=True,
entry_points={
'avocado.plugins.settings': [
'vt-settings = avocado_vt.plugins.vt_settings:VTSettings',
],
'avocado.plugins.cli': [
'vt-list = avocado_vt.plugins.vt_list:VTLister',
'vt = avocado_vt.plugins.vt:VTRun',
],
'avocado.plugins.cli.cmd': [
'vt-bootstrap = avocado_vt.plugins.vt_bootstrap:VTBootstrap',
],
pre_post_plugin_type(): [
'vt-joblock = avocado_vt.plugins.vt_joblock:VTJobLock',
],
},
install_requires=requirements,
)