guix/tests
Giacomo Leidi 337037d22c
accounts: Add /etc/subid and /etc/subgid allocation logic.
This commit adds allocation logic for subid ranges. Subid ranges are
ranges of contiguous subids that are mapped to a user in the host
system. This patch implements a flexible allocation algorithm allowing
users that do not want (or need) to specify details of the subid ranges
that they are requesting to avoid doing so, while upholding requests of
users that need to have specific ranges.

* gnu/build/accounts.scm (%subordinate-id-min): New variable;
(%subordinate-id-max): new variable;
(%subordinate-id-count): new variable;
(subordinate-id?): new variable;
(&subordinate-id-error): new variable;
(&subordinate-id-overflow-error): new variable;
(&illegal-subid-range-error): new variable;
(&specific-subid-range-expected-error): new variable;
(&generic-subid-range-expected-error): new variable;
(within-interval?): new variable;
(allocate-unused-range): new variable;
(allocate-generic-range): new variable;
(allocate-specific-range): new variable;
(reserve-subids): new variable;
(range->entry): new variable;
(entry->range): new variable;
(allocate-subids): new variable;
(subuid+subgid-databases): new variable.

* gnu/system/accounts.scm (subid-range-end): New variable;
(subid-range-has-start?): new variable;
(subid-range-less): new variable.

* test/accounts.scm: Test them.

Change-Id: I8de1fd7cfe508b9c76408064d6f498471da0752d
Co-Authored-By: Ludovic Courtès <ludo@gnu.org>
Signed-off-by: Giacomo Leidi <goodoldpaul@autistici.org>
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
2024-12-18 18:32:40 +01:00
..
keys
services services: configuration: Use transducers within serialize-configuration. 2023-10-07 12:41:05 -04:00
accounts.scm accounts: Add /etc/subid and /etc/subgid allocation logic. 2024-12-18 18:32:40 +01:00
base16.scm
base32.scm
base64.scm
boot-parameters.scm
bournish.scm
build-emacs-utils.scm
build-utils.scm build: utils: Raise error in modify-phases upon missing key. 2024-08-31 10:42:06 +02:00
builders.scm git-download: Use “builtin:git-download” when available. 2023-09-26 17:36:58 +02:00
cache.scm cache: Avoid cache cleanup storms from concurrent processes. 2024-08-21 00:52:39 +02:00
challenge.scm
channels.scm channels: ‘latest-channel-instances’ traverses user-provided channels first. 2024-01-31 09:07:25 +01:00
combinators.scm
composer.scm guix: import: Add composer importer. 2023-12-18 23:16:28 +01:00
containers.scm
cpan.scm tests: Ensure 'cpan' updater test does not access the network. 2023-06-09 14:19:14 +02:00
cpio.scm utils: Don’t re-export ‘call-with-temporary-output-file’. 2024-04-15 22:36:42 +02:00
cran.scm
crate.scm Revert "import: crate: Emit new-style package inputs." 2024-09-19 12:41:54 +02:00
cve-sample.json
cve.scm
debug-link.scm
derivations.scm derivations: ‘derivation-build-plan’ returns builds in topological order. 2024-11-12 23:46:49 +01:00
discovery.scm
egg.scm utils: Don’t re-export ‘call-with-temporary-output-file’. 2024-04-15 22:36:42 +02:00
elm.scm tests: Adjust ‘elm’ importer test to expect inputs without labels. 2024-09-17 17:34:58 +02:00
elpa.scm tests: Ensure 'elpa' test does not access the network. 2023-06-09 14:19:14 +02:00
file-systems.scm
gem.scm import: utils: End package descriptions with period. 2024-06-03 22:58:53 +02:00
gexp.scm gexp: ‘imported-files’ does not create symlinks. 2024-09-16 00:16:20 +02:00
git-authenticate.scm tests: Assume ‘git’ is always available. 2023-09-26 17:36:59 +02:00
git.scm git: Remove untracked files from cached checkouts. 2024-07-18 17:31:19 +02:00
glob.scm
gnu-maintenance.scm tests: ‘rewrite-url’ test no longer depends on network access. 2023-09-27 23:38:21 +02:00
go.scm tests: Fix the 'go-module->guix-package' test. 2024-11-17 20:32:50 +09:00
grafts.scm grafts: Fix corner case involving multiple-output derivations. 2023-10-28 00:17:23 +02:00
graph.scm tests: Adjust 'node-back-edges' test for 'bag' to system-dependent glibc. 2023-08-21 16:16:47 +02:00
gremlin.scm tests: Fix gremlin.scm for GCC 14 2024-11-12 23:40:39 +01:00
guix-archive.sh tests: Fix checks for expected failures. 2023-04-21 16:16:38 +02:00
guix-authenticate.sh
guix-build-branch.sh tests: Fix checks for expected failures. 2023-04-21 16:16:38 +02:00
guix-build.sh tests: Adjust ‘guix build -P1’ test to new packages. 2024-12-02 23:18:52 +01:00
guix-daemon.sh tests: Fix checks for expected failures. 2023-04-21 16:16:38 +02:00
guix-describe.sh
guix-download.sh tests: Remove interference from the user’s Git config. 2024-05-13 16:31:35 +02:00
guix-environment-container.sh tests: Adjust to cope with glibc graft. 2023-10-28 01:30:37 +02:00
guix-environment.sh tests: Fix checks for expected failures. 2023-04-21 16:16:38 +02:00
guix-gc.sh tests: Fix checks for expected failures. 2023-04-21 16:16:38 +02:00
guix-git-authenticate.sh git authenticate: Record introduction and keyring in ‘.git/config’. 2024-05-01 17:26:18 +02:00
guix-graph.sh tests: Adjust ‘guix graph --path’ test to latest Emacs changes. 2023-09-26 17:36:57 +02:00
guix-hash.sh tests: Fix checks for expected failures. 2023-04-21 16:16:38 +02:00
guix-home.sh tests: guix-home: Fix description search for home-mcron. 2023-08-25 17:45:47 +02:00
guix-lint.sh
guix-locate.sh locate: Accept ‘--clear’ without additional arguments. 2023-11-15 18:29:37 +01:00
guix-pack-localstatedir.sh
guix-pack-relocatable.sh tests: Fix checks for expected failures. 2023-04-21 16:16:38 +02:00
guix-pack.sh tests: Adjust to cope with glibc graft. 2023-10-28 01:30:37 +02:00
guix-package-aliases.sh tests: Relax two tests that expected a non-zero error code. 2023-04-21 17:09:46 +02:00
guix-package-net.sh tests: Fix checks for expected failures. 2023-04-21 16:16:38 +02:00
guix-package.sh tests: guix-package: Fix guix package --search test. 2024-12-14 00:34:28 +01:00
guix-refresh.sh refresh: Add --target-version option. 2023-08-15 09:38:29 -04:00
guix-repl.sh
guix-shell-export-manifest.sh tests: guix-shell-export-manifest: Fix pyproject-build-system python test. 2024-12-14 01:28:49 +01:00
guix-shell.sh shell: ‘--development’ honors ‘--system’. 2023-12-06 23:50:04 +01:00
guix-style.sh scripts: style: Add 'alphabetical-sort' option. 2024-09-03 13:59:33 +02:00
guix-system.sh tests: Adjust ‘guix system’ test for EFI bootloader. 2024-06-13 22:34:00 +02:00
guix-time-machine.sh time-machine: Allow time travels to v0.16.0. 2024-03-11 22:12:34 +01:00
hackage.scm guix: import: Fix parsing Cabal files that import many stanzas 2023-12-03 16:15:29 +01:00
hexpm.scm import: utils: End package descriptions with period. 2024-06-03 22:58:53 +02:00
home-import.scm
home-services.scm
http-client.scm
import-git.scm tests: Assume ‘git’ is always available. 2023-09-26 17:36:59 +02:00
import-github.scm
import-utils.scm import: utils: Wrap function names in @code. 2024-12-03 16:59:54 +01:00
inferior.scm
ipfs.scm
lint.scm lint: More abbreviations. 2024-12-12 12:52:07 +01:00
minetest.scm import: utils: End package descriptions with period. 2024-06-03 22:58:53 +02:00
modules.scm build-systems: gnu: Export %default-gnu-imported-modules and %default-gnu-modules. 2024-08-31 10:42:16 +02:00
monads.scm
nar.scm
networking.scm services: ntp-service-type: Remove deprecated server as strings support. 2023-04-07 17:56:07 +02:00
npm-binary.scm import: Add binary npm importer. 2024-05-19 16:05:00 +02:00
offload.scm
opam.scm utils: Don’t re-export ‘call-with-temporary-output-file’. 2024-04-15 22:36:42 +02:00
openpgp.scm
pack.scm pack: Add support for AppImage pack format. 2024-11-23 16:30:17 +01:00
packages.scm packages: Use origin file names as their input labels. 2024-12-16 00:19:56 +01:00
pki.scm
print.scm tests: Make ‘tests/print.scm’ deterministic. 2024-09-28 00:20:18 +02:00
processes.scm
profiles.scm profiles: Use C.UTF-8 instead of ‘glibc-utf8-locales’ where possible. 2024-08-31 10:42:49 +02:00
publish.scm utils: Don’t re-export ‘call-with-temporary-output-file’. 2024-04-15 22:36:42 +02:00
pypi.scm import: pypi: Support extracting dependencies from pyproject.toml. 2024-12-16 19:27:43 +00:00
read-print.scm read-print: Properly indent ‘parameterize’. 2023-11-22 16:51:46 +01:00
records.scm tests: records: Add test for ellipsis in body. 2023-06-04 10:59:28 +02:00
rpm.scm
scripts.scm
search-paths.scm
services.scm gnu: services: Revert to deleting and updating all matching services 2023-08-31 23:31:50 -04:00
sets.scm
size.scm
status.scm
store-database.scm utils: Don’t re-export ‘call-with-temporary-output-file’. 2024-04-15 22:36:42 +02:00
store-deduplication.scm deduplication: Detect holes and create sparse files. 2024-05-25 16:44:42 +02:00
store-roots.scm tests: store-roots: Remove bogus test. 2023-08-18 16:10:08 +02:00
store.scm daemon: Implement ‘substitute-urls’ RPC. 2023-12-11 23:18:53 +01:00
style.scm style: Fix conversion of ‘unquote-splicing’ by ‘-S arguments’. 2024-06-03 22:58:52 +02:00
substitute.scm substitute: Do not exit when failing to find a nar. 2023-12-04 22:26:36 +01:00
swh.scm swh: ‘lookup-origin-revision’ handles branches pointing to directories. 2024-03-09 18:55:49 +01:00
syscalls.scm syscalls: Add ‘mode’ parameter to ‘lock-file’. 2024-08-21 00:52:38 +02:00
system.scm
test.drv
texlive.scm guix: import texlive: Add UPSTREAM-NAME property when necessary. 2024-08-31 10:45:37 +02:00
toml.scm guix: toml: Fix parsing empty strings in arrays. 2024-12-13 20:18:36 +00:00
transformations.scm transformations: ‘package-with-upstream-version’ can preserve patches. 2024-12-01 20:14:16 +01:00
ui.scm
union.scm
upstream.scm tests: upstream: Restore test that was skipped. 2023-05-31 23:25:25 +02:00
utils.scm utils: Don’t re-export ‘call-with-temporary-output-file’. 2024-04-15 22:36:42 +02:00
uuid.scm
workers.scm