Browse Source

Merge "Add docs for auto generation of fixtures"

Jenkins 3 years ago
parent
commit
103aec708b
1 changed files with 66 additions and 1 deletions
  1. 66
    1
      doc/fixtures.rst

+ 66
- 1
doc/fixtures.rst View File

@@ -9,7 +9,72 @@ This repository will be automatically fetched before the noop tests are run to
9 9
 the *tests/noop/fuel-noop-fixtures* directory.
10 10
 
11 11
 Developers of the noop tests can add new Hiera and facts yaml files into this
12
-repository instead of the main `fuel-library`_ repository.
12
+repository instead of the main `fuel-library`_ repository starting from the
13
+Fuel 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 18
 .. _fuel-noop-fixtures: https://github.com/openstack/fuel-noop-fixtures
15 19
 .. _fuel-library: https://github.com/openstack/fuel-library
20
+
21
+Automatic generation of fixtures
22
+--------------------------------
23
+
24
+The fixtures must contain data as it comes from the Fuel deployment data
25
+backend (Nailgun). Fixtures contain only data specific to the corresponding
26
+Fuel version. Manual changes to the fixtures' data should be avoided.
27
+
28
+The current approach to generate the fixtures is a semi-automated and
29
+requires a Fuel master node of a given release deployed. To generate the
30
+fixtures, for each of the deployment cases (environments) under test, first
31
+create the environment, for example:
32
+
33
+.. code-block:: console
34
+
35
+  $ fuel env --create --name test_neutron_vlan --rel 2 --net vlan
36
+
37
+Then query, update and upload the environment attributes as required. For example,
38
+to 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
+
53
+At last, add nodes, assign roles as you want to test it, then generate and store
54
+the 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
+
64
+Those files are now ready to be renamed and put under the `hiera`
65
+directory, 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
+
77
+Note, there is a `script`_ to automate things to a certain degree as well.
78
+Hopefully, we will improve the auto-generation process, eventually.
79
+
80
+.. _script: https://github.com/fuel-noop-fixtures/utils/blob/master/generate_yamls.sh

Loading…
Cancel
Save