图片解析应用
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

30 lines
868 B

  1. import os
  2. from sys import platform
  3. import pytest
  4. from kazoo.testing import KazooTestCase
  5. class KazooInterruptTests(KazooTestCase):
  6. def test_interrupted_systemcall(self):
  7. """
  8. Make sure interrupted system calls don't break the world, since we
  9. can't control what all signals our connection thread will get
  10. """
  11. if "linux" not in platform:
  12. pytest.skip(
  13. "Unable to reproduce error case on non-linux platforms"
  14. )
  15. path = "interrupt_test"
  16. value = b"1"
  17. self.client.create(path, value)
  18. # set the euid to the current process' euid.
  19. # glibc sends SIGRT to all children, which will interrupt the
  20. # system call
  21. os.seteuid(os.geteuid())
  22. # basic sanity test that it worked alright
  23. assert self.client.get(path)[0] == value