[Pkg-giraffe-discuss] Getting autopkgtest for kopanocore working (finally)

Guido Günther agx at sigxcpu.org
Sun Dec 16 12:03:17 GMT 2018


Hi,
On Sat, Dec 15, 2018 at 07:57:04PM +0100, Carsten Schoenert wrote:
[..snip..]
> especially if the SQL server must run on the same machine. That's what
> I've found out after after a while of looking into the logs.
> Currently there is kopano-server already installed by the 'help' test
> target due the usage of '@' in the Depends field. In my opinion there is
> no need to run the 'help' test before the smoke tests, so we can reorder
> the selection of the tests.
> 
> And we could be more specific with the required packages for the 'help'
> test, just add the packages with some output for '--help' as an
> dependency and explicit drop kopano-server here? Just do the test of
> this for kopano-server later in the smoke test would also work.

I was wondering if the previous 'help' test would trigger it but *thought*
each test is supposed to start out from a clean test bed. If this is not
the case there's a bug somewhere else since I'm pretty sure this used to
be the case. This might depend on the used runner. When you use e.g.
the nullrunner in pbuilder tests are not properly isolated. I thought
the ssh runner would handle deinstalling packages but I was wrong there.

> >> obviously not what we want to have. But a dpkg-reconfigure of the
> >> package kopano-server after the installation of mariadb-server is doing
> >> the trick and the autopkg thingy is working like before!
> >>
> >> Any other objections or suggestion I should consider now before pushing
> >> all to Salsa? Something I've forgotten?
> > 
> > See above. I think there is no bug here, your test setup is broken. You
> > must not have kopano-server installed when running the tests. See:
> > 
> >    https://github.com/tijuca/Giraffe/blob/debian/sid/debian/tests/control
> > 
> > So we have two choices: 
> > 
> > a) Fail outright at the beginning of the script if kopano-server is installed:
> > 
> >    if dpkg -s kopano-server 2>/dev/null; then
> >      echo "You must not have kopano-server installed." 1>&2
> >      exit 1
> >    fi
> > 
> > b) Do the dpkg-reconfigure to work around broken test setups (but only then).
> > 
> >    if dpkg -s kopano-server 2>/dev/null; then
> >      echo "kopano-server already installed. Trying to work around that." 1>&2
> >      KOPANO_SERVER_WA=1
> >    fi
> > 
> > ....
> > 
> >    [ -z "$KOPANO_SERVER_WA" ] || dpkg-reconfigure kopano-server
> > 
> > 
> > It'd opt for a) since if we allow for that we still have problems of
> > prefilled databases, etc. so we should always cater for a clean testbed.
> > Does this make sense?
> 
> Given to your critics a I did a quick rearrangement of the ordering of
> the test as written above and did a quick test run and this works of
> course too. This is than more the "old" original fashion style that
> makes sense and I agree with.

Yeah, lets do this for now since it makes sure we run the more complex
smoke test from a clean testbed.

> We could then also decrease the list of dependencies for the 'help' test
> to just check kopano-{backup,presence,search,spamd}. kopanu-utils (for
> kopano-cli) is here already installed.
> 
> This would be more straight forward than to do some special handling in
> the smoke test. And yes, we will need to do more tests like db
> updates/recovery so it will be mostly a question how to combine and
> order the tests. For now I think it's important to see we wont have
> knowingly RC bugs by the new version.

For the more complex tests we need to look why tests aren't properly
isolated but that can be done later on.

> This is what I've changed now.
> 
> > $ git diff
> > diff --git a/debian/tests/control b/debian/tests/control
> > index 7e39c683..5335a194 100644
> > --- a/debian/tests/control
> > +++ b/debian/tests/control
> > @@ -1,10 +1,12 @@
> > -Tests: help
> > -Depends: @
> > -Restrictions: allow-stderr,
> > - needs-root,
> > -
> >  Tests: smoke
> >  Depends: python3-nose
> >  Restrictions: allow-stderr,
> >   needs-root,
> >  
> > +Tests: help
> > +Depends: kopano-backup,
> > + kopano-presence,
> > + kopano-search,
> > + kopano-spamd
> > +Restrictions: allow-stderr,
> > + needs-root,
> > diff --git a/debian/tests/smoke b/debian/tests/smoke
> > index 6049cd84..08979217 100755
> > --- a/debian/tests/smoke
> > +++ b/debian/tests/smoke
> > @@ -2,9 +2,6 @@
> >  
> >  set -e
> >  
> > -# enable some debug output for dbconfig-common
> > -sed -i 's/#dbc_debug/dbc_debug/' /var/lib/dpkg/info/kopano-server.postinst
> > -
> >  echo "#######################################################################"
> >  echo "# Setting up database configuration...                                #"
> >  cat <<EOF | debconf-set-selections
> > @@ -39,9 +36,9 @@ echo "#######################################################################"
> >  echo
> >  
> >  echo "#######################################################################"
> > -echo "# Reconfigure package kopano-server...                                #"
> > -dpkg-reconfigure kopano-server
> > -echo "# Reconfigure package kopano-server... done.                          #"
> > +echo "# Installing kopano-server and kopano-utils...                        #"
> > +apt-get -y install kopano-server kopano-utils
> > +echo "# Installing kopano-server and kopano-utils... done.                  #"
> >  echo "#######################################################################"
> >  echo
> 
> autopkgtest log looks now like this. I've cut some parts of boring
> stuff.

Cool! Looks good to me!
 -- Guido




More information about the Pkg-giraffe-discuss mailing list