summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/facts_linux_network/tasks
diff options
context:
space:
mode:
authorSam Doran <sdoran@redhat.com>2020-07-30 19:40:14 +0200
committerGitHub <noreply@github.com>2020-07-30 19:40:14 +0200
commite6bf20273808642ec58b4dd2a765cd7e5b25f48e (patch)
tree8e9cd17696c521e489af84b3607547c0b729cca1 /test/integration/targets/facts_linux_network/tasks
parentfacts - fix incorrect time for some date_time_facts (#70665) (diff)
downloadansible-e6bf20273808642ec58b4dd2a765cd7e5b25f48e.tar.xz
ansible-e6bf20273808642ec58b4dd2a765cd7e5b25f48e.zip
linux facts - return proper broadcast address (#64528)
* linux facts - return proper broadcast address Check that the value being returned is actually a broadcast address * Add tests * Cleanup tests
Diffstat (limited to 'test/integration/targets/facts_linux_network/tasks')
-rw-r--r--test/integration/targets/facts_linux_network/tasks/main.yml18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/integration/targets/facts_linux_network/tasks/main.yml b/test/integration/targets/facts_linux_network/tasks/main.yml
new file mode 100644
index 0000000000..af4dde96aa
--- /dev/null
+++ b/test/integration/targets/facts_linux_network/tasks/main.yml
@@ -0,0 +1,18 @@
+- block:
+ - name: Add IP to interface
+ command: ip address add 100.42.42.1/32 dev {{ ansible_facts.default_ipv4.interface }}
+ ignore_errors: yes
+
+ - name: Gather network facts
+ setup:
+ gather_subset: network
+
+ - name: Ensure broadcast is reported as empty
+ assert:
+ that:
+ - ansible_facts[ansible_facts['default_ipv4']['interface']]['ipv4_secondaries'][0]['broadcast'] == ''
+
+ always:
+ - name: Remove IP from interface
+ command: ip address delete 100.42.42.1/32 dev {{ ansible_facts.default_ipv4.interface }}
+ ignore_errors: yes