Sha256: 30bd7d986b65931b0e1d904aa038fca021d3dee82d94e20c29f5f5a2fb8dc6be

Contents?: true

Size: 1.68 KB

Versions: 14

Compression:

Stored size: 1.68 KB

Contents

[<< back](README.md)

# Unique value

* `unique NAME, VALUE` keyword defines unique values.
* All cases that do not comply with this requirement will obtain a score of 0 and it will be reflected in the reports.

Example:

```ruby
# File: lib/unique.rb

group "Unique value: hostname" do
  run "hostname -f", on: :host1

  unique "Host name", result.value
end
```

Cheking test:

```
❯ teuton check examples/08-unique_values

+--------------------------+
| GROUP: Using file: users |
+--------------------------+
(001) target      Create user get(username)
      weight      1.0
      run         'id get(username)' on host1
      expect      get(username) (String)

+----------------------------+
| GROUP: Using file: network |
+----------------------------+
(002) target      Update computer name with get(hostname)
      weight      1.0
      run         'hostname' on host1
      expect_one  get(hostname) (String)

(003) target      Ensure DNS Server is working
      weight      2.0
      run         'host www.google.es' on host1
      expect      www.google.es has address  (String)

+-------------------------------+
| GROUP: Unique value: hostname |
+-------------------------------+
      run         'hostname -f' on host1
    ! Unique      value for <Host name>

+-------------+-------+
| DSL Stats   | Count |
+-------------+-------+
| Groups      | 3     |
| Targets     | 3     |
| Runs        | 4     |
|  * host1    | 4     |
| Uniques     | 1     |
| Logs        | 1     |
|             |       |
| Gets        | 5     |
|  * username | 3     |
|  * hostname | 2     |
| Sets        | 0     |
+-------------+-------+
+----------------------+
| Revising CONFIG file |
+----------------------+
```

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
teuton-2.9.2 docs/learn/08-unique_values.md
teuton-2.9.1 docs/learn/08-unique_values.md
teuton-2.9.0 docs/learn/08-unique_values.md
teuton-2.8.0 docs/learn/08-unique_values.md
teuton-2.7.3 docs/learn/08-unique_values.md
teuton-2.7.2 docs/learn/08-unique_values.md
teuton-2.7.1 docs/learn/08-unique_values.md
teuton-2.7.0 docs/learn/08-unique_values.md
teuton-2.6.0 docs/learn/08-unique_values.md
teuton-2.5.0 docs/learn/08-unique_values.md
teuton-2.4.5 docs/learn/08-unique_values.md
teuton-2.4.4 docs/learn/08-unique_values.md
teuton-2.4.3 docs/learn/08-unique_values.md
teuton-2.4.2 docs/learn/08-unique_values.md