unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* handling package tests requiring root?
@ 2025-01-01 10:13 45mg
  2025-01-01 23:18 ` Tomas Volf
  0 siblings, 1 reply; 3+ messages in thread
From: 45mg @ 2025-01-01 10:13 UTC (permalink / raw)
  To: Guix Devel


The only approach I'm aware of is to just ignore such tests. Examples of
this I've seen:

mdadm:
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/linux.scm#n5943
borg:
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/backup.scm#n739
rdiff-backup:
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/backup.scm#n540
maradns:
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/dns.scm#n1197
hostscope:
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/monitoring.scm#n698
python-path:
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/python-xyz.scm#n17458
python-executing:
https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/python-xyz.scm#n11112

I haven't been able to find a single instance of tests requiring root
that we /don't/ skip. (But then, I don't really know how to look,
either...)

Surely there must be a way to do this?


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: handling package tests requiring root?
  2025-01-01 10:13 handling package tests requiring root? 45mg
@ 2025-01-01 23:18 ` Tomas Volf
  2025-01-04  5:14   ` 45mg
  0 siblings, 1 reply; 3+ messages in thread
From: Tomas Volf @ 2025-01-01 23:18 UTC (permalink / raw)
  To: 45mg; +Cc: Guix Devel

[-- Attachment #1: Type: text/plain, Size: 1506 bytes --]

45mg <45mg.writes@gmail.com> writes:

> The only approach I'm aware of is to just ignore such tests. Examples of
> this I've seen:
>
> mdadm:
> https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/linux.scm#n5943
> borg:
> https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/backup.scm#n739
> rdiff-backup:
> https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/backup.scm#n540
> maradns:
> https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/dns.scm#n1197
> hostscope:
> https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/monitoring.scm#n698
> python-path:
> https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/python-xyz.scm#n17458
> python-executing:
> https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/python-xyz.scm#n11112
>
> I haven't been able to find a single instance of tests requiring root
> that we /don't/ skip. (But then, I don't really know how to look,
> either...)
>
> Surely there must be a way to do this?

Sure there is.  The one I found is horrific though.  In my channel I
packaged acme-client (Let's Encrypt client ported from OpenBSD), and
root is required for the tests.  I resolved to using bubblewrap to
pretend I am a root.  You can see all the eye-cancer causing details
here[0].

Tomas

0: https://git.wolfsden.cz/wolfsden/tree/wolfsden/packages/tls.scm#n76

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 853 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: handling package tests requiring root?
  2025-01-01 23:18 ` Tomas Volf
@ 2025-01-04  5:14   ` 45mg
  0 siblings, 0 replies; 3+ messages in thread
From: 45mg @ 2025-01-04  5:14 UTC (permalink / raw)
  To: Tomas Volf; +Cc: Guix Devel

Hi Tomas,

I was curious how Nix handles this, so I asked about it on the #nixos
IRC. It looks like they run such tests in a VM. These are called NixOS
tests, and they seem to be the equivalent of our system tests - they
have to be run manually, separately from regular package tests.

So unless someone comes up with something innovative, it looks like
that's the best answer to this question - figure out a minimal
`operating-system` declaration that works for whatever you're testing,
and use it to add a test in `(gnu tests ...)`.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-01-04  5:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-01 10:13 handling package tests requiring root? 45mg
2025-01-01 23:18 ` Tomas Volf
2025-01-04  5:14   ` 45mg

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).