Bug 41331 - Не проходит тест test-sysusers.sh
Summary: Не проходит тест test-sysusers.sh
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: systemd-tests (show other bugs)
Version: unstable
Hardware: x86_64 Linux
: P5 normal
Assignee: Alexey Shabalin
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-11 19:28 MSK by Alexander Makeenkov
Modified: 2021-11-12 01:20 MSK (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alexander Makeenkov 2021-11-11 19:28:55 MSK
Шаги воспроизведения:
# apt-get install systemd-tests
# /usr/lib/systemd/tests/run-unit-tests.py
либо запустить только этот тест:
# /usr/lib/systemd/tests/test-sysusers.sh

Тест падает с ошибкой:
--- /tmp/.private/root/test-sysusers.HgeDMCRrnU/etc/passwd      2021-11-11 19:17:04.778024067 +0300
+++ /dev/fd/63  2021-11-11 19:17:04.779024070 +0300
@@ -1,4 +1,4 @@
-u1:x:499:499:some gecos:/random/dir:/sbin/nologin
+u1:x:555:555:some gecos:/random/dir:/sbin/nologin
 u2:x:777:777:some gecos:/random/dir:/bin/zsh
 u3:x:778:778::/random/dir2:/bin/bash
 u4:x:779:779::/:/bin/csh
**** Unexpected output for /usr/lib/systemd/tests/testdata/test-sysusers/test-2.input (with login.defs)

Ошибка возникает из-за того, что в нашей системе максимальный UID системного пользователя = 499.

Предлагаемое решение:
--- test-sysusers.sh-orig       2021-11-11 19:18:04.782225642 +0300
+++ test-sysusers.sh    2021-11-11 19:18:58.512406147 +0300
@@ -106,7 +106,7 @@
 SYS_GID_MIN abcd
 SYS_GID_MAX abcd
 SYS_UID_MIN 401
-SYS_UID_MAX 555
+SYS_UID_MAX 499
 SYS_GID_MIN 405
 SYS_GID_MAX 666
 SYS_UID_MIN abcd
@@ -125,7 +125,7 @@
     cp $f $TESTDIR/usr/lib/sysusers.d/test.conf
     $SYSUSERS --root=$TESTDIR
 
-    [ 1 = 1 ] && bound=555 || bound=$system_guid_max
+    [ 1 = 1 ] && bound=499 || bound=$system_guid_max
     compare ${f%.*} "(with login.defs)" $bound
 done
 
@@ -140,7 +140,7 @@
     cp $f $TESTDIR/usr/lib/sysusers.d/test.conf
     $SYSUSERS --root=$TESTDIR
 
-    [ 1 = 1 ] && bound=555 || bound=$system_guid_max
+    [ 1 = 1 ] && bound=499 || bound=$system_guid_max
     compare ${f%.*} "(with login.defs symlinked)" $bound
 done
Comment 1 Alexey Shabalin 2021-11-12 01:20:06 MSK
Исправлено в systemd-249.6-alt1