Kailash Khalasi | 5f63914 | 2018-03-19 10:31:46 -0700 | [diff] [blame] | 1 | --- |
| 2 | # Copyright 2017-present Open Networking Foundation |
| 3 | # |
| 4 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | # you may not use this file except in compliance with the License. |
| 6 | # You may obtain a copy of the License at |
| 7 | # |
| 8 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | # |
| 10 | # Unless required by applicable law or agreed to in writing, software |
| 11 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | # See the License for the specific language governing permissions and |
| 14 | # limitations under the License. |
| 15 | |
| 16 | - name: Replace SERVER_IP in API Properties |
| 17 | replace: |
| 18 | dest: "{{ cord_test_dir }}/Properties/RestApiProperties.py" |
| 19 | regexp: "SERVER_IP = '.+'$" |
| 20 | replace: "SERVER_IP = '{{ api_test_server_ip }}'" |
| 21 | backup: yes |
| 22 | |
| 23 | - name: Replace SERVER_PORT in API Properties |
| 24 | replace: |
| 25 | dest: "{{ cord_test_dir }}/Properties/RestApiProperties.py" |
| 26 | regexp: "SERVER_PORT = '.+'$" |
| 27 | replace: "SERVER_PORT = '{{ api_test_server_port }}'" |
| 28 | |
| 29 | - name: Replace USER in API Properties |
| 30 | replace: |
| 31 | dest: "{{ cord_test_dir }}/Properties/RestApiProperties.py" |
| 32 | regexp: "USER = '.+'$" |
| 33 | replace: "USER = '{{ xos_admin_user }}'" |
| 34 | |
| 35 | - name: Replace PASSWD in API Properties |
| 36 | lineinfile: |
| 37 | dest: "{{ cord_test_dir }}/Properties/RestApiProperties.py" |
| 38 | regexp: "^PASSWD" |
| 39 | line: "PASSWD = '{{ xos_admin_pass }}'" |
| 40 | |
| 41 | - name: Get List of Tests to run |
| 42 | find: |
| 43 | paths: "{{ cord_test_dir }}/Tests" |
| 44 | patterns: '*.robot' |
| 45 | register: api_tests |
| 46 | |
| 47 | - name: Run Core API Tests |
| 48 | command: > |
| 49 | pybot |
| 50 | -v xos_service:{{ item | regex_replace('.*/(\w+)_service_api.robot$', '\1' ) }} |
| 51 | -e ControllerImages |
| 52 | -e ContollerUser |
| 53 | -e ContollerSlice |
| 54 | -e Port |
| 55 | -e TenantWithContainer |
| 56 | -e AddressManagerServiceInstance {{ item }} |
| 57 | args: |
| 58 | chdir: "../../test/cord-tester/src/test/cord-api/Tests" |
| 59 | with_items: "{{ api_tests.files | map(attribute='path') | list }}" |
| 60 | register: cmdout |
| 61 | tags: |
| 62 | - skip_ansible_lint # pybot execution |