fuel-noop-fixtures/doc/fixtures.rst

3.2 KiB

Fuel Noop fixtures

There is a separate fuel-noop-fixtures repository to store all of the fixtures and libraries required for the noop tests execution. 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 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.

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:

$ 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:

$ 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:

$ 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:

$ 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.