teuton 2.9.4 → 2.9.6
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 +12 -8
- data/docs/changelog/changelog.2.md +9 -1
- data/docs/commands/README.md +33 -65
- data/docs/commands/{example_check.md → check-example.md} +2 -6
- data/docs/commands/{example_run.md → howto-run-tests.md} +16 -10
- data/docs/es/README.md +72 -0
- data/docs/es/aprender/01-cmd_new.md +27 -0
- data/docs/es/aprender/02-target.md +131 -0
- data/docs/es/aprender/README.md +36 -0
- data/docs/install/README.md +10 -6
- data/docs/install/s-node.md +3 -3
- data/docs/install/t-node.md +75 -6
- data/docs/learn/02-target.md +3 -2
- data/lib/teuton/case/config.rb +1 -1
- data/lib/teuton/case/dsl/expect.rb +1 -1
- data/lib/teuton/case/dsl/expect_sequence.rb +2 -2
- data/lib/teuton/case/dsl/run_script.rb +1 -1
- data/lib/teuton/case/dsl/unique.rb +1 -1
- data/lib/teuton/case/execute/execute_base.rb +2 -2
- data/lib/teuton/case/execute/execute_manager.rb +2 -2
- data/lib/teuton/case/execute/execute_ssh.rb +10 -10
- data/lib/teuton/case/execute/execute_telnet.rb +1 -1
- data/lib/teuton/case/host.rb +6 -6
- data/lib/teuton/case_manager/case_manager.rb +1 -0
- data/lib/teuton/case_manager/export_manager.rb +12 -4
- data/lib/teuton/case_manager/report.rb +1 -1
- data/lib/teuton/case_manager/show_report.rb +0 -1
- data/lib/teuton/check/dsl/all.rb +1 -1
- data/lib/teuton/check/show.rb +4 -4
- data/lib/teuton/deprecated/runner.rb +12 -12
- data/lib/teuton/readme/dsl/getset.rb +3 -3
- data/lib/teuton/readme/dsl/run.rb +3 -3
- data/lib/teuton/readme/readme.rb +1 -0
- data/lib/teuton/report/formatter/default/array.rb +1 -1
- data/lib/teuton/report/formatter/default/html.rb +1 -1
- data/lib/teuton/report/formatter/default/json.rb +3 -2
- data/lib/teuton/report/formatter/default/xml.rb +1 -1
- data/lib/teuton/report/formatter/default/yaml.rb +1 -1
- data/lib/teuton/report/formatter/moodle_csv_formatter.rb +1 -1
- data/lib/teuton/report/formatter/resume/array.rb +1 -1
- data/lib/teuton/report/formatter/resume/html.rb +1 -1
- data/lib/teuton/report/formatter/resume/json.rb +3 -2
- data/lib/teuton/report/formatter/resume/yaml.rb +1 -1
- data/lib/teuton/report/report.rb +2 -2
- data/lib/teuton/utils/configfile_reader.rb +2 -1
- data/lib/teuton/version.rb +1 -1
- metadata +20 -16
- data/docs/install/manual.md +0 -41
- data/docs/install/vagrant_docker.md +0 -56
- /data/docs/{diagram.md → devel/diagram.md} +0 -0
data/docs/install/t-node.md
CHANGED
|
@@ -30,7 +30,7 @@ Option B:
|
|
|
30
30
|
|
|
31
31
|
If you don't know how to install Ruby on your system, execute this script to run automatical installation for your OS.
|
|
32
32
|
|
|
33
|
-
**
|
|
33
|
+
**GNU/Linux installation**
|
|
34
34
|
|
|
35
35
|
Run this command as `root` user:
|
|
36
36
|
|
|
@@ -38,7 +38,7 @@ Run this command as `root` user:
|
|
|
38
38
|
wget -qO- https://raw.githubusercontent.com/teuton-software/teuton/master/install/linux/t-node_install.sh | bash
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
**
|
|
41
|
+
**Windows installation**
|
|
42
42
|
|
|
43
43
|
Requirements:
|
|
44
44
|
* Windows 7+ / Windows Server 2003+
|
|
@@ -50,7 +50,7 @@ Run this command on **PowerShell (PS)** as `Administrator` user:
|
|
|
50
50
|
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://raw.githubusercontent.com/teuton-software/teuton/master/install/windows/t-node_install.ps1'))
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
-
**
|
|
53
|
+
**Mac OS X installation**
|
|
54
54
|
|
|
55
55
|
Run this command as admin user (member of `admin` group):
|
|
56
56
|
|
|
@@ -58,14 +58,83 @@ Run this command as admin user (member of `admin` group):
|
|
|
58
58
|
curl -sL https://raw.githubusercontent.com/teuton-software/teuton/master/install/mac/t-node_install.sh | bash
|
|
59
59
|
```
|
|
60
60
|
|
|
61
|
-
# 4. Vagrant
|
|
61
|
+
# 4. Vagrant and Docker installation
|
|
62
62
|
|
|
63
63
|
Choose this way if you plan to install Teuton into virtual machines or containers, and you are familiar with Vagrant and Docker technologies.
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
## 4.1 Install using Vagrant
|
|
66
|
+
|
|
67
|
+
* First, install `Vagrant` and `VirtualBox` on your host.
|
|
68
|
+
* Create directory for vagrant project. For example, `mkdir teuton-vagrant`.
|
|
69
|
+
* Move into that directory: `cd teuton-vagrant`.
|
|
70
|
+
* Choose and download [Vagrantfile](../../install/vagrant).
|
|
71
|
+
* Run `vagrant up` to create your Virtual Machine.
|
|
72
|
+
|
|
73
|
+
## 4.2 Install using Docker
|
|
74
|
+
|
|
75
|
+
First:
|
|
76
|
+
* Install `docker` on your host.
|
|
77
|
+
|
|
78
|
+
Second, choose:
|
|
79
|
+
* Pulling docker image from remote or
|
|
80
|
+
* Rebuild local docker image.
|
|
81
|
+
|
|
82
|
+
## 4.2 Pulling docker images from remote
|
|
83
|
+
|
|
84
|
+
Run this command to pull **dvarrui/teuton** image from Docker Hub and create "teuton" container:
|
|
85
|
+
|
|
86
|
+
`docker run --name teuton -v /home/teuton -i -t dvarrui/teuton /bin/bash`
|
|
87
|
+
|
|
88
|
+
## 4.2 Rebuild local docker image
|
|
89
|
+
|
|
90
|
+
1. Create Dockerfile like this:
|
|
91
|
+
|
|
92
|
+
```
|
|
93
|
+
FROM debian:latest
|
|
94
|
+
|
|
95
|
+
MAINTAINER teuton 2.1
|
|
96
|
+
|
|
97
|
+
RUN apt-get update
|
|
98
|
+
RUN apt-get install -y apt-utils
|
|
99
|
+
RUN apt-get install -y vim tree
|
|
100
|
+
RUN apt-get install -y ruby
|
|
101
|
+
RUN gem install teuton
|
|
102
|
+
RUN mkdir /home/teuton
|
|
103
|
+
|
|
104
|
+
EXPOSE 80
|
|
105
|
+
|
|
106
|
+
WORKDIR /home/teuton
|
|
107
|
+
CMD ["/bin/bash"]
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
1. Build local docker image **dvarrui/teuton** with `docker build -t dvarrui/teuton .`
|
|
111
|
+
1. Create **teuton** container with `docker run --name teuton -v /home/teuton -i -t dvarrui/teuton /bin/bash`.
|
|
112
|
+
|
|
113
|
+
> Notice `/home/teuton` folder is persistent volume.
|
|
66
114
|
|
|
67
115
|
# 5. Source code
|
|
68
116
|
|
|
69
117
|
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.
|
|
70
118
|
|
|
71
|
-
|
|
119
|
+
Manual installation:
|
|
120
|
+
1. Git installation
|
|
121
|
+
* Install Git.
|
|
122
|
+
* Run `git --version` to show current version
|
|
123
|
+
1. Ruby installation
|
|
124
|
+
* Install ruby.
|
|
125
|
+
* Run `ruby -v` to show current version (2.1.3p242+)
|
|
126
|
+
1. Rake installation
|
|
127
|
+
* Run `gem install rake`, then
|
|
128
|
+
* `rake --version` to show current version (10.4.2+).
|
|
129
|
+
1. Download this project
|
|
130
|
+
* (a) `git clone https://github.com/dvarrui/teuton.git` or
|
|
131
|
+
* (b) Download and unzip [file](https://github.com/dvarrui/teuton-panel/archive/master.zip).
|
|
132
|
+
1. Move into Teuton folder
|
|
133
|
+
* Run `cd teuton`
|
|
134
|
+
1. Gems installation.
|
|
135
|
+
* `rake install:gems`, to install required gems.
|
|
136
|
+
1. Only for developers
|
|
137
|
+
* Run `rake install:debian` or
|
|
138
|
+
* `rake install:opensuse`, install gem for developers.
|
|
139
|
+
1. Final check
|
|
140
|
+
* `rake`
|
data/docs/learn/02-target.md
CHANGED
|
@@ -2,10 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
# target
|
|
4
4
|
|
|
5
|
-
A [target](../dsl/target.md) is a feature you want to check. Targets are defined into `group` sections
|
|
5
|
+
A [target](../dsl/target.md) is a feature you want to check. Targets are defined into `group` sections.
|
|
6
6
|
|
|
7
7
|
## Target definition
|
|
8
8
|
|
|
9
|
+
Every evaluation has 3 parts:
|
|
9
10
|
* [target](dsl/target.md): Description of the element to be tested.
|
|
10
11
|
* [run](../dsl/run.md): Execute a command `id obiwan` on localhost.
|
|
11
12
|
* [expect](../dsl/expect.md): Verify that the result contains expected value.
|
|
@@ -32,7 +33,7 @@ When the user exists, we expect this words: `uid=, (obiwan), gid=`.
|
|
|
32
33
|
uid=1000(obiwan) gid=1000(obiwan) grupos=1000(obiwan)
|
|
33
34
|
```
|
|
34
35
|
|
|
35
|
-
But when user does not exist, we expect
|
|
36
|
+
But when user does not exist, we expect command fail.
|
|
36
37
|
|
|
37
38
|
```
|
|
38
39
|
> id vader
|
data/lib/teuton/case/config.rb
CHANGED
|
@@ -23,7 +23,7 @@ module DSL
|
|
|
23
23
|
@action_counter += 1
|
|
24
24
|
@action[:id] = @action_counter
|
|
25
25
|
if @result.exitcode < 0
|
|
26
|
-
# When exitcode is less than zero, it is because there has been
|
|
26
|
+
# When exitcode is less than zero, it is because there has been
|
|
27
27
|
# an error in the remote connection (SSH or Telnet)
|
|
28
28
|
@action[:check] = false
|
|
29
29
|
@action[:result] = @action[:output]
|
|
@@ -38,8 +38,8 @@ class ExpectSequence
|
|
|
38
38
|
|
|
39
39
|
def find_best_state
|
|
40
40
|
@states.each do |state|
|
|
41
|
-
state[:score] =
|
|
42
|
-
state[:fails] =
|
|
41
|
+
state[:score] = state[:steps].select { it }.size
|
|
42
|
+
state[:fails] = state[:steps].select { !it }.size
|
|
43
43
|
state[:ok] = (state[:fails] == 0)
|
|
44
44
|
end
|
|
45
45
|
best = @states[0]
|
|
@@ -5,7 +5,7 @@ module DSL
|
|
|
5
5
|
def run_script(script, args = {})
|
|
6
6
|
items = script.split(" ")
|
|
7
7
|
if items.size == 1
|
|
8
|
-
shell = args[:shell] || (get(:shell) != "NODATA" ? get(:shell) : nil)
|
|
8
|
+
shell = args[:shell] || ((get(:shell) != "NODATA") ? get(:shell) : nil)
|
|
9
9
|
script = "#{shell} #{script}" if shell
|
|
10
10
|
script = "#{script} #{args[:args]} " if args[:args]
|
|
11
11
|
end
|
|
@@ -41,8 +41,8 @@ class ExecuteBase
|
|
|
41
41
|
|
|
42
42
|
# TODO: text.gsub!('\r', '')
|
|
43
43
|
if [:default, "UTF-8"].include? encoding
|
|
44
|
-
text.encode!("UTF-8", invalid: :replace, :
|
|
45
|
-
return text.split("\n")
|
|
44
|
+
text.encode!("UTF-8", invalid: :replace, undef: :replace, replace: "")
|
|
45
|
+
return text.split("\n")
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
# Convert text from input ENCODING to UTF-8
|
|
@@ -31,8 +31,8 @@ class ExecuteManager
|
|
|
31
31
|
end
|
|
32
32
|
|
|
33
33
|
def run_on(host)
|
|
34
|
-
protocol = config.get("#{host}_protocol"
|
|
35
|
-
ip = config.get("#{host}_ip"
|
|
34
|
+
protocol = config.get(:"#{host}_protocol")
|
|
35
|
+
ip = config.get(:"#{host}_ip")
|
|
36
36
|
|
|
37
37
|
if protocol.to_s.downcase == "local" || host.to_s == "localhost"
|
|
38
38
|
# Protocol force => local
|
|
@@ -9,24 +9,24 @@ class ExecuteSSH < ExecuteBase
|
|
|
9
9
|
def call(input_hostname)
|
|
10
10
|
action[:conn_type] = :ssh
|
|
11
11
|
hostname = input_hostname.to_s
|
|
12
|
-
ip = config.get("#{hostname}_ip"
|
|
13
|
-
username = config.get("#{hostname}_username"
|
|
14
|
-
password = config.get("#{hostname}_password"
|
|
15
|
-
port = config.get("#{hostname}_port"
|
|
12
|
+
ip = config.get(:"#{hostname}_ip").to_s
|
|
13
|
+
username = config.get(:"#{hostname}_username").to_s
|
|
14
|
+
password = config.get(:"#{hostname}_password").to_s
|
|
15
|
+
port = config.get(:"#{hostname}_port").to_i
|
|
16
16
|
port = 22 if port.zero?
|
|
17
17
|
|
|
18
|
-
unless config.get("#{hostname}_route"
|
|
18
|
+
unless config.get(:"#{hostname}_route") == "NODATA"
|
|
19
19
|
# Reconfigure command with gateway. Example host1_route: IP.
|
|
20
20
|
# hostname2 = hostname ¿not used?
|
|
21
21
|
ip2 = ip
|
|
22
22
|
username2 = username
|
|
23
23
|
password2 = password
|
|
24
24
|
command2 = action[:command]
|
|
25
|
-
hostname = config.get("#{hostname}_route"
|
|
26
|
-
ip = config.get("#{hostname}_ip"
|
|
27
|
-
username = config.get("#{hostname}_username"
|
|
28
|
-
password = config.get("#{hostname}_password"
|
|
29
|
-
ostype = config.get("#{hostname}_ostype"
|
|
25
|
+
hostname = config.get(:"#{hostname}_route")
|
|
26
|
+
ip = config.get(:"#{hostname}_ip").to_s
|
|
27
|
+
username = config.get(:"#{hostname}_username").to_s
|
|
28
|
+
password = config.get(:"#{hostname}_password").to_s
|
|
29
|
+
ostype = config.get(:"#{hostname}_ostype").to_s
|
|
30
30
|
|
|
31
31
|
action[:command] = if ostype.downcase.start_with? "win"
|
|
32
32
|
"echo y | plink #{username2}@#{ip2} -ssh -pw #{password2} \"#{command2}\""
|
data/lib/teuton/case/host.rb
CHANGED
|
@@ -34,11 +34,11 @@ class Case
|
|
|
34
34
|
|
|
35
35
|
def init(id)
|
|
36
36
|
@id = id.to_sym
|
|
37
|
-
@ip = @config.get("#{@id}_ip"
|
|
38
|
-
@username = @config.get("#{@id}_username"
|
|
39
|
-
@password = @config.get("#{@id}_password"
|
|
37
|
+
@ip = @config.get(:"#{@id}_ip").to_s
|
|
38
|
+
@username = @config.get(:"#{@id}_username").to_s
|
|
39
|
+
@password = @config.get(:"#{@id}_password").to_s
|
|
40
40
|
|
|
41
|
-
@protocol = @config.get("#{@id}_protocol"
|
|
41
|
+
@protocol = @config.get(:"#{@id}_protocol").to_s.downcase
|
|
42
42
|
if @protocol == "nodata"
|
|
43
43
|
@protocol = if @ip == "localhost" || @ip.start_with?("127.0.0.")
|
|
44
44
|
"local"
|
|
@@ -47,12 +47,12 @@ class Case
|
|
|
47
47
|
end
|
|
48
48
|
end
|
|
49
49
|
|
|
50
|
-
@port = @config.get("#{@id}_port"
|
|
50
|
+
@port = @config.get(:"#{@id}_port").to_i
|
|
51
51
|
if @port.zero?
|
|
52
52
|
default = {"local" => 0, "ssh" => 22, "telnet" => 23}
|
|
53
53
|
@port = default[@protocol]
|
|
54
54
|
end
|
|
55
|
-
@route = @config.get("#{@id}_route"
|
|
55
|
+
@route = @config.get(:"#{@id}_route")
|
|
56
56
|
end
|
|
57
57
|
|
|
58
58
|
def init_default
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
require "rainbow"
|
|
4
|
+
require_relative "../utils/project"
|
|
4
5
|
|
|
5
6
|
##
|
|
6
7
|
# Execute "export" order: Export every case report
|
|
@@ -57,13 +58,20 @@ class ExportManager
|
|
|
57
58
|
##
|
|
58
59
|
# Preserve output files for current project execution
|
|
59
60
|
def preserve_files
|
|
60
|
-
|
|
61
|
+
srcdir = File.join(
|
|
62
|
+
Project.value[:output_basedir],
|
|
63
|
+
Project.value[:test_name]
|
|
64
|
+
)
|
|
65
|
+
|
|
61
66
|
t = Time.now
|
|
62
|
-
data = {
|
|
67
|
+
data = {
|
|
68
|
+
year: t.year, month: t.month, day: t.day,
|
|
69
|
+
hour: t.hour, min: t.min, sec: t.sec
|
|
70
|
+
}
|
|
63
71
|
subdir = format("%<year>s%<month>02d%<day>02d-" \
|
|
64
72
|
"%<hour>02d%<min>02d%<sec>02d", data)
|
|
65
|
-
logdir = File.join(
|
|
66
|
-
|
|
73
|
+
logdir = File.join(srcdir, subdir)
|
|
74
|
+
|
|
67
75
|
puts "[INFO] Preserving files => #{logdir}"
|
|
68
76
|
FileUtils.mkdir(logdir)
|
|
69
77
|
Dir.glob(File.join(srcdir, "**.*")).each { |file| FileUtils.cp(file, logdir) }
|
|
@@ -26,7 +26,7 @@ class CaseManager
|
|
|
26
26
|
@report.tail[:finish_time] = finish_time
|
|
27
27
|
@report.tail[:duration] = finish_time - start_time
|
|
28
28
|
|
|
29
|
-
duration = format("%3.3f",
|
|
29
|
+
duration = format("%3.3f", finish_time - start_time)
|
|
30
30
|
verboseln Rainbow("\nFinished in #{duration} seconds").green
|
|
31
31
|
verboseln Rainbow("-" * 36).green
|
|
32
32
|
verboseln " "
|
data/lib/teuton/check/dsl/all.rb
CHANGED
data/lib/teuton/check/show.rb
CHANGED
|
@@ -61,7 +61,7 @@ class ShowCheck
|
|
|
61
61
|
end
|
|
62
62
|
if Project.value[:macros].size.positive?
|
|
63
63
|
st.add_row ["Macros", Project.value[:macros].size]
|
|
64
|
-
Project.value[:macros].each_key { st.add_row ["",
|
|
64
|
+
Project.value[:macros].each_key { st.add_row ["", it] }
|
|
65
65
|
end
|
|
66
66
|
st.add_row ["Groups", @stats[:groups]]
|
|
67
67
|
st.add_row ["Targets", @stats[:targets]]
|
|
@@ -87,11 +87,11 @@ class ShowCheck
|
|
|
87
87
|
|
|
88
88
|
if @stats[:sets].size.positive?
|
|
89
89
|
st.add_row ["Sets", @stats[:sets].size]
|
|
90
|
-
@stats[:sets].each { st.add_row ["",
|
|
90
|
+
@stats[:sets].each { st.add_row ["", it] }
|
|
91
91
|
end
|
|
92
92
|
if @stats[:uploads].size.positive?
|
|
93
93
|
st.add_row ["Uploads", @stats[:uploads].size]
|
|
94
|
-
@stats[:uploads].each { st.add_row ["",
|
|
94
|
+
@stats[:uploads].each { st.add_row ["", it] }
|
|
95
95
|
end
|
|
96
96
|
end
|
|
97
97
|
Logger.info my_screen_table.to_s + "\n"
|
|
@@ -114,7 +114,7 @@ class ShowCheck
|
|
|
114
114
|
script_vars << k.to_s + "_password"
|
|
115
115
|
end
|
|
116
116
|
end
|
|
117
|
-
@stats[:gets].keys.each { script_vars <<
|
|
117
|
+
@stats[:gets].keys.each { script_vars << it }
|
|
118
118
|
script_vars
|
|
119
119
|
end
|
|
120
120
|
end
|
|
@@ -9,8 +9,8 @@ class Case
|
|
|
9
9
|
# READ: @config
|
|
10
10
|
# WRITE: @action, @result, @session
|
|
11
11
|
def run_cmd_on(host)
|
|
12
|
-
protocol = @config.get("#{host}_protocol"
|
|
13
|
-
ip = @config.get("#{host}_ip"
|
|
12
|
+
protocol = @config.get(:"#{host}_protocol")
|
|
13
|
+
ip = @config.get(:"#{host}_ip")
|
|
14
14
|
|
|
15
15
|
if protocol.to_s.downcase == "local" || host.to_s == "localhost"
|
|
16
16
|
# Protocol force => local
|
|
@@ -59,24 +59,24 @@ class Case
|
|
|
59
59
|
def run_cmd_remote_ssh(input_hostname)
|
|
60
60
|
@action[:conn_type] = :ssh
|
|
61
61
|
hostname = input_hostname.to_s
|
|
62
|
-
ip = @config.get("#{hostname}_ip"
|
|
63
|
-
username = @config.get("#{hostname}_username"
|
|
64
|
-
password = @config.get("#{hostname}_password"
|
|
65
|
-
port = @config.get("#{hostname}_port"
|
|
62
|
+
ip = @config.get(:"#{hostname}_ip").to_s
|
|
63
|
+
username = @config.get(:"#{hostname}_username").to_s
|
|
64
|
+
password = @config.get(:"#{hostname}_password").to_s
|
|
65
|
+
port = @config.get(:"#{hostname}_port").to_i
|
|
66
66
|
port = 22 if port.zero?
|
|
67
67
|
|
|
68
|
-
unless @config.get("#{hostname}_route"
|
|
68
|
+
unless @config.get(:"#{hostname}_route") == "NODATA"
|
|
69
69
|
# Reconfigure command with gateway. Example host1_route: IP.
|
|
70
70
|
# hostname2 = hostname ¿not used?
|
|
71
71
|
ip2 = ip
|
|
72
72
|
username2 = username
|
|
73
73
|
password2 = password
|
|
74
74
|
command2 = @action[:command]
|
|
75
|
-
hostname = @config.get("#{hostname}_route"
|
|
76
|
-
ip = @config.get("#{hostname}_ip"
|
|
77
|
-
username = @config.get("#{hostname}_username"
|
|
78
|
-
password = @config.get("#{hostname}_password"
|
|
79
|
-
ostype = @config.get("#{hostname}_ostype"
|
|
75
|
+
hostname = @config.get(:"#{hostname}_route")
|
|
76
|
+
ip = @config.get(:"#{hostname}_ip").to_s
|
|
77
|
+
username = @config.get(:"#{hostname}_username").to_s
|
|
78
|
+
password = @config.get(:"#{hostname}_password").to_s
|
|
79
|
+
ostype = @config.get(:"#{hostname}_ostype").to_s
|
|
80
80
|
|
|
81
81
|
@action[:command] = if ostype.downcase.start_with? "win"
|
|
82
82
|
"echo y | plink #{username2}@#{ip2} -ssh -pw #{password2} \"#{command2}\""
|
|
@@ -14,11 +14,11 @@ module ReadmeDSL
|
|
|
14
14
|
def gett(value)
|
|
15
15
|
a = get(value)
|
|
16
16
|
if @cases_params.include? value
|
|
17
|
-
"[
|
|
17
|
+
"[" + value + "](#required-params)"
|
|
18
18
|
elsif @setted_params[value]
|
|
19
|
-
"[
|
|
19
|
+
"[" + value + "](#created-params)"
|
|
20
20
|
elsif @global_params.include? value
|
|
21
|
-
"[
|
|
21
|
+
"[" + a + "](#global-params)"
|
|
22
22
|
end
|
|
23
23
|
a
|
|
24
24
|
end
|
|
@@ -2,21 +2,21 @@ module ReadmeDSL
|
|
|
2
2
|
def goto(host = :localhost, args = {})
|
|
3
3
|
unless host == :localhost
|
|
4
4
|
b = {}
|
|
5
|
-
a = "#{host}_ip"
|
|
5
|
+
a = :"#{host}_ip"
|
|
6
6
|
if @config[:global][a].nil? && !@setted_params.include?(a)
|
|
7
7
|
@cases_params << a
|
|
8
8
|
end
|
|
9
9
|
b[:ip] = @config[:global][a] if @config[:global][a]
|
|
10
10
|
b[:ip] = @setted_params[a] if @setted_params[a]
|
|
11
11
|
|
|
12
|
-
a = "#{host}_username"
|
|
12
|
+
a = :"#{host}_username"
|
|
13
13
|
if @config[:global][a].nil? && !@setted_params.include?(a)
|
|
14
14
|
@cases_params << a
|
|
15
15
|
end
|
|
16
16
|
b[:username] = @config[:global][a] if @config[:global][a]
|
|
17
17
|
b[:username] = @setted_params[a] if @setted_params[a]
|
|
18
18
|
|
|
19
|
-
a = "#{host}_password"
|
|
19
|
+
a = :"#{host}_password"
|
|
20
20
|
if @config[:global][a].nil? && !@setted_params.include?(a)
|
|
21
21
|
@cases_params << a
|
|
22
22
|
end
|
data/lib/teuton/readme/readme.rb
CHANGED
data/lib/teuton/report/report.rb
CHANGED
|
@@ -28,7 +28,7 @@ class Report
|
|
|
28
28
|
report = Report.new
|
|
29
29
|
attrs = %i[id filename output_dir head lines tail format]
|
|
30
30
|
attrs.each do |attr|
|
|
31
|
-
attr_set = "#{attr}="
|
|
31
|
+
attr_set = :"#{attr}="
|
|
32
32
|
report.send(attr_set, send(attr).clone)
|
|
33
33
|
end
|
|
34
34
|
|
|
@@ -42,7 +42,7 @@ class Report
|
|
|
42
42
|
|
|
43
43
|
def export_resume(options)
|
|
44
44
|
format = options[:format]
|
|
45
|
-
@format = "resume_#{format}"
|
|
45
|
+
@format = :"resume_#{format}"
|
|
46
46
|
options[:format] = @format
|
|
47
47
|
filepath = File.join(@output_dir, @filename)
|
|
48
48
|
Formatter.call(self, options, filepath)
|
data/lib/teuton/version.rb
CHANGED