Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(24.04) add adduser slice #305

Draft
wants to merge 5 commits into
base: ubuntu-24.04
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions slices/adduser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package: adduser

essential:
- adduser_copyright

slices:
bins:
essential:
- adduser_config
- adduser_modules
- passwd_bins
contents:
/usr/sbin/addgroup:
/usr/sbin/adduser:
/usr/sbin/delgroup:
/usr/sbin/deluser:

modules:
contents:
/usr/share/perl5/Debian/AdduserCommon.pm:
/usr/share/perl5/Debian/AdduserLogging.pm:
/usr/share/perl5/Debian/AdduserRetvalues.pm:

config:
contents:
/etc/adduser.conf:
/etc/deluser.conf:

copyright:
contents:
/usr/share/doc/adduser/copyright:
13 changes: 13 additions & 0 deletions tests/spread/integration/adduser/task.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
summary: Integration tests for adduser

execute: |
rootfs="$(install-slices adduser_bins)"
mkdir -p "$rootfs/{bin,lib,lib64}"
linostar marked this conversation as resolved.
Show resolved Hide resolved
cp /bin/bash "$rootfs/bin"
linostar marked this conversation as resolved.
Show resolved Hide resolved
chroot "$rootfs"
linostar marked this conversation as resolved.
Show resolved Hide resolved

test -f /etc/passwd
adduser --quiet --system testuser
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this working? Isn't adduser a perl script? I don't see perl being included/chiselled anywhere

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. This was working before because adduser was running outside of the chroot env. We need perl slice first before this test passes.

grep testuser /etc/passwd
deluser --quiet testuser
! grep testuser /etc/passwd
Loading