From 2e1392eff879bdfe443f706fd54577816b169d64 Mon Sep 17 00:00:00 2001 From: Abhijeet Kasurde Date: Mon, 24 Jun 2019 22:17:47 +0530 Subject: [PATCH] ipaddr: unit tests for empty string (#58274) Signed-off-by: Abhijeet Kasurde --- test/integration/targets/filters/tasks/main.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/integration/targets/filters/tasks/main.yml b/test/integration/targets/filters/tasks/main.yml index e6a37a2b1e0..6d167f7bec4 100644 --- a/test/integration/targets/filters/tasks/main.yml +++ b/test/integration/targets/filters/tasks/main.yml @@ -276,6 +276,17 @@ - "'192.168.0.1/24' | ipaddr('network') == '192.168.0.0'" - "'fe80::dead:beef/64' | ipaddr('broadcast') == 'fe80::ffff:ffff:ffff:ffff'" - "'::1/120' | ipaddr('netmask') == 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ff00'" + - "{{ subnets | ipaddr(1) }} == ['10.1.1.1/24', '10.1.2.1/24']" + - "{{ subnets | ipaddr('1') }} == ['10.1.1.1/24', '10.1.2.1/24']" + - "{{ subnets | ipaddr(-1) }} == ['10.1.1.255/24', '10.1.2.255/24']" + - "{{ subnets | ipaddr('-1') }} == ['10.1.1.255/24', '10.1.2.255/24']" + - "'{{ prefix | ipaddr(1) }}' == '10.1.1.1/24'" + - "'{{ prefix | ipaddr('1') }}' == '10.1.1.1/24'" + - "'{{ prefix | ipaddr('network') }}' == '10.1.1.0'" + - "'{{ prefix | ipaddr('-1') }}' == '10.1.1.255/24'" + vars: + subnets: ['10.1.1.0/24', '10.1.2.0/24'] + prefix: '10.1.1.0/24' - name: Ensure dict2items works with hostvars debug: