[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to add debci user in a specific group? or use sudo in a autopkgtest script?



Hi Ludovic,

On 02-04-2023 18:57, Ludovic Rousseau wrote:
What is the best way using autopkgtest to solve my problem?
- Maybe adding the user debci to the group softhsm is enough but I would need to use sudo or be root. - Another option is to change the access rights of the directory /etc/softhsm/ so the user can access the files in it.

I think that something like "Restrictions: needs-root" can help.
But I do not want to run all the test script as root. I just want to change some files configuration in the virtual machine.

Adding user debci in sudoers would solve my problem.
I use something like "sudo chmod o+rx /etc/softhsm/" and problem solved.
Since the VM is not reused it should be harmless. And it is safer than running the full script as root.

Any ideas of the best solution?

From your story above using sudo with the needs-sudo restriction sounds like a perfect match (the restriction is relatively new). I suggest you read the documentation [1] discussion it.

Paul

[1] https://salsa.debian.org/ci-team/autopkgtest/-/blob/master/doc/README.package-tests.rst

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


Reply to: