[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
bug#33195: 27.0.50; user-login-name has no group-login-name
From: |
Eli Zaretskii |
Subject: |
bug#33195: 27.0.50; user-login-name has no group-login-name |
Date: |
Sat, 10 Nov 2018 21:15:34 +0200 |
> From: Glenn Morris <rgm@gnu.org>
> Cc: Eli Zaretskii <eliz@gnu.org>, 33195@debbugs.gnu.org
> Date: Sat, 10 Nov 2018 13:36:47 -0500
>
> Jules Tamagnan wrote:
>
> > I've tried my hand at writing a test for this but am dubious it will
> > pass on all machines, I believe it should work on gnu/linux
> [...]
> > +(ert-deftest group-name ()
> > + (let ((list `((0 . "root")
> > + (1000 . ,(user-login-name 1000))
> > + (1212345 . nil))))
> > + (dolist (test list)
> > + (should (equal (group-name (car test)) (cdr test))))))
>
> This assumes that user 1000's primary group is the same as their login name.
> This is not at all guaranteed, so I will remove it.
> Eg it fails for me on rhel 7.5, and also on hydra.nixos.org, ref
> https://hydra.nixos.org/eval/1488740
>
> I guess that UID 0 is always the root group, but I wouldn't swear to it.
> The 1212345 thing relies on UID 1212345 not existing.
> It seems to me that this is fragile too.
> So all in all, I'm not sure this test is very useful.
Maybe all platforms should use the same code as MS-Windows for this
test, then.