Subject: Re: [ovs-dev] selftests: openvswitch: Questions about possible enhancements

From: Simon Horman <[email-masked]>
Date: Thu, 25 Apr 2024 08:33:17 +0100

On Wed, Apr 24, 2024 at 01:59:29PM -0400, Benjamin Poirier wrote:
> On 2024-04-24 18:37 +0100, Simon Horman wrote:
> > On Wed, Apr 24, 2024 at 05:44:05PM +0100, Simon Horman wrote:
> > > Hi Aaron, Jakub, all,
> > > 
> > > I have recently been exercising the Open vSwitch kernel selftests,
> > > using vng, something like this:
> > > 
> > > 	TESTDIR="tools/testing/selftests/net/openvswitch"
> > > 
> > >         vng -v --run . --user root --cpus 2 \
> > >                 --overlay-rwdir "$PWD" -- \
> > >                 "modprobe openvswitch && \
> > > 		 echo \"timeout=90\" >> \"${TESTDIR}/settings\" && \
> > >                  make -C \"$TESTDIR\" run_tests"
> > > 
> > > And I have some observations that I'd like to ask about.
> > > 
> > > 1. Building the kernel using the following command does not
> > >    build the openvswitch kernel module.
> > > 
> > > 	vng -v --build \
> > > 		--config tools/testing/selftests/net/config
> > > 
> > >    All that seems to be missing is CONFIG_OPENVSWITCH=m
> > >    and I am wondering what the best way of resolving this is.
> > > 
> > >    Perhaps I am doing something wrong.
> > >    Or perhaps tools/testing/selftests/net/openvswitch/config
> > >    should be created? If so, should it include (most of?) what is in
> > >    tools/testing/selftests/net/config, or just CONFIG_OPENVSWITCH=m?
> 
> I noticed something similar when testing Jiri's virtio_net selftests
> patchset [1].
> 
> drivers/net/virtio_net/config includes virtio options but the
> test also needs at least CONFIG_NET_VRF=y which is part of net/config.
> 
> Whatever the answer to your question, all config files should be
> coherent on this matter.

Yes, agreed. That is the main reason I'm asking about this.

> [1] https://lore.kernel.org/netdev/[email-masked]/
> 
> [...]
> > 
> >   5. openvswitch.sh starts with "#!/bin/sh".
> >      But substitutions such as "${ns:0:1}0"  fail if /bin/sh is dash.
> >      Perhaps we should change openvswitch.sh to use bash?
> 
> I think so. A similar change was done in
> c2518da8e6b0 selftests: bonding: Change script interpreter (v6.8-rc1)

Thanks, this one seems straightforward.