Class: ProviderTesting::Helper

Inherits:
Object
  • Object
show all
Defined in:
lib/provider-testing/helper.rb

Class Method Summary collapse

Class Method Details

.cimomObject



24
25
26
# File 'lib/provider-testing/helper.rb', line 24

def self.cimom
  @@cimom rescue (self.cimom = :sfcb; @@cimom)
end

.cimom=(name) ⇒ Object

called from rake



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/provider-testing/helper.rb', line 12

def self.cimom= name
  @@cimom ||= case name
  when :sfcb
    require_relative "./sfcb"
    Sfcb.new :tmpdir => TMPDIR, :provider => PROVIDERDIR
  when :pegasus
    require_relative "./pegasus"
    Pegasus.new :tmpdir => TMPDIR, :provider => PROVIDERDIR
  else
    raise "Unknown CIMOM #{@cimom}"
  end
end

.setup(klass = "", namespace = "root/cimv2") ⇒ Object

called from test/unit



30
31
32
33
34
35
# File 'lib/provider-testing/helper.rb', line 30

def self.setup klass = "", namespace = "root/cimv2"
  client = Sfcc::Cim::Client.connect(:uri => self.cimom.uri, :verify => false)
  raise "Connection error" unless client
  op = Sfcc::Cim::ObjectPath.new(namespace, klass, client)
  return client, op
end

.teardownObject



36
37
38
# File 'lib/provider-testing/helper.rb', line 36

def self.teardown
  self.cimom.stop
end