icontrol 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -7,7 +7,7 @@ class EndpointHelper
7
7
 
8
8
  def self.soap_endpoint
9
9
  icontrol_base = IControl.config[:base_url].split("://")
10
- return icontrol_base[0] + "://" + IControl.config[:user] + ":" + IControl.config[:password] + "@" + icontrol_base[1..-1].join
10
+ return icontrol_base[0] + "://" + IControl.config[:user] + ":" + IControl.config[:password] + "@" + icontrol_base[1..-1].join + "/iControl/iControlPortal.cgi"
11
11
  end
12
12
 
13
13
  end
@@ -84,14 +84,14 @@ describe IControl::LocalLB::VirtualServer do
84
84
 
85
85
  describe "type method" do
86
86
 
87
- it "shold exists" do
87
+ it "should exists" do
88
88
  lambda { @virtual_server.type }.should_not raise_exception(NoMethodError)
89
89
  end
90
90
 
91
91
  it "should return a constant child of VirtualServerType" do
92
92
  vs_type = @virtual_server.type
93
93
  vs_type.should_not be(nil)
94
- vs_type.ancestors.should include(IControl::LocalLB::VirtualServer::Type)
94
+ IControl::LocalLB::VirtualServer::Type.constants.should include(vs_type.name.split("::").last.to_sym)
95
95
  end
96
96
  end
97
97
 
@@ -114,7 +114,7 @@ describe IControl::LocalLB::VirtualServer do
114
114
  it "should return a constant telling the cmp_enable_mode of the virtual server" do
115
115
  cmp_enable = @virtual_server.cmp_enable_mode
116
116
  cmp_enable.should_not be(nil)
117
- cmp_enable.ancestors.should include(IControl::LocalLB::VirtualServer::CMPEnableMode)
117
+ IControl::LocalLB::VirtualServer::CMPEnableMode.constants.should include(cmp_enable.name.split("::").last.to_sym)
118
118
  end
119
119
  end
120
120
 
@@ -149,7 +149,7 @@ describe IControl::LocalLB::VirtualServer do
149
149
  end
150
150
 
151
151
  it "should return an IControl::Common::ProtocolType constant" do
152
- @virtual_server.protocol.ancestors.should include(IControl::Common::ProtocolType)
152
+ IControl::Common::ProtocolType.constants.should include @virtual_server.protocol.name.split("::").last.to_sym
153
153
  end
154
154
  end
155
155
 
@@ -159,7 +159,7 @@ describe IControl::LocalLB::VirtualServer do
159
159
  end
160
160
 
161
161
  it "should return an IControl::Common::EnabledState constant" do
162
- @virtual_server.enabled_state.ancestors.should include(IControl::Common::EnabledState)
162
+ IControl::Common::EnabledState.constants.should include @virtual_server.enabled_state.name.split("::").last.to_sym
163
163
  end
164
164
  end
165
165
 
@@ -191,6 +191,10 @@ describe IControl::LocalLB::VirtualServer do
191
191
  it "should allow the assignment of a connection limit" do
192
192
  lambda { @virtual_server.connection_limit= 4194967294 }.should_not raise_exception
193
193
  end
194
+
195
+ it "should allow the assignment of a connection limit using an ULong64 instance" do
196
+ lambda { @virtual_server.connection_limit= IControl::Common::ULong64.new(:high => 0,:low => 4194967294) }.should_not raise_exception
197
+ end
194
198
  end
195
199
 
196
200
  describe "rate_class method" do
@@ -223,7 +227,7 @@ describe IControl::LocalLB::VirtualServer do
223
227
  end
224
228
 
225
229
  it "should return an IControl::Common::EnabledState constant" do
226
- @virtual_server.connection_mirror_state.ancestors.should include(IControl::Common::EnabledState)
230
+ IControl::Common::EnabledState.constants.should include(@virtual_server.connection_mirror_state.name.split("::").last.to_sym)
227
231
  end
228
232
  end
229
233
 
@@ -243,7 +247,7 @@ describe IControl::LocalLB::VirtualServer do
243
247
  end
244
248
 
245
249
  it "should return an IControl::Common::EnabledState constant" do
246
- @virtual_server.translate_port_state.ancestors.should include(IControl::Common::EnabledState)
250
+ IControl::Common::EnabledState.constants.should include(@virtual_server.translate_port_state.name.split("::").last.to_sym)
247
251
  end
248
252
  end
249
253
 
@@ -253,7 +257,7 @@ describe IControl::LocalLB::VirtualServer do
253
257
  end
254
258
 
255
259
  it "should return an IControl::Common::EnabledState constant" do
256
- @virtual_server.translate_address_state.ancestors.should include(IControl::Common::EnabledState)
260
+ IControl::Common::EnabledState.constants.should include(@virtual_server.translate_address_state.name.split("::").last.to_sym)
257
261
  end
258
262
  end
259
263
 
@@ -283,7 +287,7 @@ describe IControl::LocalLB::VirtualServer do
283
287
  end
284
288
 
285
289
  it "should return an IControl::Common::SourcePortBehavior constant" do
286
- @virtual_server.source_port_behavior.ancestors.should include(IControl::Common::SourcePortBehavior)
290
+ IControl::Common::SourcePortBehavior.constants.should include(@virtual_server.source_port_behavior.name.split("::").last.to_sym)
287
291
  end
288
292
  end
289
293
 
@@ -303,7 +307,7 @@ describe IControl::LocalLB::VirtualServer do
303
307
  end
304
308
 
305
309
  it "should return an IControl::LocalLB::HardwareAccelerationMode instance" do
306
- @virtual_server.actual_hardware_acceleration.ancestors.should include(IControl::LocalLB::HardwareAccelerationMode)
310
+ IControl::LocalLB::HardwareAccelerationMode.constants.should include(@virtual_server.actual_hardware_acceleration.name.split("::").last.to_sym)
307
311
  end
308
312
 
309
313
  end
@@ -314,7 +318,7 @@ describe IControl::LocalLB::VirtualServer do
314
318
  end
315
319
 
316
320
  it "should return an IControl::LocalLB::SnatType constant" do
317
- @virtual_server.snat_type.ancestors.should include(IControl::LocalLB::SnatType)
321
+ IControl::LocalLB::SnatType.constants.should include (@virtual_server.snat_type.name.split("::").last.to_sym)
318
322
  end
319
323
  end
320
324
 
@@ -349,6 +353,7 @@ describe IControl::LocalLB::VirtualServer do
349
353
  @virtual_server_nil.snat_pool.should be nil
350
354
  end
351
355
 
356
+
352
357
  it "should return a SnatPool" do
353
358
  @virtual_server.snat_pool.class.should be(IControl::LocalLB::SNATPool)
354
359
  end
@@ -382,6 +387,25 @@ describe IControl::LocalLB::VirtualServer do
382
387
  end
383
388
  end
384
389
 
390
+
391
+ describe "remove_persistence_profile method" do
392
+
393
+ it "should remove a given persistence profile" do
394
+ register_conversation ["IControl.LocalLB.VirtualServer_before_profile_removal.get_persistence_profile",
395
+ "IControl.LocalLB.VirtualServer_after_profile_removal.get_persistence_profile"]
396
+
397
+ persistence_profile = @virtual_server.persistence_profile
398
+ persistence_profile.should_not be_nil
399
+ @virtual_server.remove_persistence_profile(persistence_profile)
400
+ @virtual_server.persistence_profile.should be_nil
401
+ end
402
+
403
+ it "should exists" do
404
+ @virtual_server.methods.should include :remove_persistence_profile
405
+ end
406
+
407
+ end
408
+
385
409
  describe "rules method" do
386
410
 
387
411
  it "should exists" do
@@ -425,7 +449,7 @@ describe IControl::LocalLB::VirtualServer do
425
449
 
426
450
  it "should return a hash of statistics" do
427
451
  @virtual_server.statistics.class.should be(Hash)
428
- @virtual_server.statistics.first[0].ancestors.should include(IControl::Common::StatisticType)
452
+ IControl::Common::StatisticType.constants.should include(@virtual_server.statistics.first[0].name.split("::").last.to_sym)
429
453
  end
430
454
  end
431
455
 
@@ -459,12 +483,26 @@ describe IControl::LocalLB::VirtualServer do
459
483
  vlan = @virtual_server.vlan
460
484
  vlan.class.should be(IControl::Common::VLANFilterList)
461
485
  @virtual_server_nil.vlan.vlans.class.should be(Array)
462
- @virtual_server_nil.vlan.vlans.should be_empty
463
486
  vlan.vlans.should_not be_empty
464
487
  vlan.vlans.class.should be(Array)
465
488
  end
466
489
  end
467
490
 
491
+ describe "vlan= method" do
492
+ it "should exists" do
493
+ @virtual_server.methods.should include(:vlan=)
494
+ end
495
+ it "should allow the assignment of a VLAN" do
496
+ register_conversation(["IControl.LocalLB.VirtualServer_before_vlan_change.get_vlan",
497
+ "IControl.LocalLB.VirtualServer_after_vlan_change.get_vlan"])
498
+ source_vlan = @virtual_server.vlan
499
+ @virtual_server_nil.vlan.vlans.should be_empty
500
+ @virtual_server_nil.vlan = source_vlan
501
+ @virtual_server_nil.vlan.vlans.should_not be_empty
502
+ end
503
+ end
504
+
505
+
468
506
  describe "create method" do
469
507
  it "should create a new virtual_server when correctly called" do
470
508
  virtual_server =
@@ -648,6 +686,10 @@ describe IControl::LocalLB::VirtualServer do
648
686
  @virtual_server.methods.should include(:snat_pool=)
649
687
  end
650
688
 
689
+ it "should do nothing if nil is passed" do
690
+ lambda { @virtual_server.snat_pool= nil }.should_not raise_exception
691
+ end
692
+
651
693
  it "assign a new snat pool" do
652
694
  register_conversation(["IControl.LocalLB.VirtualServer.get_snat_pool_before_snat_pool",
653
695
  "IControl.LocalLB.VirtualServer.get_snat_pool_after_snat_pool"])
@@ -44,7 +44,7 @@ def register_fixtures
44
44
  end
45
45
 
46
46
  Spec::Runner.configure do |config|
47
- IControl.config[:base_url] = "https://localhost:443/iControl/iControlPortal.cgi"
47
+ IControl.config[:base_url] = "https://localhost:443"
48
48
  IControl.config[:user] = "test_user"
49
49
  IControl.config[:password] = "secret"
50
50
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: icontrol
3
3
  version: !ruby/object:Gem::Version
4
- hash: 27
4
+ hash: 25
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 2
10
- version: 0.0.2
9
+ - 3
10
+ version: 0.0.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Jose Fernandez (magec)
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-08-23 00:00:00 +02:00
18
+ date: 2010-08-24 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -72,7 +72,6 @@ extensions: []
72
72
 
73
73
  extra_rdoc_files:
74
74
  - LICENSE
75
- - README.markdown
76
75
  - README.rdoc
77
76
  files:
78
77
  - lib/icontrol.rb
@@ -93,7 +92,6 @@ files:
93
92
  - lib/icontrol/mappings.rb
94
93
  - lib/icontrol/statistic_type.rb
95
94
  - LICENSE
96
- - README.markdown
97
95
  - README.rdoc
98
96
  - spec/icontrol_local_lb_pool_spec.rb
99
97
  - spec/icontrol_local_lb_profile_http_class_spec.rb
@@ -1,9 +0,0 @@
1
- # IControl: F5 BigIP SOAP API Client
2
-
3
- IControl allows you to easily connect to a BigIP F5 load balancer and by means of the SOAP API. You can programmatically do almost the same as in the Web Interface.
4
-
5
- ## Installing
6
-
7
- # Install the gem:
8
- gem install icontrol
9
-