teuton 2.1.9 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +15 -12
- data/bin/check_teuton +0 -2
- data/docs/changelog/ideas.md +132 -0
- data/docs/changelog/v2.1.md +14 -122
- data/docs/changelog/v2.2.md +52 -28
- data/docs/changelog/version2.1.md +4 -0
- data/docs/commands/README.md +58 -15
- data/docs/commands/example_check.md +0 -4
- data/docs/commands/example_run.md +0 -4
- data/docs/dsl/README.md +1 -1
- data/docs/dsl/definition/result.md +1 -0
- data/docs/dsl/definition/run_remote.md +12 -6
- data/docs/dsl/definition/target.md +9 -10
- data/docs/dsl/execution/export.md +27 -20
- data/docs/install/README.md +13 -18
- data/docs/install/vagrant_docker.md +1 -1
- data/docs/learn/README.md +8 -8
- data/docs/learn/example-01-target.md +25 -25
- data/docs/learn/example-02-config.md +38 -49
- data/docs/learn/example-03-remote-hosts.md +22 -22
- data/docs/learn/{example-11-first-test.md → example-04-new-test.md} +23 -24
- data/docs/learn/{example-04-use.md → example-05-use.md} +6 -6
- data/docs/learn/{example-05-debug.md → example-06-debug.md} +8 -8
- data/docs/learn/{example-06-log.md → example-07-log.md} +7 -7
- data/docs/learn/example-08-readme.md +59 -0
- data/docs/learn/example-09-preserve.md +41 -0
- data/docs/videos.md +19 -0
- data/lib/teuton/application.rb +22 -3
- data/lib/teuton/case_manager/case/builtin/main.rb +3 -19
- data/lib/teuton/case_manager/case/builtin/package.rb +7 -6
- data/lib/teuton/case_manager/case/builtin/service.rb +9 -8
- data/lib/teuton/case_manager/case/builtin/teuton_file.rb +28 -0
- data/lib/teuton/case_manager/case/builtin/teuton_host.rb +31 -0
- data/lib/teuton/case_manager/case/builtin/user.rb +8 -7
- data/lib/teuton/case_manager/case/case.rb +1 -1
- data/lib/teuton/case_manager/case/dsl/goto.rb +2 -2
- data/lib/teuton/case_manager/case/dsl/log.rb +1 -1
- data/lib/teuton/case_manager/case/dsl/macro.rb +4 -1
- data/lib/teuton/case_manager/case/dsl/send.rb +2 -1
- data/lib/teuton/case_manager/case/play.rb +2 -0
- data/lib/teuton/case_manager/case/result/ext_compare.rb +16 -0
- data/lib/teuton/case_manager/case/result/result.rb +1 -1
- data/lib/teuton/case_manager/case/runner.rb +30 -4
- data/lib/teuton/case_manager/case_manager.rb +1 -1
- data/lib/teuton/case_manager/dsl.rb +10 -0
- data/lib/teuton/case_manager/export_manager.rb +24 -5
- data/lib/teuton/case_manager/utils.rb +1 -1
- data/lib/teuton/{project/laboratory → check}/builtin.rb +0 -0
- data/lib/teuton/{project/laboratory → check}/dsl.rb +40 -28
- data/lib/teuton/{project/laboratory → check}/laboratory.rb +3 -8
- data/lib/teuton/{project/laboratory → check}/show.rb +53 -59
- data/lib/teuton/cli.rb +85 -14
- data/lib/teuton/{project/readme → readme}/dsl.rb +0 -0
- data/lib/teuton/{project/readme → readme}/lang.rb +1 -1
- data/lib/teuton/{project/readme → readme}/readme.rb +22 -18
- data/lib/teuton/report/formatter/array_formatter.rb +13 -1
- data/lib/teuton/report/formatter/base_formatter.rb +18 -5
- data/lib/teuton/{project/skeleton.rb → skeleton.rb} +8 -20
- data/lib/teuton/utils/configfile_reader.rb +121 -0
- data/lib/teuton/{project → utils}/name_file_finder.rb +46 -26
- data/lib/teuton/version.rb +8 -0
- data/lib/teuton.rb +39 -32
- metadata +109 -61
- data/lib/teuton/case_manager/case/dsl/deprecated.rb +0 -14
- data/lib/teuton/cli/check.rb +0 -38
- data/lib/teuton/cli/main.rb +0 -6
- data/lib/teuton/cli/play.rb +0 -38
- data/lib/teuton/cli/readme.rb +0 -26
- data/lib/teuton/cli/version.rb +0 -12
- data/lib/teuton/project/configfile_reader.rb +0 -49
- data/lib/teuton/project/project.rb +0 -80
@@ -2,7 +2,6 @@
|
|
2
2
|
|
3
3
|
1. [Description](#description)
|
4
4
|
2. [Usage](#usage)
|
5
|
-
3. [Alias](#alias)
|
6
5
|
4. [Weight](#weight)
|
7
6
|
|
8
7
|
## Description
|
@@ -18,24 +17,24 @@ target "Write here your description"
|
|
18
17
|
* Define target description. Use your own words to describe it, so everybody could understand what is going to be measured.
|
19
18
|
* This text will be shown into reports to help us understand output information easily.
|
20
19
|
|
21
|
-
##
|
20
|
+
## Weight
|
22
21
|
|
23
|
-
|
22
|
+
By default weight is 1.0, but it's posible specified other value:
|
24
23
|
|
25
24
|
```ruby
|
26
|
-
target "Write here your description"
|
25
|
+
target "Write here your description", :weight => 2.5
|
27
26
|
```
|
28
27
|
|
29
|
-
|
28
|
+
## [DEPRECATED] Alias
|
29
|
+
|
30
|
+
`goal` keyword is an alias of `target`. So it's the same:
|
30
31
|
|
31
32
|
```ruby
|
32
|
-
|
33
|
+
target "Write here your description"
|
33
34
|
```
|
34
35
|
|
35
|
-
|
36
|
-
|
37
|
-
By default weight is 1.0, but it's posible specified other value:
|
36
|
+
or
|
38
37
|
|
39
38
|
```ruby
|
40
|
-
|
39
|
+
goal "Write here your description"
|
41
40
|
```
|
@@ -1,22 +1,14 @@
|
|
1
1
|
[<< back](../../README.md)
|
2
2
|
|
3
3
|
1. [Description](#description)
|
4
|
-
2. [
|
5
|
-
3. [
|
6
|
-
4. [
|
4
|
+
2. [Example](#example)
|
5
|
+
3. [Options](#options)
|
6
|
+
4. [Usage](#usage)
|
7
7
|
|
8
8
|
## Description
|
9
9
|
|
10
10
|
Create reports and save then into `var/TEST-NAME` folder.
|
11
11
|
|
12
|
-
## Usage
|
13
|
-
|
14
|
-
```ruby
|
15
|
-
play do
|
16
|
-
export
|
17
|
-
end
|
18
|
-
```
|
19
|
-
|
20
12
|
## Example
|
21
13
|
|
22
14
|
Run export and build reports using txt output format by default:
|
@@ -35,13 +27,28 @@ play do
|
|
35
27
|
end
|
36
28
|
```
|
37
29
|
|
38
|
-
##
|
30
|
+
## Options
|
31
|
+
|
32
|
+
1. **format**: txt, html, yaml. json, colored_text (txt with colors).
|
33
|
+
2. **preserve**: true, false.
|
34
|
+
|
35
|
+
## Usage
|
39
36
|
|
40
|
-
| Command | Description |
|
41
|
-
| ------------------------ | ----------- |
|
42
|
-
| `export` | Export report files using default ouput format |
|
43
|
-
| `export :format => :txt` | Export file using TXT ouput format |
|
44
|
-
| `export :format => :html` | Export file using HTML ouput format |
|
45
|
-
| `export :format => :yaml` | Export file using YAML ouput format |
|
46
|
-
| `export :format => :json` | Export file using JSON ouput format |
|
47
|
-
| `export :format => :colored_text` | Export file using colored TXT ouput format |
|
37
|
+
| | Command | Description |
|
38
|
+
| -- | ------------------------ | ----------- |
|
39
|
+
| 01 | `export` | Export report files using default ouput format |
|
40
|
+
| 02 | `export :format => :txt` | Export file using TXT ouput format |
|
41
|
+
| 03 | `export :format => :html` | Export file using HTML ouput format |
|
42
|
+
| 04 | `export :format => :yaml` | Export file using YAML ouput format |
|
43
|
+
| 05 | `export :format => :json` | Export file using JSON ouput format |
|
44
|
+
| 06 | `export :format => :colored_text` | Export file using colored TXT ouput format |
|
45
|
+
| 07 | `export :preserve => true` | Same as 01 example buy preserving report copies |
|
46
|
+
| 08 | `export :format => :html, :preserve => true` | Same as 03 example but preserving report copies |
|
47
|
+
| 09 | `export format: :html, preserve: true` | Same as 08 example |
|
48
|
+
| 12 | `export format: "txt"` | Same as 02 |
|
49
|
+
| 13 | `export format: "html"` | Same as 03 |
|
50
|
+
| 14 | `export format: "yaml"` | Same as 04 |
|
51
|
+
| 15 | `export format: "json"` | Same as 05 |
|
52
|
+
| 16 | `export format: "colored_text"` | Same as 06 |
|
53
|
+
| 17 | `export preserve: true` | Same as 07 |
|
54
|
+
| 18 | `export format: "html", preserve: true` | Same as 08 |
|
data/docs/install/README.md
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
# Installation
|
4
4
|
|
5
5
|
> Definitions:
|
6
|
-
> * **T-node**: Host where Teuton software is installed.
|
6
|
+
> * **T-node**: Host where Teuton software is installed. A T-NODE monitors several S-NODE hosts.
|
7
7
|
> * **S-node**: Host where SSH server is installed. This hosts are monitotized by T-NODE host.
|
8
8
|
>
|
9
9
|
> Read [Modes of use](modes_of_use.md) to know about different Teuton ways of using it.
|
@@ -13,18 +13,18 @@
|
|
13
13
|
* **Install** Teuton (T-NODE role host):
|
14
14
|
1. Install Ruby on your system.
|
15
15
|
2. `gem install teuton`
|
16
|
-
* Run `teuton version` to check
|
16
|
+
* Run `teuton version` to check the installed version.
|
17
17
|
|
18
|
-
> **PROBLEMS**: If you don't find `teuton`command (OpenSUSE distro), try this:
|
18
|
+
> **PROBLEMS**: If you don't find `teuton` command (OpenSUSE distro, for example), try this:
|
19
19
|
> * Option A:
|
20
|
-
> * `ruby -v`, display your current ruby version. Suppose it is 2.5.
|
20
|
+
> * `ruby -v`, display your current ruby version. Suppose it is "2.5".
|
21
21
|
> * Run `teuton.ruby2.5`, instead of `teuton`.
|
22
22
|
> * Option B:
|
23
23
|
> * `find /usr/lib64/ruby -name teuton`, to find absolute path to teuton command.
|
24
24
|
> * `sudo ln -s /PATH/TO/bin/teuton /usr/local/bin/teuton`, to create symbolic link to teuton command.
|
25
25
|
|
26
|
-
* **Update** with `gem teuton update`.
|
27
|
-
* **Uninstall** with `gem uninstall teuton
|
26
|
+
* **Update** Teuton with `gem teuton update`.
|
27
|
+
* **Uninstall** Teuton with `gem uninstall teuton`.
|
28
28
|
|
29
29
|
## S-NODE installation
|
30
30
|
|
@@ -33,17 +33,12 @@
|
|
33
33
|
---
|
34
34
|
# Other installation ways
|
35
35
|
|
36
|
-
**Scripts
|
37
|
-
*
|
38
|
-
*
|
36
|
+
**Scripts**: [Installation using scripts](scripts.md)
|
37
|
+
* These scripts run automatical installation for your OS.
|
38
|
+
* Choose this way if you don't know how to install Ruby on your system.
|
39
39
|
|
40
|
-
**Vagrant or Docker
|
41
|
-
*
|
40
|
+
**Vagrant or Docker**: [Installation using Vagrant or Docker](vagrant_docker.md)
|
41
|
+
* Choose this way if you plan to install Teuton into virtual machines or containers, and you are familiar with Vagrant and Docker technologies.
|
42
42
|
|
43
|
-
**Manual
|
44
|
-
* If you
|
45
|
-
|
46
|
-
---
|
47
|
-
Let's us known your installation difficulties.
|
48
|
-
|
49
|
-
Thanks!
|
43
|
+
**Manual**: [Manual installation](manual.md)
|
44
|
+
* If you want to install Teuton by your own, or there are not installation scripts for your OS, and you don't want to use Vagrant then... here you have information how to install all the required packages for Teuton.
|
@@ -25,7 +25,7 @@ Second, choose:
|
|
25
25
|
|
26
26
|
## 2.1 Pulling docker images from remote
|
27
27
|
|
28
|
-
Run this command to pull **dvarrui/teuton** image from Docker Hub and create teuton container:
|
28
|
+
Run this command to pull **dvarrui/teuton** image from Docker Hub and create "teuton" container:
|
29
29
|
|
30
30
|
`docker run --name teuton -v /home/teuton -i -t dvarrui/teuton /bin/bash`
|
31
31
|
|
data/docs/learn/README.md
CHANGED
@@ -11,14 +11,14 @@ Learn how to use Teuton language to write your own tests:
|
|
11
11
|
- [Example 01 - Target](example-01-target.md)
|
12
12
|
- [Example 02 - Config file](example-02-config.md)
|
13
13
|
- [Example 03 - Remote hosts](example-03-remote-hosts.md)
|
14
|
-
- [Example 04 -
|
15
|
-
- [Example 05 -
|
16
|
-
- [Example 06 -
|
17
|
-
- Example 07 -
|
18
|
-
- Example 08 - Readme
|
19
|
-
- Example 09 -
|
20
|
-
- Example 10 -
|
21
|
-
-
|
14
|
+
- [Example 04 - Create new test](example-04-new-test.md)
|
15
|
+
- [Example 05 - Use](example-05-use.md)
|
16
|
+
- [Example 06 - Debug](example-06-debug.md)
|
17
|
+
- [Example 07 - Log](example-07-log.md)
|
18
|
+
- [Example 08 - Readme](example-08-readme.md)
|
19
|
+
- [Example 09 - Preserve](example-09-preserve.md)
|
20
|
+
- Example 10 - Macros
|
21
|
+
- Example 11 - Alias
|
22
22
|
- [Videos](videos.md)
|
23
23
|
|
24
24
|
# Examples
|
@@ -1,16 +1,16 @@
|
|
1
1
|
[<< back](README.md)
|
2
2
|
|
3
|
-
1. [Definition section](#definition-section)
|
4
|
-
2. [Execution section](#execution-section)
|
5
|
-
3. [Run test](#run-test)
|
6
|
-
4. [Output reports](#output-reports)
|
7
|
-
|
8
3
|
# Example: learn-01-target
|
9
4
|
|
5
|
+
> This example is on GitHub repository at `examples/learn-01-target/`.
|
6
|
+
|
10
7
|
Let's learn how to create our first target.
|
11
8
|
A target is a feature you want to measure or check.
|
12
9
|
|
13
|
-
|
10
|
+
1. [Definition section](#definition-section)
|
11
|
+
2. [Execution section](#execution-section)
|
12
|
+
3. [Run test](#run-test)
|
13
|
+
4. [Output reports](#output-reports)
|
14
14
|
|
15
15
|
## Definition section
|
16
16
|
|
@@ -54,25 +54,25 @@ DSL keywords:
|
|
54
54
|
```bash
|
55
55
|
[INFO] ScriptPath => examples/learn-01-target/start.rb
|
56
56
|
[INFO] ConfigPath => examples/learn-01-target/config.yaml
|
57
|
-
[INFO] Pwd => /
|
57
|
+
[INFO] Pwd => /home/david/proy/repos/teuton.d/teuton
|
58
58
|
[INFO] TestName => learn-01-target
|
59
59
|
|
60
60
|
==================================
|
61
|
-
Executing [teuton] (version 2.
|
62
|
-
[INFO] Running in parallel (2020-
|
61
|
+
Executing [teuton] (version 2.2.0)
|
62
|
+
[INFO] Running in parallel (2020-10-10 12:29:34 +0100)
|
63
63
|
.
|
64
|
-
[INFO] Duration = 0.
|
64
|
+
[INFO] Duration = 0.002 (2020-10-10 12:29:34 +0100)
|
65
65
|
==================================
|
66
66
|
|
67
67
|
INITIAL CONFIGURATIONS
|
68
|
-
|
69
|
-
| tt_title | Executing [teuton] (version 2.
|
70
|
-
| tt_scriptname | examples/learn-01-target/start.rb
|
71
|
-
| tt_configfile | examples/learn-01-target/config.yaml
|
72
|
-
| tt_pwd | /
|
73
|
-
| tt_testname | learn-01-target
|
74
|
-
| tt_sequence | false
|
75
|
-
|
68
|
+
+---------------+----------------------------------------+
|
69
|
+
| tt_title | Executing [teuton] (version 2.2.0) |
|
70
|
+
| tt_scriptname | examples/learn-01-target/start.rb |
|
71
|
+
| tt_configfile | examples/learn-01-target/config.yaml |
|
72
|
+
| tt_pwd | /home/david/proy/repos/teuton.d/teuton |
|
73
|
+
| tt_testname | learn-01-target |
|
74
|
+
| tt_sequence | false |
|
75
|
+
+---------------+----------------------------------------+
|
76
76
|
|
77
77
|
CASE RESULTS
|
78
78
|
+------+-----------+-------+-------+
|
@@ -82,9 +82,9 @@ CASE RESULTS
|
|
82
82
|
|
83
83
|
FINAL VALUES
|
84
84
|
+-------------+---------------------------+
|
85
|
-
| start_time | 2020-
|
86
|
-
| finish_time | 2020-
|
87
|
-
| duration | 0.
|
85
|
+
| start_time | 2020-10-10 12:29:34 +0100 |
|
86
|
+
| finish_time | 2020-10-10 12:29:34 +0100 |
|
87
|
+
| duration | 0.002187719 |
|
88
88
|
+-------------+---------------------------+
|
89
89
|
```
|
90
90
|
|
@@ -116,7 +116,7 @@ GROUPS
|
|
116
116
|
01 (1.0/1.0)
|
117
117
|
Description : Create user david
|
118
118
|
Command : id david
|
119
|
-
Duration : 0.
|
119
|
+
Duration : 0.002 (local)
|
120
120
|
Alterations : find(david) & count
|
121
121
|
Expected : Greater than 0 (String)
|
122
122
|
Result : 1 (Integer)
|
@@ -124,9 +124,9 @@ GROUPS
|
|
124
124
|
RESULTS
|
125
125
|
+--------------+---------------------------+
|
126
126
|
| case_id | 01 |
|
127
|
-
| start_time | 2020-
|
128
|
-
| finish_time | 2020-
|
129
|
-
| duration | 0.
|
127
|
+
| start_time | 2020-10-10 12:29:34 +0100 |
|
128
|
+
| finish_time | 2020-10-10 12:29:34 +0100 |
|
129
|
+
| duration | 0.001781893 |
|
130
130
|
| unique_fault | 0 |
|
131
131
|
| max_weight | 1.0 |
|
132
132
|
| good_weight | 1.0 |
|
@@ -1,30 +1,30 @@
|
|
1
1
|
[<< back](README.md)
|
2
2
|
|
3
|
-
1. [Config file](#config-file).
|
4
|
-
2. [Definition section](#definition-section).
|
5
|
-
3. [Execution section](#execution-section).
|
6
|
-
4. [Results](#results).
|
7
|
-
|
8
3
|
# Example: learn-02-config
|
9
4
|
|
10
|
-
This example is on GitHub repository at `examples/learn-02-config`.
|
5
|
+
> This example is on GitHub repository at `examples/learn-02-config`.
|
11
6
|
|
12
7
|
* Learn how to use config file.
|
13
|
-
*
|
8
|
+
* Use params defined into config files.
|
14
9
|
* It's good idea save variable data separated into external config file.
|
15
10
|
|
11
|
+
1. [Config file](#config-file).
|
12
|
+
2. [Definition section](#definition-section).
|
13
|
+
3. [Execution section](#execution-section).
|
14
|
+
4. [Results](#results).
|
15
|
+
|
16
16
|
## Config file
|
17
17
|
|
18
18
|
By default, `config.yaml` is our config file. Let's an example:
|
19
19
|
|
20
20
|
```yaml
|
21
21
|
---
|
22
|
-
|
23
|
-
|
24
|
-
-
|
25
|
-
|
26
|
-
-
|
27
|
-
|
22
|
+
global:
|
23
|
+
cases:
|
24
|
+
- tt_members: Student-name-1
|
25
|
+
username: root
|
26
|
+
- tt_members: Student-name-2
|
27
|
+
username: vargas
|
28
28
|
```
|
29
29
|
|
30
30
|
## Definition section
|
@@ -34,7 +34,7 @@ By default, `start.rb` it's our main execution file.
|
|
34
34
|
```ruby
|
35
35
|
group "Reading params from config file" do
|
36
36
|
|
37
|
-
target "Create user #{
|
37
|
+
target "Create user #{get(:username)}"
|
38
38
|
run "id #{get(:username)}"
|
39
39
|
expect get(:username)
|
40
40
|
|
@@ -61,41 +61,29 @@ Runing this example and see `show` keyword output:
|
|
61
61
|
|
62
62
|
```bash
|
63
63
|
> teuton run --no-color examples/learn-02-config
|
64
|
-
|
65
|
-
|
66
|
-
[
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
==================================
|
76
|
-
|
77
|
-
INITIAL CONFIGURATIONS
|
78
|
-
+---------------+-------------------------------------------+
|
79
|
-
| tt_title | Executing [teuton] (version 2.1.9) |
|
80
|
-
| tt_scriptname | examples/learn-02-config/start.rb |
|
81
|
-
| tt_configfile | examples/learn-02-config/config.yaml |
|
82
|
-
| tt_pwd | /mnt/home/leap/proy/repos/teuton.d/teuton |
|
83
|
-
| tt_testname | learn-02-config |
|
84
|
-
| tt_sequence | false |
|
85
|
-
+---------------+-------------------------------------------+
|
86
|
-
|
87
|
-
CASE RESULTS
|
64
|
+
CONFIGURATION
|
65
|
+
+---------------+----------------------------------------+
|
66
|
+
| tt_title | Executing [teuton] (version 2.2.0) |
|
67
|
+
| tt_scriptname | examples/learn-02-config/start.rb |
|
68
|
+
| tt_configfile | examples/learn-02-config/config.yaml |
|
69
|
+
| tt_pwd | /home/david/proy/repos/teuton.d/teuton |
|
70
|
+
| tt_testname | learn-02-config |
|
71
|
+
| tt_sequence | false |
|
72
|
+
+---------------+----------------------------------------+
|
73
|
+
|
74
|
+
CASES
|
88
75
|
+------+----------------+-------+-------+
|
89
76
|
| CASE | MEMBERS | GRADE | STATE |
|
90
|
-
| 01 | Student-name-1 |
|
91
|
-
| 02 | Student-name-2 |
|
77
|
+
| 01 | Student-name-1 | 100 | |
|
78
|
+
| 02 | Student-name-2 | 0 | ? |
|
92
79
|
+------+----------------+-------+-------+
|
93
80
|
|
94
|
-
|
81
|
+
|
82
|
+
RESULTS
|
95
83
|
+-------------+---------------------------+
|
96
|
-
| start_time | 2020-
|
97
|
-
| finish_time | 2020-
|
98
|
-
| duration | 0.
|
84
|
+
| start_time | 2020-10-10 12:37:54 +0100 |
|
85
|
+
| finish_time | 2020-10-10 12:37:54 +0100 |
|
86
|
+
| duration | 0.002054143 |
|
99
87
|
+-------------+---------------------------+
|
100
88
|
```
|
101
89
|
|
@@ -124,12 +112,13 @@ CONFIGURATION
|
|
124
112
|
| username | root |
|
125
113
|
+-------------+-----------------+
|
126
114
|
|
115
|
+
|
127
116
|
GROUPS
|
128
|
-
-
|
117
|
+
- Reading params from config file
|
129
118
|
01 (1.0/1.0)
|
130
119
|
Description : Create user root (username)
|
131
120
|
Command : id root
|
132
|
-
Duration : 0.
|
121
|
+
Duration : 0.001 (local)
|
133
122
|
Alterations : find(root) & count
|
134
123
|
Expected : Greater than 0 (String)
|
135
124
|
Result : 1 (Integer)
|
@@ -137,9 +126,9 @@ GROUPS
|
|
137
126
|
RESULTS
|
138
127
|
+--------------+---------------------------+
|
139
128
|
| case_id | 01 |
|
140
|
-
| start_time | 2020-
|
141
|
-
| finish_time | 2020-
|
142
|
-
| duration | 0.
|
129
|
+
| start_time | 2020-10-10 12:37:54 +0100 |
|
130
|
+
| finish_time | 2020-10-10 12:37:54 +0100 |
|
131
|
+
| duration | 0.001762191 |
|
143
132
|
| unique_fault | 0 |
|
144
133
|
| max_weight | 1.0 |
|
145
134
|
| good_weight | 1.0 |
|
@@ -1,19 +1,19 @@
|
|
1
1
|
[<< back](README.md)
|
2
2
|
|
3
|
-
1. [Config file](#config-file)
|
4
|
-
2. [Definition section](#definition-section).
|
5
|
-
3. [Execution section](#execution-section).
|
6
|
-
4. [Results](#results).
|
7
|
-
|
8
3
|
# Example: learn-03-remote-hosts
|
9
4
|
|
10
|
-
This example is on GitHub repository at `examples/learn-03-remote-hosts`.
|
5
|
+
> This example is on GitHub repository at `examples/learn-03-remote-hosts`.
|
11
6
|
|
12
7
|
Summary:
|
13
8
|
* Check a group of remote hosts.
|
14
9
|
* Export reports using other output formats.
|
15
10
|
* Checking remote machine (host1) with Windows OS.
|
16
11
|
|
12
|
+
1. [Config file](#config-file)
|
13
|
+
2. [Definition section](#definition-section).
|
14
|
+
3. [Execution section](#execution-section).
|
15
|
+
4. [Results](#results).
|
16
|
+
|
17
17
|
## Config file
|
18
18
|
|
19
19
|
This configuration file contains:
|
@@ -23,22 +23,22 @@ This configuration file contains:
|
|
23
23
|
|
24
24
|
```yaml
|
25
25
|
---
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
-
|
39
|
-
|
40
|
-
|
41
|
-
|
26
|
+
global:
|
27
|
+
host1_username: root
|
28
|
+
host1_password: profesor
|
29
|
+
cases:
|
30
|
+
- tt_members: Darth Maul
|
31
|
+
host1_ip: 192.168.1.201
|
32
|
+
host1_hostname: siths
|
33
|
+
username: maul
|
34
|
+
- tt_members: R2D2
|
35
|
+
host1_ip: 192.168.1.202
|
36
|
+
host1_hostname: robots
|
37
|
+
username: r2d2
|
38
|
+
- tt_members: Obiwan Kenobi
|
39
|
+
host1_ip: 192.168.1.203
|
40
|
+
host1_hostname: jedis
|
41
|
+
username: obiwan
|
42
42
|
```
|
43
43
|
|
44
44
|
## Definition section
|
@@ -1,26 +1,27 @@
|
|
1
1
|
|
2
|
+
[<< back](README.md)
|
3
|
+
|
4
|
+
# Example: learn-04-new-test
|
5
|
+
|
6
|
+
> This example is on GitHub repository at `examples/learn-04-new-test`.
|
7
|
+
|
2
8
|
Steps:
|
3
9
|
1. Create skeleton
|
4
10
|
2. Personalize targets
|
5
11
|
3. Personalize configuration file
|
6
12
|
4. Run the challenge
|
7
13
|
|
8
|
-
---
|
9
|
-
|
10
14
|
## STEP 1: Create skeleton
|
11
15
|
|
12
16
|
Create skeleton for a new project: `teuton create foo`
|
13
17
|
|
14
18
|
```bash
|
15
|
-
$ teuton
|
19
|
+
$ teuton new foo
|
16
20
|
|
17
|
-
[INFO]
|
21
|
+
[INFO] Creating foo project skeleton
|
18
22
|
* Create dir => foo
|
19
|
-
* Create dir => foo/assets
|
20
|
-
* Create file => foo/start.rb
|
21
23
|
* Create file => foo/config.yaml
|
22
|
-
* Create file => foo
|
23
|
-
* Create file => foo/assets/README.md
|
24
|
+
* Create file => foo/start.rb
|
24
25
|
```
|
25
26
|
|
26
27
|
> It's posible to create these files by hand.
|
@@ -30,36 +31,32 @@ This command will create:
|
|
30
31
|
| File/Directory | Description |
|
31
32
|
| --------------- | -------------- |
|
32
33
|
| foo | Base directory |
|
33
|
-
| foo/assets | Base directory for assest (images and text files) |
|
34
34
|
| foo/start.rb | Main Script |
|
35
35
|
| foo/config.yaml | YAML configuration file |
|
36
|
-
| foo/.gitignore | Prevent uploading YAML files to git repository |
|
37
|
-
| foo/assets/README.md | Statement of practice |
|
38
36
|
|
39
37
|
---
|
40
38
|
|
41
39
|
## STEP 2: Personalize targets
|
42
40
|
|
43
|
-
Write your own targets using the keywords: `target`, `
|
41
|
+
Write your own targets using the keywords: `target`, `run` and `expect`. Let's see:
|
44
42
|
|
45
43
|
```ruby
|
46
44
|
group "Demo group" do
|
47
45
|
|
48
46
|
target "Exist </home/david> directory"
|
49
|
-
|
47
|
+
run "file /home/david", :on => :host1
|
50
48
|
expect ["/home/david", "directory"]
|
51
49
|
|
52
50
|
end
|
53
51
|
```
|
54
52
|
|
55
|
-
The above example checks if exists '
|
53
|
+
The above example checks if exists '/home/david' directory, into *host1* device.
|
56
54
|
|
57
55
|
> Let's see the keywords used:
|
58
56
|
>
|
59
57
|
> * `target "Exist </home/david> directory"`, Describe the target with our words, so every one could easily understand what we are trying
|
60
58
|
to check.
|
61
|
-
> * `
|
62
|
-
into the remote machine (host1).
|
59
|
+
> * `run "file /home/david", :on => :host1`, : Execute the command into the remote machine (host1).
|
63
60
|
> * `expect ["/home/david", "directory"]`: Compare command ouput with our expectations.
|
64
61
|
|
65
62
|
---
|
@@ -73,17 +70,17 @@ Use a YAML file (`foo/config.yaml`) or JSON for your own configurations. In this
|
|
73
70
|
```yaml
|
74
71
|
---
|
75
72
|
:global:
|
76
|
-
|
73
|
+
:host1_username: root
|
77
74
|
:cases:
|
78
|
-
- :tt_members:
|
79
|
-
|
80
|
-
|
81
|
-
- :tt_members:
|
82
|
-
|
83
|
-
|
75
|
+
- :tt_members: student-name-01
|
76
|
+
:host1_ip: 1.1.1.1
|
77
|
+
:host1_password: root-password-student-01
|
78
|
+
- :tt_members: student-name-02
|
79
|
+
:host1_ip: 2.2.2.2
|
80
|
+
:host1_password: root-password-student-02
|
84
81
|
```
|
85
82
|
|
86
|
-
> The above file configures 2
|
83
|
+
> The above file configures 2 differents cases with their own params. The script use this information when execute every case.
|
87
84
|
|
88
85
|
---
|
89
86
|
|
@@ -94,3 +91,5 @@ Now we only have to run the challenge:
|
|
94
91
|
```bash
|
95
92
|
$ teuton foo
|
96
93
|
```
|
94
|
+
|
95
|
+
Output files are saved into `var/foo` directory.
|
@@ -1,17 +1,17 @@
|
|
1
1
|
[<< back](README.md)
|
2
2
|
|
3
|
-
|
4
|
-
2. [Execution section](#execution-section)
|
5
|
-
3. [Users file](#users-file)
|
6
|
-
4. [Network file](#network-file)
|
3
|
+
# Example: learn-05-use
|
7
4
|
|
8
|
-
|
5
|
+
> This example is on GitHub repository at `examples/learn-05-use`.
|
9
6
|
|
10
7
|
Learn how to:
|
11
8
|
* Organize huge amount of groups/targets into several files.
|
12
9
|
* Checking Windows OS infrastructure (host1).
|
13
10
|
|
14
|
-
|
11
|
+
1. [Tree directory](#tree-directory)
|
12
|
+
2. [Execution section](#execution-section)
|
13
|
+
3. [Users file](#users-file)
|
14
|
+
4. [Network file](#network-file)
|
15
15
|
|
16
16
|
## Tree directory
|
17
17
|
|
@@ -1,24 +1,24 @@
|
|
1
1
|
|
2
2
|
[<< back](README.md)
|
3
3
|
|
4
|
-
|
5
|
-
2. [Execution section](#execution-section)
|
6
|
-
3. [Check test](#check-test)
|
7
|
-
4. [Debug](#debug)
|
4
|
+
# Example: learn-06-debug
|
8
5
|
|
9
|
-
|
6
|
+
> This example is on GitHub repository at `examples/learn-06-debug`.
|
10
7
|
|
11
8
|
Learn how to:
|
12
9
|
* Check test syntax.
|
13
10
|
* Debug your tests.
|
14
11
|
|
15
|
-
|
12
|
+
1. [Tree directory](#tree-directory)
|
13
|
+
2. [Execution section](#execution-section)
|
14
|
+
3. [Check test](#check-test)
|
15
|
+
4. [Debug](#debug)
|
16
16
|
|
17
17
|
## Tree directory
|
18
18
|
|
19
19
|
```bash
|
20
|
-
$ tree learn/learn-
|
21
|
-
example/learn-
|
20
|
+
$ tree learn/learn-06-debug
|
21
|
+
example/learn-06-debug
|
22
22
|
├── config.yaml
|
23
23
|
├── external.rb
|
24
24
|
├── internal.rb
|