OpenStack in a snap!
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.
 
 
 
 

50 lines
1.2 KiB

  1. #!/usr/bin/env python
  2. """
  3. control_test.py
  4. This is a test to verify that a control node gets setup properly. We verify:
  5. 1) We can install the snap.
  6. 2) Nova services are not running
  7. 3) Other essential services are running
  8. 4) TODO: the horizon dashboard works.
  9. """
  10. import sys
  11. import os
  12. import unittest
  13. sys.path.append(os.getcwd())
  14. from tests.framework import Framework, check, check_output # noqa E402
  15. class TestControlNode(Framework):
  16. INIT_FLAG = 'control'
  17. def test_control_node(self):
  18. print("Checking output of services ...")
  19. services = check_output(
  20. *self.PREFIX, 'systemctl', 'status', 'snap.microstack.*',
  21. '--no-page')
  22. print("services: @@@")
  23. print(services)
  24. self.assertFalse('nova-' in services)
  25. self.assertTrue('neutron-' in services)
  26. self.assertTrue('keystone-' in services)
  27. self.passed = True
  28. if __name__ == '__main__':
  29. # Run our tests, ignoring deprecation warnings and warnings about
  30. # unclosed sockets. (TODO: setup a selenium server so that we can
  31. # move from PhantomJS, which is deprecated, to to Selenium headless.)
  32. unittest.main(warnings='ignore')