|
| 1 | +summary: A general test for a system role |
| 2 | +tag: playbooks_parallel |
| 3 | +provision: |
| 4 | + # TF uses `how: artemis`, and `tmt try`` uses `how: virtual`. |
| 5 | + # Hence there is no need to define `how` explicitly. |
| 6 | + - name: control-node1 |
| 7 | + role: control_node |
| 8 | + # `connection: system` is required for `how: virtual` to assign VMs a real |
| 9 | + # IP making SSH configuration easier. |
| 10 | + # This setting is ignored in `artemis`, so we can leave it as is. |
| 11 | + connection: system |
| 12 | + - name: managed-node1 |
| 13 | + role: managed_node |
| 14 | + connection: system |
| 15 | + hardware: |
| 16 | + network: |
| 17 | + - type: eth |
| 18 | + - type: eth |
| 19 | + - name: managed-node2 |
| 20 | + role: managed_node |
| 21 | + connection: system |
| 22 | + hardware: |
| 23 | + network: |
| 24 | + - type: eth |
| 25 | + - type: eth |
| 26 | + - name: managed-node3 |
| 27 | + role: managed_node |
| 28 | + connection: system |
| 29 | + hardware: |
| 30 | + network: |
| 31 | + - type: eth |
| 32 | + - type: eth |
| 33 | + - name: managed-node4 |
| 34 | + role: managed_node |
| 35 | + connection: system |
| 36 | + hardware: |
| 37 | + network: |
| 38 | + - type: eth |
| 39 | + - type: eth |
| 40 | + - name: managed-node5 |
| 41 | + role: managed_node |
| 42 | + connection: system |
| 43 | + hardware: |
| 44 | + network: |
| 45 | + - type: eth |
| 46 | + - type: eth |
| 47 | + - name: managed-node6 |
| 48 | + role: managed_node |
| 49 | + connection: system |
| 50 | + hardware: |
| 51 | + network: |
| 52 | + - type: eth |
| 53 | + - type: eth |
| 54 | +environment: |
| 55 | + ANSIBLE_VER: 2.17 |
| 56 | + REPO_NAME: network |
| 57 | + PYTHON_VERSION: 3.12 |
| 58 | + SYSTEM_ROLES_ONLY_TESTS: "" |
| 59 | + TEST_LOCAL_CHANGES: true |
| 60 | + PR_NUM: "" |
| 61 | + LINUXSYSTEMROLES_USER: "" |
| 62 | + LINUXSYSTEMROLES_DOMAIN: "" |
| 63 | + LINUXSYSTEMROLES_SSH_KEY: "" |
| 64 | + ARTIFACTS_DIR: "" |
| 65 | + ARTIFACTS_URL: "" |
| 66 | + LSR_TFT_DEBUG: false |
| 67 | +prepare: |
| 68 | + - name: Use vault.centos.org repos (CS 7, 8 EOL workaround) |
| 69 | + script: | |
| 70 | + if grep -q 'CentOS Stream release 8' /etc/redhat-release; then |
| 71 | + sed -i '/^mirror/d;s/#\(baseurl=http:\/\/\)mirror/\1vault/' /etc/yum.repos.d/*.repo |
| 72 | + fi |
| 73 | + if grep -q 'CentOS Linux release 7.9' /etc/redhat-release; then |
| 74 | + sed -i '/^mirror/d;s/#\?\(baseurl=http:\/\/\)mirror/\1vault/' /etc/yum.repos.d/*.repo |
| 75 | + fi |
| 76 | + # Replace with feature: epel: enabled once https://github.com/teemtee/tmt/pull/3128 is merged |
| 77 | + - name: Enable epel to install beakerlib |
| 78 | + script: | |
| 79 | + # CS 10 and Fedora doesn't require epel |
| 80 | + if grep -q -e 'CentOS Stream release 10' -e 'Fedora release' /etc/redhat-release; then |
| 81 | + exit 0 |
| 82 | + fi |
| 83 | + yum install epel-release yum-utils -y |
| 84 | + yum-config-manager --enable epel epel-debuginfo epel-source |
| 85 | + - name: Test NICs |
| 86 | + script: lshw -C network |
| 87 | +discover: |
| 88 | + - name: Prepare managed node |
| 89 | + how: fmf |
| 90 | + where: managed_node |
| 91 | + filter: tag:prep_managed_node |
| 92 | + url: https://github.com/linux-system-roles/tft-tests |
| 93 | + ref: main |
| 94 | + - name: Run test playbooks from control_node |
| 95 | + how: fmf |
| 96 | + where: control_node |
| 97 | + filter: tag:test_playbooks |
| 98 | + url: https://github.com/linux-system-roles/tft-tests |
| 99 | + ref: main |
| 100 | + # Uncomment this step for troubleshooting |
| 101 | + # This is required because currently testing-farm cli doesn't support running multi-node plans |
| 102 | + # You can set ID_RSA_PUB in the environment section above to your public key to distribute it to nodes |
| 103 | + # - name: Inject your ssh public key to test systems |
| 104 | + # how: fmf |
| 105 | + # where: control_node |
| 106 | + # filter: tag:reserve_system |
| 107 | + # url: https://github.com/linux-system-roles/tft-tests |
| 108 | + # ref: main |
| 109 | +execute: |
| 110 | + how: tmt |
0 commit comments