summaryrefslogtreecommitdiffstats
path: root/test/integration/targets/virt_net/files
diff options
context:
space:
mode:
authorGonéri Le Bouder <goneri@lebouder.net>2019-03-28 17:12:35 +0100
committerAbhijeet Kasurde <akasurde@redhat.com>2019-03-28 17:12:35 +0100
commitfc3064471b26a76b90f8b06950b3fb81d88ac21e (patch)
treec22365c47ae5e0dbf4c78d8ce1223cb85307834a /test/integration/targets/virt_net/files
parentFix file path encoding bugs on Python 3. (diff)
downloadansible-fc3064471b26a76b90f8b06950b3fb81d88ac21e.tar.xz
ansible-fc3064471b26a76b90f8b06950b3fb81d88ac21e.zip
virt_net: idempotency of create/stop actions (#53276)
Currently, if we try to stop or start a network two time in a row, the second call will fail. With this patch: - we don't recreate a network, if it exists - we only stop a network if it's active, and so we avoid an exception saying the network is not active * test: mock libvirt * add integration tests for virt_net * test: enable virt_net test on RedHat 7 and 8 * ci: use the unsupported alias * tests that require privileged mode are run in VM * virt_net/create raise unexpected libvirt exception * import mock from units.compat * virt_net: do not call create() on "active" network * virt_net func test: only clean up the libvirt packages * test: virt_net: don't use assert_called() * virt_net: add the destructive alias * move the test in virt_net dir * test/virt_net: clean up the network at the end
Diffstat (limited to 'test/integration/targets/virt_net/files')
-rw-r--r--test/integration/targets/virt_net/files/foobar.xml9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/integration/targets/virt_net/files/foobar.xml b/test/integration/targets/virt_net/files/foobar.xml
new file mode 100644
index 0000000000..768e10eaa8
--- /dev/null
+++ b/test/integration/targets/virt_net/files/foobar.xml
@@ -0,0 +1,9 @@
+<network>
+ <name>foobar</name>
+ <forward mode='nat'/>
+ <ip address='192.168.125.1' netmask='255.255.255.0'>
+ <dhcp>
+ <range start='192.168.125.2' end='192.168.125.254'/>
+ </dhcp>
+ </ip>
+</network>