Re: autopkgtest testing postinst

2022-07-22 Thread Marc Haber
On Fri, Jul 22, 2022 at 09:52:37AM +0800, Paul Wise wrote:
> On Thu, 2022-07-21 at 10:30 +0200, Marc Haber wrote:
> > Is there also a documented way to install the packages from stable,
> > testing, unstable to automatically test updates?
> 
> That sounds like what piuparts is for:
> 
> https://packages.debian.org/unstable/piuparts
> https://piuparts.debian.org/

Then this maybe is the point where I need to take a closer look at
piuparts. I hope it can be parametrized. What I want to do is probably
something that our tools don't have built-in checks, I'd like to
_remove_ debconf support from a package and make a formerly
debconf/postinst controlled file a dpkg-conffile, and I of course need
to test a number of combinations including changed conffile, deleted
conffile etc foo.

Greetings
Marc

-- 
-
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany|  lose things."Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421



Re: autopkgtest testing postinst

2022-07-21 Thread Paul Wise
On Thu, 2022-07-21 at 10:30 +0200, Marc Haber wrote:

> Is there also a documented way to install the packages from stable,
> testing, unstable to automatically test updates?

That sounds like what piuparts is for:

https://packages.debian.org/unstable/piuparts
https://piuparts.debian.org/

-- 
bye,
pabs

https://wiki.debian.org/PaulWise


signature.asc
Description: This is a digitally signed message part


Re: autopkgtest testing postinst

2022-07-21 Thread Matt Barry
On Thu, 2022-07-21 at 10:30 +0200, Marc Haber wrote:
> On Fri, Jul 15, 2022 at 09:23:20AM -0400, Matt Barry wrote:
> > autopkgtest adds it's own sources.list entry under /tmp, so afaict
> > 'apt-get --reinstall' will do exactly what it should.
> 
> Thanks for finding that out. Is there also a documented way to
> install
> te packages from stable, testing, unstable to automatically test
> updates?

Not that I'm aware of, but - there is a fairly standard way of adding
to sources.list.d, so that 'apt install adduser=stable' might be made
to work; otoh it might be dependency hell (less so perhaps in this
particular case).

If you want to test unstable's tests against stable's version I'd maybe
try:

git checkout 3.121
git checkout master -- debian/tests/
autopkgtest -- 

But I might be misunderstanding what you want to do..

Cheers,
Matt



Re: autopkgtest testing postinst

2022-07-21 Thread Marc Haber
On Fri, Jul 15, 2022 at 09:23:20AM -0400, Matt Barry wrote:
> autopkgtest adds it's own sources.list entry under /tmp, so afaict
> 'apt-get --reinstall' will do exactly what it should.

Thanks for finding that out. Is there also a documented way to install
te packages from stable, testing, unstable to automatically test
updates?

Greetings
Marc

-- 
-
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany|  lose things."Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421



Re: autopkgtest testing postinst

2022-07-15 Thread Matt Barry
On Fri, 2022-07-15 at 07:16 -0400, Matt Barry wrote:
> On Fri, 2022-07-15 at 09:41 +0200, Marc Haber wrote:
> > On Thu, Jul 14, 2022 at 11:33:50PM +0200, Lorenzo wrote:
> > > On Thu, 14 Jul 2022 09:52:51 +0200
> > > Marc Haber  wrote:
> > > > I would like to hear about your experiences. Pointers to
> > > > packages
> > > > that
> > > > are already doing this would be greatly appreciated as well.
> > > > Thank you
> > > > very much.
> > > 
> > > You can look at dh-runit, probably not the best example but it
> > > gives
> > > you the idea
> > > 
> > > https://salsa.debian.org/debian/dh-runit/-/blob/master/debian/tests/helper-update-rc.d
> > 
> > So a testbed has apt configured in a way that apt-get install
> > $PACKAGE
> > will install _this_ version of the package? Or will it just pull
> > the
> > version from the archive?
> 
> The challenge I have encountered is getting the installed binary; it
> seems that it puts files under /tmp/autopkgtest.X, but cleans it
> up
> before the actual tests run?  (I have added a test which searches for
> the package during the test run, to no avail.)
> 
> We could always use dpkg-repack I suppose, but we would have to do so
> before any configuration was modified..

Actually, disregard this, I neglected to attempt the simple solution:

autopkgtest adds it's own sources.list entry under /tmp, so afaict
'apt-get --reinstall' will do exactly what it should.

mb


signature.asc
Description: This is a digitally signed message part


Re: autopkgtest testing postinst

2022-07-15 Thread Matt Barry
On Fri, 2022-07-15 at 09:41 +0200, Marc Haber wrote:
> On Thu, Jul 14, 2022 at 11:33:50PM +0200, Lorenzo wrote:
> > On Thu, 14 Jul 2022 09:52:51 +0200
> > Marc Haber  wrote:
> > > I would like to hear about your experiences. Pointers to packages
> > > that
> > > are already doing this would be greatly appreciated as well.
> > > Thank you
> > > very much.
> > 
> > You can look at dh-runit, probably not the best example but it
> > gives
> > you the idea
> > 
> > https://salsa.debian.org/debian/dh-runit/-/blob/master/debian/tests/helper-update-rc.d
> 
> So a testbed has apt configured in a way that apt-get install
> $PACKAGE
> will install _this_ version of the package? Or will it just pull the
> version from the archive?

The challenge I have encountered is getting the installed binary; it
seems that it puts files under /tmp/autopkgtest.X, but cleans it up
before the actual tests run?  (I have added a test which searches for
the package during the test run, to no avail.)

We could always use dpkg-repack I suppose, but we would have to do so
before any configuration was modified..

Cheers,
Matt


signature.asc
Description: This is a digitally signed message part


Re: autopkgtest testing postinst

2022-07-15 Thread Marc Haber
On Thu, Jul 14, 2022 at 11:33:50PM +0200, Lorenzo wrote:
> On Thu, 14 Jul 2022 09:52:51 +0200
> Marc Haber  wrote:
> > I would like to hear about your experiences. Pointers to packages that
> > are already doing this would be greatly appreciated as well. Thank you
> > very much.
> 
> You can look at dh-runit, probably not the best example but it gives
> you the idea
> 
> https://salsa.debian.org/debian/dh-runit/-/blob/master/debian/tests/helper-update-rc.d

So a testbed has apt configured in a way that apt-get install $PACKAGE
will install _this_ version of the package? Or will it just pull the
version from the archive?

Greetings
Marc

-- 
-
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany|  lose things."Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421



Re: autopkgtest testing postinst

2022-07-14 Thread Paul Wise
On Thu, 2022-07-14 at 09:52 +0200, Marc Haber wrote:

> How would I do that in autopkgtest? Can I uninstall and reinstall the
> package in question while an autopkgtest is running?

Sounds like you want the breaks-testbed and needs-root restrictions:

https://salsa.debian.org/ci-team/autopkgtest/raw/master/doc/README.package-tests.rst

-- 
bye,
pabs

https://wiki.debian.org/PaulWise


signature.asc
Description: This is a digitally signed message part


Re: autopkgtest testing postinst

2022-07-14 Thread Lorenzo
Hi,


On Thu, 14 Jul 2022 09:52:51 +0200
Marc Haber  wrote:

> Hi,
> 
> [ ... ]
> 
> But due to the criticality of the package, I need to test package
> installation in both cases, with and without ucf. [ ... ]
>
> How would I do that in autopkgtest? Can I uninstall and reinstall the
> package in question while an autopkgtest is running?

Sure

> 
> I would like to hear about your experiences. Pointers to packages that
> are already doing this would be greatly appreciated as well. Thank you
> very much.

You can look at dh-runit, probably not the best example but it gives
you the idea

https://salsa.debian.org/debian/dh-runit/-/blob/master/debian/tests/helper-update-rc.d

> 
> Greetings
> Marc
> 

Lorenzo



autopkgtest testing postinst

2022-07-14 Thread Marc Haber
Hi,

for adduser (which is Priority: important and installed on nearly every
Debian system alive), I would like to use ucf to manage adduser.conf in
the future. I would not like to add ucf as a dependency though.

I am therefore planning to use ucf in Recommends or Suggests and to
scaffold the ucf calls in postinst, providing only very basic conffile
handling in the case where ucf is not installed (leaving that decision
to the local admin).

But due to the criticality of the package, I need to test package
installation in both cases, with and without ucf. This is especially
important because the case "no ucf" might occur in automated settings
like the installer, debootstrap, image and testbed building and breakage
in those functions is likely to do horrible things to Debian's tooling.

How would I do that in autopkgtest? Can I uninstall and reinstall the
package in question while an autopkgtest is running?

I would like to hear about your experiences. Pointers to packages that
are already doing this would be greatly appreciated as well. Thank you
very much.

Greetings
Marc

-- 
-
Marc Haber | "I don't trust Computers. They | Mailadresse im Header
Leimen, Germany|  lose things."Winona Ryder | Fon: *49 6224 1600402
Nordisch by Nature |  How to make an American Quilt | Fax: *49 6224 1600421