mcollective-client 2.7.0 → 2.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (186) hide show
  1. data/lib/mcollective/agent/discovery.rb +37 -0
  2. data/lib/mcollective/agent/rpcutil.ddl +220 -0
  3. data/lib/mcollective/agent/rpcutil.rb +108 -0
  4. data/lib/mcollective/aggregate/average.ddl +33 -0
  5. data/lib/mcollective/aggregate/average.rb +29 -0
  6. data/lib/mcollective/aggregate/result.rb +3 -3
  7. data/lib/mcollective/aggregate/sum.ddl +33 -0
  8. data/lib/mcollective/aggregate/sum.rb +18 -0
  9. data/lib/mcollective/aggregate/summary.ddl +33 -0
  10. data/lib/mcollective/aggregate/summary.rb +53 -0
  11. data/lib/mcollective/aggregate.rb +2 -2
  12. data/lib/mcollective/application/completion.rb +104 -0
  13. data/lib/mcollective/application/facts.rb +62 -0
  14. data/lib/mcollective/application/find.rb +21 -0
  15. data/lib/mcollective/application/help.rb +28 -0
  16. data/lib/mcollective/application/inventory.rb +344 -0
  17. data/lib/mcollective/application/ping.rb +77 -0
  18. data/lib/mcollective/application/plugin.rb +369 -0
  19. data/lib/mcollective/application/rpc.rb +121 -0
  20. data/lib/mcollective/application.rb +2 -0
  21. data/lib/mcollective/audit/logfile.rb +26 -0
  22. data/lib/mcollective/config.rb +16 -9
  23. data/lib/mcollective/connector/activemq.ddl +9 -0
  24. data/lib/mcollective/connector/activemq.rb +572 -0
  25. data/lib/mcollective/connector/rabbitmq.ddl +9 -0
  26. data/lib/mcollective/connector/rabbitmq.rb +484 -0
  27. data/lib/mcollective/connector.rb +1 -1
  28. data/lib/mcollective/data/agent_data.ddl +22 -0
  29. data/lib/mcollective/data/agent_data.rb +17 -0
  30. data/lib/mcollective/data/collective_data.ddl +20 -0
  31. data/lib/mcollective/data/collective_data.rb +9 -0
  32. data/lib/mcollective/data/fact_data.ddl +28 -0
  33. data/lib/mcollective/data/fact_data.rb +55 -0
  34. data/lib/mcollective/data/fstat_data.ddl +89 -0
  35. data/lib/mcollective/data/fstat_data.rb +56 -0
  36. data/lib/mcollective/data.rb +2 -2
  37. data/lib/mcollective/ddl.rb +4 -4
  38. data/lib/mcollective/discovery/flatfile.ddl +11 -0
  39. data/lib/mcollective/discovery/flatfile.rb +48 -0
  40. data/lib/mcollective/discovery/mc.ddl +11 -0
  41. data/lib/mcollective/discovery/mc.rb +30 -0
  42. data/lib/mcollective/discovery/stdin.ddl +11 -0
  43. data/lib/mcollective/discovery/stdin.rb +66 -0
  44. data/lib/mcollective/facts/yaml_facts.rb +61 -0
  45. data/lib/mcollective/facts.rb +1 -1
  46. data/lib/mcollective/generators.rb +3 -3
  47. data/lib/mcollective/logger.rb +1 -1
  48. data/lib/mcollective/matcher/scanner.rb +1 -1
  49. data/lib/mcollective/matcher.rb +2 -2
  50. data/lib/mcollective/pluginpackager/debpackage_packager.rb +237 -0
  51. data/lib/mcollective/pluginpackager/modulepackage_packager.rb +127 -0
  52. data/lib/mcollective/pluginpackager/ospackage_packager.rb +59 -0
  53. data/lib/mcollective/pluginpackager/rpmpackage_packager.rb +180 -0
  54. data/lib/mcollective/pluginpackager/templates/debian/Makefile.erb +7 -0
  55. data/lib/mcollective/pluginpackager/templates/debian/changelog.erb +5 -0
  56. data/lib/mcollective/pluginpackager/templates/debian/compat.erb +1 -0
  57. data/lib/mcollective/pluginpackager/templates/debian/control.erb +15 -0
  58. data/lib/mcollective/pluginpackager/templates/debian/copyright.erb +8 -0
  59. data/lib/mcollective/pluginpackager/templates/debian/rules.erb +6 -0
  60. data/lib/mcollective/pluginpackager/templates/module/Modulefile.erb +5 -0
  61. data/lib/mcollective/pluginpackager/templates/module/README.md.erb +37 -0
  62. data/lib/mcollective/pluginpackager/templates/module/_manifest.pp.erb +9 -0
  63. data/lib/mcollective/pluginpackager/templates/redhat/rpm_spec.erb +63 -0
  64. data/lib/mcollective/pluginpackager.rb +2 -2
  65. data/lib/mcollective/registration/agentlist.rb +10 -0
  66. data/lib/mcollective/registration.rb +1 -1
  67. data/lib/mcollective/rpc/stats.rb +0 -1
  68. data/lib/mcollective/rpc.rb +11 -11
  69. data/lib/mcollective/security/aes_security.rb +394 -0
  70. data/lib/mcollective/security/psk.rb +117 -0
  71. data/lib/mcollective/security/ssl.rb +328 -0
  72. data/lib/mcollective/security.rb +1 -1
  73. data/lib/mcollective/util.rb +18 -18
  74. data/lib/mcollective/validator/array_validator.ddl +7 -0
  75. data/lib/mcollective/validator/array_validator.rb +9 -0
  76. data/lib/mcollective/validator/ipv4address_validator.ddl +7 -0
  77. data/lib/mcollective/validator/ipv4address_validator.rb +16 -0
  78. data/lib/mcollective/validator/ipv6address_validator.ddl +7 -0
  79. data/lib/mcollective/validator/ipv6address_validator.rb +16 -0
  80. data/lib/mcollective/validator/length_validator.ddl +7 -0
  81. data/lib/mcollective/validator/length_validator.rb +11 -0
  82. data/lib/mcollective/validator/regex_validator.ddl +7 -0
  83. data/lib/mcollective/validator/regex_validator.rb +9 -0
  84. data/lib/mcollective/validator/shellsafe_validator.ddl +7 -0
  85. data/lib/mcollective/validator/shellsafe_validator.rb +13 -0
  86. data/lib/mcollective/validator/typecheck_validator.ddl +7 -0
  87. data/lib/mcollective/validator/typecheck_validator.rb +28 -0
  88. data/lib/mcollective.rb +31 -31
  89. data/spec/spec_helper.rb +0 -5
  90. data/spec/unit/{plugins/mcollective → mcollective}/agent/rpcutil_spec.rb +1 -1
  91. data/spec/unit/{agents_spec.rb → mcollective/agents_spec.rb} +0 -0
  92. data/spec/unit/{plugins/mcollective → mcollective}/aggregate/average_spec.rb +1 -1
  93. data/spec/unit/{aggregate → mcollective/aggregate}/base_spec.rb +0 -0
  94. data/spec/unit/{aggregate → mcollective/aggregate}/result/base_spec.rb +0 -0
  95. data/spec/unit/{aggregate → mcollective/aggregate}/result/collection_result_spec.rb +0 -0
  96. data/spec/unit/{aggregate → mcollective/aggregate}/result/numeric_result_spec.rb +0 -0
  97. data/spec/unit/{plugins/mcollective → mcollective}/aggregate/sum_spec.rb +1 -1
  98. data/spec/unit/{plugins/mcollective → mcollective}/aggregate/summary_spec.rb +1 -1
  99. data/spec/unit/{aggregate_spec.rb → mcollective/aggregate_spec.rb} +0 -0
  100. data/spec/unit/{plugins/mcollective → mcollective}/application/plugin_spec.rb +1 -1
  101. data/spec/unit/{application_spec.rb → mcollective/application_spec.rb} +0 -0
  102. data/spec/unit/{applications_spec.rb → mcollective/applications_spec.rb} +1 -1
  103. data/spec/unit/{array_spec.rb → mcollective/array_spec.rb} +0 -0
  104. data/spec/unit/{plugins/mcollective → mcollective}/audit/logfile_spec.rb +1 -1
  105. data/spec/unit/{cache_spec.rb → mcollective/cache_spec.rb} +0 -0
  106. data/spec/unit/{client_spec.rb → mcollective/client_spec.rb} +0 -0
  107. data/spec/unit/{config_spec.rb → mcollective/config_spec.rb} +12 -7
  108. data/spec/unit/{plugins/mcollective → mcollective}/connector/activemq_spec.rb +1 -1
  109. data/spec/unit/{connector → mcollective/connector}/base_spec.rb +0 -0
  110. data/spec/unit/{plugins/mcollective → mcollective}/connector/rabbitmq_spec.rb +1 -1
  111. data/spec/unit/{plugins/mcollective → mcollective}/data/agent_data_spec.rb +1 -1
  112. data/spec/unit/{data → mcollective/data}/base_spec.rb +0 -0
  113. data/spec/unit/{plugins/mcollective → mcollective}/data/collective_data_spec.rb +1 -1
  114. data/spec/unit/{plugins/mcollective → mcollective}/data/fact_data_spec.rb +1 -1
  115. data/spec/unit/{plugins/mcollective → mcollective}/data/fstat_data_spec.rb +1 -1
  116. data/spec/unit/{data → mcollective/data}/result_spec.rb +0 -0
  117. data/spec/unit/{data_spec.rb → mcollective/data_spec.rb} +0 -0
  118. data/spec/unit/{ddl → mcollective/ddl}/agentddl_spec.rb +0 -0
  119. data/spec/unit/{ddl → mcollective/ddl}/base_spec.rb +0 -0
  120. data/spec/unit/{ddl → mcollective/ddl}/dataddl_spec.rb +0 -0
  121. data/spec/unit/{ddl → mcollective/ddl}/discoveryddl_spec.rb +0 -0
  122. data/spec/unit/{ddl_spec.rb → mcollective/ddl_spec.rb} +0 -0
  123. data/spec/unit/{plugins/mcollective → mcollective}/discovery/flatfile_spec.rb +1 -1
  124. data/spec/unit/{plugins/mcollective → mcollective}/discovery/mc_spec.rb +1 -1
  125. data/spec/unit/{plugins/mcollective → mcollective}/discovery/stdin_spec.rb +1 -1
  126. data/spec/unit/{discovery_spec.rb → mcollective/discovery_spec.rb} +0 -0
  127. data/spec/unit/{facts → mcollective/facts}/base_spec.rb +0 -0
  128. data/spec/unit/{plugins/mcollective → mcollective}/facts/yaml_facts_spec.rb +1 -1
  129. data/spec/unit/{facts_spec.rb → mcollective/facts_spec.rb} +0 -0
  130. data/spec/unit/{generators → mcollective/generators}/agent_generator_spec.rb +0 -0
  131. data/spec/unit/{generators → mcollective/generators}/base_spec.rb +0 -0
  132. data/spec/unit/{generators → mcollective/generators}/data_generator_spec.rb +0 -0
  133. data/spec/unit/{generators → mcollective/generators}/snippets/agent_ddl +0 -0
  134. data/spec/unit/{generators → mcollective/generators}/snippets/data_ddl +0 -0
  135. data/spec/unit/{log_spec.rb → mcollective/log_spec.rb} +0 -0
  136. data/spec/unit/{logger → mcollective/logger}/base_spec.rb +0 -0
  137. data/spec/unit/{logger → mcollective/logger}/console_logger_spec.rb +0 -0
  138. data/spec/unit/{logger → mcollective/logger}/file_logger_spec.rb +0 -0
  139. data/spec/unit/{logger → mcollective/logger}/syslog_logger_spec.rb +0 -0
  140. data/spec/unit/{matcher → mcollective/matcher}/parser_spec.rb +0 -0
  141. data/spec/unit/{matcher → mcollective/matcher}/scanner_spec.rb +0 -0
  142. data/spec/unit/{matcher_spec.rb → mcollective/matcher_spec.rb} +0 -0
  143. data/spec/unit/{message_spec.rb → mcollective/message_spec.rb} +0 -0
  144. data/spec/unit/{monkey_patches_spec.rb → mcollective/monkey_patches_spec.rb} +0 -0
  145. data/spec/unit/{optionparser_spec.rb → mcollective/optionparser_spec.rb} +0 -0
  146. data/spec/unit/{plugins/mcollective → mcollective}/packagers/debpackage_packager_spec.rb +1 -1
  147. data/spec/unit/{plugins/mcollective → mcollective}/packagers/modulepackage_packager_spec.rb +1 -1
  148. data/spec/unit/{plugins/mcollective → mcollective}/packagers/ospackage_spec.rb +1 -1
  149. data/spec/unit/{plugins/mcollective → mcollective}/packagers/rpmpackage_packager_spec.rb +1 -1
  150. data/spec/unit/{pluginmanager_spec.rb → mcollective/pluginmanager_spec.rb} +0 -0
  151. data/spec/unit/{pluginpackager → mcollective/pluginpackager}/agent_definition_spec.rb +0 -0
  152. data/spec/unit/{pluginpackager → mcollective/pluginpackager}/standard_definition_spec.rb +0 -0
  153. data/spec/unit/{pluginpackager_spec.rb → mcollective/pluginpackager_spec.rb} +0 -0
  154. data/spec/unit/{registration → mcollective/registration}/base_spec.rb +0 -0
  155. data/spec/unit/{rpc → mcollective/rpc}/actionrunner_spec.rb +0 -0
  156. data/spec/unit/{rpc → mcollective/rpc}/agent_spec.rb +0 -0
  157. data/spec/unit/{rpc → mcollective/rpc}/client_spec.rb +0 -0
  158. data/spec/unit/{rpc → mcollective/rpc}/helpers_spec.rb +0 -0
  159. data/spec/unit/{rpc → mcollective/rpc}/reply_spec.rb +0 -0
  160. data/spec/unit/{rpc → mcollective/rpc}/request_spec.rb +0 -0
  161. data/spec/unit/{rpc → mcollective/rpc}/result_spec.rb +0 -0
  162. data/spec/unit/{rpc → mcollective/rpc}/stats_spec.rb +0 -0
  163. data/spec/unit/{rpc_spec.rb → mcollective/rpc_spec.rb} +0 -0
  164. data/spec/unit/{runner_spec.rb → mcollective/runner_spec.rb} +0 -0
  165. data/spec/unit/{runnerstats_spec.rb → mcollective/runnerstats_spec.rb} +0 -0
  166. data/spec/unit/{plugins/mcollective → mcollective}/security/aes_security_spec.rb +1 -1
  167. data/spec/unit/{security → mcollective/security}/base_spec.rb +0 -0
  168. data/spec/unit/{plugins/mcollective → mcollective}/security/psk_spec.rb +1 -1
  169. data/spec/unit/{shell_spec.rb → mcollective/shell_spec.rb} +0 -0
  170. data/spec/unit/{ssl_spec.rb → mcollective/ssl_spec.rb} +12 -12
  171. data/spec/unit/{string_spec.rb → mcollective/string_spec.rb} +0 -0
  172. data/spec/unit/{symbol_spec.rb → mcollective/symbol_spec.rb} +0 -0
  173. data/spec/unit/{unix_daemon_spec.rb → mcollective/unix_daemon_spec.rb} +0 -0
  174. data/spec/unit/{util_spec.rb → mcollective/util_spec.rb} +28 -6
  175. data/spec/unit/{plugins/mcollective → mcollective}/validator/array_validator_spec.rb +1 -1
  176. data/spec/unit/{plugins/mcollective → mcollective}/validator/ipv4address_validator_spec.rb +1 -1
  177. data/spec/unit/{plugins/mcollective → mcollective}/validator/ipv6address_validator_spec.rb +1 -1
  178. data/spec/unit/{plugins/mcollective → mcollective}/validator/length_validator_spec.rb +1 -1
  179. data/spec/unit/{plugins/mcollective → mcollective}/validator/regex_validator_spec.rb +1 -1
  180. data/spec/unit/{plugins/mcollective → mcollective}/validator/shellsafe_validator_spec.rb +1 -1
  181. data/spec/unit/{plugins/mcollective → mcollective}/validator/typecheck_validator_spec.rb +1 -1
  182. data/spec/unit/{validator_spec.rb → mcollective/validator_spec.rb} +1 -1
  183. data/spec/unit/{vendor_spec.rb → mcollective/vendor_spec.rb} +2 -2
  184. data/spec/unit/{windows_daemon_spec.rb → mcollective/windows_daemon_spec.rb} +0 -0
  185. metadata +361 -284
  186. checksums.yaml +0 -7
data/lib/mcollective.rb CHANGED
@@ -27,40 +27,40 @@ require 'mcollective/exceptions'
27
27
  # http://www.devco.net/archives/2009/10/18/middleware_for_systems_administration.php
28
28
  module MCollective
29
29
 
30
- autoload :Agent, "mcollective/agent"
31
- autoload :Agents, "mcollective/agents"
32
- autoload :Aggregate, "mcollective/aggregate"
33
- autoload :Application, "mcollective/application"
34
- autoload :Applications, "mcollective/applications"
35
- autoload :Client, "mcollective/client"
36
- autoload :Config, "mcollective/config"
37
- autoload :Connector, "mcollective/connector"
38
- autoload :Data, "mcollective/data"
39
- autoload :DDL, "mcollective/ddl"
40
- autoload :Discovery, "mcollective/discovery"
41
- autoload :Facts, "mcollective/facts"
42
- autoload :Logger, "mcollective/logger"
43
- autoload :Log, "mcollective/log"
44
- autoload :Matcher, "mcollective/matcher"
45
- autoload :Message, "mcollective/message"
46
- autoload :Optionparser, "mcollective/optionparser"
47
- autoload :Generators, "mcollective/generators"
48
- autoload :PluginManager, "mcollective/pluginmanager"
49
- autoload :PluginPackager, "mcollective/pluginpackager"
50
- autoload :Registration, "mcollective/registration"
51
- autoload :RPC, "mcollective/rpc"
52
- autoload :Runner, "mcollective/runner"
53
- autoload :RunnerStats, "mcollective/runnerstats"
54
- autoload :Security, "mcollective/security"
55
- autoload :Shell, "mcollective/shell"
56
- autoload :SSL, "mcollective/ssl"
57
- autoload :Util, "mcollective/util"
58
- autoload :Validator, "mcollective/validator"
59
- autoload :Vendor, "mcollective/vendor"
30
+ require "mcollective/agent"
31
+ require "mcollective/agents"
32
+ require "mcollective/aggregate"
33
+ require "mcollective/application"
34
+ require "mcollective/applications"
35
+ require "mcollective/client"
36
+ require "mcollective/config"
37
+ require "mcollective/connector"
38
+ require "mcollective/data"
39
+ require "mcollective/ddl"
40
+ require "mcollective/discovery"
41
+ require "mcollective/facts"
42
+ require "mcollective/logger"
43
+ require "mcollective/log"
44
+ require "mcollective/matcher"
45
+ require "mcollective/message"
46
+ require "mcollective/optionparser"
47
+ require "mcollective/generators"
48
+ require "mcollective/pluginmanager"
49
+ require "mcollective/pluginpackager"
50
+ require "mcollective/registration"
51
+ require "mcollective/rpc"
52
+ require "mcollective/runner"
53
+ require "mcollective/runnerstats"
54
+ require "mcollective/security"
55
+ require "mcollective/shell"
56
+ require "mcollective/ssl"
57
+ require "mcollective/util"
58
+ require "mcollective/validator"
59
+ require "mcollective/vendor"
60
60
 
61
61
  MCollective::Vendor.load_vendored
62
62
 
63
- VERSION="2.7.0"
63
+ VERSION="2.8.0"
64
64
 
65
65
  def self.version
66
66
  VERSION
data/spec/spec_helper.rb CHANGED
@@ -1,8 +1,3 @@
1
- dir = File.expand_path(File.dirname(__FILE__))
2
- $LOAD_PATH.unshift("#{dir}/")
3
- $LOAD_PATH.unshift("#{dir}/../lib")
4
- $LOAD_PATH.unshift("#{dir}/../plugins")
5
-
6
1
  require 'rubygems'
7
2
 
8
3
  gem 'mocha'
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env rspec
2
2
 
3
- @agent_file = File.join(File.dirname(__FILE__), '../../../../../', 'plugins', 'mcollective', 'agent', 'rpcutil.rb')
3
+ @agent_file = File.join('mcollective', 'agent', 'rpcutil')
4
4
 
5
5
  require 'spec_helper'
6
6
  require @agent_file
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env rspec
2
2
 
3
3
  require 'spec_helper'
4
- require File.dirname(__FILE__) + "/../../../../../plugins/mcollective/aggregate/average.rb"
4
+ require 'mcollective/aggregate/average'
5
5
 
6
6
  module MCollective
7
7
  class Aggregate
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env rspec
2
2
 
3
3
  require 'spec_helper'
4
- require File.dirname(__FILE__) + "/../../../../../plugins/mcollective/aggregate/sum.rb"
4
+ require 'mcollective/aggregate/sum'
5
5
 
6
6
  module MCollective
7
7
  class Aggregate
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env rspec
2
2
 
3
3
  require 'spec_helper'
4
- require File.dirname(__FILE__) + "/../../../../../plugins/mcollective/aggregate/summary.rb"
4
+ require 'mcollective/aggregate/summary'
5
5
 
6
6
  module MCollective
7
7
  class Aggregate
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env rspec
2
2
 
3
3
  require 'spec_helper'
4
- require File.join(File.dirname(__FILE__), '../../../../../', 'plugins', 'mcollective', 'application', 'plugin.rb')
4
+ require 'mcollective/application/plugin'
5
5
 
6
6
  module MCollective
7
7
  class Application
@@ -16,7 +16,7 @@ module MCollective
16
16
  @appsdir = File.join([@tmpdir, "mcollective", "application"])
17
17
  FileUtils.mkdir_p(@appsdir)
18
18
 
19
- FileUtils.cp(File.join([File.dirname(__FILE__), "..", "fixtures", "application", "test.rb"]), @appsdir)
19
+ FileUtils.cp(File.join([File.dirname(__FILE__), '..', "..", "fixtures", "application", "test.rb"]), @appsdir)
20
20
  end
21
21
 
22
22
  after do
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env rspec
2
2
 
3
3
  require 'spec_helper'
4
- require File.join(File.dirname(__FILE__), '../../../../../', 'plugins', 'mcollective', 'audit', 'logfile.rb')
4
+ require 'mcollective/audit/logfile'
5
5
 
6
6
  module MCollective
7
7
  module RPC
@@ -5,13 +5,6 @@ require 'spec_helper'
5
5
  module MCollective
6
6
  describe Config do
7
7
  describe "#loadconfig" do
8
- it "should fail when no libdir is set" do
9
- File.expects(:exists?).with("/nonexisting").returns(true)
10
- File.expects(:readlines).with("/nonexisting").returns([])
11
- Config.instance.stubs(:set_config_defaults)
12
- expect { Config.instance.loadconfig("/nonexisting") }.to raise_error("The /nonexisting config file does not specify a libdir setting, cannot continue")
13
- end
14
-
15
8
  it "should only test that libdirs are absolute paths" do
16
9
  Util.expects(:absolute_path?).with("/one").returns(true)
17
10
  Util.expects(:absolute_path?).with("/two").returns(true)
@@ -33,6 +26,18 @@ module MCollective
33
26
  expect { Config.instance.loadconfig("/nonexisting") }.to raise_error(/should be absolute paths/)
34
27
  end
35
28
 
29
+ it 'should prepend $libdir to $LOAD_PATH' do
30
+ Util.expects(:absolute_path?).with('/test').returns(true)
31
+
32
+ File.stubs(:exists?).with("/nonexisting").returns(true)
33
+
34
+ File.expects(:readlines).with('/nonexisting').returns(['libdir = /test'])
35
+
36
+ Config.instance.loadconfig("/nonexisting")
37
+
38
+ $LOAD_PATH[0].should == '/test'
39
+ end
40
+
36
41
  it "should not allow any path like construct for identities" do
37
42
  # Taken from puppet test cases
38
43
  ['../foo', '..\\foo', './../foo', '.\\..\\foo',
@@ -4,7 +4,7 @@ require 'spec_helper'
4
4
 
5
5
  MCollective::PluginManager.clear
6
6
 
7
- require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/connector/activemq.rb'
7
+ require 'mcollective/connector/activemq'
8
8
 
9
9
  # create the stomp error class here as it does not always exist
10
10
  # all versions of the stomp gem and we do not want to tie tests
@@ -4,7 +4,7 @@ require 'spec_helper'
4
4
 
5
5
  MCollective::PluginManager.clear
6
6
 
7
- require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/connector/rabbitmq.rb'
7
+ require 'mcollective/connector/rabbitmq'
8
8
 
9
9
  # create the stomp error class here as it does not always exist
10
10
  # all versions of the stomp gem and we do not want to tie tests
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- require File.dirname(__FILE__) + "/../../../../../plugins/mcollective/data/agent_data.rb"
5
+ require 'mcollective/data/agent_data'
6
6
 
7
7
  module MCollective
8
8
  module Data
File without changes
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- require File.dirname(__FILE__) + "/../../../../../plugins/mcollective/data/collective_data.rb"
5
+ require 'mcollective/data/collective_data'
6
6
 
7
7
  module MCollective
8
8
  module Data
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- require File.dirname(__FILE__) + "/../../../../../plugins/mcollective/data/fact_data.rb"
5
+ require 'mcollective/data/fact_data'
6
6
 
7
7
  module MCollective
8
8
  module Data
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- require File.dirname(__FILE__) + "/../../../../../plugins/mcollective/data/fstat_data.rb"
5
+ require 'mcollective/data/fstat_data'
6
6
 
7
7
  module MCollective
8
8
  module Data
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/discovery/flatfile.rb'
5
+ require 'mcollective/discovery/flatfile'
6
6
 
7
7
  module MCollective
8
8
  class Discovery
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/discovery/mc.rb'
5
+ require 'mcollective/discovery/mc'
6
6
 
7
7
  module MCollective
8
8
  class Discovery
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/discovery/stdin.rb'
5
+ require 'mcollective/discovery/stdin'
6
6
 
7
7
  module MCollective
8
8
  class Discovery
File without changes
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env rspec
2
2
 
3
3
  require 'spec_helper'
4
- require File.join(File.dirname(__FILE__), '../../../../../', 'plugins', 'mcollective', 'facts', 'yaml_facts.rb')
4
+ require 'mcollective/facts/yaml_facts'
5
5
 
6
6
  module MCollective
7
7
  module Facts
File without changes
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env rspec
2
2
  require 'spec_helper'
3
- require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/pluginpackager/debpackage_packager.rb'
3
+ require 'mcollective/pluginpackager/debpackage_packager'
4
4
 
5
5
  module MCollective
6
6
  module PluginPackager
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env rspec
2
2
  require 'spec_helper'
3
- require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/pluginpackager/modulepackage_packager.rb'
3
+ require 'mcollective/pluginpackager/modulepackage_packager'
4
4
 
5
5
  module MCollective
6
6
  module PluginPackager
@@ -3,7 +3,7 @@
3
3
  require 'spec_helper'
4
4
 
5
5
  MCollective::PluginManager.clear
6
- require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/pluginpackager/ospackage_packager.rb'
6
+ require 'mcollective/pluginpackager/ospackage_packager'
7
7
 
8
8
  module MCollective
9
9
  module PluginPackager
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env rspec
2
2
  require 'spec_helper'
3
- require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/pluginpackager/rpmpackage_packager.rb'
3
+ require 'mcollective/pluginpackager/rpmpackage_packager'
4
4
 
5
5
  module MCollective
6
6
  module PluginPackager
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env rspec
2
2
 
3
3
  require 'spec_helper'
4
- require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/security/aes_security.rb'
4
+ require 'mcollective/security/aes_security'
5
5
 
6
6
  module MCollective
7
7
  module Security
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env rspec
2
2
 
3
3
  require 'spec_helper'
4
- require File.dirname(__FILE__) + '/../../../../../plugins/mcollective/security/psk.rb'
4
+ require 'mcollective/security/psk'
5
5
 
6
6
  module MCollective::Security
7
7
  describe Psk do
@@ -6,7 +6,7 @@ module MCollective
6
6
  describe SSL do
7
7
  before do
8
8
  @rootdir = File.dirname(__FILE__)
9
- @ssl = SSL.new("#{@rootdir}/../fixtures/test-public.pem", "#{@rootdir}/../fixtures/test-private.pem")
9
+ @ssl = SSL.new("#{@rootdir}/../../fixtures/test-public.pem", "#{@rootdir}/../../fixtures/test-private.pem")
10
10
  end
11
11
 
12
12
  it "should be able to decode base64 text it encoded" do
@@ -51,26 +51,26 @@ module MCollective
51
51
 
52
52
  it "should take the configured value when present" do
53
53
  Config.instance.stubs("ssl_cipher").returns("aes-128-cbc")
54
- @ssl = SSL.new("#{@rootdir}/../fixtures/test-public.pem", "#{@rootdir}/../fixtures/test-private.pem")
54
+ @ssl = SSL.new("#{@rootdir}/../../fixtures/test-public.pem", "#{@rootdir}/../../fixtures/test-private.pem")
55
55
 
56
56
  @ssl.ssl_cipher.should == "aes-128-cbc"
57
57
  end
58
58
 
59
59
  it "should set the supplied ssl cipher" do
60
- @ssl = SSL.new("#{@rootdir}/../fixtures/test-public.pem", "#{@rootdir}/../fixtures/test-private.pem", nil, "aes-128-cbc")
60
+ @ssl = SSL.new("#{@rootdir}/../../fixtures/test-public.pem", "#{@rootdir}/../../fixtures/test-private.pem", nil, "aes-128-cbc")
61
61
  @ssl.ssl_cipher.should == "aes-128-cbc"
62
62
  end
63
63
 
64
64
  it "should prefer the supplied cipher over configured cipher" do
65
65
  Config.instance.stubs("aes_key_size").returns("foo-foo-foo")
66
- @ssl = SSL.new("#{@rootdir}/../fixtures/test-public.pem", "#{@rootdir}/../fixtures/test-private.pem", nil, "aes-128-cbc")
66
+ @ssl = SSL.new("#{@rootdir}/../../fixtures/test-public.pem", "#{@rootdir}/../../fixtures/test-private.pem", nil, "aes-128-cbc")
67
67
 
68
68
  @ssl.ssl_cipher.should == "aes-128-cbc"
69
69
  end
70
70
 
71
71
  it "should fail on invalid ciphers" do
72
72
  expect {
73
- @ssl = SSL.new("#{@rootdir}/../fixtures/test-public.pem", "#{@rootdir}/../fixtures/test-private.pem", nil, "foo-foo-foo")
73
+ @ssl = SSL.new("#{@rootdir}/../../fixtures/test-public.pem", "#{@rootdir}/../../fixtures/test-private.pem", nil, "foo-foo-foo")
74
74
  }.to raise_error("The supplied cipher 'foo-foo-foo' is not supported")
75
75
  end
76
76
  end
@@ -97,11 +97,11 @@ module MCollective
97
97
  end
98
98
 
99
99
  it "should read a public key" do
100
- @ssl.read_key(:public, "#{@rootdir}/../fixtures/test-public.pem")
100
+ @ssl.read_key(:public, "#{@rootdir}/../../fixtures/test-public.pem")
101
101
  end
102
102
 
103
103
  it "should read the public key from a certificate" do
104
- @ssl.read_key(:public, "#{@rootdir}/../fixtures/test-cert.pem").to_s.should match(/.+BEGIN.+PUBLIC KEY.+END.+PUBLIC KEY.+/m)
104
+ @ssl.read_key(:public, "#{@rootdir}/../../fixtures/test-cert.pem").to_s.should match(/.+BEGIN.+PUBLIC KEY.+END.+PUBLIC KEY.+/m)
105
105
  end
106
106
 
107
107
  it "should return nil if no key was given" do
@@ -115,15 +115,15 @@ module MCollective
115
115
  it "should clear the OpenSSL error queue on ruby 1.8" do
116
116
  Util.expects(:ruby_version).returns("1.8.7")
117
117
  OpenSSL.expects(:errors)
118
- @ssl.read_key(:public, "#{@rootdir}/../fixtures/test-public.pem")
119
- @ssl.read_key(:private, "#{@rootdir}/../fixtures/test-private.pem")
118
+ @ssl.read_key(:public, "#{@rootdir}/../../fixtures/test-public.pem")
119
+ @ssl.read_key(:private, "#{@rootdir}/../../fixtures/test-private.pem")
120
120
  end
121
121
 
122
122
  it "should not clear the OpenSSL error queue on ruby > 1.8" do
123
123
  Util.expects(:ruby_version).returns("1.9.3")
124
124
  OpenSSL.expects(:errors).never
125
- @ssl.read_key(:public, "#{@rootdir}/../fixtures/test-public.pem")
126
- @ssl.read_key(:private, "#{@rootdir}/../fixtures/test-private.pem")
125
+ @ssl.read_key(:public, "#{@rootdir}/../../fixtures/test-public.pem")
126
+ @ssl.read_key(:private, "#{@rootdir}/../../fixtures/test-private.pem")
127
127
  end
128
128
  end
129
129
 
@@ -176,7 +176,7 @@ module MCollective
176
176
  end
177
177
 
178
178
  # new ssl instance configured for aes-128-cbc, should work
179
- @ssl = SSL.new("#{@rootdir}/../fixtures/test-public.pem", "#{@rootdir}/../fixtures/test-private.pem", nil, "aes-128-cbc")
179
+ @ssl = SSL.new("#{@rootdir}/../../fixtures/test-public.pem", "#{@rootdir}/../../fixtures/test-private.pem", nil, "aes-128-cbc")
180
180
  @ssl.aes_decrypt(key, data).should == "foo"
181
181
  end
182
182
  end