Ifd_Automation 2.9.4 → 2.9.5
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/lib/Ifd_Automation/database_helper.rb +68 -68
- data/lib/Ifd_Automation/file_helper.rb +30 -30
- data/lib/Ifd_Automation/mail_helper.rb +50 -50
- data/lib/Ifd_Automation/rest_helper.rb +77 -77
- data/lib/Ifd_Automation/soap_helper.rb +56 -56
- data/lib/Ifd_Automation/ssh_helper.rb +31 -31
- data/lib/Ifd_Automation/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1769e472551339c079ec798f299462bead4e77e445324e27b941f60079f78b00
|
4
|
+
data.tar.gz: eadcb14e690e25a587ac8fde7e3a3f671f257d8b720aaa7e3d0711b6883df53a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38e210be4b7e38b7a737321b378edcb3126a83d60fa0acecc2438dd95cd091603b2bf5a7b95a3f702abf11919b0d5476eb794fa7889002260321e7a8bcda51e5
|
7
|
+
data.tar.gz: 27f57f53fc333382c1871e67b502da91023edab0a4abfb1e5ea422eb12b909381e7c54e5ada118139ee419271f62159dd4a9ab1fda9b1ab017dab228ab6dfc7b
|
@@ -1,78 +1,78 @@
|
|
1
|
-
# require 'tiny_tds'
|
2
|
-
require 'activerecord-sqlserver-adapter'
|
3
|
-
require 'active_record'
|
1
|
+
# # require 'tiny_tds'
|
2
|
+
# require 'activerecord-sqlserver-adapter'
|
3
|
+
# require 'active_record'
|
4
4
|
|
5
|
-
def new_cnn(connection_params)
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
end
|
5
|
+
# def new_cnn(connection_params)
|
6
|
+
# begin
|
7
|
+
# put_log ("Connecting to database...")
|
8
|
+
# return ActiveRecord::Base.establish_connection(connection_params)
|
9
|
+
# rescue Exception => e
|
10
|
+
# raise e.message
|
11
|
+
# end
|
12
|
+
# end
|
13
13
|
|
14
|
-
def create_database_connection(data)
|
15
|
-
|
16
|
-
|
17
|
-
|
14
|
+
# def create_database_connection(data)
|
15
|
+
# unless data.hashes.empty?
|
16
|
+
# data = data.hashes[0]
|
17
|
+
# data = JSON.parse(data) unless data.is_a? Hash
|
18
18
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
end
|
19
|
+
# data.each_pair do |k, v|
|
20
|
+
# data[k] = check_dynamic_value(v)
|
21
|
+
# end
|
22
|
+
# @connection = new_cnn(data)
|
23
|
+
# put_log "Connect to database successfully!" if @connection
|
24
|
+
# end
|
25
|
+
# end
|
26
26
|
|
27
|
-
def close_database_connection
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
end
|
27
|
+
# def close_database_connection
|
28
|
+
# @connection.disconnect!
|
29
|
+
# if !@connection.connected?
|
30
|
+
# put_log "Disconnected to Database!"
|
31
|
+
# end
|
32
|
+
# end
|
33
33
|
|
34
|
-
def execute_select(script)
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
end
|
34
|
+
# def execute_select(script)
|
35
|
+
# script = check_dynamic_value(script)
|
36
|
+
# if @connection
|
37
|
+
# @result = @connection.connection.exec_query(script)
|
38
|
+
# else
|
39
|
+
# raise "ERROR: Create connection to database first!"
|
40
|
+
# end
|
41
|
+
# end
|
42
42
|
|
43
|
-
def execute_script(script)
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
end
|
43
|
+
# def execute_script(script)
|
44
|
+
# script = check_dynamic_value(script)
|
45
|
+
# if @connection
|
46
|
+
# @result = @connection.connection.execute(script)
|
47
|
+
# else
|
48
|
+
# raise "ERROR: Create connection to database first!"
|
49
|
+
# end
|
50
|
+
# end
|
51
51
|
|
52
|
-
def print_sql_result
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
end
|
52
|
+
# def print_sql_result
|
53
|
+
# if @result.present?
|
54
|
+
# @result.each do |row|
|
55
|
+
# p row
|
56
|
+
# end
|
57
|
+
# else
|
58
|
+
# p "WARNING: No result from SQL statement"
|
59
|
+
# end
|
60
|
+
# end
|
61
61
|
|
62
|
-
def verify_sql_result_with_json(json)
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
end
|
62
|
+
# def verify_sql_result_with_json(json)
|
63
|
+
# expected = JSON.parse(json)
|
64
|
+
# @result.each do |row|
|
65
|
+
# assert_string_equal(expected,row)
|
66
|
+
# end
|
67
|
+
# end
|
68
68
|
|
69
|
-
def verify_sql_result_with_json_node(json_node, value)
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
end
|
69
|
+
# def verify_sql_result_with_json_node(json_node, value)
|
70
|
+
# @result.each do|row|
|
71
|
+
# results = JsonPath.new(json_node).on(row).to_a.map(&:to_s)
|
72
|
+
# assert_string_equal(results[0], value)
|
73
|
+
# end
|
74
|
+
# end
|
75
75
|
|
76
|
-
def store_sql_result_into_string(string)
|
77
|
-
|
78
|
-
end
|
76
|
+
# def store_sql_result_into_string(string)
|
77
|
+
# set_var(string, @result)
|
78
|
+
# end
|
@@ -1,33 +1,33 @@
|
|
1
1
|
|
2
|
-
def delete_file(file_name)
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
end
|
2
|
+
# def delete_file(file_name)
|
3
|
+
# file_path = ($test_data_dir + file_name.gsub(" ", "_"))
|
4
|
+
# if File.exists?(file_path)
|
5
|
+
# File.delete(file_path)
|
6
|
+
# puts "#{file_name} is deleted successfully"
|
7
|
+
# else
|
8
|
+
# puts "File #{file_name} does not exists"
|
9
|
+
# end
|
10
|
+
# end
|
11
11
|
|
12
|
-
def read_file(file_name)
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
end
|
12
|
+
# def read_file(file_name)
|
13
|
+
# @file_data = ""
|
14
|
+
# file_path = $test_data_dir + file_name.downcase
|
15
|
+
# if File.exist?(file_path)
|
16
|
+
# file = File.open(file_path)
|
17
|
+
# @file_data += file.read
|
18
|
+
# file.close
|
19
|
+
# else
|
20
|
+
# raise "*** WARNING: File #{file_name} does not exist."
|
21
|
+
# end
|
22
|
+
# p @file_data
|
23
|
+
# end
|
24
24
|
|
25
|
-
def execute_windows_file(filename, file_location)
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
end
|
25
|
+
# def execute_windows_file(filename, file_location)
|
26
|
+
# file = file_location + filename
|
27
|
+
# p file
|
28
|
+
# if File.exist? file
|
29
|
+
# system("'"+file+"'")
|
30
|
+
# else
|
31
|
+
# raise "*** ERROR: File #{file} is not existed."
|
32
|
+
# end
|
33
|
+
# end
|
@@ -1,56 +1,56 @@
|
|
1
|
-
require 'mail'
|
2
|
-
# require 'email_spec'
|
3
|
-
# include EmailSpec::Helpers
|
4
|
-
# include EmailSpec::Matcher
|
1
|
+
# require 'mail'
|
2
|
+
# # require 'email_spec'
|
3
|
+
# # include EmailSpec::Helpers
|
4
|
+
# # include EmailSpec::Matcher
|
5
5
|
|
6
|
-
def send_email(raw_data)
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
6
|
+
# def send_email(raw_data)
|
7
|
+
# include Mail::Matchers
|
8
|
+
# raw_data.strip!
|
9
|
+
# header, body = raw_data.split(/\n\n/, 2) # 2: maximum number of fields
|
10
|
+
# conditions = {}
|
11
|
+
# header.split("\n").each do |row|
|
12
|
+
# if row.lstrip.chop.match(/^[a-z\-]+:/i)
|
13
|
+
# key, value = row.split(":", 2)
|
14
|
+
# conditions[key.gsub(' ','').underscore.to_sym] = value.gsub(' ','')
|
15
15
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
end
|
16
|
+
# end
|
17
|
+
# end
|
18
|
+
# conditions[:body] = body if body
|
19
|
+
# filepath = ($test_data_dir + conditions[:attachments] if conditions[:attachments])
|
20
|
+
# # Mail::TestMailer.deliveries.clear
|
21
|
+
# Mail.deliver do
|
22
|
+
# from "abc@gmail.com"
|
23
|
+
# to to_address if conditions[:to]
|
24
|
+
# subject subject if conditions[:subject]
|
25
|
+
# body body_email if conditions[:body]
|
26
|
+
# add_file attachments if filepath
|
27
|
+
# end
|
28
|
+
# end
|
29
29
|
|
30
|
-
def verify_receive_email(raw_data)
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
30
|
+
# def verify_receive_email(raw_data)
|
31
|
+
# raw_data.strip!
|
32
|
+
# header, body = raw_data.split(/\n\n/, 2) # 2: maximum number of fields
|
33
|
+
# conditions = {}
|
34
|
+
# header.split("\n").each do |row|
|
35
|
+
# if row.lstrip.chop.match(/^[a-z\-]+:/i)
|
36
|
+
# key, value = row.split(":", 2)
|
37
|
+
# conditions[key.gsub(' ','').underscore.to_sym] = value.gsub(' ','')
|
38
38
|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
39
|
+
# end
|
40
|
+
# end
|
41
|
+
# conditions[:body] = body.squeeze(' ').strip if body
|
42
|
+
# sleep 5
|
43
|
+
# emails = Mail.find(:what => :last, :count => 1)
|
44
44
|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
end
|
45
|
+
# if emails.instance_of? Mail::Message
|
46
|
+
# assert_string_equal(conditions[:from], emails.from[0].to_s)
|
47
|
+
# assert_string_equal(conditions[:subject], emails.subject)
|
48
|
+
# assert_string_contain(conditions[:body], emails.body)
|
49
|
+
# emails.attachments.each do |attachment|
|
50
|
+
# assert_string_equal(conditions[:attachments], attachment.filename)
|
51
|
+
# end if conditions[:attachments]
|
52
|
+
# else
|
53
|
+
# raise "WARNING: *** No new Email is found"
|
54
|
+
# end
|
55
|
+
# end
|
56
56
|
|
@@ -1,89 +1,89 @@
|
|
1
|
-
require 'httparty'
|
2
|
-
def set_headers(data)
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
# require 'httparty'
|
2
|
+
# def set_headers(data)
|
3
|
+
# unless data.hashes.empty?
|
4
|
+
# data = data.hashes[0]
|
5
|
+
# data = JSON.parse(data) unless data.is_a? Hash
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
end
|
7
|
+
# data.each_pair do |k, v|
|
8
|
+
# data[k] = check_dynamic_value(v)
|
9
|
+
# end
|
10
|
+
# @header = data
|
11
|
+
# end
|
12
|
+
# p "HEADER: #{@header}"
|
13
|
+
# end
|
14
14
|
|
15
|
-
def get_rest_result
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
end
|
15
|
+
# def get_rest_result
|
16
|
+
# if @response.nil?
|
17
|
+
# p "WARNING***: MISSING STEPS: Please send a REST request to get response first."
|
18
|
+
# end
|
19
|
+
# @response
|
20
|
+
# end
|
21
21
|
|
22
|
-
def store_json_node_result(json_node,string)
|
23
|
-
|
24
|
-
|
25
|
-
end
|
22
|
+
# def store_json_node_result(json_node,string)
|
23
|
+
# $context_value = JsonPath.new(json_node).on(get_rest_result.body).to_a.map(&:to_s)[0]
|
24
|
+
# set_var(string, '$context_value')
|
25
|
+
# end
|
26
26
|
|
27
|
-
def print_rest_code
|
28
|
-
|
29
|
-
end
|
27
|
+
# def print_rest_code
|
28
|
+
# puts "REST RESULT code: #{get_rest_result.code}"
|
29
|
+
# end
|
30
30
|
|
31
|
-
def get_rest_body
|
32
|
-
|
33
|
-
end
|
31
|
+
# def get_rest_body
|
32
|
+
# puts "REST RESULT body: #{get_rest_result.body}"
|
33
|
+
# end
|
34
34
|
|
35
|
-
def verify_rest_response_code(code)
|
36
|
-
|
37
|
-
end
|
35
|
+
# def verify_rest_response_code(code)
|
36
|
+
# assert_string_equal(code, get_rest_result.code.to_s)
|
37
|
+
# end
|
38
38
|
|
39
|
-
def verify_response_body_with_json(json)
|
40
|
-
|
41
|
-
end
|
39
|
+
# def verify_response_body_with_json(json)
|
40
|
+
# assert_string_equal(json, get_rest_result.body.to_s)
|
41
|
+
# end
|
42
42
|
|
43
|
-
def verify_response_at_json_node(json_node,string)
|
44
|
-
|
45
|
-
|
46
|
-
end
|
43
|
+
# def verify_response_at_json_node(json_node,string)
|
44
|
+
# result = JsonPath.new(json_node).on(get_rest_result.body).to_a.map(&:to_s)
|
45
|
+
# assert_string_equal(string, result[0])
|
46
|
+
# end
|
47
47
|
|
48
|
-
def send_request(*args)
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
48
|
+
# def send_request(*args)
|
49
|
+
# request_type = args.shift.downcase
|
50
|
+
# url = check_dynamic_value(args.shift)
|
51
|
+
# put_log "Request URL: #{url}"
|
52
|
+
# json_payload = args.shift
|
53
|
+
# if json_payload
|
54
|
+
# payload = Hash.new
|
55
|
+
# JSON.parse(json_payload).each do |k1, v1|
|
56
|
+
# payload[check_dynamic_value(k1)] = check_dynamic_value(v1)
|
57
|
+
# end
|
58
|
+
# payload = payload.to_json
|
59
|
+
# end
|
60
|
+
# put_log "Data Body from #{request_type} method: #{payload}"
|
61
61
|
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
end
|
62
|
+
# if (payload.nil? && request_type == 'get' && @header.nil?)
|
63
|
+
# @response = Request.get(url)
|
64
|
+
# elsif (payload.nil? && request_type == 'get')
|
65
|
+
# @response = Request.get(url, {headers: @header})
|
66
|
+
# elsif (payload.nil? && request_type == 'delete' && @header.nil?)
|
67
|
+
# @response = Request.delete(url)
|
68
|
+
# elsif (payload.nil? && request_type == 'delete')
|
69
|
+
# @response = Request.delete(url, {headers: @header})
|
70
|
+
# elsif (payload && request_type == 'get' && @header.nil?)
|
71
|
+
# @response = Request.get(url, {body: payload})
|
72
|
+
# elsif (payload && request_type == 'get')
|
73
|
+
# @response = Request.get(url, {body: payload, headers: @header})
|
74
|
+
# elsif (payload && request_type == 'post' && @header.nil?)
|
75
|
+
# @response = Request.post(url, {body: payload})
|
76
|
+
# elsif (payload && request_type == 'post')
|
77
|
+
# @response = Request.post(url, {body: payload, headers: @header})
|
78
|
+
# elsif (payload && request_type == 'put' && @header.nil?)
|
79
|
+
# @response = Request.put(url, {body: payload})
|
80
|
+
# elsif (payload && request_type == 'put')
|
81
|
+
# @response = Request.put(url, {body: payload, headers: @header})
|
82
|
+
# end
|
83
|
+
# end
|
84
84
|
|
85
85
|
|
86
|
-
class Request
|
87
|
-
include HTTParty
|
88
|
-
default_options.update(verify: false)
|
89
|
-
end
|
86
|
+
# class Request
|
87
|
+
# include HTTParty
|
88
|
+
# default_options.update(verify: false)
|
89
|
+
# end
|
@@ -1,57 +1,57 @@
|
|
1
|
-
require 'savon'
|
2
|
-
require 'jsonpath'
|
3
|
-
|
4
|
-
def get_soap_operation_list(url)
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
end
|
13
|
-
|
14
|
-
def call_and_fail_gracefully(client, *args, &block)
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
rescue Savon::SOAPFault => e
|
21
|
-
|
22
|
-
end
|
23
|
-
|
24
|
-
def get_soap_response
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
end
|
33
|
-
|
34
|
-
def send_soap_with_operation_and_xml(operation,file_name)
|
35
|
-
|
36
|
-
|
37
|
-
end
|
38
|
-
|
39
|
-
def send_soap_with_operation_and_data(operation,data)
|
40
|
-
|
41
|
-
|
42
|
-
end
|
43
|
-
|
44
|
-
def verify_response_with_json_node(json_node,string)
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
end
|
49
|
-
|
50
|
-
def verify_response_code(status_code)
|
51
|
-
|
52
|
-
end
|
53
|
-
|
54
|
-
def print_response
|
55
|
-
|
56
|
-
end
|
1
|
+
# require 'savon'
|
2
|
+
# require 'jsonpath'
|
3
|
+
|
4
|
+
# def get_soap_operation_list(url)
|
5
|
+
# request_url = URI.encode check_dynamic_value url
|
6
|
+
# @SOAPclient = Savon.client(ssl_verify_mode: :none,
|
7
|
+
# wsdl: "#{request_url}",
|
8
|
+
# :open_timeout => 10,
|
9
|
+
# :read_timeout => 10,
|
10
|
+
# :log => false)
|
11
|
+
# p "Operations List: #{@SOAPclient.operations}"
|
12
|
+
# end
|
13
|
+
|
14
|
+
# def call_and_fail_gracefully(client, *args, &block)
|
15
|
+
# if client.nil?
|
16
|
+
# raise "ERROR***: MISSING STEPS: Please run step to get operation list from WSDL first."
|
17
|
+
# else
|
18
|
+
# client.call(*args, &block)
|
19
|
+
# end
|
20
|
+
# rescue Savon::SOAPFault => e
|
21
|
+
# raise e.message
|
22
|
+
# end
|
23
|
+
|
24
|
+
# def get_soap_response
|
25
|
+
# soap_response = @response
|
26
|
+
# if soap_response.nil?
|
27
|
+
# raise "ERROR***: MISSING STEPS: Please send SOAP request to get the response first."
|
28
|
+
# else
|
29
|
+
# soap_response
|
30
|
+
# end
|
31
|
+
# soap_response
|
32
|
+
# end
|
33
|
+
|
34
|
+
# def send_soap_with_operation_and_xml(operation,file_name)
|
35
|
+
# xml = File.read($test_data_dir + file_name)
|
36
|
+
# @response = call_and_fail_gracefully(@SOAPclient, operation.downcase.to_sym, xml: xml )
|
37
|
+
# end
|
38
|
+
|
39
|
+
# def send_soap_with_operation_and_data(operation,data)
|
40
|
+
# xml = bind_with_dyn_vars(data)
|
41
|
+
# @response = call_and_fail_gracefully(@SOAPclient, operation.downcase.to_sym, xml: xml )
|
42
|
+
# end
|
43
|
+
|
44
|
+
# def verify_response_with_json_node(json_node,string)
|
45
|
+
# json = get_soap_response.body.to_json
|
46
|
+
# results = JsonPath.new(json_node).on(json).to_a.map(&:to_s)
|
47
|
+
# assert_string_equal(string, results[0])
|
48
|
+
# end
|
49
|
+
|
50
|
+
# def verify_response_code(status_code)
|
51
|
+
# assert_string_equal(get_soap_response.http.code, status_code.to_i)
|
52
|
+
# end
|
53
|
+
|
54
|
+
# def print_response
|
55
|
+
# p "SOAP RESPONSE: #{get_soap_response}"
|
56
|
+
# end
|
57
57
|
|
@@ -1,37 +1,37 @@
|
|
1
|
-
require 'net/ssh'
|
1
|
+
# require 'net/ssh'
|
2
2
|
|
3
|
-
def connect_to_server_with_credential(host_name,table)
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
3
|
+
# def connect_to_server_with_credential(host_name,table)
|
4
|
+
# hostname = check_dynamic_value host_name
|
5
|
+
# @keys = []
|
6
|
+
# @auth_methods ||= %w(password)
|
7
|
+
# session = table.hashes.first
|
8
|
+
# session_keys = Array.new(@keys)
|
9
|
+
# session_auth_methods = Array.new(@auth_methods)
|
10
|
+
# if session["keyfile"]
|
11
|
+
# session_keys << session["keyfile"]
|
12
|
+
# session_auth_methods << "publickey"
|
13
|
+
# end
|
14
14
|
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
end
|
15
|
+
# @SSHconnection = Net::SSH.start(hostname, session["username"], :password => session["password"],
|
16
|
+
# :auth_methods => session_auth_methods,
|
17
|
+
# :keys => session_keys)
|
18
|
+
# end
|
19
19
|
|
20
|
-
def exec_command(command)
|
21
|
-
|
22
|
-
|
23
|
-
end
|
20
|
+
# def exec_command(command)
|
21
|
+
# command = check_dynamic_value command
|
22
|
+
# @output = @SSHconnection.exec!(command)
|
23
|
+
# end
|
24
24
|
|
25
|
-
def print_output
|
26
|
-
|
27
|
-
end
|
25
|
+
# def print_output
|
26
|
+
# p @output
|
27
|
+
# end
|
28
28
|
|
29
|
-
def verify_output(string)
|
30
|
-
|
31
|
-
|
32
|
-
end
|
29
|
+
# def verify_output(string)
|
30
|
+
# string = check_dynamic_value(string)
|
31
|
+
# assert_string_equal(string, @output.strip)
|
32
|
+
# end
|
33
33
|
|
34
|
-
def store_result_string(name)
|
35
|
-
|
36
|
-
|
37
|
-
end
|
34
|
+
# def store_result_string(name)
|
35
|
+
# $context_value = bind_with_dyn_vars(@output)
|
36
|
+
# set_var(name, '$context_value')
|
37
|
+
# end
|