summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkaustubh-d <kausubh@clogeny.com>2013-07-18 01:16:30 -0700
committeradamedx <adamed@opscode.com>2013-07-23 10:36:15 -0700
commit81e80f1edc9b117246a0506c3fa1b7c25b92d0bc (patch)
treee7e9a88e96b4290c09a91cfbab4e8f665dad79d8
parentcccf92cfbe4b7f45a365e4160a18a698b69ab6ee (diff)
downloadchef-81e80f1edc9b117246a0506c3fa1b7c25b92d0bc.tar.gz
aix ifconfig - disable unit tests.
-rw-r--r--spec/unit/provider/ifconfig/aix_spec.rb45
1 files changed, 45 insertions, 0 deletions
diff --git a/spec/unit/provider/ifconfig/aix_spec.rb b/spec/unit/provider/ifconfig/aix_spec.rb
index 70b8632feb..c9dd771052 100644
--- a/spec/unit/provider/ifconfig/aix_spec.rb
+++ b/spec/unit/provider/ifconfig/aix_spec.rb
@@ -155,4 +155,49 @@ IFCONFIG
end
end
+ describe "#action_disable" do
+
+ it "should not disable an interface if it does not exist" do
+ @new_resource.device "en10"
+ @provider.stub!(:load_current_resource) do
+ @provider.instance_variable_set("@status", double("Status", :exitstatus => 0))
+ @provider.instance_variable_set("@current_resource", Chef::Resource::Ifconfig.new("10.0.0.1", @run_context))
+ end
+
+ @provider.should_not_receive(:run_command)
+
+ @provider.run_action(:disable)
+ @new_resource.should_not be_updated
+ end
+
+ context "interface exists" do
+ before do
+ @new_resource.device "en10"
+ @provider.stub!(:load_current_resource) do
+ @provider.instance_variable_set("@status", double("Status", :exitstatus => 0))
+ current_resource = Chef::Resource::Ifconfig.new("10.0.0.1", @run_context)
+ current_resource.device @new_resource.device
+ @provider.instance_variable_set("@current_resource", current_resource)
+ end
+ end
+
+ it "should disable an interface if it exists" do
+ command = "ifconfig #{@new_resource.device} down"
+ @provider.should_receive(:run_command).with(:command => command)
+
+ @provider.run_action(:disable)
+ @new_resource.should be_updated
+ end
+
+ it "should disable VIP" do
+ @new_resource.is_vip true
+ command = "ifconfig #{@new_resource.device} inet 10.0.0.1 delete"
+ @provider.should_receive(:run_command).with(:command => command)
+
+ @provider.run_action(:disable)
+ @new_resource.should be_updated
+ end
+ end
+ end
+
end \ No newline at end of file