Skip to content
Snippets Groups Projects
Select Git revision
  • master default protected
  • v1.14.7
  • v1.14.6
  • v1.14.5
  • v1.14.4
  • v1.14.3
  • v1.14.2
  • v1.14.1
  • v1.14.0
  • v1.13.2
  • v1.13.1
  • v1.13.0
  • v1.12.1
  • v1.12.0
  • v1.11.1
  • v1.11.0
  • v1.10.0
  • v1.9.2
  • v1.9.1
  • v1.9.0
  • v1.8.4
21 results

test_automountlocation_client_context.yml

Blame
    • Rafael Guterres Jeffman's avatar
      16db5039
      Fix execution of client context tests. · 16db5039
      Rafael Guterres Jeffman authored
      When running the tests that can be executed either on server or client
      context, without defining 'ipa_context', the context is automatically
      identified.
      
      Currently, the tests in upstream CI run only on a server, and the
      context is identified as "server" context, and in order to run the test
      using a client context 'ipa_context' must be set to 'client'.
      
      This patch fixes all the client context tests by correctly setting
      ipa_context when running the client context tests in a server host.
      16db5039
      History
      Fix execution of client context tests.
      Rafael Guterres Jeffman authored
      When running the tests that can be executed either on server or client
      context, without defining 'ipa_context', the context is automatically
      identified.
      
      Currently, the tests in upstream CI run only on a server, and the
      context is identified as "server" context, and in order to run the test
      using a client context 'ipa_context' must be set to 'client'.
      
      This patch fixes all the client context tests by correctly setting
      ipa_context when running the client context tests in a server host.
    test_automountlocation_client_context.yml 1.28 KiB
    ---
    - name: Test automountlocation
      hosts: ipaclients, ipaserver
      become: no
      gather_facts: no
    
      tasks:
      - name: Include FreeIPA facts.
        include_tasks: ../env_freeipa_facts.yml
    
      # Test will only be executed if host is not a server.
      - name: Execute with server context in the client.
        ipaautomountlocation:
          ipaadmin_password: SomeADMINpassword
          ipaapi_context: server
          name: ThisShouldNotWork
        register: result
        failed_when: not (result.failed and result.msg is regex("No module named '*ipaserver'*"))
        when: ipa_host_is_client
    
    # Import basic module tests, and execute with ipa_context set to 'client'.
    # If ipaclients is set, it will be executed using the client, if not,
    # ipaserver will be used.
    #
    # With this setup, tests can be executed against an IPA client, against
    # an IPA server using "client" context, and ensure that tests are executed
    # in upstream CI.
    
    - name: Test automountlocation using client context, in client host.
      import_playbook: test_automountlocation.yml
      when: groups['ipaclients']
      vars:
        ipa_test_host: ipaclients
    
    - name: Test automountlocation using client context, in server host.
      import_playbook: test_automountlocation.yml
      when: groups['ipaclients'] is not defined or not groups['ipaclients']
      vars:
        ipa_context: client