Sergey Galkin | 86c1a65 | 2019-11-21 17:02:02 +0400 | [diff] [blame^] | 1 | # Copyright 2019 Mirantis, Inc. |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 | # not use this file except in compliance with the License. You may obtain |
| 5 | # a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 | # License for the specific language governing permissions and limitations |
| 13 | # under the License. |
| 14 | import pytest |
| 15 | |
| 16 | from tcp_tests import logger |
| 17 | |
| 18 | |
| 19 | LOG = logger.logger |
| 20 | |
| 21 | |
| 22 | class TestUpdateContrail(object): |
| 23 | @pytest.mark.day1_underlay |
| 24 | def test_upgrade_contrail(self, |
| 25 | show_step, |
| 26 | underlay_actions, |
| 27 | drivetrain_actions, |
| 28 | reclass_actions, |
| 29 | salt_actions): |
| 30 | """Execute Contrail upgrade |
| 31 | |
| 32 | Scenario: |
| 33 | 1. Perform Contrail upgarde |
| 34 | 2. If jobs are passed then start tests with cvp-sanity job |
| 35 | 3. Run tests with cvp-tempest job |
| 36 | """ |
| 37 | cfg_node = underlay_actions.get_target_node_names(target='cfg')[0] |
| 38 | LOG.info('cfg node is {}'.format(cfg_node)) |
| 39 | dt = drivetrain_actions |
| 40 | # ########## Upgrade Contrail ########### |
| 41 | show_step(1) |
| 42 | LOG.info('Upgrade control VMs') |
| 43 | job_name = 'deploy-update-opencontrail4' |
| 44 | job_parameters = { |
| 45 | 'ASK_CONFIRMATION': False |
| 46 | } |
| 47 | update_control_vms = dt.start_job_on_cid_jenkins( |
| 48 | job_name=job_name, |
| 49 | job_parameters=job_parameters) |
| 50 | assert update_control_vms == 'SUCCESS' |
| 51 | # ######################## Run CPV ########################## |
| 52 | show_step(2) |
| 53 | job_name = 'cvp-sanity' |
| 54 | job_parameters = { |
| 55 | 'EXTRA_PARAMS': ''' |
| 56 | envs: |
| 57 | - skipped_packages='{},{},{},{},{},{}' |
| 58 | - skipped_modules='xunitmerge,setuptools' |
| 59 | - skipped_services='docker,containerd' |
| 60 | - ntp_skipped_nodes='' |
| 61 | - tests_set=-k "not {} and not {} and not {}" |
| 62 | '''.format('python-setuptools', 'python-pkg-resources', |
| 63 | 'xunitmerge', 'python-gnocchiclient', |
| 64 | 'python-ujson', 'python-octaviaclient', |
| 65 | 'test_ceph_status', 'test_prometheus_alert_count', |
| 66 | 'test_uncommited_changes') |
| 67 | } |
| 68 | run_cvp_sanity = dt.start_job_on_cid_jenkins( |
| 69 | job_name=job_name, |
| 70 | job_parameters=job_parameters) |
| 71 | assert run_cvp_sanity == 'SUCCESS' |
| 72 | # ######################## Run Tempest ####################### |
| 73 | show_step(3) |
| 74 | job_name = 'cvp-tempest' |
| 75 | job_parameters = { |
| 76 | 'TEMPEST_ENDPOINT_TYPE': 'internalURL' |
| 77 | } |
| 78 | run_cvp_tempest = dt.start_job_on_cid_jenkins( |
| 79 | job_name=job_name, |
| 80 | job_parameters=job_parameters) |
| 81 | assert run_cvp_tempest == 'SUCCESS' |