Made changes

This commit is contained in:
2024-07-17 13:14:28 -04:00
parent fc56af0621
commit d663ee765a
5 changed files with 24 additions and 3 deletions

View File

@@ -13,7 +13,6 @@ module RubyQA
:runner => SSH_Runner
}
attr_accessor *DEFAULT_HOSTDATA.keys
attr_reader :client, :data, :resources
def initialize( data = {} )
@@ -21,19 +20,26 @@ module RubyQA
@data = DEFAULT_HOSTDATA.merge data
if not @data[:hostname].empty? and @data[:site].empty?
data[:site]=@data[:hostname][0,3]
end
## initialize client for usage tests
@client = @data[:runner].new(@data)
end
def exec (command)
## Send a command from the host
@client.exec(command)
end
def exec_sudo (command)
## Send a sudo command from the host
@client.exec_sudo(command)
end
def [](key)
## Provide Access to data (:ip, etc)
@data[key]
end

View File

@@ -29,7 +29,11 @@ module RubyQA
end
def self.new_test(name, options={}, &test_proc)
@@tests << Test.new(name, **options, &test_proc)
if not options.has_key? :disabled
@@tests << Test.new(name, **options, &test_proc)
elsif options[:disabled] != true
@@tests << Test.new(name, **options, &test_proc)
end
end
def self.run_tests

View File

@@ -3,5 +3,6 @@
$LOAD_PATH << __dir__
require 'manager'
require 'resource'
require 'runner'
require 'host'
require 'test'