Permalink
Browse files

Use slacklabs urls for the tests and example code. Fixes #1.

  • Loading branch information...
1 parent 680eda9 commit 4321cd9272849f8a60c56f505224ae7c1800bc6a @porcupie porcupie committed Dec 2, 2012
Showing with 20 additions and 16 deletions.
  1. +4 −2 Rakefile
  2. +5 −5 example.rb
  3. +11 −9 tests/test_nv_wrapper.rb
View
@@ -1,6 +1,8 @@
require 'bundler'
+# Import some tasks that are useful in development mode.
+#
+Bundler::GemHelper.install_tasks
+
# some custom RPM helper tasks
load "lib/tasks/rpm.rake"
-
-Bundler::GemHelper.install_tasks
View
@@ -1,15 +1,15 @@
require 'nv_helpers'
-helper = NvHelpers::NvWrapper.new
+helper = NvHelpers::NvWrapper.new(:server => "http://nventory.slacklabs.com") # guest/guest
-puts helper.get_nodes_from_group("qa-r1-singles-webapp").inspect
+puts helper.get_nodes_from_group("apache-server").inspect
puts helper.parse_node_group("qa-r1-jazzed:account").inspect
# Get all graffitis of this nodegroup
-puts helper.get_graffitis("qa-ddao-singles-webapp").inspect
+puts helper.get_graffitis("apache-server").inspect
# Specify what graffitis you want to get
-puts helper.get_graffitis("qa-ddao-singles-webapp", ["service_name", "instances"]).inspect
+puts helper.get_graffitis("apache-server", ["test"]).inspect
puts helper.get_node_by_name("nonexistingnode.com").inspect
-puts helper.get_node_by_name("devssvm.dev.dc1.eharmony.com").inspect
+puts helper.get_node_by_name("cc1").inspect
View
@@ -4,18 +4,20 @@
class TestNvWrapper < Test::Unit::TestCase
def test_initialize
assert_nothing_raised{ NvHelpers::NvWrapper.new }
- assert_nothing_raised{ NvHelpers::NvWrapper.new({'server' => 'nventory.dev.corp.eharmony.com'}) }
- assert_nothing_raised{ NvHelpers::NvWrapper.new({'server' => 'nventory.corp.eharmony.com'}) }
- assert_nothing_raised{ NvHelpers::NvWrapper.new({'server' => 'nventory.dev.corp.eharmony.com', 'username' => 'ddao'}) }
- assert_nothing_raised{ NvHelpers::NvWrapper.new({'server' => 'nventory.dev.corp.eharmony.com', 'username' => 'ddao', 'password' => 'secret'}) }
+ assert_nothing_raised{ NvHelpers::NvWrapper.new({'server' => 'nventory.slacklabs.com'}) }
+ assert_nothing_raised{ NvHelpers::NvWrapper.new({'server' => 'nventory.slacklabs.com', 'username' => 'guest'}) }
+ assert_nothing_raised{ NvHelpers::NvWrapper.new({'server' => 'nventory.slacklabs.com', 'username' => 'guest', 'password' => 'guest'}) }
end
def test_get_nodes
- # NOTE: presumes objects that exist in the eharmony Production server ...
- nv_helper = NvHelpers::NvWrapper.new({'server' => 'nventory.corp.eharmony.com'})
+ nv_helper = NvHelpers::NvWrapper.new({'server' => 'nventory.slacklabs.com'})
- result = nv_helper.get_nodes({:get => {:name => "prod.dc1.eharmony.com", 'network_interfaces[name]' => "eth0"},
- :includes => ['network_interfaces[ip_addresses]']})
- assert(!result.empty?)
+ # expecting not to find any nodes on slacklabs that have interface
+ # eth0 ...
+ result = nv_helper.get_nodes({
+ :get => {'network_interfaces[name]' => "eth0"},
+ :includes => ['network_interfaces[ip_addresses]']
+ })
+ assert(result.empty?)
end
end

0 comments on commit 4321cd9

Please sign in to comment.