|
| 1 | +--- |
| 2 | +# Test modules are able to login to Hypercore. |
| 3 | +# The local or oidc user accounts are supported. |
| 4 | + |
| 5 | +# =================================================================== |
| 6 | +# local user, from environ |
| 7 | +- environment: |
| 8 | + SC_HOST: "{{ sc_host }}" |
| 9 | + SC_USERNAME: "{{ sc_config[sc_host].sc_username }}" |
| 10 | + SC_PASSWORD: "{{ sc_config[sc_host].sc_password }}" |
| 11 | + SC_TIMEOUT: "{{ sc_timeout }}" |
| 12 | + SC_AUTH_METHOD: local |
| 13 | + |
| 14 | + block: |
| 15 | + - name: Get HC3 ping - local user, from environ |
| 16 | + scale_computing.hypercore.api: |
| 17 | + action: get |
| 18 | + endpoint: /rest/v1/ping |
| 19 | + register: ping_result |
| 20 | + - &assert_ping_result |
| 21 | + name: Check ping_result |
| 22 | + ansible.builtin.assert: |
| 23 | + that: |
| 24 | + - ping_result is not changed |
| 25 | + - ping_result.record.0 == "status" |
| 26 | + |
| 27 | +# =================================================================== |
| 28 | +# local user, from cluster_instance variable |
| 29 | +- vars: |
| 30 | + cluster_instance: |
| 31 | + host: "{{ sc_host }}" |
| 32 | + username: "{{ sc_config[sc_host].sc_username }}" |
| 33 | + password: "{{ sc_config[sc_host].sc_password }}" |
| 34 | + auth_method: local |
| 35 | + block: |
| 36 | + - name: Get HC3 ping - local user, from cluster_instance variable |
| 37 | + scale_computing.hypercore.api: |
| 38 | + action: get |
| 39 | + endpoint: /rest/v1/ping |
| 40 | + cluster_instance: "{{ cluster_instance }}" |
| 41 | + register: ping_result |
| 42 | + - *assert_ping_result |
| 43 | + |
| 44 | +# =================================================================== |
| 45 | +# OIDC user, from environ |
| 46 | +- environment: |
| 47 | + SC_HOST: "{{ sc_host }}" |
| 48 | + SC_USERNAME: "{{ sc_config[sc_host].oidc.users[0].username }}" |
| 49 | + SC_PASSWORD: "{{ sc_config[sc_host].oidc.users[0].password }}" |
| 50 | + SC_TIMEOUT: "{{ sc_timeout }}" |
| 51 | + SC_AUTH_METHOD: oidc |
| 52 | + block: |
| 53 | + - name: Get HC3 ping - OIDC user, from environ |
| 54 | + scale_computing.hypercore.api: |
| 55 | + action: get |
| 56 | + endpoint: /rest/v1/ping |
| 57 | + register: ping_result |
| 58 | + - *assert_ping_result |
| 59 | + |
| 60 | +# =================================================================== |
| 61 | +# OIDC user, from cluster_instance variable |
| 62 | +- vars: |
| 63 | + cluster_instance: &cluster_instance_local |
| 64 | + host: "{{ sc_host }}" |
| 65 | + username: "{{ sc_config[sc_host].oidc.users[0].username }}" |
| 66 | + password: "{{ sc_config[sc_host].oidc.users[0].password }}" |
| 67 | + auth_method: oidc |
| 68 | + block: |
| 69 | + - name: Get HC3 ping - OIDC user, from cluster_instance variable |
| 70 | + scale_computing.hypercore.api: |
| 71 | + action: get |
| 72 | + endpoint: /rest/v1/ping |
| 73 | + cluster_instance: "{{ cluster_instance }}" |
| 74 | + register: ping_result |
| 75 | + - *assert_ping_result |
0 commit comments