name: addons/functions tests
testcases:

- name: prepare_vars
  steps:
  - type: exec
    script: cp {{.pfserver_test_dir}}/addons-functions/vars.tests.ci {{.pfserver_test_dir}}/addons-functions/vars.tests
  - type: exec
    script: "sed -i 's#%%TEST_INTERFACE%%#{{.pfserver_mgmt_interface}}#g' {{.pfserver_test_dir}}/addons-functions/vars.tests"
  - type: exec
    script: "sed -i 's#%%TEST_INTERFACE_IP%%#{{.pfserver_mgmt_ip}}#g' {{.pfserver_test_dir}}/addons-functions/vars.tests"
  - type: exec
    script: "sed -i 's#%%TEST_INTERFACE_CIDR%%#{{.pfserver_mgmt_cidr}}#g' {{.pfserver_test_dir}}/addons-functions/vars.tests"
  - type: exec
    script: "sed -i 's#%%TEST_INTERFACE_NETMASK%%#{{.pfserver_mgmt_netmask}}#g' {{.pfserver_test_dir}}/addons-functions/vars.tests"
  - type: exec
    script: "sed -i 's#%%TEST_INTERFACE_NETWORK%%#{{.pfserver_mgmt_net}}#g' {{.pfserver_test_dir}}/addons-functions/vars.tests"

- name: run_addons_functions_tests
  steps:
  - type: exec
    script: make -C {{.pfserver_test_dir}}/addons-functions test

