diff options
Diffstat (limited to 'devel/py-avocado-framework')
7 files changed, 216 insertions, 0 deletions
diff --git a/devel/py-avocado-framework/Makefile b/devel/py-avocado-framework/Makefile new file mode 100644 index 000000000000..05c7e6c836cc --- /dev/null +++ b/devel/py-avocado-framework/Makefile @@ -0,0 +1,25 @@ +PORTNAME= avocado-framework +DISTVERSION= 111.0 +CATEGORIES= devel python +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +MAINTAINER= novel@FreeBSD.org +COMMENT= Set of tools and libraries to help with automated testing +WWW= https://avocado-framework.github.io/ + +LICENSE= GPLv2+ + +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>=0:devel/py-setuptools@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}sqlite3>=0:databases/py-sqlite3@${PY_FLAVOR} + +USES= python +USE_GITHUB= yes +GH_ACCOUNT= ${PORTNAME} +GH_PROJECT= avocado +USE_PYTHON= autoplist distutils + +PYDISTUTILS_INSTALLARGS+= --etcprefix="${PREFIX}" + +NO_ARCH= yes + +.include <bsd.port.mk> diff --git a/devel/py-avocado-framework/distinfo b/devel/py-avocado-framework/distinfo new file mode 100644 index 000000000000..1d64a1fd2be7 --- /dev/null +++ b/devel/py-avocado-framework/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1749475588 +SHA256 (avocado-framework-avocado-111.0_GH0.tar.gz) = 13334cf3c36c271f0babbaf0508186bc028b09eda9f2e3518e1a8150c3afb9c3 +SIZE (avocado-framework-avocado-111.0_GH0.tar.gz) = 1567600 diff --git a/devel/py-avocado-framework/files/patch-allow-to-override-etc-dir-location b/devel/py-avocado-framework/files/patch-allow-to-override-etc-dir-location new file mode 100644 index 000000000000..55af28d4fd5c --- /dev/null +++ b/devel/py-avocado-framework/files/patch-allow-to-override-etc-dir-location @@ -0,0 +1,122 @@ +From 4612dfa7a36c9f5520b427557dc0150bbe3af887 Mon Sep 17 00:00:00 2001 +From: Roman Bogorodskiy <bogorodskiy@gmail.com> +Date: Sun, 18 May 2025 07:11:18 +0200 +Subject: [PATCH] Allow to override /etc dir location + +Some systems, e.g. FreeBSD, place third-part software configuration +files in /usr/local/etc instead of /etc. + +Extend the install command to accept "etcprefix" option used for global +configuration paths. By default it's "/", so it keeps the current +behaviour unchanged. + +Signed-off-by: Roman Bogorodskiy <bogorodskiy@gmail.com> +--- + avocado/core/settings.py | 3 ++- + avocado/core/utils/path.py | 4 +++- + avocado/paths.py | 2 ++ + setup.py | 23 +++++++++++++++++++++++ + 4 files changed, 30 insertions(+), 2 deletions(-) + create mode 100644 avocado/paths.py + +diff --git avocado/core/settings.py avocado/core/settings.py +index b497bf0f..b76d0d0d 100644 +--- avocado/core/settings.py ++++ avocado/core/settings.py +@@ -46,6 +46,7 @@ import re + from pkg_resources import resource_exists, resource_filename + + from avocado.core.settings_dispatcher import SettingsDispatcher ++from avocado import paths + + + def sorted_dict(dict_object): +@@ -407,7 +408,7 @@ class Settings: + self.all_config_paths.append(self._config_path_local) + + def _prepare_base_dirs(self): +- cfg_dir = "/etc" ++ cfg_dir = os.path.join(paths.ETCPREFIX, "/etc") + user_dir = os.path.expanduser("~") + + if "VIRTUAL_ENV" in os.environ: +diff --git avocado/core/utils/path.py avocado/core/utils/path.py +index 8037bdd5..5f1f9ce5 100644 +--- avocado/core/utils/path.py ++++ avocado/core/utils/path.py +@@ -1,5 +1,7 @@ + import os + ++from avocado import paths ++ + from pkg_resources import get_distribution + + +@@ -32,7 +34,7 @@ def system_wide_or_base_path(file_path): + if os.path.isabs(file_path): + abs_path = file_path + else: +- abs_path = os.path.join(os.path.sep, file_path) ++ abs_path = os.path.join(paths.ETCPREFIX, file_path) + if os.path.exists(abs_path): + return abs_path + return prepend_base_path(file_path) +diff --git avocado/paths.py avocado/paths.py +new file mode 100644 +index 00000000..4d2b2f88 +--- /dev/null ++++ avocado/paths.py +@@ -0,0 +1,2 @@ ++# To be overriden by setup.py ++ETCPREFIX = "/" +diff --git setup.py setup.py +index d9e1d795..58671d03 100755 +--- setup.py ++++ setup.py +@@ -23,6 +23,7 @@ from pathlib import Path + from subprocess import CalledProcessError, run + + import setuptools.command.develop ++import setuptools.command.install + from setuptools import Command, find_packages, setup + + # pylint: disable=E0611 +@@ -203,6 +204,27 @@ class Develop(setuptools.command.develop.develop): + self.handle_uninstall() + + ++class Install(setuptools.command.install.install): ++ """Custom install command.""" ++ ++ user_options = setuptools.command.install.install.user_options + [ ++ ("etcprefix=", None, "The etc directory prefix [default: /]"), ++ ] ++ ++ def initialize_options(self): ++ super().initialize_options() ++ self.etcprefix = "/usr/local" # pylint: disable=W0201 ++ ++ def run(self): ++ pkg_dir = os.path.join(self.build_lib, 'avocado') ++ os.makedirs(pkg_dir, exist_ok=True) ++ ++ with open(os.path.join(pkg_dir, 'paths.py'), 'w') as f: ++ f.write(f'ETCPREFIX = "{self.etcprefix}"') ++ ++ super().run() ++ ++ + class SimpleCommand(Command): + """Make Command implementation simpler.""" + +@@ -504,6 +526,7 @@ if __name__ == "__main__": + cmdclass={ + "clean": Clean, + "develop": Develop, ++ "install": Install, + "lint": Linter, + "man": Man, + "plugin": Plugin, +-- +2.49.0 + diff --git a/devel/py-avocado-framework/files/patch-avocado_etc_avocado_sysinfo_commands b/devel/py-avocado-framework/files/patch-avocado_etc_avocado_sysinfo_commands new file mode 100644 index 000000000000..02a15c358a31 --- /dev/null +++ b/devel/py-avocado-framework/files/patch-avocado_etc_avocado_sysinfo_commands @@ -0,0 +1,24 @@ +--- avocado/etc/avocado/sysinfo/commands.orig 2025-06-01 04:14:46 UTC ++++ avocado/etc/avocado/sysinfo/commands +@@ -1,15 +1,14 @@ uname -a + df -mP + dmesg + uname -a +-lspci -vvnn +-gcc --version ++pciconf -lv ++cc --version + ld --version + hostname + uptime + dmidecode + ifconfig -a +-brctl show +-ip link +-numactl --hardware show +-lscpu +-fdisk -l ++sysctl kern.sched.topology_spec ++gpart show ++kldstat ++vmstat diff --git a/devel/py-avocado-framework/files/patch-avocado_etc_avocado_sysinfo_files b/devel/py-avocado-framework/files/patch-avocado_etc_avocado_sysinfo_files new file mode 100644 index 000000000000..fe20561dcd15 --- /dev/null +++ b/devel/py-avocado-framework/files/patch-avocado_etc_avocado_sysinfo_files @@ -0,0 +1,16 @@ +--- avocado/etc/avocado/sysinfo/files.orig 2025-06-01 04:14:50 UTC ++++ avocado/etc/avocado/sysinfo/files +@@ -1,13 +0,0 @@ +-/proc/cmdline +-/proc/mounts +-/proc/pci +-/proc/meminfo +-/proc/slabinfo +-/proc/version +-/proc/cpuinfo +-/proc/modules +-/proc/interrupts +-/proc/partitions +-/sys/kernel/debug/sched_features +-/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor +-/sys/devices/system/clocksource/clocksource0/current_clocksource diff --git a/devel/py-avocado-framework/files/patch-avocado_etc_avocado_sysinfo_profilers b/devel/py-avocado-framework/files/patch-avocado_etc_avocado_sysinfo_profilers new file mode 100644 index 000000000000..a2498faed8dd --- /dev/null +++ b/devel/py-avocado-framework/files/patch-avocado_etc_avocado_sysinfo_profilers @@ -0,0 +1,6 @@ +--- avocado/etc/avocado/sysinfo/profilers.orig 2025-06-01 04:14:54 UTC ++++ avocado/etc/avocado/sysinfo/profilers +@@ -1,2 +1,2 @@ vmstat 1 + vmstat 1 +-journalctl -f ++tail -f /var/log/messages diff --git a/devel/py-avocado-framework/pkg-descr b/devel/py-avocado-framework/pkg-descr new file mode 100644 index 000000000000..d4363307192d --- /dev/null +++ b/devel/py-avocado-framework/pkg-descr @@ -0,0 +1,20 @@ +Avocado is a set of tools and libraries to help with automated testing. + +One can call it a test framework with benefits. Native tests are written in +Python and they follow the unittest pattern, but any executable can serve +as a test. + +Avocado is composed of: + + - A test runner that lets you execute tests. Those tests can be either written + in your language of choice, or be written in Python and use the available + libraries. In both cases, you get facilities such as automated log + and system information collection. + + - Libraries that help you write tests in a concise, yet expressive + and powerful way. + + - Plugins that can extend and add new functionality to the Avocado Framework. + +Avocado is built on the experience accumulated with Autotest, while improving +on its weaknesses and shortcomings. |