ansible/test
Adrián López dac3bf5b71 zabbix_host: interface.port parameter is a string (#64986)
interface.port should be a string to be able to use macros in that
value.
This fixes the case when interface.port is a macro (eg.: "{$MACRO}" and
force=false.

Because, until now, setting the interface.port to an integer was the correct way to work with force=false, a type validation has been added
to that parameter.
Previously, if a string was used for interface.port, it was converted
to an integer, the comparison didn't work (if interface not in interfaces)
and the module tried to register the same interface twice, returning an
error.

Zabbix API manual specifies that only 'main, 'type', 'useip' and 'bulk'
are integers.
https://www.zabbix.com/documentation/current/manual/api/reference/hostinterface/object

Tests are changed to use always str in the interface.port.

Two new tests are added.
The first one is to show that now registering a host with force=false and
a macro in interface.port works.
The other one tests that interfaces defined using string for port are
compared correctly when force=false is used. Previously it was
a comparison between int and str, interfaces were seen as different
and an error was thrown because we were trying to create twice a main
interface.

* Try to kindly convert interface port to the string

As suggested, the previous behaviour could break current configurations. This solution accepts integers and strings.

Co-Authored-By: Dusan Matejka <D3DeFi@users.noreply.github.com>
2019-12-16 10:55:05 +05:30
..
ansible_test
integration zabbix_host: interface.port parameter is a string (#64986) 2019-12-16 10:55:05 +05:30
legacy Sanity test fixups - AWS related tests (#64093) 2019-10-30 09:48:59 -07:00
lib/ansible_test Sanity checks: test for print statement (#65219) 2019-12-06 05:31:31 +10:00
sanity fixed inconsistent required set to True in zabbix modules 2019-12-09 10:20:17 -08:00
units Fix flake8 errors for iosxr tests (#65860) 2019-12-15 23:48:28 -05:00
utils Increase unit test timeout in CI. 2019-11-01 17:16:07 -07:00