From 1d6bce961ca6e8617975a84506e84ae9ace47d87 Mon Sep 17 00:00:00 2001 From: Jill R <4121322+jillr@users.noreply.github.com> Date: Mon, 12 Aug 2019 02:13:21 -0700 Subject: [PATCH] VMware: Add writing new tests subsection to vmware_guidelines (#60163) * Add writing new tests subsection to vmware_guidelines Specifically address use of the prepare_vmware_tests role Point to common vars for use by test writers Co-Authored-By: Abhijeet Kasurde --- .../dev_guide/platforms/vmware_guidelines.rst | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/docs/docsite/rst/dev_guide/platforms/vmware_guidelines.rst b/docs/docsite/rst/dev_guide/platforms/vmware_guidelines.rst index 796b0295b6b..ea3a3d2e6f8 100644 --- a/docs/docsite/rst/dev_guide/platforms/vmware_guidelines.rst +++ b/docs/docsite/rst/dev_guide/platforms/vmware_guidelines.rst @@ -181,6 +181,24 @@ Depending upon the functionality provided by ESXi or vCenter, some modules can s Functional tests ---------------- +Writing new tests +~~~~~~~~~~~~~~~~~ + +If you are writing a new collection of integration tests, there are a few VMware-specific things to note beyond +the standard Ansible :ref:`integration testing` process. + +The test-suite uses a set of common, pre-defined vars located in the :file:`test/integration/targets/prepare_vmware_tests/` role. +The resources defined there are automatically created by importing that role at the start of your test: + +.. code-block:: yaml + + - import_role: + name: prepare_vmware_tests + vars: + setup_datacenter: true + +This will give you a ready to use cluster, datacenter, datastores, folder, switch, dvswitch, ESXi hosts, and VMs. + No need to create too much resources ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~