]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test/test-systemd-tmpfiles.py: do not fail if machine-id is missing
authorLuca Boccassi <bluca@debian.org>
Tue, 25 Oct 2022 14:02:10 +0000 (15:02 +0100)
committerLuca Boccassi <bluca@debian.org>
Tue, 25 Oct 2022 15:00:26 +0000 (16:00 +0100)
When building in a chroot there might not be any machine-id

test/test-systemd-tmpfiles.py

index 4b3bdf33644b14562bef5474db9e72d8106cf19c..af9ff9bf9319086cb26f66dc373439d153c4c94e 100755 (executable)
@@ -87,7 +87,7 @@ def test_content(line, expected, *, user, extra={}, subpath='/arg', path_cb=None
 
 def test_valid_specifiers(*, user):
     test_content('f {} - - - - two words', 'two words', user=user)
-    if id128:
+    if id128 and os.path.isfile('/etc/machine-id'):
         try:
             test_content('f {} - - - - %m', '{}'.format(id128.get_machine().hex), user=user)
         except AssertionError as e: