name: Create connection profile
testcases:
- name: get_login_token
  steps:
  - type: get_login_token

- name: create_dot1x_eap_tls_connection_profile
  steps:
  - type: http
    method: POST
    url: '{{.pfserver_webadmin_url}}/api/v1/config/connection_profiles'
    ignore_verify_ssl: true
    body: >-
      {
        "access_registration_when_registered": null,
        "advanced_filter": null,
        "always_use_redirecturl": null,
        "autoregister": "enabled",
        "billing_tiers": null,
        "block_interval": {
          "interval": "10",
          "unit": "m"
        },
        "default_psk_key": null,
        "description": "{{.wired_dot1x_eap_tls_manual.profiles.wired.description}}",
        "dot1x_recompute_role_from_portal": "enabled",
        "dot1x_unset_on_unmatch": "disabled",
        "dpsk": "disabled",
        "filter": [
          {
            "type": "connection_type",
            "match": "{{.wired_dot1x_eap_tls_manual.profiles.wired.filters.connection_type}}"
          },
          {
            "type": "connection_sub_type",
            "match": "{{.wired_dot1x_eap_tls_manual.profiles.wired.filters.connection_sub_type}}"
          }          
        ],
        "filter_match_style": "all",
        "id": "{{.wired_dot1x_eap_tls_manual.profiles.wired.id}}",
        "locale": null,
        "login_attempt_limit": 0,
        "logo": null,
        "mac_auth_recompute_role_from_portal": "disabled",
        "network_logoff": null,
        "network_logoff_popup": null,
        "preregistration": null,
        "provisioners": null,
        "redirecturl": null,
        "reuse_dot1x_credentials": null,
        "root_module": "default_policy",
        "scans": null,
        "self_service": null,
        "sms_pin_retry_limit": 0,
        "sms_request_limit": 0,
        "sources": [
          "{{.wired_dot1x_eap_tls_manual.sources.eaptls.name}}"
        ],
        "status": "enabled",
        "unreg_on_acct_stop": "{{.wired_dot1x_eap_tls_manual.profiles.wired.unreg_on_acct_stop}}",
        "vlan_pool_technique": "username_hash"
      }
    headers:
      "Authorization": "{{.get_login_token.result.token}}"
      "Content-Type": "application/json"
    assertions:
      - result.statuscode ShouldEqual 201
