summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBogdan Dobrelya <bdobrelia@mirantis.com>2016-03-31 11:47:56 +0200
committerBogdan Dobrelya <bdobrelia@mirantis.com>2016-03-31 15:10:03 +0200
commiteb61292b88e445c171dbde3c62345092e42490cc (patch)
treebcf675b8baffa3f834b28b51e7c42db5af5ad89c
parentd1c5bae25b3c3458fad98ad1545aa5d526c434a6 (diff)
Add docs for auto generation of fixtures
Related-bug: #1535339 Related blueprint deployment-dryrun-fixtures-generator Change-Id: I665fcfeb5a8b93132228522ad53a3eea52d6648a Signed-off-by: Bogdan Dobrelya <bdobrelia@mirantis.com>
Notes
Notes (review): Code-Review+2: Bogdan Dobrelya <bdobrelia@mirantis.com> Workflow+1: Bogdan Dobrelya <bdobrelia@mirantis.com> Code-Review+1: Sharat Sharma <sharat.sharma@nectechnologies.in> Verified+2: Jenkins Submitted-by: Jenkins Submitted-at: Thu, 31 Mar 2016 13:26:20 +0000 Reviewed-on: https://review.openstack.org/299839 Project: openstack/fuel-noop-fixtures Branch: refs/heads/master
-rw-r--r--doc/fixtures.rst67
1 files changed, 66 insertions, 1 deletions
diff --git a/doc/fixtures.rst b/doc/fixtures.rst
index 9fd7163..30f4ac9 100644
--- a/doc/fixtures.rst
+++ b/doc/fixtures.rst
@@ -9,7 +9,72 @@ This repository will be automatically fetched before the noop tests are run to
9the *tests/noop/fuel-noop-fixtures* directory. 9the *tests/noop/fuel-noop-fixtures* directory.
10 10
11Developers of the noop tests can add new Hiera and facts yaml files into this 11Developers of the noop tests can add new Hiera and facts yaml files into this
12repository instead of the main `fuel-library`_ repository. 12repository instead of the main `fuel-library`_ repository starting from the
13Fuel Mitaka (9.0) release.
14
15.. note:: The fixtures for the Fuel <=8.0 belong to the fuel-library
16 repository and must be changed there.
13 17
14.. _fuel-noop-fixtures: https://github.com/openstack/fuel-noop-fixtures 18.. _fuel-noop-fixtures: https://github.com/openstack/fuel-noop-fixtures
15.. _fuel-library: https://github.com/openstack/fuel-library 19.. _fuel-library: https://github.com/openstack/fuel-library
20
21Automatic generation of fixtures
22--------------------------------
23
24The fixtures must contain data as it comes from the Fuel deployment data
25backend (Nailgun). Fixtures contain only data specific to the corresponding
26Fuel version. Manual changes to the fixtures' data should be avoided.
27
28The current approach to generate the fixtures is a semi-automated and
29requires a Fuel master node of a given release deployed. To generate the
30fixtures, for each of the deployment cases (environments) under test, first
31create the environment, for example:
32
33.. code-block:: console
34
35 $ fuel env --create --name test_neutron_vlan --rel 2 --net vlan
36
37Then query, update and upload the environment attributes as required. For example,
38to test a Ceph-for-all-but-ephemeral-plus-Ceilometer deployment:
39
40.. code-block:: console
41
42 $ fuel env --attributes --env 1 --download
43 $ ruby -ryaml -e '\
44 > attr = YAML.load(File.read("./cluster_1/attributes.yaml"))
45 > attr["editable"]["storage"]["images_ceph"]["value"] = true
46 > attr["editable"]["storage"]["objects_ceph"]["value"] = true
47 > attr["editable"]["storage"]["volumes_ceph"]["value"] = true
48 > attr["editable"]["storage"]["volumes_lvm"]["value"] = false
49 > attr["editable"]["additional_components"]["ceilometer"]["value"] = true
50 > File.open("./cluster_1/attributes.yaml", "w").write(attr.to_yaml)'
51 $ fuel env --attributes --env 1 --upload
52
53At last, add nodes, assign roles as you want to test it, then generate and store
54the data fixtures as YAML files, for example:
55
56.. code-block:: console
57
58 $ fuel --env 1 node set --node 1 --role controller
59 $ fuel --env 1 node set --node 2 --role compute,ceph-osd
60 $ fuel deployment --default --env 1
61 $ ls /root/deployment_1
62 ceph-osd_2.yaml compute_2.yaml primary-controller_1.yaml
63
64Those files are now ready to be renamed and put under the `hiera`
65directory, like this:
66
67.. code-block:: console
68
69 $ git clone https://github.com/openstack/fuel-noop-fixtures
70 $ mv /root/deployment_1/compute_2.yaml \
71 > ./fuel-noop-fixtures/hiera/neut_vlan.ceph.ceil-compute.yaml
72 $ mv /root/deployment_1/ceph-osd_2.yaml \
73 > ./fuel-noop-fixtures/hiera/neut_vlan.ceph.ceil-ceph-osd.yaml
74 $ mv /root/deployment_1/primary-controller_1.yaml \
75 > ./fuel-noop-fixtures/hiera/neut_vlan.ceph.ceil-primary-controller.yaml
76
77Note, there is a `script`_ to automate things to a certain degree as well.
78Hopefully, we will improve the auto-generation process, eventually.
79
80.. _script: https://github.com/fuel-noop-fixtures/utils/blob/master/generate_yamls.sh