On Thu, Oct 17, 2024 at 07:42:18PM +0000, Daniel Markstedt wrote:
> I would like to ask your advice concerning autopkgtest.
> At the moment, I'm preparing to set up an automated test suite for the 
> "netatalk" package.
> Netatalk is a file server daemon that you need to authenticate with through 
> user credentials.
> So in order to run end to end tests, one need to know the credentials of a 
> user on the host:
> Either an existing user's, or by creating new users on the fly.
> 
> My question is: How would one go about doing either of the above on the 
> autopkgtest runner hosts?
> I don't want to start running `useradd' before confirming that this is 
> allowed,
> and/or if there is a more sophisticated way to achieve my goals.

Declaring "Restrictions: needs-root", running adduser or similar, and
then dropping privileges to run the actual test is fine and sounds quite
reasonable in this case.  It'll all be done within the relevant testbed
and thrown away at the end of the test.  For example, openssh does
something similar.

I suggest reading /usr/share/doc/autopkgtest/README.package-tests.html
for the exact semantics of needs-root.

-- 
Colin Watson (he/him)                              [cjwat...@debian.org]

Reply via email to