name: Local User Authentication
testcases:
  - name: register_device_on_the_portal
    steps:
    - type: exec
      script: ssh -o "ConnectTimeout 3" -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" "root@{{.inline_l2.node.ipaddress}}"  -t "/root/register_node -portal={{.inline_lx.pf_portal_url}}"

    # let wait a bit until the device is set in the ipset
    - type: exec
      script: sleep 5

  - name: test_if_the_device_is_in_the_ipset_register_set
    steps:
      - type: exec
        script: 'ipset test pfsession_Reg_{{.inline_l2.networks}} {{.inline_l2.node.ipaddress}}'


  - name: test_if_the_device_is_in_the_ipset_role_id_1
    steps:
      - type: exec
        script: 'ipset test PF-iL2_ID1_{{.inline_l2.networks}} {{.inline_l2.node.ipaddress}}'

  - name: test_if_the_device_can_reach_cnn_com
    steps:
    - type: exec
      script: ssh -o "ConnectTimeout 3" -o "StrictHostKeyChecking no" -o "UserKnownHostsFile /dev/null" "root@{{.inline_l2.node.ipaddress}}"  -t "/root/test_internet_access"
      retry: 5
      delay: 1
