On Tue, Jun 20, 2023 at 6:09 PM Ilya Maximets <i.maxim...@ovn.org> wrote: > > On 6/20/23 10:08, Frode Nordahl wrote: > > The autopkgtests [0][1] are relevant in an upstream context > > because an Open vSwitch contributor may want to have a quick > > way of running the upstream system testsuites on recent > > Debian/Ubuntu releases in an automated and contained manner. > > > > During the Debian/Ubuntu/upstream package source sync work [2], a > > relatively naive autopkgtest was added. It had been around since > > Open vSwitch was initially packaged many years ago. > > > > Replace the autopkgtest with a test that runs all the upstream > > system testsuites instead. > > > > To run the autopkgtest, take a look at [1] for prerequisites then: > > > > ./boot.sh && \ > > ./configure \ > > --prefix=/usr \ > > --localstatedir=/var \ > > ----sysconfdir=/etc \ > > --with-dpdk=shared && \ > > make debian-source > > autopkgtest \ > > --env DEB_BUILD_OPTIONS="afxdp nocheck parallel=32" \ > > openvswitch_3.1.90-1.dsc \ > > -- qemu \ > > --cpus 32 \ > > --ram-size 8129 \ > > autopkgtest-mantic-amd64.img > > > > 0: https://wiki.debian.org/ContinuousIntegration/autopkgtest > > 1: https://packaging.ubuntu.com/html/auto-pkg-test.html > > 2: https://mail.openvswitch.org/pipermail/ovs-dev/2022-July/396219.html > > > > Signed-off-by: Frode Nordahl <frode.nord...@canonical.com> > > --- > > .gitignore | 1 + > > debian/automake.mk | 31 ++++++- > > debian/rules | 5 ++ > > debian/tests/afxdp | 1 + > > debian/tests/control | 38 ++++++-- > > debian/tests/dpdk | 46 +--------- > > debian/tests/kernel | 1 + > > debian/tests/offloads | 1 + > > debian/tests/openflow.py | 66 -------------- > > debian/tests/run-tests.sh | 160 ++++++++++++++++++++++++++++++++++ > > debian/tests/system-userspace | 1 + > > debian/tests/vanilla | 29 ------ > > 12 files changed, 230 insertions(+), 150 deletions(-) > > create mode 120000 debian/tests/afxdp > > mode change 100755 => 120000 debian/tests/dpdk > > create mode 120000 debian/tests/kernel > > create mode 120000 debian/tests/offloads > > delete mode 100755 debian/tests/openflow.py > > create mode 100755 debian/tests/run-tests.sh > > create mode 120000 debian/tests/system-userspace > > delete mode 100755 debian/tests/vanilla > > > > diff --git a/.gitignore b/.gitignore > > index 26ed8d3d0..3d4f17b8a 100644 > > --- a/.gitignore > > +++ b/.gitignore > > @@ -75,6 +75,7 @@ OvsDpInterface.h > > testsuite.tmp.orig > > /rpm/ > > /openvswitch*.tar.gz > > +/openvswitch*.dsc > > /tests/lcov/ > > /Documentation/_build > > /.venv > > diff --git a/debian/automake.mk b/debian/automake.mk > > index 3195964c9..3e0a38edd 100644 > > --- a/debian/automake.mk > > +++ b/debian/automake.mk > > @@ -61,10 +61,13 @@ EXTRA_DIST += \ > > debian/rules \ > > debian/source/format \ > > debian/source/lintian-overrides \ > > + debian/tests/afxdp \ > > debian/tests/control \ > > debian/tests/dpdk \ > > - debian/tests/openflow.py \ > > - debian/tests/vanilla \ > > + debian/tests/kernel \ > > + debian/tests/offloads \ > > + debian/tests/run-tests.sh \ > > + debian/tests/system-userspace \ > > debian/watch > > > > check-debian-changelog-version: > > @@ -125,7 +128,6 @@ CLEANFILES += debian/control > > debian: debian/copyright debian/control > > .PHONY: debian > > > > - > > debian-deb: debian > > @if test X"$(srcdir)" != X"$(top_builddir)"; then > > \ > > echo "Debian packages should be built from $(abs_srcdir)/"; > > \ > > @@ -144,3 +146,26 @@ else > > $(AM_V_GEN) DEB_BUILD_OPTIONS="nocheck parallel=`nproc` nodpdk" \ > > fakeroot debian/rules binary > > endif > > + > > +debian-source: debian > > + @if test X"$(srcdir)" != X"$(top_builddir)"; then > > \ > > + echo "Debian packages should be built from $(abs_srcdir)/"; > > \ > > + exit 1; > > \ > > + fi > > + cp $(srcdir)/debian/control.in $(srcdir)/debian/control > > + $(update_deb_copyright) > > + $(update_deb_control_afxdp) > > + $(update_deb_control_dpdk) > > + $(AM_V_GEN) $(MAKE) distdir > > + cp $(srcdir)/debian/control $(srcdir)/debian/copyright \ > > + $(distdir)/debian/ > > + $(AM_V_GEN) tardir=$(distdir) && $(am__tar) | \ > > + eval GZIP= gzip $(GZIP_ENV) \ > > + -c >$(PACKAGE_NAME)_$(PACKAGE_VERSION).orig.tar.gz > > + cd $(distdir); \ > > + $(AM_V_GEN) dpkg-source --compression=gzip -b . > > + $(am__post_remove_distdir) > > + > > +DISTCLEANFILES += $(PACKAGE_NAME)_$(PACKAGE_VERSION)-1.debian.tar.gz \ > > + $(PACKAGE_NAME)_$(PACKAGE_VERSION).orig.tar.gz \ > > + $(PACKAGE_NAME)_$(PACKAGE_VERSION)-1.dsc > > diff --git a/debian/rules b/debian/rules > > index 8ed19db70..aa80737ad 100755 > > --- a/debian/rules > > +++ b/debian/rules > > @@ -97,6 +97,11 @@ endif > > > > execute_before_dh_auto_clean: > > find . -name "*.pyc" -delete > > + test -f debian/control && cp debian/control > > debian/control.save.$(PPID) > > + > > +execute_after_dh_auto_clean: > > + test -f debian/control.save.$(PPID) && \ > > + mv debian/control.save.$(PPID) debian/control > > > > override_dh_auto_install: > > dh_auto_install --sourcedirectory=_debian > > diff --git a/debian/tests/afxdp b/debian/tests/afxdp > > new file mode 120000 > > index 000000000..7080a3249 > > --- /dev/null > > +++ b/debian/tests/afxdp > > @@ -0,0 +1 @@ > > +run-tests.sh > > \ No newline at end of file > > diff --git a/debian/tests/control b/debian/tests/control > > index b481ed53c..29a65fb12 100644 > > --- a/debian/tests/control > > +++ b/debian/tests/control > > @@ -1,8 +1,32 @@ > > -Tests: vanilla dpdk > > +Tests: afxdp, kernel, offloads, system-userspace > > Depends: > > - iperf, > > - mininet (>= 2.2.0~), > > - openvswitch-switch, > > - openvswitch-switch-dpdk [amd64 i386], > > - openvswitch-testcontroller, > > -Restrictions: needs-root rw-build-tree isolation-machine > > + @, > > + @builddeps@, > > + conntrack, > > + net-tools, > > + netcat-openbsd, > > + tcpdump, > > + python3-pyftpdlib, > > +Restrictions: > > + allow-stderr, > > + isolation-machine, > > + needs-root, > > + rw-build-tree, > > + > > +# The dpdk tests are marked `skippable`, because they have environment > > specific > > +# requirements which may or may not be available at runtime (hugepages > > setup). > > +Tests: dpdk > > +Depends: > > + @, > > + @builddeps@, > > + conntrack, > > + dpdk-dev [amd64 i386 ppc64el arm64 riscv64], > > I'm not familiar with the syntax here and I didn't test, but shouldn't > @builddeps@ already include the dpdk-dev ?
In Debian/Ubuntu, the development headers and libraries and tools are split into separate packages, so the build dependency is `libdpdk-dev` while `dpdk-dev` contains stuff like `testpmd` which is needed for the test. > > + net-tools, > > + netcat-openbsd, > > + tcpdump, > > + python3-pyftpdlib, > > +Restrictions: > > + allow-stderr, > > + isolation-machine, > > + needs-root, > > + skippable, > > diff --git a/debian/tests/dpdk b/debian/tests/dpdk > > deleted file mode 100755 > > index 2aabae050..000000000 > > --- a/debian/tests/dpdk > > +++ /dev/null > > @@ -1,45 +0,0 @@ > > -#!/bin/sh > > - > > -set -e > > - > > -if [ ! -x /usr/lib/openvswitch-switch-dpdk/ovs-vswitchd-dpdk ]; then > > - echo "DPDK enabled binary not detected - skipping" > > - exit 0 > > -fi > > - > > -sse3flag=$(sed -n "/^flags.*sse3/p" < /proc/cpuinfo | wc -l) > > -if [ "${sse3flag}" -eq 0 ]; then > > - echo "sse3 not available in test environment" > > - echo "for adt-virt-qemu please consider adding --qemu-options='-cpu > > qemu64,+ssse3'" > > - echo "SKIPPING" > > - exit 0 > > -fi > > - > > -update-alternatives --set ovs-vswitchd \ > > - /usr/lib/openvswitch-switch-dpdk/ovs-vswitchd-dpdk > > -service openvswitch-switch restart > > - > > -modprobe openvswitch || true > > - > > -echo "kernel modules loaded: " > > -# Check that ovs loaded > > -lsmod | grep "openvswitch" > > -echo "OK" > > - > > -echo "Checking daemons: " > > -pgrep ovs-vswitchd > > -pgrep ovsdb-server > > -echo "OK" > > - > > -echo "stop conflicting openvswitch testcontroller" > > -systemctl stop openvswitch-testcontroller || true > > - > > -if dpkg --compare-versions "$(dpkg-query --showformat '${Version}\n' > > --show mininet)" ge "2.3.0-1"; then > > - PYCMD="python3" > > -else > > - PYCMD="python2" > > -fi > > - > > -printf "running openflow tests using mininet" > > -${PYCMD} `dirname $0`/openflow.py 2>&1 > > -echo "OK" > > diff --git a/debian/tests/dpdk b/debian/tests/dpdk > > new file mode 120000 > > index 000000000..7080a3249 > > --- /dev/null > > +++ b/debian/tests/dpdk > > @@ -0,0 +1 @@ > > +run-tests.sh > > \ No newline at end of file > > Can we add some '\n' characters at the end to new files throughout the patch? > Or will it break something? These are symlinks, so this is unfortunately just the way git represents them. There is not actually a file that can have newlines at the end or not. -- Frode Nordahl > Best regards, Ilya Maximets. _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev