File: rules

package info (click to toggle)
openvswitch 3.6.0-7
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 99,632 kB
  • sloc: sh: 1,683,183; ansic: 313,349; python: 28,192; xml: 21,442; makefile: 549; javascript: 191
file content (255 lines) | stat: -rwxr-xr-x 13,086 bytes parent folder | download
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
#!/usr/bin/make -f
# -*- makefile -*-
#export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

# While -fPIC is often the default, we explicitly enable it for this package
# because it is a requirement for successful linking the static libopenvswitch
# with shared libraries used for the Python JSON C extension.
#
# Ref: https://patchwork.ozlabs.org/project/openvswitch/patch/20220725121939.2710272-5-i.maximets@ovn.org/
export DEB_CFLAGS_MAINT_APPEND = -fPIC

%:
	dh $@

execute_after_dh_autoreconf:
	patch -f --no-backup-if-mismatch -i $(CURDIR)/debian/ltmain-whole-archive.diff build-aux/ltmain.sh

ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
PARALLEL = -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
else
PARALLEL =
endif

DEB_HOST_ARCH?=$(shell dpkg-architecture -qDEB_HOST_ARCH)

override_dh_auto_configure:
	test -d _debian || mkdir _debian
	cd _debian && ( \
		test -e Makefile || \
		../configure --prefix=/usr --localstatedir=/var --enable-ssl \
					 --sysconfdir=/etc \
					 $(DATAPATH_CONFIGURE_OPTS) \
					 $(EXTRA_CONFIGURE_OPTS) \
					 )
ifneq (,$(filter i386 amd64 ppc64el arm64 riscv64 loong64, $(DEB_HOST_ARCH)))
	test -d _dpdk || mkdir _dpdk
	cd _dpdk && ( \
		test -e Makefile || \
        ../configure --prefix=/usr --localstatedir=/var --enable-ssl \
                     --with-dpdk=shared --sysconfdir=/etc \
					 $(DATAPATH_CONFIGURE_OPTS) \
					 $(EXTRA_CONFIGURE_OPTS) \
					 )
endif


# NOTE(jamespage): by default, just run all tests
# NOTE(zigo): by default, blacklist non-deterministic tests
# 2436: ovsdb-idl.at:1544  ovsdb-idl - track, simple idl, initially populated, weak references, insert+delete batch - C ovsdb server idl tracking positive
# 2455: ovsdb-idl.at:1751  ovsdb-idl - track, simple idl, initially empty, strong references, insert and delete - C ovsdb server idl tracking positive
# 2456: ovsdb-idl.at:1751  ovsdb-idl - track, simple idl, initially empty, strong references, insert and delete - write-changed-only - C ovsdb server idl tracking positive
# 2489: ovsdb-idl.at:2725  ovsdb-idl - track, insert and delete, refs to link1 - C ovsdb server idl tracking positive
# 2490: ovsdb-idl.at:2725  ovsdb-idl - track, insert and delete, refs to link1 - write-changed-only - C ovsdb server idl tracking positive
# 2491: ovsdb-idl.at:2768  ovsdb-idl - track, insert and delete, refs to link2 - C ovsdb server idl tracking positive
# 2492: ovsdb-idl.at:2768  ovsdb-idl - track, insert and delete, refs to link2 - write-changed-only - C ovsdb server idl tracking positive
TEST_LIST = 1-1223 1227-2391 2394-2410 2413-2435 2437-2442 2447-2454 2457-2488 2493-
TEST_LIST_DPDK = $(TEST_LIST)

# s390x:
# 33: bfd.at:268         bfd - bfd decay
TEST_LIST = 1-32 34-1223 1227-2391 2394-2410 2413-2442 2447-
TEST_LIST_DPDK = $(TEST_LIST)

# mips64el:
#    20: bfd - bfd decay FAILED (bfd.at:396)
#  1033: ofproto-dpif - select group with weights
#  1035: ofproto-dpif - select group with weights
#  1057: ofproto-dpif - controller action without megaflows FAILED (ofproto-dpif.at:1893)
#  1021: ofproto-dpif - select group with weights        FAILED (ofproto-dpif.at:535)
#  1069: ofproto-dpif - controller action without megaflows
ifneq (,$(filter mips64el, $(DEB_HOST_ARCH)))
TEST_LIST = 1-19 22-531 533-1020 1022-1032 1034 1037-1056 1058-1068 1070 1072-1120 1122-1223 1227-2391 2394-2410 2413-2442 2447-
TEST_LIST_DPDK = $(TEST_LIST)
endif # mips64el

# arm64:
#   159: ofp-actions - inconsistent MPLS actions         FAILED (ofp-actions.at:819)
#  1021: ofproto-dpif - select group with weights        FAILED (ofproto-dpif.at:535)
#  1057: ofproto-dpif - controller action without megaflows FAILED (ofproto-dpif.at:1893)
ifneq (,$(filter arm64, $(DEB_HOST_ARCH)))
TEST_LIST = 1-19 21-158 160-531 533-1020 1022-1056 1058-1068 1070 1072-1120 1122-1223 1227-2391 2394-2410 2413-2442 2447-
TEST_LIST_DPDK = $(TEST_LIST)
endif #arm64

# sparc64
#    20: bfd - bfd decay                                 FAILED (bfd.at:396)
#    26: bfd - check that BFD works together with RSTP   FAILED (bfd.at:829)
#   478: fuzz regression - ofp_print_fuzzer-5395207246839808 FAILED (fuzz-regression.at:12)
#   927: ofproto - bundle packet-out makes bundle commit to fail(OpenFlow 1.4) FAILED (ofproto.at:2181)
#   945: ofproto - asynchronous message control (OpenFlow 1.3) FAILED (ovs-macros.at:242)
#   969: ofproto - flow monitoring pause and resume      FAILED (ofproto.at:4851)
#   998: PMD - monitor threads                           FAILED (pmd.at:660)
#  1057: ofproto-dpif - controller action without megaflows FAILED (ofproto-dpif.at:1893)
#  1155: ofproto-dpif - continuation - resubmit - OpenFlow10 FAILED (ovs-macros.at:242)7
#  1156: ofproto-dpif - continuation - resubmit - OpenFlow13 FAILED (ovs-macros.at:242)
#  1187: ofproto-dpif - sFlow packet sampling - LACP structures FAILED (ofproto-dpif.at:7205)
#  2184: STP - dummy interface                           FAILED (stp.at:439)
#  2185: STP - flush the fdb and mdb when topology changed FAILED (stp.at:529)
#  2249: auto-attach - packets                           FAILED (auto-attach.at:5)
ifneq (,$(filter sparc64, $(DEB_HOST_ARCH)))
TEST_LIST = 1-19 22-25 27-477 479-531 533-926 928-944 946-968 970-997 999-1056 1058-1154 1157-1223 1227-1186 1188-2183 2186-2248 2250-2391 2394-2410 2413-2442 2447-
TEST_LIST_DPDK = $(TEST_LIST)
endif #sparc64

# riscv64
#  758: tunnel - input with matching tunnel mask        FAILED (tunnel.at:132)
#  806: tunnel.at:790      tunnel - Geneve metadata
#  945: ofproto - asynchronous message control (OpenFlow 1.3) FAILED (ofproto.at:3372)
#  946: ofproto - asynchronous message control (OpenFlow 1.4) FAILED (ovs-macros.at:242)
#  969: ofproto - flow monitoring pause and resume      FAILED (ofproto.at:4851)
#  980: ofproto - flow table names                      FAILED (ofproto.at:2461)
#  1036: ofproto-dpif - select group with weights        ok
#  1038: ALB - min num PMD/RxQ                           FAILED (ovs-macros.at:242)
#  1039: ALB - cross-numa                                FAILED (ovs-macros.at:242)
#  1040: ALB - PMD/RxQ assignment type                   FAILED (ovs-macros.at:242)
#  1069: ofproto-dpif - select group with weights        FAILED (ofproto-dpif.at:863)
#  1072: ofproto-dpif - controller action without megaflows FAILED (ofproto-dpif.at:2145)
#  1105: ofproto-dpif - controller action without megaflows FAILED (ofproto-dpif.at:2221)
#  1153: ofproto-dpif - continuation - actions - OpenFlow10 FAILED (ovs-macros.at:242)
#  1154: ofproto-dpif - continuation - actions - OpenFlow13 FAILED (ovs-macros.at:242)
#  1155: ofproto-dpif - continuation - resubmit - OpenFlow10 FAILED (ovs-macros.at:242)
#  1156: ofproto-dpif - continuation - resubmit - OpenFlow13 FAILED (ovs-macros.at:242)
#  1159: ofproto-dpif - continuation - goto_table - OpenFlow10 FAILED (ovs-macros.at:242)
#  1160: ofproto-dpif - continuation - goto_table - OpenFlow13 FAILED (ovs-macros.at:242)
#  1161: ofproto-dpif - continuation - write_metadata - OpenFlow10 FAILED (ovs-macros.at:242)
#  1162: ofproto-dpif - continuation - write_metadata - OpenFlow13 FAILED (ovs-macros.at:242)
#  1163: ofproto-dpif - continuation - data stack - OpenFlow10 FAILED (ovs-macros.at:242)
#  1164: ofproto-dpif - continuation - data stack - OpenFlow13 FAILED (ovs-macros.at:242)
#  1167: ofproto-dpif - continuation - patch ports - OpenFlow10 FAILED (ovs-macros.at:242)
#  1168: ofproto-dpif - continuation - patch ports - OpenFlow13 FAILED (ovs-macros.at:242)
#  1187: ofproto-dpif - sFlow packet sampling - LACP structures FAILED (ofproto-dpif.at:7205)
#  1805: ovsdb-server combines updates on backlogged connections FAILED (ovsdb-server.at:1213)
#  1806: ovsdb-server transaction history size           FAILED (ovsdb-server.at:1282)
ifneq (,$(filter riscv64, $(DEB_HOST_ARCH)))
TEST_LIST = 1-19 22-28 30-531 533-757 759-805 807-944 947-968 970-979 981-1020 1022-1223 1227-1035 1037 1041-1056 1058-1068 1070-1071 1073-1104 1106-1152 1157-1158 1165-1166 1169-1186 1188-1234 1237-1804 1807-2391 2394-2410 2413-2442 2447-
TEST_LIST_DPDK = $(TEST_LIST)
endif #riscv64

# ia64
#    20: bfd - bfd decay                                 FAILED (bfd.at:396)
#  1021: ofproto-dpif - select group with weights        FAILED (ofproto-dpif.at:535)
#  1057: ofproto-dpif - controller action without megaflows FAILED (ofproto-dpif.at:1893)
ifneq (,$(filter ia64, $(DEB_HOST_ARCH)))
TEST_LIST = 1-19 22-531 533-1020 1022-1056 1058-1223 1227-2391 2394-2410 2413-2442 2447-
TEST_LIST_DPDK = $(TEST_LIST)
endif #ia64

# LP: #2090931 DPDK 24.11 increases the residential footprint for binaries
# linked with DPDK.
#
# The OVS build system currently links all binaries with DPDK, consequently
# some tests no longer pass in constrained CI environment due to the increased
# memory footprint.
#
# On an installed system with DPDK enabled, all binaries come from the normal
# build tree, with the exception of the ovs-vswitchd daemon.
#
# We mimic this in our build time test for DPDK to avoid the issue.
DPDK_AUTOTEST_PATH = $(CURDIR)/_debian/utilities:vswitchd:$(CURDIR)/_debian/ovsdb:$(CURDIR)/_debian/vtep:tests:$(CURDIR)/_debian/ipsec::

override_dh_auto_test:
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
	if $(MAKE) -C _debian check TESTSUITEFLAGS='$(PARALLEL) $(TEST_LIST)' || \
                $(MAKE) -C _debian check TESTSUITEFLAGS='--recheck'; then :; \
	else \
		cat _debian/tests/testsuite.log; \
		exit 1; \
	fi
# Skip DPDK testing on arm64 as builders don't have crc32 support
# which is used in aarch64 based crc optimization in ovs >= 2.12.0~
ifneq (,$(filter i386 amd64 ppc64el riscv64 loong64, $(DEB_HOST_ARCH)))
	if $(MAKE) -C _dpdk check TESTSUITEFLAGS='$(PARALLEL) $(TEST_LIST_DPDK)' \
		AUTOTEST_PATH=$(DPDK_AUTOTEST_PATH) || \
				$(MAKE) -C _dpdk check TESTSUITEFLAGS='--recheck'; then :; \
	else \
		cat _dpdk/tests/testsuite.log; \
		exit 1; \
	fi
endif # i386/amd64/ppc64el
endif # nocheck

export PYBUILD_DESTDIR = $(CURDIR)/debian/tmp
export PYBUILD_DIR = $(CURDIR)/python

pybuild = \
	export PKG_CONFIG_PATH=$(CURDIR)/debian/tmp/usr/lib/pkgconfig; \
	        export PYBUILD_SYSTEM=distutils; \
		export PKG_CONFIG_SYSROOT_DIR=$(CURDIR)/debian/tmp; \
		export PKG_CONFIG_SYSTEM_INCLUDE_PATH=/; \
		export PKG_CONFIG_SYSTEM_LIBRARY_PATH=/; \
		enable_shared=no \
		extra_cflags="`pkg-config --cflags libopenvswitch`" \
		extra_libs="-Wl,-Bstatic -lopenvswitch -Wl,-Bdynamic `pkg-config --libs --static libopenvswitch`" \
		pybuild

override_dh_auto_build:
	dh_auto_build --sourcedirectory=_debian -- distdir-am distdir=openvswitch
	dh_auto_build --sourcedirectory=_debian
	# We need an extra install here so that we can use pkgconfig to
	# retrieve accurate CFLAGS and LDFLAGS for building Python extensions.
	dh_auto_install --sourcedirectory=_debian
	$(pybuild) --build
ifneq (,$(filter i386 amd64 ppc64el arm64 riscv64 loong64, $(DEB_HOST_ARCH)))
	dh_auto_build --sourcedirectory=_dpdk
endif

execute_before_dh_auto_clean:
	find . -name "*.pyc" -delete
	rm -f package.m4
	rm -f python/ovs/dirs.py python/ovs/flow/ofp_fields.py python/ovs/version.py
	rm -rf python/ovs.egg-info python/ovs_build_helpers/__pycache__ python/build .pybuild
	rm -f rhel/openvswitch-fedora.spec rhel/openvswitch.spec
	rm -f tests/ovsdb-cluster-testsuite tests/system-afxdp-testsuite tests/system-dpdk-testsuite tests/system-kmod-testsuite tests/system-offloads-testsuite tests/system-tso-testsuite tests/system-userspace-testsuite tests/testsuite
	if test -d $(PYBUILD_DIR)/build; then \
		pybuild --clean ; \
	fi

override_dh_auto_install:
	# We need to use pybuild to install Python extensions.
	$(pybuild) --install
	dh_auto_install --sourcedirectory=_debian

override_dh_installinit:
	dh_installinit --restart-after-upgrade
	dh_installinit -popenvswitch-switch --name=ovsdb-server --no-start
	dh_installinit -popenvswitch-switch --name=ovs-vswitchd --no-start
	dh_installinit -popenvswitch-switch --name=ovs-record-hostname --no-start

override_dh_installsystemd:
	dh_installsystemd -popenvswitch-switch --name=ovsdb-server --no-start
	dh_installsystemd -popenvswitch-switch --name=ovs-vswitchd --no-start
	dh_installsystemd -popenvswitch-switch --name=ovs-record-hostname --no-start
	dh_installsystemd --restart-after-upgrade -Xovs-vswitchd.service -Xovsdb-server.service -Xovs-record-hostname.service

override_dh_strip:
	dh_strip --dbgsym-migration='openvswitch-dbg (<< 2.17~)'

override_dh_python3:
	DEB_HOST_ARCH=$(DEB_HOST_ARCH) dh_python3 --shebang=/usr/bin/python3

# Helper target for creating snapshots from upstream git
DATE=$(shell date +%Y%m%d)
# Upstream branch to track
BRANCH=branch-3.5
VERSION=3.5.0

get-orig-snapshot:
	rm -Rf openvswitch-upstream
	git clone --branch $(BRANCH) --depth 1 https://github.com/openvswitch/ovs openvswitch-upstream
	cd openvswitch-upstream && \
		export COMMIT=`git rev-parse --short HEAD` && \
		git archive --format tgz --prefix=openvswitch-$(VERSION)~git$(DATE).$$COMMIT/ \
			-o ../../openvswitch_$(VERSION)~git$(DATE).$$COMMIT.orig.tar.gz $(BRANCH)
	rm -Rf openvswitch-upstream