Refactored test framework so that we have more flexibility in terms of installing various versions of microstack before and after running some tests. Moved in class "globals" into per instance variables, to avoid broken cases with incomplete cleanup. Added test_refresh.py, plus matching env in tox. Refresh tests will fail currently, because we have some pending issues that break refreshes. Fixing those is a subject for a different commit. Refactored cluster_test.py and control_test.py to use new framework. Should (and do) pass. Framework now cleans up multipass hosts regardless of whether or not the tests passed. Leaning on the .tar.gz for local troubleshooting helps us make it better for in gate troubleshooting. Change-Id: I6a45b39132f5959c2944fe1ebbe10f71408ee777
51 lines
1.2 KiB
Python
Executable File
51 lines
1.2 KiB
Python
Executable File
#!/usr/bin/env python
|
|
"""
|
|
control_test.py
|
|
|
|
This is a test to verify that a control node gets setup properly.
|
|
|
|
"""
|
|
|
|
import sys
|
|
import os
|
|
|
|
import unittest
|
|
|
|
sys.path.append(os.getcwd())
|
|
|
|
from tests.framework import Framework, check, check_output # noqa E402
|
|
|
|
|
|
class TestControlNode(Framework):
|
|
|
|
def test_control_node(self):
|
|
"""A control node has all services running, so this shouldn't be any
|
|
different than our standard setup.
|
|
|
|
"""
|
|
|
|
host = self.get_host()
|
|
host.install()
|
|
host.init(flag='control')
|
|
|
|
print("Checking output of services ...")
|
|
services = check_output(
|
|
*host.prefix, 'systemctl', 'status', 'snap.microstack.*',
|
|
'--no-page')
|
|
|
|
print("services: @@@")
|
|
print(services)
|
|
|
|
self.assertTrue('neutron-' in services)
|
|
self.assertTrue('keystone-' in services)
|
|
self.assertTrue('nova-' in services)
|
|
|
|
self.passed = True
|
|
|
|
|
|
if __name__ == '__main__':
|
|
# Run our tests, ignoring deprecation warnings and warnings about
|
|
# unclosed sockets. (TODO: setup a selenium server so that we can
|
|
# move from PhantomJS, which is deprecated, to to Selenium headless.)
|
|
unittest.main(warnings='ignore')
|