teuton 2.11.0 → 3.0.1

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.
data/README.md CHANGED
@@ -83,33 +83,60 @@ Consult the generated [output files](examples/02-target/output.d/)
83
83
 
84
84
  # Documentation
85
85
 
86
- * Installation
86
+ 1. Installation
87
87
  * [Teuton installation](docs/install/t-node.md)
88
88
  * [SSH/Telnet installation](docs/install/s-node.md)
89
- * Teuton commands
90
- * [teuton config](docs/commands/config.md)
91
- * [teuton check](docs/commands/check.md)
92
- * [teuton help](docs/commands/help.md)
93
- * [teuton new](docs/commands/new.md)
94
- * [teuton readme](docs/commands/readme.md)
95
- * [teuton run](docs/commands/run.md)
96
- * [Learning guide](docs/learn/README.md). Learning to create tests by doing.
97
- * [Learning Examples](examples). The learning guide is based on these examples.
98
- * [Configuration file](docs/config_file.md)
99
- * [DSL - Language reference](docs/dsl/README.md). DSL used to define tests.
100
- * [expect](docs/dsl/expect.md)
101
- * [export](docs/dsl/export.md)
102
- * [get](docs/dsl/get.md)
103
- * [group](docs/dsl/group.md)
104
- * [play](docs/dsl/play.md)
105
- * [result](docs/dsl/result.md)
106
- * [run](docs/dsl/run.md)
107
- * [send](docs/dsl/send.md)
108
- * [set](docs/dsl/set.md)
109
- * [show](docs/dsl/show.md)
110
- * [target](docs/dsl/target.md)
111
- * [Modes of use](docs/modes_of_use.md): Classroom, contest, standalone.
112
- * [Blogs and videos](docs/videos.md)
89
+ 2. Teuton commands
90
+ * [teuton config](docs/commands/config.md): suggest config file.
91
+ * [teuton check](docs/commands/check.md): check test syntax.
92
+ * [teuton help](docs/commands/help.md): show command help.
93
+ * [teuton new](docs/commands/new.md): create new test.
94
+ * [teuton readme](docs/commands/readme.md): generate test documentation.
95
+ * [teuton run](docs/commands/run.md): run test.
96
+ 3. [Learning guide](docs/learn/README.md). Learn writing your own tests. [Examples](examples).
97
+ * [Create NEW test](docs/learn/01-cmd_new.md)
98
+ * [Evaluate TARGET](docs/learn/02-target.md)
99
+ * [Check REMOTE HOSTS](docs/learn/03-remote_hosts.md)
100
+ * [Read CONFIG file](docs/learn/04-config.md)
101
+ * [Use several files](docs/learn/05-use.md)
102
+ * [CHECK test syntax](docs/learn/06-cmd_check.md)
103
+ * [Target WEIGHT](docs/learn/07-target_weight.md)
104
+ * [UNIQUE values](docs/learn/08-unique_values.md)
105
+ * [SEND report copies to remote hosts](docs/learn/09-send.md)
106
+ * [DEBUG results](docs/learn/10-debug.md)
107
+ * [Export other FORMATS](docs/learn/11-export.md)
108
+ * [PRESERVE old reports](docs/learn/12-preserve.md)
109
+ * [Hide FEEDBACK from reports](docs/learn/13-feedback.md)
110
+ * [MOODLE](docs/learn/14-moodle_id.md)
111
+ * [Build README from test](docs/learn/15-readme.md)
112
+ * [INCLUDE more configuration files](docs/learn/16-include.md)
113
+ * [ALIAS](docs/learn/17-alias.md)
114
+ * [LOG messages](docs/learn/18-log.md)
115
+ * [Don't get params, just read vars](docs/learn/19-read_vars.md)
116
+ * [MACROS](docs/learn/20-macros.md)
117
+ * [Checking exit codes](docs/learn/21-exit_codes.md)
118
+ * [RESULT object](docs/learn/22-result.md)
119
+ * [How to test code](docs/learn/23-test-code.md)
120
+ * [How to test SQL and database](docs/learn/24-test-sql.md)
121
+ * [expect vs result](docs/learn/25-expect-result.md) TODO
122
+ * [EXPECT_SEQUENCE](docs/learn/26-expect_sequence.md)
123
+ * [RUN_SCRIPT](docs/learn/27-run_script.md)
124
+ * [UPLOAD](docs/learn/28-upload.md)
125
+ 4. [Configuration file](docs/config_file.md): Reserved params, configure hosts, etc.
126
+ 5. [Language reference](docs/dsl/README.md). DSL used to define tests.
127
+ * [expect](docs/dsl/expect.md): check run output with expectations.
128
+ * [export](docs/dsl/export.md): save evaluation reports.
129
+ * [get](docs/dsl/get.md): read config params.
130
+ * [group](docs/dsl/group.md): group targets.
131
+ * [play](docs/dsl/play.md): starts main execution.
132
+ * [result](docs/dsl/result.md): contains run output.
133
+ * [run](docs/dsl/run.md): execute command on local/remote host.
134
+ * [send](docs/dsl/send.md): send reports into remote machines.
135
+ * [set](docs/dsl/set.md): write new param.
136
+ * [show](docs/dsl/show.md): show progress on screen.
137
+ * [target](docs/dsl/target.md): define new target.
138
+ 6. [Modes of use](docs/modes_of_use.md): Classroom, contest, standalone.
139
+ 7. [More information](docs/more.md)
113
140
 
114
141
  # Contact
115
142
 
@@ -0,0 +1,52 @@
1
+ [<< back](../../README.md)
2
+
3
+ # Contributing
4
+
5
+ List of things to do, classified into 3 sections:
6
+ * (A) I know read and write.
7
+ * (B) I work as IT teacher
8
+ * (C) I want to program using Ruby language
9
+
10
+ > I write this list without any criteria.
11
+ > Only an unordered list of interesting/usefull things to be done.
12
+
13
+ ## Section A
14
+
15
+ Documentation
16
+
17
+ * Revise documentation.
18
+ * Make videos showing how to use this tool
19
+ * Video about download and install this tool
20
+ * Test installation scripts
21
+ * Vídeo with Windows installation.
22
+ * Video using examples 01 to 05...
23
+ * Write a special documentation for novice
24
+
25
+ ## Section B
26
+
27
+ * Create your own (simple or complex) teuton tests.
28
+ * Upload your own tests to github.com/teuton-software/challenge repository.
29
+ * Make videos showing how to create our own tests and run it on VMs.
30
+
31
+ ## Section C
32
+
33
+ Contact with us to help develop this tool.
34
+
35
+ 1. Make sure you have Ruby installed
36
+ 1. Fork it and clone it
37
+ 1. Create your feature branch (`git checkout -b my-new-feature`)
38
+ 1. Commit your changes (`git commit -am 'Add some feature'`)
39
+ 1. Push to the branch (`git push origin my-new-feature`)
40
+ 1. Create new Pull Request.
41
+
42
+ > You can also [create issues](https://github.com/teuton-software/teuton/issues) with your requests, incidences or suggestions.
43
+
44
+ **Development environment installation**
45
+
46
+ * git clone REPO
47
+ * install ruby-dev or ruby-devel
48
+ * debian => sudo apt install ruby-dev build-essential
49
+ * debian => ssh make gcc ruby-devel
50
+ * gem install bundler
51
+ * bundle install
52
+ * rake
@@ -0,0 +1,218 @@
1
+ [<< back](../../README.md)
2
+
3
+ # Roadmap Teuton v3.0.0 - 2026
4
+
5
+ # 1. Revisar
6
+
7
+ * Revisar (tests): result.grep(a).grep(b)
8
+ * "Limpiar" las funciones "deprecated"
9
+ * Aplicar las recomendaciones del informe de seguridad de Andrés.
10
+ * Eliminar/limpiar toda referencia a Vagrant.
11
+ * verify get(:key) and get('key') works fine!
12
+ * Formatter: xml
13
+
14
+ # 2. Documentacion
15
+
16
+ * Nuevo repo `teuton-book`: para documentación, tutoriales en español.
17
+ * Documentar y hacer videos. Tener foros de la comunidad o presencia en reddit o stackoverflow.... o algo parecido???
18
+ * Snode Dockerfile with SSH server
19
+ * **ngrok**:
20
+ * Doc ngrok use. Use cases and tutorial
21
+ * Doc host1_route combined with ngrok
22
+ * **PENSAR**: Script to set **static IP**
23
+
24
+ # 3. Features
25
+
26
+ ## 3.1. teuton readme -> teuton doc
27
+
28
+ * Renombrar "teuton readme" por "teuton doc".
29
+ * Modificar código, documentación y los ejemplos
30
+ * Modificar los ejemplos de dvarrui/teuton-tests
31
+ * Añadir opciones de lenguaje a `teuton doc`.
32
+ * Por defecto se usará `--lang=en`.
33
+ * Pero poder especificar el idioma usando el paráemetro `lang`. Por ejemplo :`teuton doc --lang=es`
34
+
35
+ ## 3.2. Feature: export stats on resume
36
+
37
+ Ampliar las estadísticas de salida en el report `resume`:
38
+ * Improve RESUME report or create stat-report, with stat information.
39
+ * the worst target/task/case,
40
+ * the best target/task/case,
41
+ * the slowest target/task/case,
42
+ * the fastest target/task/case, etc.
43
+ * Related targets: group of targets that always have the same state in every case.
44
+
45
+ ## 3.3. Feature: Eventos
46
+
47
+ Nueva feature "eventos".
48
+
49
+ * La idea está documentada mejor en el enlace siguiente.
50
+ * [Propuesta](https://github.com/dvarrui/teuton-book/blob/main/docs/03.eventos/index.md)
51
+
52
+ Idea antigua: `ensure`
53
+
54
+ * ensure: es como un target pero que no puntua
55
+ * Puede puntuar 0, poner grade a 0, dejar un log y terminar
56
+ * Puede puntuar 0 y dejar un log
57
+ * Puede puntuar negativo y dejar un log
58
+ * para controlar los hacking de los alias/fake scripts
59
+
60
+ ## 3.4. Feature: libs vs macros
61
+
62
+ libs/module
63
+
64
+ * Cambiar las macros por lib/modules
65
+ * Permitir crear librerías reutilizables
66
+ * bloques "TRE" target/run/expect
67
+ * Conjuntos de bloques <TRE>
68
+ * cualquier lógica reutilizable
69
+
70
+ ## 3.5 Integración con contenedores
71
+
72
+ Modificar el DSL/configuración para mejorar la integración con los contenidores Docker/podman:
73
+
74
+ > * Docker en vez de vagrant?? → https://www.cloudbees.com/blog/ssh-into-a-docker-container-how-to-execute-your-commands
75
+
76
+ Host definition example:
77
+
78
+ ```
79
+ host1_ip:
80
+ host1_port:
81
+ host1_username:
82
+ host1_password:
83
+
84
+ host1_docker_image: "debian:latest"
85
+ host1_docker_name (default value) -> "testname_hostname_case01" as dockername
86
+ host1_docker_preffix: (Code added to docker name) "idp" -> "idp_hostname_case01"
87
+
88
+ host1_docker_vol_rw: "_, _, _"
89
+ host1_docker_vol_ro: "_, _, _"
90
+ ```
91
+
92
+ * Folders to mount docker volumes
93
+ Create temp folders for every case/host.
94
+ but... When create theses folders?
95
+ (1) While running? This may be done automaticaly at running first step
96
+ It's easy but temp folders that not exists before running test
97
+ (2) Before run? New command as: "teuton create-temp" TESTNAME
98
+ It's usefull if we need to put files into temp folders (volumes)
99
+ before running test.
100
+
101
+ ```
102
+ var
103
+ └── test_1
104
+ └── tmp
105
+ ├── case01
106
+ │   ├── host1
107
+ │   └── host2
108
+ ├── case02
109
+ │   ├── host1
110
+ │   └── host2
111
+ └── case03
112
+    ├── host1
113
+    └── host2
114
+ ```
115
+
116
+ ## 3.6 SEND email
117
+
118
+ * `send :email_to => :members_emails`... esto requiere que cada caso tenga un email y que además el profesor tenga configurado el acceso a su cuenta de correo... para poder enviar copias de los informes....
119
+
120
+ ## 3.7 varios
121
+
122
+ * **HELP**. When students demand help they could recibe some advises. More ideas: bonus, lives, etc.
123
+
124
+ # 4. Refactor internal code
125
+
126
+ ## 4.1. Host object
127
+
128
+ * Host object so "host(:debian)" return a Host object so
129
+
130
+ ```
131
+ h = host(:debian)
132
+ h.ip -> get(:debian_ip)
133
+ h.username -> get(:debian_username)
134
+ h.password -> get(:debian_password)
135
+ h.port
136
+ h.route
137
+ h.protocol
138
+ ```
139
+
140
+ ## 4.2 Cambios internos
141
+
142
+ * Default port values ssh/telnet and default username values (root, Administrator)
143
+ * `expect_equal "camaleon"`, same as `expect result.equal "camaleon"`.
144
+ * RENAME
145
+ * Laboratory to Checker
146
+ * Add tt_label as alias of tt_members
147
+ * Unify messages ERROR, INFO, WARN. etc
148
+ * **TEST**:
149
+ * HallOfFame test
150
+ * actualizar las pruebas con vagrant para la versión actual. Mejora de la calidad del código (Todo lo de Vagrant debería estar deprecated).
151
+
152
+ ## 4.3 FEATURE - SAVE STATE
153
+
154
+ * Save case state or progress. var/tesname/states.db ¿?
155
+ * save partial grades. Before play challenge read previous moodle.cvs.
156
+ * Then play challenge and when creates new moodle.csv... we could preseve old cases(grades) 100% for example.
157
+ * Create 2 evaluation modes:
158
+ 1. Evaluate targets (current mode): `start eval: :targets`
159
+ 1. Evaluate task: `start eval: :groups` and perhaps add group weight?
160
+ 1. config file with `tt_eval: groups`
161
+
162
+ ## 4.4 varios
163
+
164
+ * Implement "scp" over Telnet ¿?
165
+ * Use travis???
166
+ * **FEATURE - EXPORT**. Sign reports generated with GPG... just to verify autenticity if needed.
167
+ * **PENSAR**: Change export to show full command output into reports.
168
+ * Propuestas de sdelquin
169
+ * Tablas "bonitas" en terminal → https://github.com/piotrmurach/tty-markdown#17-table
170
+ * Documentación en https://readthedocs.org/ ??
171
+ * FEATURE: Auto Parse new input format, and detect parse errors
172
+
173
+ # 5. Proyectos
174
+
175
+ Empezó como un nuevo feature pero por su dimensión, funcionalidad y características ha derivado en su propio proyecto indepemndiente:
176
+
177
+ * La gema `teuton-panel`
178
+
179
+ ## 5.1. Nueva gema teuton-panel (v2.0.0)
180
+
181
+ > Consultar en el repostorio `teuton-panel`. EN PROCESO!!!
182
+
183
+ Este TO-DO debería estar en el propio repo de la nueva gema.
184
+
185
+ * Crear nueva gema `teuton-panel` (v2) que sustituirá la versión obsoleta actual.
186
+ * Modificar/ampliar las funciones de `teuton config` para facilitar el trabajo a `teuton-panel`.
187
+ * tt_include
188
+ * tt_include_params
189
+ * aplanar/desaplanar config file.
190
+ * En las pruebas hemos usado `sinatra` para implementarlo.
191
+
192
+ Funcionalidades del interfaz web:
193
+
194
+ * config cases:
195
+ * config/remote:
196
+ * accept-remote-config. activar/desactivar configuraciones remotas
197
+ * Aceptar post formulario y vía get curl con ruta.
198
+ * config/list: mostrar listado con info de alumnos
199
+ * Elegir ubicación de almacenamiento de las configuraciones
200
+ * run:
201
+ * Ejecutar por el profesor
202
+ * Todos
203
+ * Una selección de cases
204
+ * every: repeticiones en bucle de I iteraciones, cada T tiempo.
205
+ * El alumno solicita su propia ejecución vía curl
206
+ * Elegir ubicación de almacenamiento de los informes
207
+ * Al finalizar cada ejecución se muestre un listado con los resultados
208
+ * readme/doc:
209
+ * activar auto "teuton doc" a página web para los alumnos.
210
+ * config panel:
211
+ * panel/new: crear fichero de configuración del panel
212
+ * panel/save: save configuración del panel
213
+
214
+ ## 5.2 Editor de tests
215
+
216
+ * Editor de tests ?! .... lo veo complejo... a menos que se empiece por una versión simplificada..
217
+ * El DSL es tan sencillo que no le veo sentido a un editor de retos.
218
+ * Pero si podemos aprovechar y crear una" librería " de los módulos más frecuentes?!... una ayuda para facilitar la creación de test... esto se puede emparejar con el editor de test...
data/docs/dsl/expect.md CHANGED
@@ -97,8 +97,10 @@ run 'cat /etc/passwd'
97
97
 
98
98
  Then we can check result with:
99
99
 
100
- * **expect result.find(/obiwan|kenobi/).count.eq(1)**, expect there exists only 1 line with "obiwan" or "kenobi".
101
- * **expect result.find(/darth/).find(/vader/).count.gt(2)**, expect there exists more than 2 lines with texts "darth" and "vader".
102
- * **expect result.not_find('#').find('yoda').count.lt(3)**, expects there exists less than 3 lines with text "yoda" and without "#" symbol.
100
+ ```ruby
101
+ expect result.find(/obiwan|kenobi/).count.eq(1) # only 1 line with "obiwan" or "kenobi".
102
+ expect result.find(/darth/).find(/vader/).count.gt(2) # more than 2 lines with texts "darth" and "vader".
103
+ expect result.not_find('#').find('yoda').count.lt(3) # less than 3 lines with text "yoda" and without "#" symbol.
104
+ ```
103
105
 
104
106
  Read more about [result](result.md) object.
@@ -4,6 +4,8 @@
4
4
 
5
5
  * ES - [Introducción a Teuton](https://elpuig.xeill.net/Members/vcarceler/articulos/introduccion-a-teuton): iniciarse en el uso de Teutón gracias al fantástico artículo de Víctor Carceler.
6
6
  * ES - [Verificar prácticas de GNS3 con Teuton](https://elpuig.xeill.net/Members/juanmorote/articulos/verificar-practicas-de-gns3-con-teuton): GNS3 es un excelente simulador de red Open Source que además se entiende con Teuton a las mil maravillas.
7
+ * ES - [teuton-book](https://github.com/dvarrui/teuton-book): Documentación y tutoriales sobre Teuton en español.
8
+ * Mores examples at [teuton-tests](https://github.com/dvarrui/teuton-tests) GitHub repository.
7
9
 
8
10
  # Videos
9
11
 
@@ -30,7 +30,7 @@ class BaseFormatter
30
30
 
31
31
  def trim(input)
32
32
  output = input.to_s
33
- output = "...#{input[input.size - 50, input.size]}" if output.size > 65
33
+ output = "...#{input[-50, input.size]}" if output.size > 65
34
34
  output.to_s
35
35
  end
36
36
  end
@@ -1,5 +1,5 @@
1
1
  module Teuton
2
- VERSION = "2.11.0"
2
+ VERSION = "3.0.1"
3
3
  APPNAME = "teuton"
4
4
  GEMNAME = "teuton"
5
5
  DOCKERNAME = "dvarrui/#{GEMNAME}"
data/lib/teuton.rb CHANGED
@@ -42,9 +42,9 @@ module Teuton
42
42
  require_relative dslpath
43
43
  begin
44
44
  require_relative Project.value[:script_path]
45
- rescue => e
46
- warn Rainbow.new("[ERROR] require_dsl_and_script: <#{e}>").bright.red
47
- warn Rainbow.new("[ERROR] Reading file #{Project.value[:script_path]}").bright.red
45
+ rescue StandardError => e
46
+ warn Rainbow("[ERROR] require_dsl_and_script: <#{e}>").bright.red
47
+ warn Rainbow("[ERROR] Reading file #{Project.value[:script_path]}").bright.red
48
48
  exit 1
49
49
  end
50
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teuton
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.11.0
4
+ version: 3.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Vargas Ruiz
@@ -131,9 +131,9 @@ extra_rdoc_files:
131
131
  - docs/commands/readme.md
132
132
  - docs/commands/run.md
133
133
  - docs/config_file.md
134
- - docs/devel/README.md
135
- - docs/devel/contributions.md
134
+ - docs/devel/contribute.md
136
135
  - docs/devel/diagram.md
136
+ - docs/devel/todo.md
137
137
  - docs/dsl/README.md
138
138
  - docs/dsl/expect.md
139
139
  - docs/dsl/export.md
@@ -183,8 +183,8 @@ extra_rdoc_files:
183
183
  - docs/learn/28-upload.md
184
184
  - docs/learn/README.md
185
185
  - docs/modes_of_use.md
186
+ - docs/more.md
186
187
  - docs/tutorial/es/nginx/README.md
187
- - docs/videos.md
188
188
  files:
189
189
  - LICENSE
190
190
  - README.md
@@ -197,9 +197,9 @@ files:
197
197
  - docs/commands/readme.md
198
198
  - docs/commands/run.md
199
199
  - docs/config_file.md
200
- - docs/devel/README.md
201
- - docs/devel/contributions.md
200
+ - docs/devel/contribute.md
202
201
  - docs/devel/diagram.md
202
+ - docs/devel/todo.md
203
203
  - docs/dsl/README.md
204
204
  - docs/dsl/expect.md
205
205
  - docs/dsl/export.md
@@ -249,8 +249,8 @@ files:
249
249
  - docs/learn/28-upload.md
250
250
  - docs/learn/README.md
251
251
  - docs/modes_of_use.md
252
+ - docs/more.md
252
253
  - docs/tutorial/es/nginx/README.md
253
- - docs/videos.md
254
254
  - lib/teuton.rb
255
255
  - lib/teuton/case/builtin/main.rb
256
256
  - lib/teuton/case/builtin/package.rb
@@ -349,7 +349,7 @@ files:
349
349
  - lib/teuton/version.rb
350
350
  homepage: https://github.com/teuton-software/teuton
351
351
  licenses:
352
- - GPL-3.0
352
+ - MPL-2.0
353
353
  metadata: {}
354
354
  rdoc_options: []
355
355
  require_paths:
@@ -365,7 +365,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
365
365
  - !ruby/object:Gem::Version
366
366
  version: '0'
367
367
  requirements: []
368
- rubygems_version: 3.7.2
368
+ rubygems_version: 4.0.10
369
369
  specification_version: 4
370
370
  summary: Teuton (Infrastructure test)
371
371
  test_files: []
data/docs/devel/README.md DELETED
@@ -1,12 +0,0 @@
1
-
2
- Development process:
3
-
4
- Process
5
- git clone REPO
6
- install ruby-dev or ruby-devel
7
- debian => sudo apt install ruby-dev build-essential
8
- debian => ssh make gcc ruby-devel
9
-
10
- gem install bundler
11
- bundle install
12
- rake
@@ -1,32 +0,0 @@
1
-
2
- # TO-DO list
3
-
4
- List of things to do, classified into 3 sections:
5
- * (A) I know read and write.
6
- * (B) I work as IT teacher
7
- * (C) I want to program ruby language
8
-
9
- > I write this list without any criteria.
10
- > Only an unordered list of interesting/usefull things to be done.
11
-
12
- ## Section A
13
-
14
- Documentation
15
-
16
- * Revise documentation.
17
- * Make videos showing how to use this tool
18
- * Video about download and install this tool
19
- * Test installation scripts
20
- * Vídeo with Windows installation.
21
- * Video using examples 01 to 05...
22
- * Write a special documentation for novice
23
-
24
- ## Section B
25
-
26
- * Create your own (simple or complex) teuton tests.
27
- * Upload your own tests to github.com/teuton-software/challenge repository.
28
-
29
- ## Section C
30
-
31
- * Contact with us to help develop this tool :-)
32
-