teuton 2.1.8 → 2.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +5 -8
- data/bin/check_teuton +43 -0
- data/docs/changelog/contributions.md +32 -0
- data/docs/changelog/v2.1.md +22 -0
- data/docs/changelog/v2.2.md +29 -0
- data/docs/commands/README.md +105 -7
- data/docs/commands/example_check.md +54 -0
- data/docs/commands/example_run.md +112 -0
- data/docs/dsl/README.md +11 -9
- data/docs/dsl/definition/expect.md +25 -21
- data/docs/dsl/definition/group.md +5 -1
- data/docs/dsl/definition/result.md +45 -34
- data/docs/dsl/definition/run_local.md +34 -0
- data/docs/dsl/definition/run_remote.md +119 -0
- data/docs/dsl/definition/target.md +6 -0
- data/docs/dsl/execution/export.md +27 -19
- data/docs/dsl/execution/play.md +4 -0
- data/docs/dsl/execution/send.md +21 -2
- data/docs/dsl/execution/show.md +13 -8
- data/docs/dsl/setting/get.md +24 -8
- data/docs/dsl/setting/set.md +8 -3
- data/docs/install/README.md +19 -26
- data/docs/install/modes_of_use.md +27 -26
- data/docs/install/scripts.md +53 -36
- data/docs/install/vagrant_docker.md +56 -0
- data/docs/learn/README.md +13 -6
- data/docs/learn/example-01-target.md +78 -61
- data/docs/learn/example-02-config.md +152 -0
- data/docs/learn/example-03-remote-hosts.md +31 -25
- data/docs/learn/example-04-use.md +23 -17
- data/docs/learn/example-05-debug.md +24 -17
- data/docs/learn/example-06-log.md +70 -0
- data/lib/teuton/application.rb +7 -4
- data/lib/teuton/case_manager/case/case.rb +4 -1
- data/lib/teuton/case_manager/case/dsl/expect.rb +3 -1
- data/lib/teuton/case_manager/case/dsl/goto.rb +12 -7
- data/lib/teuton/case_manager/case/dsl/macro.rb +38 -0
- data/lib/teuton/case_manager/case/dsl/main.rb +1 -2
- data/lib/teuton/case_manager/case/dsl/target.rb +1 -1
- data/lib/teuton/case_manager/case/runner.rb +7 -7
- data/lib/teuton/case_manager/case_manager.rb +1 -20
- data/lib/teuton/case_manager/check_cases.rb +12 -2
- data/lib/teuton/case_manager/dsl.rb +4 -6
- data/lib/teuton/case_manager/export_manager.rb +29 -3
- data/lib/teuton/case_manager/report.rb +29 -8
- data/lib/teuton/case_manager/show.rb +8 -4
- data/lib/teuton/cli.rb +1 -0
- data/lib/teuton/cli/play.rb +1 -0
- data/lib/teuton/cli/version.rb +1 -4
- data/lib/teuton/files/config.yaml +0 -1
- data/lib/teuton/files/start.rb +1 -1
- data/lib/teuton/files/template/case.html +135 -0
- data/lib/teuton/files/template/resume.html +115 -0
- data/lib/teuton/project/laboratory/builtin.rb +2 -1
- data/lib/teuton/project/laboratory/dsl.rb +13 -15
- data/lib/teuton/project/laboratory/laboratory.rb +5 -1
- data/lib/teuton/project/laboratory/show.rb +21 -13
- data/lib/teuton/project/name_file_finder.rb +6 -1
- data/lib/teuton/project/project.rb +7 -3
- data/lib/teuton/project/readme/dsl.rb +3 -1
- data/lib/teuton/project/readme/readme.rb +37 -26
- data/lib/teuton/project/skeleton.rb +20 -4
- data/lib/teuton/report/close.rb +15 -11
- data/lib/teuton/report/formatter/formatter_factory.rb +10 -6
- data/lib/teuton/report/formatter/html_formatter.rb +16 -79
- data/lib/teuton/report/formatter/resume_html_formatter.rb +39 -0
- data/lib/teuton/report/formatter/resume_yaml_formatter.rb +7 -1
- data/lib/teuton/report/report.rb +5 -4
- data/lib/teuton/report/show.rb +55 -26
- metadata +26 -39
- data/docs/changelog/todo.md +0 -46
- data/docs/commands/create_skeleton.md +0 -31
- data/docs/commands/help.md +0 -13
- data/docs/commands/revise_test.md +0 -46
- data/docs/commands/run_test_unit.md +0 -78
- data/docs/commands/show_version.md +0 -9
- data/docs/developers/01-telnet.md +0 -121
- data/docs/developers/02-ssh.md +0 -93
- data/docs/developers/03-encoding.md +0 -153
- data/docs/developers/comparative.md +0 -17
- data/docs/dsl/_Sidebar.md +0 -30
- data/docs/dsl/definition/goto.md +0 -112
- data/docs/dsl/definition/run.md +0 -23
- data/docs/install/tested_os.md +0 -25
- data/docs/install/vagrant.md +0 -9
- data/docs/learn/example-02-configfile.md +0 -174
- data/docs/learn/quick-demo.md +0 -170
- data/lib/teuton/case_manager/case/dsl/check.rb +0 -24
- data/lib/teuton/case_manager/case/dsl/missing.rb +0 -12
- data/lib/teuton/files/gitignore +0 -2
data/docs/learn/README.md
CHANGED
|
@@ -1,26 +1,33 @@
|
|
|
1
1
|
|
|
2
2
|
[<< back](../../README.md)
|
|
3
3
|
|
|
4
|
+
1. [Learning](#learning)
|
|
5
|
+
2. [Examples](#examples)
|
|
6
|
+
3. [Videos](#videos)
|
|
7
|
+
|
|
4
8
|
# Learning
|
|
5
9
|
|
|
6
|
-
Learn how to write your own tests
|
|
7
|
-
- [Quick demo](quick-demo.md)
|
|
10
|
+
Learn how to use Teuton language to write your own tests:
|
|
8
11
|
- [Example 01 - Target](example-01-target.md)
|
|
9
|
-
- [Example 02 - Config file](example-02-
|
|
12
|
+
- [Example 02 - Config file](example-02-config.md)
|
|
10
13
|
- [Example 03 - Remote hosts](example-03-remote-hosts.md)
|
|
11
14
|
- [Example 04 - Use](example-04-use.md)
|
|
12
15
|
- [Example 05 - Debug](example-05-debug.md)
|
|
16
|
+
- [Example 06 - Log](example-06-log.md)
|
|
17
|
+
- Example 07 - Preserve
|
|
18
|
+
- Example 08 - Readme
|
|
19
|
+
- Example 09 - Macros
|
|
20
|
+
- Example 10 - Alias
|
|
13
21
|
- [Example 11 - Create your first test](example-11-first-test.md)
|
|
14
22
|
- [Videos](videos.md)
|
|
15
23
|
|
|
16
|
-
|
|
17
|
-
# More examples
|
|
24
|
+
# Examples
|
|
18
25
|
|
|
26
|
+
More examples
|
|
19
27
|
* Let's see examples at [teuton-challenges](https://github.com/teuton-software/teuton-challenges) GitHub repository.
|
|
20
28
|
* Ask us by email at `teuton.software@protonmail.com` or Twitter at `@SoftwareTeuton`.
|
|
21
29
|
* [CHAPI19 - Spanish Teuton demo](https://github.com/dvarrui/proyectos-de-ejemplo/tree/master/charlas/teuton)
|
|
22
30
|
|
|
23
|
-
---
|
|
24
31
|
# Videos
|
|
25
32
|
|
|
26
33
|
By now there are no English videos. We are sorry!
|
|
@@ -1,5 +1,10 @@
|
|
|
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
|
+
|
|
3
8
|
# Example: learn-01-target
|
|
4
9
|
|
|
5
10
|
Let's learn how to create our first target.
|
|
@@ -7,26 +12,29 @@ A target is a feature you want to measure or check.
|
|
|
7
12
|
|
|
8
13
|
> This example is on GitHub repository at `examples/learn-01-target/`.
|
|
9
14
|
|
|
10
|
-
##
|
|
15
|
+
## Definition section
|
|
11
16
|
|
|
17
|
+
Test definition section (Group):
|
|
12
18
|
```ruby
|
|
13
|
-
group "
|
|
19
|
+
group "Learn about targets" do
|
|
14
20
|
|
|
15
|
-
target "
|
|
21
|
+
target "Create user david"
|
|
16
22
|
run "id david"
|
|
17
23
|
expect "david"
|
|
18
24
|
|
|
19
25
|
end
|
|
20
26
|
```
|
|
21
27
|
|
|
22
|
-
|
|
23
|
-
* **target**: Description of the
|
|
24
|
-
* **run**: Execute a command `id david` on localhost
|
|
25
|
-
* **expect**:
|
|
28
|
+
Define targets using these lines:
|
|
29
|
+
* **target**: Description of the element to be tested.
|
|
30
|
+
* **run**: Execute a command `id david` on localhost.
|
|
31
|
+
* **expect**: Ensure the result contains expected value.
|
|
26
32
|
|
|
27
33
|
> In this example, localhost's OS must be GNU/Linux (any other compatible OS) because the command used is `id david`.
|
|
28
34
|
|
|
29
|
-
##
|
|
35
|
+
## Execution section
|
|
36
|
+
|
|
37
|
+
Test execution section (Play):
|
|
30
38
|
|
|
31
39
|
```ruby
|
|
32
40
|
play do
|
|
@@ -35,81 +43,90 @@ play do
|
|
|
35
43
|
end
|
|
36
44
|
```
|
|
37
45
|
|
|
38
|
-
|
|
46
|
+
DSL keywords:
|
|
47
|
+
* **show**: display process information on screen.
|
|
48
|
+
* **export**: build output reports.
|
|
49
|
+
|
|
50
|
+
## Run test
|
|
51
|
+
|
|
52
|
+
**Let's see example**: Executing ` teuton run examples/learn-01-target` command.
|
|
39
53
|
|
|
40
54
|
```bash
|
|
41
|
-
|
|
42
|
-
[INFO]
|
|
43
|
-
[INFO]
|
|
55
|
+
[INFO] ScriptPath => examples/learn-01-target/start.rb
|
|
56
|
+
[INFO] ConfigPath => examples/learn-01-target/config.yaml
|
|
57
|
+
[INFO] Pwd => /mnt/home/leap/proy/repos/teuton.d/teuton
|
|
44
58
|
[INFO] TestName => learn-01-target
|
|
59
|
+
|
|
45
60
|
==================================
|
|
46
|
-
Executing [teuton] (version 2.
|
|
47
|
-
[INFO] Running in parallel (
|
|
61
|
+
Executing [teuton] (version 2.1.9)
|
|
62
|
+
[INFO] Running in parallel (2020-04-18 21:32:16 +0100)
|
|
48
63
|
.
|
|
49
|
-
[INFO] Duration = 0.
|
|
50
|
-
|
|
51
|
-
|
|
64
|
+
[INFO] Duration = 0.003 (2020-04-18 21:32:16 +0100)
|
|
52
65
|
==================================
|
|
66
|
+
|
|
53
67
|
INITIAL CONFIGURATIONS
|
|
54
|
-
|
|
55
|
-
| tt_title | Executing [teuton] (version 2.
|
|
56
|
-
| tt_scriptname | /
|
|
57
|
-
| tt_configfile | /
|
|
58
|
-
|
|
|
59
|
-
|
|
|
60
|
-
|
|
68
|
+
+---------------+-------------------------------------------+
|
|
69
|
+
| tt_title | Executing [teuton] (version 2.1.9) |
|
|
70
|
+
| tt_scriptname | examples/learn-01-target/start.rb |
|
|
71
|
+
| tt_configfile | examples/learn-01-target/config.yaml |
|
|
72
|
+
| tt_pwd | /mnt/home/leap/proy/repos/teuton.d/teuton |
|
|
73
|
+
| tt_testname | learn-01-target |
|
|
74
|
+
| tt_sequence | false |
|
|
75
|
+
+---------------+-------------------------------------------+
|
|
76
|
+
|
|
61
77
|
CASE RESULTS
|
|
62
|
-
|
|
63
|
-
|
|
|
64
|
-
|
|
|
65
|
-
|
|
78
|
+
+------+-----------+-------+-------+
|
|
79
|
+
| CASE | MEMBERS | GRADE | STATE |
|
|
80
|
+
| 01 | anonymous | 100.0 | |
|
|
81
|
+
+------+-----------+-------+-------+
|
|
82
|
+
|
|
66
83
|
FINAL VALUES
|
|
67
84
|
+-------------+---------------------------+
|
|
68
|
-
| start_time |
|
|
69
|
-
| finish_time |
|
|
70
|
-
| duration | 0.
|
|
85
|
+
| start_time | 2020-04-18 21:32:16 +0100 |
|
|
86
|
+
| finish_time | 2020-04-18 21:32:16 +0100 |
|
|
87
|
+
| duration | 0.003310235 |
|
|
71
88
|
+-------------+---------------------------+
|
|
72
89
|
```
|
|
73
90
|
|
|
74
|
-
##
|
|
91
|
+
## Output reports
|
|
75
92
|
|
|
76
|
-
Output reports
|
|
93
|
+
**Output directory**: reports created into `var/learn-01-target/` output directory.
|
|
77
94
|
|
|
78
95
|
```bash
|
|
79
|
-
var
|
|
80
|
-
|
|
81
|
-
|
|
96
|
+
var
|
|
97
|
+
└── learn-01-target
|
|
98
|
+
├── case-01.txt
|
|
99
|
+
├── moodle.csv
|
|
100
|
+
└── resume.txt
|
|
82
101
|
```
|
|
83
102
|
|
|
84
|
-
Let's see `
|
|
103
|
+
**Let's see example**: Executing `more var/learn-01-target/case-01.txt` command.
|
|
85
104
|
|
|
86
105
|
```bash
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
|
92
|
-
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
Expected : Greater than 0 (String)
|
|
106
|
-
Result : 1 (Integer)
|
|
106
|
+
CONFIGURATION
|
|
107
|
+
+-------------+-----------------+
|
|
108
|
+
| tt_members | anonymous |
|
|
109
|
+
| tt_sequence | false |
|
|
110
|
+
| tt_skip | false |
|
|
111
|
+
| tt_testname | learn-01-target |
|
|
112
|
+
+-------------+-----------------+
|
|
113
|
+
|
|
114
|
+
GROUPS
|
|
115
|
+
- Learn about targets
|
|
116
|
+
01 (1.0/1.0)
|
|
117
|
+
Description : Create user david
|
|
118
|
+
Command : id david
|
|
119
|
+
Duration : 0.003 (local)
|
|
120
|
+
Alterations : find(david) & count
|
|
121
|
+
Expected : Greater than 0 (String)
|
|
122
|
+
Result : 1 (Integer)
|
|
123
|
+
|
|
107
124
|
RESULTS
|
|
108
125
|
+--------------+---------------------------+
|
|
109
|
-
| case_id |
|
|
110
|
-
|
|
|
111
|
-
| finish_time |
|
|
112
|
-
| duration | 0.
|
|
126
|
+
| case_id | 01 |
|
|
127
|
+
| start_time | 2020-04-18 21:32:16 +0100 |
|
|
128
|
+
| finish_time | 2020-04-18 21:32:16 +0100 |
|
|
129
|
+
| duration | 0.002835857 |
|
|
113
130
|
| unique_fault | 0 |
|
|
114
131
|
| max_weight | 1.0 |
|
|
115
132
|
| good_weight | 1.0 |
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
[<< back](README.md)
|
|
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
|
+
# Example: learn-02-config
|
|
9
|
+
|
|
10
|
+
This example is on GitHub repository at `examples/learn-02-config`.
|
|
11
|
+
|
|
12
|
+
* Learn how to use config file.
|
|
13
|
+
* Tests use params defined into config files.
|
|
14
|
+
* It's good idea save variable data separated into external config file.
|
|
15
|
+
|
|
16
|
+
## Config file
|
|
17
|
+
|
|
18
|
+
By default, `config.yaml` is our config file. Let's an example:
|
|
19
|
+
|
|
20
|
+
```yaml
|
|
21
|
+
---
|
|
22
|
+
:global:
|
|
23
|
+
:cases:
|
|
24
|
+
- :tt_members: Student-name-1
|
|
25
|
+
:username: root
|
|
26
|
+
- :tt_members: Student-name-2
|
|
27
|
+
:username: vargas
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Definition section
|
|
31
|
+
|
|
32
|
+
By default, `start.rb` it's our main execution file.
|
|
33
|
+
|
|
34
|
+
```ruby
|
|
35
|
+
group "Reading params from config file" do
|
|
36
|
+
|
|
37
|
+
target "Create user #{gett(:username)}"
|
|
38
|
+
run "id #{get(:username)}"
|
|
39
|
+
expect get(:username)
|
|
40
|
+
|
|
41
|
+
end
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
In this section we define targets using keywords: target, run, expect and get.
|
|
45
|
+
|
|
46
|
+
* **get** keyword is used to read params from configuracion file. It's posible personalize tests with diferent values for every case.
|
|
47
|
+
|
|
48
|
+
> NOTE: In this example, we assume GNU/Linux as localhost's OS.
|
|
49
|
+
|
|
50
|
+
## Execution section
|
|
51
|
+
|
|
52
|
+
Main execution block:
|
|
53
|
+
```ruby
|
|
54
|
+
play do
|
|
55
|
+
show
|
|
56
|
+
export
|
|
57
|
+
end
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Runing this example and see `show` keyword output:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
> teuton run --no-color examples/learn-02-config
|
|
64
|
+
[INFO] ScriptPath => examples/learn-02-config/start.rb
|
|
65
|
+
[INFO] ConfigPath => examples/learn-02-config/config.yaml
|
|
66
|
+
[INFO] Pwd => /mnt/home/leap/proy/repos/teuton.d/teuton
|
|
67
|
+
[INFO] TestName => learn-02-config
|
|
68
|
+
|
|
69
|
+
==================================
|
|
70
|
+
Executing [teuton] (version 2.1.9)
|
|
71
|
+
[INFO] Running in parallel (2020-04-18 21:46:38 +0100)
|
|
72
|
+
id: «vargas»: no existe ese usuario
|
|
73
|
+
.F
|
|
74
|
+
[INFO] Duration = 0.004 (2020-04-18 21:46:38 +0100)
|
|
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
|
|
88
|
+
+------+----------------+-------+-------+
|
|
89
|
+
| CASE | MEMBERS | GRADE | STATE |
|
|
90
|
+
| 01 | Student-name-1 | 100.0 | |
|
|
91
|
+
| 02 | Student-name-2 | 0.0 | ? |
|
|
92
|
+
+------+----------------+-------+-------+
|
|
93
|
+
|
|
94
|
+
FINAL VALUES
|
|
95
|
+
+-------------+---------------------------+
|
|
96
|
+
| start_time | 2020-04-18 21:46:38 +0100 |
|
|
97
|
+
| finish_time | 2020-04-18 21:46:38 +0100 |
|
|
98
|
+
| duration | 0.003665655 |
|
|
99
|
+
+-------------+---------------------------+
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
## Results
|
|
103
|
+
|
|
104
|
+
Output reports are saved into `var/learn-02-config/` directory. Detail output report is created for every case.
|
|
105
|
+
|
|
106
|
+
```
|
|
107
|
+
var/learn-02-config
|
|
108
|
+
├── case-01.txt
|
|
109
|
+
├── case-02.txt
|
|
110
|
+
├── moodle.csv
|
|
111
|
+
└── resume.txt
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Let's see `export` keyword output for case 01.
|
|
115
|
+
|
|
116
|
+
```
|
|
117
|
+
> more var/learn-02-config/case-01.txt
|
|
118
|
+
CONFIGURATION
|
|
119
|
+
+-------------+-----------------+
|
|
120
|
+
| tt_members | Student-name-1 |
|
|
121
|
+
| tt_sequence | false |
|
|
122
|
+
| tt_skip | false |
|
|
123
|
+
| tt_testname | learn-02-config |
|
|
124
|
+
| username | root |
|
|
125
|
+
+-------------+-----------------+
|
|
126
|
+
|
|
127
|
+
GROUPS
|
|
128
|
+
- Using config file values
|
|
129
|
+
01 (1.0/1.0)
|
|
130
|
+
Description : Create user root (username)
|
|
131
|
+
Command : id root
|
|
132
|
+
Duration : 0.003 (local)
|
|
133
|
+
Alterations : find(root) & count
|
|
134
|
+
Expected : Greater than 0 (String)
|
|
135
|
+
Result : 1 (Integer)
|
|
136
|
+
|
|
137
|
+
RESULTS
|
|
138
|
+
+--------------+---------------------------+
|
|
139
|
+
| case_id | 01 |
|
|
140
|
+
| start_time | 2020-04-18 21:46:38 +0100 |
|
|
141
|
+
| finish_time | 2020-04-18 21:46:38 +0100 |
|
|
142
|
+
| duration | 0.002899065 |
|
|
143
|
+
| unique_fault | 0 |
|
|
144
|
+
| max_weight | 1.0 |
|
|
145
|
+
| good_weight | 1.0 |
|
|
146
|
+
| fail_weight | 0.0 |
|
|
147
|
+
| fail_counter | 0 |
|
|
148
|
+
| grade | 100 |
|
|
149
|
+
+--------------+---------------------------+
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
> **How to choose another config file?** Read this [document](../commands/example_run.md#3-choosing-config-file).
|
|
@@ -1,18 +1,25 @@
|
|
|
1
|
-
|
|
2
1
|
[<< back](README.md)
|
|
3
2
|
|
|
3
|
+
1. [Config file](#config-file)
|
|
4
|
+
2. [Definition section](#definition-section).
|
|
5
|
+
3. [Execution section](#execution-section).
|
|
6
|
+
4. [Results](#results).
|
|
7
|
+
|
|
4
8
|
# Example: learn-03-remote-hosts
|
|
5
9
|
|
|
6
|
-
|
|
10
|
+
This example is on GitHub repository at `examples/learn-03-remote-hosts`.
|
|
11
|
+
|
|
12
|
+
Summary:
|
|
7
13
|
* Check a group of remote hosts.
|
|
8
14
|
* Export reports using other output formats.
|
|
9
15
|
* Checking remote machine (host1) with Windows OS.
|
|
10
16
|
|
|
11
|
-
> This example is on GitHub repository at `examples/learn-03-remote-hosts`.
|
|
12
|
-
|
|
13
17
|
## Config file
|
|
14
18
|
|
|
15
|
-
|
|
19
|
+
This configuration file contains:
|
|
20
|
+
* 2 global params denitions.
|
|
21
|
+
* 3 cases.
|
|
22
|
+
* 4 specific case params definitions.
|
|
16
23
|
|
|
17
24
|
```yaml
|
|
18
25
|
---
|
|
@@ -34,37 +41,37 @@ Learn how to:
|
|
|
34
41
|
:username: obiwan
|
|
35
42
|
```
|
|
36
43
|
|
|
37
|
-
##
|
|
44
|
+
## Definition section
|
|
38
45
|
|
|
39
46
|
Define 3 targets (items to be checked):
|
|
40
47
|
|
|
41
48
|
```ruby
|
|
42
|
-
group "
|
|
49
|
+
group "How to test remote Windows hosts" do
|
|
43
50
|
|
|
44
|
-
target "
|
|
45
|
-
|
|
51
|
+
target "Update hostname with #{gett(:host1_hostname)}"
|
|
52
|
+
run "hostname", on: :host1
|
|
46
53
|
expect_one get(:host1_hostname)
|
|
47
54
|
|
|
48
|
-
target "DNS
|
|
49
|
-
|
|
55
|
+
target "Ensure network DNS configuration is working"
|
|
56
|
+
run "nslookup www.google.es", on: :host1
|
|
50
57
|
expect "Nombre:"
|
|
51
58
|
|
|
52
|
-
target "
|
|
53
|
-
|
|
59
|
+
target "Create user #{gett(:username)}"
|
|
60
|
+
run "net user", on: :host1
|
|
54
61
|
expect get(:username)
|
|
55
62
|
|
|
56
63
|
end
|
|
57
64
|
```
|
|
58
65
|
|
|
59
|
-
>
|
|
66
|
+
> NOTE: This example requires Windows OS on remote machine (host1).
|
|
60
67
|
|
|
61
|
-
## Execution
|
|
68
|
+
## Execution section
|
|
62
69
|
|
|
63
70
|
```ruby
|
|
64
71
|
play do
|
|
65
72
|
show
|
|
66
73
|
# export using other output formats
|
|
67
|
-
export :format => :
|
|
74
|
+
export :format => :txt
|
|
68
75
|
export :format => :json
|
|
69
76
|
send :copy_to => :host1
|
|
70
77
|
end
|
|
@@ -74,23 +81,22 @@ end
|
|
|
74
81
|
* `export :format => :json`, create output reports into `var/learn-03-remote-host/` directory. We can use diferents format to export: txt, colored_text, json and yaml.
|
|
75
82
|
* `send :copy_to => :host1` keyword copy output report into remote machine (host1).
|
|
76
83
|
|
|
77
|
-
##
|
|
84
|
+
## Results
|
|
78
85
|
|
|
79
86
|
```
|
|
80
|
-
$ tree var
|
|
81
87
|
var
|
|
82
88
|
└── learn-03-remote-hosts
|
|
83
|
-
├── case-01.colored_text
|
|
84
89
|
├── case-01.json
|
|
85
|
-
├── case-
|
|
86
|
-
├── case-02.json
|
|
87
|
-
├── case-03.colored_text
|
|
90
|
+
├── case-01.txt
|
|
88
91
|
├── case-03.json
|
|
89
|
-
├──
|
|
90
|
-
|
|
92
|
+
├── case-03.txt
|
|
93
|
+
├── moodle.csv
|
|
94
|
+
├── resume.json
|
|
95
|
+
└── resume.txt
|
|
91
96
|
```
|
|
92
97
|
|
|
93
98
|
* `case-01`, report with details about case 01 (maul)
|
|
94
|
-
*
|
|
99
|
+
* Case 02 (r2ds) is skipped. So there are no report `case-02`.
|
|
95
100
|
* `case-03`, report with details about case 03 (obiwan)
|
|
96
101
|
* `resume`, report with global resumed information about all cases.
|
|
102
|
+
* `moodle.csv`, CVS file with required fields to upload grades into Moodle eLearning platform.
|