#250 Add info how to use FMF in provisioners.
Merged 5 years ago by astepano. Opened 5 years ago by astepano.

file modified
+51 -4
@@ -21,15 +21,58 @@ 

  

  # Standard Inventory scripts

  

- The inventory scripts are about taking the subjects produced by a CI system

- and transforming them into something testable. That includes launching

- a QCow2 image into a virtual machine, or installing an RPM.

+ The inventory scripts are about taking the subjects produced by a CI system and

+ transforming them into something testable. That includes launching a QCow2

+ image into a virtual machine, or installing an RPM.

  

  Tests are not required to use these scripts but they provide useful, usable

  defaults for this task.

  

+ ## Flexible Metadata Format for default provisioner(s)

  

- ## `standard-inventory-qcow2`

+ You can find information for FMF [here][1], and for supported  FMF attributes

+ [here][2].

+ 

+ ### Initialize a new metadata tree

+ 

+ To add desired parameters for default provisioners first of all make sure that

+ your `/tests` directory has initialized metadata tree.  Directory `.fmf` must be

+ present. If it is not, run next command:

+ 

+ ```

+ fmf init

+ ```

+ 

+ ### Usage

+ 

+ Put in `/tests` a file with name `provision.fmf`:

+ 

+ ```yaml

+ ---

+ 

+ standard-inventory-qcow2:

+   qemu:

+     m: 3G

+     net_nic:

+       model: e1000

+ 

+ standard-inventory-docker:

+   dumb_option: dumb_parameter

+ ```

+ 

+ ### Supported parameters

+ 

+ #### standard-inventory-qcow2

+ 

+ * `qemu.m` - RAM size in megabytes. Optionally, a suffix of `M` or `G`.

+ * `qemu.net_nic.model` - Use `qemu-system-x86_64 -net nic,model=help` for a list

+    of available devices.

+ 

+ You can open a RFE ticket to extend supported parameters according to

+ https://qemu.weilnetz.de/doc/qemu-doc.html

+ 

+ 

+ ## LOCK_ON_FILE for standard-inventory-qcow2

  

  This inventory script launches a virtual machine via qemu. The VM image should

  be specified via command line or an environment variable `TEST_SUBJECTS`.
@@ -78,3 +121,7 @@ 

        ansible_user: "{{ inventory_data.ansible_user }}"

        ansible_python_interpreter: "{% if vm_python_interpreter != '' %}{{ vm_python_interpreter }}{% else %}/usr/bin/python2{% endif %}"

  ```

+ 

+ 

+ [1]: https://fedoraproject.org/wiki/CI/Metadata

+ [2]: http://fmf.readthedocs.io/

@@ -6,7 +6,7 @@ 

  `roles/standard-test-beakerlib/vars/main.yml`:

  

   * **tests**: A list of beakerlib test files

-  * **fmf_filter**: An fmf filter to select tests based on test metadata [1]

+  * **fmf_filter**: An fmf filter to select tests based on test [metadata][1]

   * **artifacts**: An artifacts directory on localhost to store logs

   * **remote_artifacts**: The directory on the system under test where the logs

     are stored.  Note: if this variable is left undefined, it will default to
@@ -26,45 +26,55 @@ 

  

  Example usage:

  

-     - hosts: localhost

-       roles:

-       - role: standard-test-beakerlib

-         tags:

-         - classic

-         repositories:

-         - repo: "https://src.fedoraproject.org/tests/shell.git"

-           dest: "shell"

-         tests:

-         - shell/func

-         - shell/login

-         - shell/smoke

-         required_packages:

-         - expect

-         - which

+ ```yaml

+ - hosts: localhost

+   roles:

+   - role: standard-test-beakerlib

+     tags:

+     - classic

+     repositories:

+     - repo: "https://src.fedoraproject.org/tests/shell.git"

+       dest: "shell"

+     tests:

+     - shell/func

+     - shell/login

+     - shell/smoke

+     required_packages:

+     - expect

+     - which

+ ```

  

- Instead of manually listing all tests to be executed it is also

- possible to provide an fmf [1] filter in the following way:

+ # Flexible Metadata Format support

  

-     - hosts: localhost

-       roles:

-       - role: standard-test-beakerlib

-         tags:

-         - classic

-         repositories:

-         - repo: "https://src.fedoraproject.org/tests/shell.git"

-           dest: "shell"

-           fmf_filter: "tier: 1"

+ ## Filter required tests

+ 

+ Instead of manually listing all tests to be executed it is also possible to

+ provide an [fmf][1] filter in the following way:

+ 

+ ```yaml

+ - hosts: localhost

+   roles:

+   - role: standard-test-beakerlib

+     tags:

+     - classic

+     repositories:

+     - repo: "https://src.fedoraproject.org/tests/shell.git"

+       dest: "shell"

+       fmf_filter: "tier: 1"

+ ```

  

  Filter can be used also if tests are stored directly in the git:

  

-     - hosts: localhost

-       roles:

-       - role: standard-test-beakerlib

-         tags:

-         - classic

-         fmf_filter: "tier: 1"

+ ```yaml

+ - hosts: localhost

+   roles:

+   - role: standard-test-beakerlib

+     tags:

+     - classic

+     fmf_filter: "tier: 1"

+ ```

  

- See the Fedora CI metadata wiki [1] for more details and examples

- on test metadata.

+ See the Fedora CI [metadata wiki][1] for more details and examples on test

+ metadata.

  

- [1] https://fedoraproject.org/wiki/CI/Metadata

+ [1]: https://fedoraproject.org/wiki/CI/Metadata

@psss, hi, this PR describes how to use FMF with default provisioners. Could you please check?
Thank you!

Looks good to me. Perhaps it would make sense to add link to the CI/Metadata wiki also in the main README file.

rebased onto 78d5f1c6e1474bfc58e2b1bbaf1a5027fea7178c

5 years ago

rebased onto 753a6c62a1c4da241f63648685bfefcf3c77fe21

5 years ago

rebased onto c4e64db46f34ee6ac4f92651a35a1514a3a1ce9c

5 years ago

rebased onto c786f7c

5 years ago

Commit f323b30 fixes this pull-request

Pull-Request has been merged by astepano

5 years ago

Pull-Request has been merged by astepano

5 years ago