Fix compatibility with procps 4. Negative UIDs are no longer allowed. Use a very high one instead. Taken from upstream: https://github.com/ganeti/ganeti/commit/9cd67e6a81c66ed326d68ea8c3241d14eea6550b diff --git a/test/py/ganeti.uidpool_unittest.py b/test/py/ganeti.uidpool_unittest.py index b2f5bc5cf2..2d9227cbf5 100755 --- a/test/py/ganeti.uidpool_unittest.py +++ b/test/py/ganeti.uidpool_unittest.py @@ -106,23 +106,24 @@ def testRequestUnusedUid(self): # Check with a single, known unused user-id # - # We use "-1" here, which is not a valid user-id, so it's - # guaranteed that it's unused. - uid = uidpool.RequestUnusedUid(set([-1])) - self.assertEqualValues(uid.GetUid(), -1) + # We use 2^30+42 here, which is a valid UID, but unlikely to be used on + # most systems (even as a subuid). + free_uid = 2**30 + 42 + uid = uidpool.RequestUnusedUid(set([free_uid])) + self.assertEqualValues(uid.GetUid(), free_uid) # Check uid-pool exhaustion # - # uid "-1" is locked now, so RequestUnusedUid is expected to fail + # free_uid is locked now, so RequestUnusedUid is expected to fail self.assertRaises(errors.LockError, uidpool.RequestUnusedUid, - set([-1])) + set([free_uid])) # Check unlocking uid.Unlock() # After unlocking, "-1" should be available again - uid = uidpool.RequestUnusedUid(set([-1])) - self.assertEqualValues(uid.GetUid(), -1) + uid = uidpool.RequestUnusedUid(set([free_uid])) + self.assertEqualValues(uid.GetUid(), free_uid) if __name__ == "__main__": 441e7f054e5310'/>
path: root/tests/guix-gc.sh
AgeCommit message (Expand)Author
2023-04-21tests: Fix checks for expected failures....Addresses <https://issues.guix.gnu.org/62406>. With 'set -e', a return status inverted with '!' does not cause the shell to exit immediately. Instead use '&& false' to indicate an expected failure. * tests/guix-archive.sh, tests/guix-build-branch.sh, tests/guix-build.sh, tests/guix-daemon.sh, tests/guix-download.sh, tests/guix-environment-container.sh, tests/guix-environment.sh, tests/guix-gc.sh, tests/guix-git-authenticate.sh, tests/guix-graph.sh, tests/guix-hash.sh, tests/guix-home.sh, tests/guix-pack-relocatable.sh, tests/guix-pack.sh, tests/guix-package-aliases.sh, tests/guix-package-net.sh, tests/guix-package.sh, tests/guix-refresh.sh, tests/guix-shell.sh, tests/guix-style.sh, tests/guix-system.sh: Replace uses of '! ...' with '... && false' or `test ! ...` as appropriate. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Eric Bavier