blob: c92e2a03c45af9405e0900840e07cb610e2bc7a3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
|
# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{13..14} )
DISTUTILS_USE_PEP517=setuptools
inherit tmpfiles systemd distutils-r1
DESCRIPTION="The BGP swiss army knife of networking"
HOMEPAGE="https://github.com/Exa-Networks/exabgp"
SRC_URI="https://github.com/Exa-Networks/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64"
IUSE="test"
RESTRICT="!test? ( test )"
RDEPEND="
acct-group/exabgp
acct-user/exabgp
"
BDEPEND="
test? (
dev-python/psutil[${PYTHON_USEDEP}]
dev-python/pytest-asyncio[${PYTHON_USEDEP}]
dev-python/hypothesis[${PYTHON_USEDEP}]
dev-python/pytest-timeout[${PYTHON_USEDEP}]
)
"
PATCHES=(
"${FILESDIR}/exabgp-5.0.8-paths.patch"
"${FILESDIR}/exabgp-5.0.8-ip-path.patch"
"${FILESDIR}/exabgp-5.0.8-healthcheck-allow-disable-metric.patch"
"${FILESDIR}/exabgp-5.0.8-less-verbose-logging.patch"
)
EPYTEST_PLUGINS=(
hypothesis
pytest-asyncio
pytest-timeout
)
distutils_enable_tests pytest
python_prepare_all() {
# remove performance tests
rm -rf tests/performance || die
# remove tests that need internet access
rm -f tests/unit/test_flow_needs_a_match.py || die
distutils-r1_python_prepare_all
}
python_install_all() {
distutils-r1_python_install_all
newinitd "${FILESDIR}/${PN}.initd-r2" ${PN}
newconfd "${FILESDIR}/${PN}.confd" ${PN}
newtmpfiles "${FILESDIR}/exabgp.tmpfiles" ${PN}.conf
systemd_dounit etc/systemd/*
insinto /etc/logrotate.d
newins "${FILESDIR}/${PN}.logrotate" ${PN}
keepdir /etc/exabgp
doman doc/man/*.?
}
python_test() {
local -a EPYTEST_DESELECT=(
# tests that need network access
tests/integration/test_connection_lifecycle.py::TestConnectionConcurrency::test_concurrent_read_write
tests/integration/test_connection_lifecycle.py::TestConnectionStateManagement::test_connection_cleanup_on_close
tests/integration/test_connection_lifecycle.py::TestConnectionStateManagement::test_multiple_close_calls
tests/integration/test_connection_lifecycle.py::TestOutgoingConnectionLifecycle::test_outgoing_connection_establishment
tests/integration/test_connection_lifecycle.py::TestOutgoingConnectionLifecycle::test_outgoing_full_message_exchange
tests/integration/test_connection_lifecycle.py::TestOutgoingConnectionLifecycle::test_outgoing_receive_keepalive
tests/integration/test_connection_lifecycle.py::TestOutgoingConnectionLifecycle::test_outgoing_send_keepalive
tests/integration/test_connection_lifecycle.py::TestConnectionStateManagement::test_file_descriptor_tracking
tests/unit/test_gates_are_wired.py::TestEveryTestDirectoryIsActuallyRun::test_the_walk_found_the_directories
tests/unit/test_gates_are_wired.py::TestEveryTestDirectoryIsActuallyRun::test_the_ones_that_were_unwired_are_among_them
tests/unit/test_network_tcp.py::TestSocketCreation::test_a_refused_setsockopt_is_reported_as_itself
tests/unit/test_network_tcp.py::TestSocketCreation::test_a_real_interface_is_bound_with_a_nul_terminated_name
tests/unit/test_validate_survives_a_route_with_no_nlri.py::test_a_route_which_reads_back_no_nlri_is_reported_not_raised
tests/unit/test_validate_survives_a_route_with_no_nlri.py::test_a_flow_route_with_a_match_still_validates
# unreliable test
tests/fuzz/test_update_split.py::test_update_split_withdrawn_length_fuzzing
)
epytest
}
pkg_postinst() {
tmpfiles_process ${PN}.conf
}
|