Oleksii Butenko | 3b3bab1 | 2019-05-23 17:30:15 +0300 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | |
| 3 | import os |
| 4 | import sys |
| 5 | |
| 6 | sys.path.append(os.getcwd()) |
| 7 | try: |
| 8 | from tcp_tests.fixtures import config_fixtures |
| 9 | from tcp_tests.managers import underlay_ssh_manager |
| 10 | from tcp_tests.managers import saltmanager as salt_manager |
| 11 | except ImportError: |
| 12 | print("ImportError: Run the application from the tcp-qa directory or " |
| 13 | "set the PYTHONPATH environment variable to directory which contains" |
| 14 | " ./tcp_tests") |
| 15 | sys.exit(1) |
| 16 | |
| 17 | |
| 18 | def main(): |
| 19 | tests_configs = os.environ.get('TESTS_CONFIGS', None) |
| 20 | if not tests_configs or not os.path.isfile(tests_configs): |
| 21 | print("Please set TESTS_CONFIGS environment variable whith" |
| 22 | "the path to INI file with lab metadata.") |
| 23 | return 1 |
| 24 | config = config_fixtures.config() |
| 25 | underlay = underlay_ssh_manager.UnderlaySSHManager(config) |
| 26 | saltmanager = salt_manager.SaltManager(config, underlay) |
| 27 | saltmanager.create_env_jenkins_cicd() |
| 28 | saltmanager.create_env_k8s() |
| 29 | |
| 30 | |
| 31 | if __name__ == '__main__': |
| 32 | sys.exit(main()) |