Merge "Add docs for auto generation of fixtures"
This commit is contained in:
commit
103aec708b
|
@ -9,7 +9,72 @@ This repository will be automatically fetched before the noop tests are run to
|
|||
the *tests/noop/fuel-noop-fixtures* directory.
|
||||
|
||||
Developers of the noop tests can add new Hiera and facts yaml files into this
|
||||
repository instead of the main `fuel-library`_ repository.
|
||||
repository instead of the main `fuel-library`_ repository starting from the
|
||||
Fuel Mitaka (9.0) release.
|
||||
|
||||
.. note:: The fixtures for the Fuel <=8.0 belong to the fuel-library
|
||||
repository and must be changed there.
|
||||
|
||||
.. _fuel-noop-fixtures: https://github.com/openstack/fuel-noop-fixtures
|
||||
.. _fuel-library: https://github.com/openstack/fuel-library
|
||||
|
||||
Automatic generation of fixtures
|
||||
--------------------------------
|
||||
|
||||
The fixtures must contain data as it comes from the Fuel deployment data
|
||||
backend (Nailgun). Fixtures contain only data specific to the corresponding
|
||||
Fuel version. Manual changes to the fixtures' data should be avoided.
|
||||
|
||||
The current approach to generate the fixtures is a semi-automated and
|
||||
requires a Fuel master node of a given release deployed. To generate the
|
||||
fixtures, for each of the deployment cases (environments) under test, first
|
||||
create the environment, for example:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ fuel env --create --name test_neutron_vlan --rel 2 --net vlan
|
||||
|
||||
Then query, update and upload the environment attributes as required. For example,
|
||||
to test a Ceph-for-all-but-ephemeral-plus-Ceilometer deployment:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ fuel env --attributes --env 1 --download
|
||||
$ ruby -ryaml -e '\
|
||||
> attr = YAML.load(File.read("./cluster_1/attributes.yaml"))
|
||||
> attr["editable"]["storage"]["images_ceph"]["value"] = true
|
||||
> attr["editable"]["storage"]["objects_ceph"]["value"] = true
|
||||
> attr["editable"]["storage"]["volumes_ceph"]["value"] = true
|
||||
> attr["editable"]["storage"]["volumes_lvm"]["value"] = false
|
||||
> attr["editable"]["additional_components"]["ceilometer"]["value"] = true
|
||||
> File.open("./cluster_1/attributes.yaml", "w").write(attr.to_yaml)'
|
||||
$ fuel env --attributes --env 1 --upload
|
||||
|
||||
At last, add nodes, assign roles as you want to test it, then generate and store
|
||||
the data fixtures as YAML files, for example:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ fuel --env 1 node set --node 1 --role controller
|
||||
$ fuel --env 1 node set --node 2 --role compute,ceph-osd
|
||||
$ fuel deployment --default --env 1
|
||||
$ ls /root/deployment_1
|
||||
ceph-osd_2.yaml compute_2.yaml primary-controller_1.yaml
|
||||
|
||||
Those files are now ready to be renamed and put under the `hiera`
|
||||
directory, like this:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ git clone https://github.com/openstack/fuel-noop-fixtures
|
||||
$ mv /root/deployment_1/compute_2.yaml \
|
||||
> ./fuel-noop-fixtures/hiera/neut_vlan.ceph.ceil-compute.yaml
|
||||
$ mv /root/deployment_1/ceph-osd_2.yaml \
|
||||
> ./fuel-noop-fixtures/hiera/neut_vlan.ceph.ceil-ceph-osd.yaml
|
||||
$ mv /root/deployment_1/primary-controller_1.yaml \
|
||||
> ./fuel-noop-fixtures/hiera/neut_vlan.ceph.ceil-primary-controller.yaml
|
||||
|
||||
Note, there is a `script`_ to automate things to a certain degree as well.
|
||||
Hopefully, we will improve the auto-generation process, eventually.
|
||||
|
||||
.. _script: https://github.com/fuel-noop-fixtures/utils/blob/master/generate_yamls.sh
|
||||
|
|
Loading…
Reference in New Issue