teuton 2.4.0 → 2.4.2

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.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +9 -6
  3. data/docs/changelog/todo.md +10 -1
  4. data/docs/changelog/v2.4.md +5 -1
  5. data/docs/commands/README.md +8 -17
  6. data/docs/commands/example_check.md +4 -4
  7. data/docs/commands/example_run.md +10 -32
  8. data/docs/dsl/README.md +27 -39
  9. data/docs/dsl/{definition/expect.md → expect.md} +2 -18
  10. data/docs/dsl/{execution/export.md → export.md} +4 -8
  11. data/docs/dsl/{setting/get.md → get.md} +4 -10
  12. data/docs/dsl/{definition/group.md → group.md} +2 -7
  13. data/docs/dsl/{execution/play.md → play.md} +1 -6
  14. data/docs/dsl/{definition/result.md → result.md} +1 -6
  15. data/docs/dsl/{definition/run_remote.md → run.md} +57 -23
  16. data/docs/dsl/{execution/send.md → send.md} +1 -8
  17. data/docs/dsl/{setting/set.md → set.md} +1 -7
  18. data/docs/dsl/{execution/show.md → show.md} +7 -16
  19. data/docs/dsl/target.md +33 -0
  20. data/docs/ideas/todo.md +35 -115
  21. data/docs/install/README.md +26 -42
  22. data/docs/install/s-node.md +35 -0
  23. data/docs/install/t-node.md +76 -0
  24. data/docs/learn/01-cmd_new.md +28 -0
  25. data/docs/learn/{01-target.md → 02-target.md} +21 -28
  26. data/docs/learn/03-remote_hosts.md +59 -87
  27. data/docs/learn/04-config.md +147 -0
  28. data/docs/learn/05-use.md +25 -45
  29. data/docs/learn/06-cmd_check.md +50 -0
  30. data/docs/learn/07-target_weight.md +44 -0
  31. data/docs/learn/08-unique_values.md +70 -0
  32. data/docs/learn/09-send.md +20 -0
  33. data/docs/learn/10-debug.md +45 -0
  34. data/docs/learn/11-export.md +35 -0
  35. data/docs/learn/{09-preserve.md → 12-preserve.md} +1 -1
  36. data/docs/learn/13-feedback.md +49 -0
  37. data/docs/learn/14-moodle_id.md +24 -0
  38. data/docs/learn/{08-readme.md → 15-readme.md} +5 -9
  39. data/docs/learn/{13-include.md → 16-include.md} +1 -3
  40. data/docs/learn/{14-alias.md → 17-alias.md} +0 -0
  41. data/docs/learn/{07-log.md → 18-log.md} +19 -23
  42. data/docs/learn/{12-get_vars.md → 19-read_vars.md} +3 -3
  43. data/docs/learn/20-macros.md +49 -0
  44. data/docs/learn/{16-exit_codes.md → 21-exit_codes.md} +0 -0
  45. data/docs/learn/{10-result.md → 22-result.md} +3 -3
  46. data/docs/learn/23-test-code.md +54 -0
  47. data/docs/learn/24-test-sql.md +69 -0
  48. data/docs/learn/README.md +31 -32
  49. data/lib/teuton/application.rb +2 -5
  50. data/lib/teuton/case_manager/case/case.rb +2 -1
  51. data/lib/teuton/case_manager/case/dsl/expect.rb +3 -1
  52. data/lib/teuton/case_manager/case/dsl/goto.rb +1 -1
  53. data/lib/teuton/case_manager/case/dsl/log.rb +5 -3
  54. data/lib/teuton/case_manager/case/dsl/send.rb +2 -2
  55. data/lib/teuton/case_manager/case/dsl/target.rb +1 -1
  56. data/lib/teuton/case_manager/case/result/ext_compare.rb +20 -21
  57. data/lib/teuton/case_manager/case/result/ext_filter.rb +15 -8
  58. data/lib/teuton/case_manager/case_manager.rb +10 -8
  59. data/lib/teuton/check/show.rb +1 -1
  60. data/lib/teuton/files/config.yaml +1 -2
  61. data/lib/teuton/files/start.rb +4 -4
  62. data/lib/teuton/readme/dsl.rb +9 -1
  63. data/lib/teuton/readme/readme.rb +8 -1
  64. data/lib/teuton/report/formatter/base_formatter.rb +2 -0
  65. data/lib/teuton/report/formatter/formatter.rb +1 -0
  66. data/lib/teuton/report/show.rb +8 -0
  67. data/lib/teuton/version.rb +1 -1
  68. data/lib/teuton.rb +2 -1
  69. metadata +72 -54
  70. data/docs/dsl/definition/run_local.md +0 -33
  71. data/docs/dsl/definition/target.md +0 -40
  72. data/docs/install/scripts.md +0 -96
  73. data/docs/learn/02-config.md +0 -121
  74. data/docs/learn/04-new_test.md +0 -87
  75. data/docs/learn/06-debug.md +0 -110
  76. data/docs/learn/11-moodle_id.md +0 -19
@@ -1,121 +1,93 @@
1
1
  [<< back](README.md)
2
2
 
3
- # Example: 03-remote-hosts
3
+ # Remote hosts
4
4
 
5
- Summary:
6
- * Check a group of remote hosts.
7
- * Export reports using other output formats.
8
- * Checking remote machine (host1) with Windows OS.
5
+ To run test on remote host we have to define them into config file.
9
6
 
10
- 1. [Config file](#config-file)
11
- 2. [Definition section](#definition-section).
12
- 3. [Execution section](#execution-section).
13
- 4. [Results](#results).
14
-
15
- ## Config file
16
-
17
- This configuration file contains:
18
- * 2 global params denitions.
19
- * 3 cases.
20
- * 4 specific case params definitions.
7
+ Let's see an example with:
8
+ * 1 global param.
9
+ * 3 cases with 3 params.
21
10
 
22
11
  ```yaml
23
12
  ---
24
13
  global:
25
14
  host1_username: root
26
- host1_password: profesor
27
15
  cases:
28
- - tt_members: Darth Maul
16
+ - tt_members: student_1
29
17
  host1_ip: 192.168.1.201
30
- host1_hostname: siths
31
- username: maul
32
- - tt_members: R2D2
18
+ host1_password: secret_1
19
+ - tt_members: student_2
33
20
  host1_ip: 192.168.1.202
34
- host1_hostname: robots
35
- username: r2d2
36
- - tt_members: Obiwan Kenobi
37
- host1_ip: 192.168.1.203
38
- host1_hostname: jedis
39
- username: obiwan
21
+ host1_password: secret_2
22
+ - tt_members: student_3
23
+ host1_ip: 127.0.0.1
24
+ host1_password: secret_3
40
25
  ```
41
26
 
42
- ## Definition section
43
-
44
- Define 3 targets (items to be checked):
27
+ Every remote host definition require some params:
45
28
 
46
- ```ruby
47
- group "How to test remote Windows hosts" do
48
- target "Update hostname with #{gett(:host1_hostname)}"
49
- run "hostname", on: :host1
50
- expect_one get(:host1_hostname)
51
-
52
- target "Ensure network DNS configuration is working"
53
- run "nslookup www.google.es", on: :host1
54
- expect "Nombre:"
55
-
56
- target "Create user #{gett(:username)}"
57
- run "net user", on: :host1
58
- expect get(:username)
59
- end
60
- ```
29
+ | Param | Description | Default value |
30
+ | ----- | -------------- | ------------- |
31
+ | ip | Remote host IP | |
32
+ | port | Remote host port | 22 |
33
+ | username | Remote user account | Not required with public SSH id |
34
+ | password | Remote user pasword | Not required with public SSH id |
35
+ | protocol | SSH or Telner | SSH |
36
+ | route | Defines host2 used as gateway to reach host | |
61
37
 
62
- > NOTE: This example requires Windows OS on remote machine (host1).
38
+ ## Definition section
63
39
 
64
- ## Execution section
40
+ Define 1 target (item to be checked):
65
41
 
66
42
  ```ruby
67
- play do
68
- show
69
- # export using other output formats
70
- export format: :txt
71
- export format: :html
72
- send copy_to: :host1
43
+ group "Remote hosts" do
44
+ target "Create user david"
45
+ run "id david", on: :host1
46
+ expect "david"
73
47
  end
74
48
  ```
75
49
 
76
- * `show`, show process log on screen.
77
- * `export format: :txt`, create output reports files into `var/learn-03-remote-host/` directory using `txt` format.
78
- * `export format: :html`, create output reports into `var/learn-03-remote-host/` directory using `html` format.
79
-
80
- > Several output formats available: txt, colored_text, html, json and yaml.
81
-
82
- * `send copy_to: :host1` keyword copy output report into remote machine (host1).
50
+ > NOTE: This example requires GNU/Linux OS on remote machine (host1).
83
51
 
84
- ## Screen output
52
+ Execution:
85
53
 
86
54
  ```
55
+ > teuton run examples/03-remote_hosts
56
+
87
57
  CASE RESULTS
88
- +------+---------------+-------+-------+
89
- | CASE | MEMBERS | GRADE | STATE |
90
- | 01 | Darth Maul | 0.0 | ? |
91
- | - | - | 0.0 | |
92
- | 03 | Obiwan Kenobi | 0.0 | ? |
93
- +------+---------------+-------+-------+
58
+ +------+-----------+-------+-------+
59
+ | CASE | MEMBERS | GRADE | STATE |
60
+ | 01 | student_1 | 0.0 | ? |
61
+ | 02 | student_2 | 0.0 | ? |
62
+ | 03 | student_3 | 100.0 | |
63
+ +------+-----------+-------+-------+
94
64
 
95
65
  CONN ERRORS
96
- +------+---------------+-------+------------------+
97
- | CASE | MEMBERS | HOST | ERROR |
98
- | 01 | Darth Maul | host1 | host_unreachable |
99
- | 03 | Obiwan Kenobi | host1 | host_unreachable |
100
- +------+---------------+-------+------------------+
66
+ +------+-----------+-------+------------------+
67
+ | CASE | MEMBERS | HOST | ERROR |
68
+ | 01 | student_1 | host1 | host_unreachable |
69
+ | 02 | student_2 | host1 | host_unreachable |
70
+ +------+-----------+-------+------------------+
101
71
  ```
102
72
 
103
- ## Results
73
+ Notice that case-03 is 100% and conection works. It is running on localhost because has localhost IP (127.0.0.1)
74
+
75
+ Results:
104
76
 
105
77
  ```
106
- var
107
- └── 03-remote-hosts
108
- ├── case-01.json
109
- ├── case-01.txt
110
- ├── case-03.json
111
- ├── case-03.txt
112
- ├── moodle.csv
113
- ├── resume.json
114
- └── resume.txt
78
+ ❯ tree var/03-remote_hosts
79
+
80
+ var/03-remote_hosts
81
+ ├── case-01.txt
82
+ ├── case-02.txt
83
+ ├── case-03.txt
84
+ ├── moodle.csv
85
+ └── resume.txt
115
86
  ```
116
87
 
117
- * `case-01`, report with details about case 01 (maul)
118
- * Case 02 (r2ds) is skipped. So there are no report `case-02`.
119
- * `case-03`, report with details about case 03 (obiwan)
120
- * `resume`, report with global resumed information about all cases.
121
- * `moodle.csv`, CVS file with required fields to upload grades into Moodle eLearning platform.
88
+ ## tt_skip param
89
+
90
+ To disable a case, add skip param `tt_skip: true`.
91
+ * `tt_skip` it is true by default.
92
+ * `tt_skip: false` ignore this case.
93
+ * `tt_skip: true`, evaluate this case.
@@ -0,0 +1,147 @@
1
+ [<< back](README.md)
2
+
3
+ # config
4
+
5
+ _It's good idea save dinamic data into config file._
6
+
7
+ By default, `config.yaml` is our config file. Example:
8
+
9
+ ```yaml
10
+ global:
11
+ cases:
12
+ - tt_members: name_student_1
13
+ username: david
14
+ - tt_members: name_student_2
15
+ username: fran
16
+ ```
17
+
18
+ > **How to choose another config file?** Read this [document](../commands/example_run.md#3-choosing-config-file).
19
+
20
+ By default, `start.rb` it's our main execution file. Example:
21
+
22
+ ```ruby
23
+ group "Reading params from config file" do
24
+
25
+ target "Create user #{get(:username)}"
26
+ run "id #{get(:username)}"
27
+ expect get(:username)
28
+
29
+ end
30
+ ```
31
+
32
+ * [get](../dsl/get.md) keyword read params from configuration file. It's posible personalize tests with diferent values for every case.
33
+
34
+ ## Example
35
+
36
+ ```console
37
+ > teuton run examples/04-config
38
+
39
+ CASE RESULTS
40
+ +------+----------------+-------+-------+
41
+ | CASE | MEMBERS | GRADE | STATE |
42
+ | 01 | name_student_1 | 100.0 | ✔ |
43
+ | 02 | name_student_2 | 0.0 | ? |
44
+ +------+----------------+-------+-------+
45
+ ```
46
+
47
+ Reports:
48
+
49
+ ```
50
+ var/04-config
51
+ ├── case-01.txt
52
+ ├── case-02.txt
53
+ ├── moodle.csv
54
+ └── resume.txt
55
+ ```
56
+
57
+ Let's see case 01 report.
58
+
59
+ ```
60
+ > more var/04-config/case-01.txt
61
+
62
+ CONFIGURATION
63
+ +-------------+----------------+
64
+ | tt_members | name_student_1 |
65
+ | tt_sequence | false |
66
+ | tt_skip | false |
67
+ | tt_testname | 04-config |
68
+ | username | david |
69
+ +-------------+----------------+
70
+
71
+ GROUPS
72
+ - Reading params from config file
73
+ 01 (1.0/1.0)
74
+ Description : Create user david
75
+ Command : id david
76
+ Duration : 0.002 (local)
77
+ Alterations : find(david) & count
78
+ Expected : Greater than 0 (String)
79
+ Result : 1 (Integer)
80
+
81
+ RESULTS
82
+ +--------------+---------------------------+
83
+ | case_id | 01 |
84
+ | start_time | 2023-01-25 20:46:13 +0000 |
85
+ | finish_time | 2023-01-25 20:46:13 +0000 |
86
+ | duration | 0.001778546 |
87
+ | unique_fault | 0 |
88
+ | max_weight | 1.0 |
89
+ | good_weight | 1.0 |
90
+ | fail_weight | 0.0 |
91
+ | fail_counter | 0 |
92
+ | grade | 100 |
93
+ +--------------+---------------------------+```
94
+ ```
95
+
96
+ ## Using differents configuration files
97
+
98
+ Example with 3 config files (yaml files):
99
+
100
+ ```
101
+ ❯ tree examples/04-config
102
+
103
+ examples/04-config
104
+ ├── config.yaml
105
+ ├── rock.yaml
106
+ ├── start.rb
107
+ └── starwars.yaml
108
+ ```
109
+
110
+ Usign default config file (`config.yaml`):
111
+
112
+ ```
113
+ ❯ teuton run examples/04-config
114
+
115
+ CASE RESULTS
116
+ +------+----------------+-------+-------+
117
+ | CASE | MEMBERS | GRADE | STATE |
118
+ | 01 | name_student_1 | 100.0 | ✔ |
119
+ | 02 | name_student_2 | 0.0 | ? |
120
+ +------+----------------+-------+-------+
121
+ ```
122
+
123
+ Using `example/04-config/starwars.yaml`:
124
+
125
+ ```
126
+ ❯ teuton run --cname=starwars examples/04-config
127
+
128
+ CASE RESULTS
129
+ +------+------------+-------+-------+
130
+ | CASE | MEMBERS | GRADE | STATE |
131
+ | 01 | Yoda | 0.0 | ? |
132
+ | 02 | Darth Maul | 0.0 | ? |
133
+ +------+------------+-------+-------+
134
+ ```
135
+
136
+ Using `example/04-config/rock.yaml`:
137
+
138
+ ```
139
+ ❯ teuton run --cpath=examples/04-config/rock.yaml examples/04-config
140
+
141
+ CASE RESULTS
142
+ +------+------------+-------+-------+
143
+ | CASE | MEMBERS | GRADE | STATE |
144
+ | 01 | AC/DC band | 0.0 | ? |
145
+ | 02 | Muse band | 0.0 | ? |
146
+ +------+------------+-------+-------+
147
+ ```
data/docs/learn/05-use.md CHANGED
@@ -1,39 +1,28 @@
1
1
  [<< back](README.md)
2
2
 
3
- # Example: 05-use
3
+ # use
4
4
 
5
- Learn how to:
6
- * Organize huge amount of groups/targets into several files.
7
- * Checking Windows OS infrastructure (host1).
5
+ `use` keyword allow us organize huge amount of groups/targets into several files.
8
6
 
9
- 1. [Tree directory](#tree-directory)
10
- 2. [Execution section](#execution-section)
11
- 3. [Users file](#users-file)
12
- 4. [Network file](#network-file)
7
+ ## Example
13
8
 
14
- ## Tree directory
15
-
16
- This example has more files:
9
+ > This example requires Windows OS on remote machine.
17
10
 
18
11
  ```bash
19
- > tree example/04-use
20
-
21
- example/04-require
12
+ tree examples/05-use
13
+ examples/05-use
14
+ ├── lib
15
+ │   ├── network.rb
16
+ │   └── users.rb
22
17
  ├── config.yaml
23
- ├── network.rb
24
- ├── README.md
25
- ├── start.rb
26
- └── users.rb
18
+ └── start.rb
27
19
  ```
28
20
 
29
- ## Execution section
30
-
31
- Previous `start.rb` file is now splited in: start.rb, users.rb and network.rb.
32
-
33
- Let's see current `start.rb` file:
21
+ * `start.rb` file is now splited into: `start.rb`, `users.rb` and `network.rb`.
34
22
 
35
23
  ```ruby
36
- use 'users'
24
+ # File: start.rb
25
+ use 'lib/users'
37
26
  use 'network'
38
27
 
39
28
  play do
@@ -42,40 +31,31 @@ play do
42
31
  end
43
32
  ```
44
33
 
45
- * `use`, indicates external rb file that will be included/imported into main rb file. It's a good idea to organize project files, when the number of groups/targets is high.
46
-
47
- ## Users file
48
-
49
- > Require Windows OS on remote machine.
34
+ * `use`, indicates that we require external file, that will be imported into our start.rb file.
35
+ * Notice that you can specify relative route `use 'lib/users'`, or only filename `use 'network'`. In the second case, teuton will search a file with that name into project folders.
50
36
 
51
- Let's see `users.rb` file
37
+ > It's a good idea to organize project files, when the number of groups/targets is high.
52
38
 
53
39
  ```ruby
54
- group "Use file: User configuration" do
40
+ # File: users.rb
55
41
 
56
- target "Create user #{gett(:username)}"
42
+ group "Using file: users" do
43
+ target "Create user #{get(:username)}"
57
44
  run "net user", on: :host1
58
45
  expect get(:username)
59
-
60
46
  end
61
47
  ```
62
48
 
63
- ## Network file
64
-
65
- > Require Windows OS on remote machine.
66
-
67
- Let's see `network.rb` file:
68
-
69
49
  ```ruby
70
- group "Use file: Network configuracion" do
50
+ # File: network.rb
71
51
 
72
- target "Update computer name with #{gett(:host1_hostname)}"
52
+ group "Using file: network" do
53
+ target "Update computer name with #{get(:hostname)}"
73
54
  run "hostname", on: :host1
74
- expect_one get(:host1_hostname)
55
+ expect_one get(:hostname)
75
56
 
76
57
  target "Ensure DNS Server is working"
77
- run "nslookup www.google.es", on: :host1
78
- expect "Nombre:"
79
-
58
+ run "host www.google.es", on: :host1
59
+ expect "www.google.es has address "
80
60
  end
81
61
  ```
@@ -0,0 +1,50 @@
1
+
2
+ [<< back](README.md)
3
+
4
+ # check test
5
+
6
+ Check Teuton test syntax and show statistics.
7
+
8
+ ```
9
+ ❯ teuton check examples/05-use
10
+
11
+ +--------------------------+
12
+ | GROUP: Using file: users |
13
+ +--------------------------+
14
+ (001) target Create user get(username)
15
+ weight 1.0
16
+ run 'id get(username)' on host1
17
+ expect get(username) (String)
18
+
19
+ +----------------------------+
20
+ | GROUP: Using file: network |
21
+ +----------------------------+
22
+ (002) target Update computer name with get(hostname)
23
+ weight 1.0
24
+ run 'hostname' on host1
25
+ expect_one get(hostname) (String)
26
+
27
+ (003) target Ensure DNS Server is working
28
+ weight 1.0
29
+ run 'host www.google.es' on host1
30
+ expect www.google.es has address (String)
31
+
32
+ +-------------+-------+
33
+ | DSL Stats | Count |
34
+ +-------------+-------+
35
+ | Groups | 2 |
36
+ | Targets | 3 |
37
+ | Runs | 3 |
38
+ | * host1 | 3 |
39
+ | Uniques | 0 |
40
+ | Logs | 0 |
41
+ | | |
42
+ | Gets | 5 |
43
+ | * username | 3 |
44
+ | * hostname | 2 |
45
+ | Sets | 0 |
46
+ +-------------+-------+
47
+ +----------------------+
48
+ | Revising CONFIG file |
49
+ +----------------------+
50
+ ```
@@ -0,0 +1,44 @@
1
+ [<< back](README.md)
2
+
3
+ # Target weight
4
+
5
+ * Changing default target weight:
6
+
7
+ ```ruby
8
+ # File: network.rb
9
+
10
+ group "Using file: network" do
11
+ target "Update computer name with #{get(:hostname)}"
12
+ run "hostname", on: :host1
13
+ expect_one get(:hostname)
14
+
15
+ target "Ensure DNS Server is working", weight: 2.0
16
+ run "host www.google.es", on: :host1
17
+ expect "www.google.es has address "
18
+ end
19
+ ```
20
+
21
+ ```
22
+ ❯ teuton check examples/07-target_weight
23
+
24
+ +--------------------------+
25
+ | GROUP: Using file: users |
26
+ +--------------------------+
27
+ (001) target Create user get(username)
28
+ weight 1.0
29
+ run 'id get(username)' on host1
30
+ expect get(username) (String)
31
+
32
+ +----------------------------+
33
+ | GROUP: Using file: network |
34
+ +----------------------------+
35
+ (002) target Update computer name with get(hostname)
36
+ weight 1.0
37
+ run 'hostname' on host1
38
+ expect_one get(hostname) (String)
39
+
40
+ (003) target Ensure DNS Server is working
41
+ weight 2.0
42
+ run 'host www.google.es' on host1
43
+ expect www.google.es has address (String)
44
+ ```
@@ -0,0 +1,70 @@
1
+ [<< back](README.md)
2
+
3
+ # Unique value
4
+
5
+ * `unique NAME, VALUE` keyword defines unique values.
6
+ * All cases that do not comply with this requirement will obtain a score of 0 and it will be reflected in the reports.
7
+
8
+ Example:
9
+
10
+ ```ruby
11
+ # File: lib/unique.rb
12
+
13
+ group "Unique value: hostname" do
14
+ run "hostname -f", on: :host1
15
+
16
+ unique "Host name", result.value
17
+ end
18
+ ```
19
+
20
+ Cheking test:
21
+
22
+ ```
23
+ ❯ teuton check examples/08-unique_values
24
+
25
+ +--------------------------+
26
+ | GROUP: Using file: users |
27
+ +--------------------------+
28
+ (001) target Create user get(username)
29
+ weight 1.0
30
+ run 'id get(username)' on host1
31
+ expect get(username) (String)
32
+
33
+ +----------------------------+
34
+ | GROUP: Using file: network |
35
+ +----------------------------+
36
+ (002) target Update computer name with get(hostname)
37
+ weight 1.0
38
+ run 'hostname' on host1
39
+ expect_one get(hostname) (String)
40
+
41
+ (003) target Ensure DNS Server is working
42
+ weight 2.0
43
+ run 'host www.google.es' on host1
44
+ expect www.google.es has address (String)
45
+
46
+ +-------------------------------+
47
+ | GROUP: Unique value: hostname |
48
+ +-------------------------------+
49
+ run 'hostname -f' on host1
50
+ ! Unique value for <Host name>
51
+
52
+ +-------------+-------+
53
+ | DSL Stats | Count |
54
+ +-------------+-------+
55
+ | Groups | 3 |
56
+ | Targets | 3 |
57
+ | Runs | 4 |
58
+ | * host1 | 4 |
59
+ | Uniques | 1 |
60
+ | Logs | 1 |
61
+ | | |
62
+ | Gets | 5 |
63
+ | * username | 3 |
64
+ | * hostname | 2 |
65
+ | Sets | 0 |
66
+ +-------------+-------+
67
+ +----------------------+
68
+ | Revising CONFIG file |
69
+ +----------------------+
70
+ ```
@@ -0,0 +1,20 @@
1
+ [<< back](README.md)
2
+
3
+ # Send
4
+
5
+ * [export](../dsl/export.md) keyword generate reports into diferents formats:
6
+ * [send](../dsl/send.md) keyword send report copies to every remote host.
7
+
8
+ ## Example
9
+
10
+ ```ruby
11
+ play do
12
+ show
13
+ export
14
+ send copy_to: :host1
15
+ end
16
+ ```
17
+
18
+ * `show`, show process log on screen.
19
+ * `export`, create reports with `txt` format.
20
+ * `send copy_to: :host1`, copy output report into remote machine (host1).
@@ -0,0 +1,45 @@
1
+ [<< back](README.md)
2
+
3
+ # debug
4
+
5
+ * Debug your tests.
6
+
7
+ ```
8
+ > tree examples/10-debug
9
+
10
+ examples/10-debug
11
+ ├── config.yaml
12
+ ├── external.rb
13
+ ├── internal.rb
14
+ └── start.rb
15
+ ```
16
+
17
+ Tests grows and becames huge, with a lot of targets (That isn't a problem). Then, we organize them spliting into several files and invoke `use` keywork from our main rb file to load other files (That's good idea).
18
+
19
+ Sometimes we need to verify or check rb file consistency and syntax, and we will do it with `teuton check PATH/TO/PROJECT/FOLDER`.
20
+
21
+ ## Debug
22
+
23
+ Every time we invoke `run` keywork, an OS command is executed. The output is showed on screen and saved into **result** internal object.
24
+
25
+ We could debug it invoking `result.debug` into our tests. Let's see an example from `external.rb` file:
26
+
27
+ ```ruby
28
+ # File: external.rb
29
+
30
+ group "Windows: external configuration from localhost" do
31
+
32
+ target "From localhost, check if exist connectivity with #{get(:windows_ip)}"
33
+ run "ping #{get(:windows_ip)} -c 1"
34
+ result.debug
35
+ expect_one "0% packet loss"
36
+ result.debug
37
+
38
+ target "From localhost, check if Netbios-ssn service working on #{get(:windows_ip)}"
39
+ run "nmap -Pn #{get(:windows_ip)}"
40
+ expect "139/tcp", "open"
41
+
42
+ end
43
+ ```
44
+
45
+ `result.debug` it's usefull when you are verifying command output captured by Teuton.