finalizer.py 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # --- BEGIN COPYRIGHT BLOCK ---
  2. # Copyright (C) 2015 Red Hat, Inc.
  3. # All rights reserved.
  4. #
  5. # License: GPL (version 3 or any later version).
  6. # See LICENSE for details.
  7. # --- END COPYRIGHT BLOCK ---
  8. #
  9. '''
  10. Created on Nov 5, 2013
  11. @author: tbordaz
  12. '''
  13. import os
  14. import sys
  15. import time
  16. import ldap
  17. import logging
  18. import socket
  19. import time
  20. import logging
  21. import pytest
  22. from lib389 import DirSrv, Entry, tools
  23. from lib389.tools import DirSrvTools
  24. from lib389._constants import DN_DM
  25. from lib389.properties import *
  26. log = logging.getLogger(__name__)
  27. def test_finalizer():
  28. # for each defined instance, remove it
  29. for args_instance in ALL_INSTANCES:
  30. instance = DirSrv(verbose=True)
  31. instance.allocate(args_instance)
  32. if instance.exists():
  33. instance.delete()
  34. # remove any existing backup for this instance
  35. instance.clearBackupFS()
  36. def run_isolated():
  37. '''
  38. run_isolated is used to run these test cases independently of a test scheduler (xunit, py.test..)
  39. To run isolated without py.test, you need to
  40. - set the installation prefix
  41. - run this program
  42. '''
  43. test_finalizer()
  44. if __name__ == '__main__':
  45. run_isolated()