Class: ProviderTesting::Pegasus
- Inherits:
-
Object
- Object
- ProviderTesting::Pegasus
- Defined in:
- lib/provider-testing/pegasus.rb
Instance Attribute Summary collapse
-
#dir ⇒ Object
readonly
Returns the value of attribute dir.
-
#pid ⇒ Object
readonly
Returns the value of attribute pid.
-
#providers_dir ⇒ Object
readonly
Returns the value of attribute providers_dir.
-
#registration_dir ⇒ Object
readonly
Returns the value of attribute registration_dir.
-
#stage_dir ⇒ Object
readonly
Returns the value of attribute stage_dir.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Pegasus
constructor
A new instance of Pegasus.
- #mkcfg ⇒ Object
- #start ⇒ Object
- #stop ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Pegasus
Returns a new instance of Pegasus.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/provider-testing/pegasus.rb', line 32 def initialize args = {} @execfile = "/usr/sbin/cimserver" @port = 12345 @pid = nil @config = {} tmpdir = args[:tmpdir] || Dir.tmpdir File.directory?(tmpdir) || Dir.mkdir(tmpdir) @dir = File.join(tmpdir, "pegasus") Dir.mkdir @dir rescue nil STDERR.puts "Pegasus directory at #{@dir}" # location of cmpi-bindings for Ruby @providers_dir = File.(File.join(TOPLEVEL,"..","..","build","swig","ruby")) # location of cmpi-bindings for Python @providers_dir = File.(File.join(TOPLEVEL,"..","..","build","swig","python")) end |
Instance Attribute Details
#dir ⇒ Object (readonly)
Returns the value of attribute dir.
11 12 13 |
# File 'lib/provider-testing/pegasus.rb', line 11 def dir @dir end |
#pid ⇒ Object (readonly)
Returns the value of attribute pid.
11 12 13 |
# File 'lib/provider-testing/pegasus.rb', line 11 def pid @pid end |
#providers_dir ⇒ Object (readonly)
Returns the value of attribute providers_dir.
11 12 13 |
# File 'lib/provider-testing/pegasus.rb', line 11 def providers_dir @providers_dir end |
#registration_dir ⇒ Object (readonly)
Returns the value of attribute registration_dir.
11 12 13 |
# File 'lib/provider-testing/pegasus.rb', line 11 def registration_dir @registration_dir end |
#stage_dir ⇒ Object (readonly)
Returns the value of attribute stage_dir.
11 12 13 |
# File 'lib/provider-testing/pegasus.rb', line 11 def stage_dir @stage_dir end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
11 12 13 |
# File 'lib/provider-testing/pegasus.rb', line 11 def uri @uri end |
Instance Method Details
#mkcfg ⇒ Object
73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 |
# File 'lib/provider-testing/pegasus.rb', line 73 def mkcfg # trace_components = [ALL # AsyncOpNode # Authentication # Authorization # BinaryMessageHandler # Channel # CimData # CIMExportRequestDispatcher # CIMOMHandle # Config # ConfigurationManager # ControlProvider # CQL # DiscardedData # Dispatcher # ExportClient # Http # IndDelivery # IndicationHandlerService # IndicationService # IndicationServiceInternal # IndHandler # IPC # L10N # Listener # Memory # MessageQueueService # MetaDispatcher # ObjectResolution # OsAbstraction # ProviderAgent # ProviderManager # ProvManager # Registration # Repository # Server # Shutdown # SubscriptionService # Thread # UserManager # WQL # XmlIO # XmlParser # XmlReader # XmlWriter @config = { "daemon" => "false", "enableAuthentication" => "false", "enableHttpConnection" => "true", "enableHttpsConnection" => "false", "httpPort" => @port, "traceFilePath" => File.join(@dir, "trace.log"), "traceLevel" => 1, # 1,2,3,4 # "traceComponents" => "", # "logLevel" => "INFORMATION", # TRACE, INFORMATION, WARNING, SEVERE, FATAL. # "repositoryDir" => "/var/lib/Pegasus/repository", "providerDir" => "#{@providers_dir}:/usr/lib64/cmpi:/usr/lib/cmpi:/usr/lib64/pycim:/usr/lib/pycim:/usr/lib64/Pegasus/providers:/usr/lib/Pegasus/providers" } end |
#start ⇒ Object
134 135 136 137 138 139 140 |
# File 'lib/provider-testing/pegasus.rb', line 134 def start unless system "sudo #{@execfile} --status" cmd = ["sudo", @execfile] + @config.collect{ |k,v| "#{k}=#{v}" } puts cmd.inspect system *cmd end end |
#stop ⇒ Object
142 143 144 |
# File 'lib/provider-testing/pegasus.rb', line 142 def stop system "sudo #{@execfile} -s" end |