icontrol 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -4,10 +4,9 @@ describe IControl::LocalLB::Pool do
4
4
 
5
5
  use_vcr_cassette "IControl::LocalLB::Pool", :record => :all, :match_requests_on => [:uri, :method, :body] # Change :record => :new_episodes when done
6
6
 
7
- TEST_POOL_NAME="test_pool"
8
-
9
7
  before(:each) do
10
- IControl::LocalLB::Pool.create(:pool_name => TEST_POOL_NAME,
8
+ @test_pool_name="test_pool"
9
+ IControl::LocalLB::Pool.create(:pool_name => @test_pool_name,
11
10
  :lb_method => IControl::LocalLB::LBMethod::LB_METHOD_ROUND_ROBIN,
12
11
  :members => [{:address => "192.168.50.1",:port => "80"},
13
12
  {:address => "192.168.50.2",:port => "80"},
@@ -16,7 +15,7 @@ describe IControl::LocalLB::Pool do
16
15
  {:address => "192.168.50.5",:port => "80"},
17
16
  {:address => "192.168.50.6",:port => "80"}
18
17
  ])
19
- @pool = IControl::LocalLB::Pool.find(TEST_POOL_NAME)
18
+ @pool = IControl::LocalLB::Pool.find(@test_pool_name)
20
19
  end
21
20
 
22
21
  after(:each) do
@@ -161,12 +160,12 @@ describe IControl::LocalLB::Pool do
161
160
  all_statistics.statistics
162
161
  # => [<IControl::Common::Statistic:0x..... ] An array with every statistic
163
162
 
164
- all_statistics.time_stamp.inspect
163
+ all_statistics.time_stamp
165
164
  # => #<IControl::Common::TimeStamp:0x9ddcf6c @attributes={:year=>"2011", :month=>"1", :day=>"4", :hour=>"10", :minute=>"59", :second=>"29", :id=>nil}>
166
165
 
167
166
 
168
- test_pool_statistics = all_statistics.statistics.find { |i| i.pool_name == TEST_POOL_NAME }
169
- # => #<IControl::LocalLB::Pool::PoolStatisticEntry:0xa492f8c @attributes={:pool_name=>TEST_POOL_NAME, :statistics=>["<..... The statistics for a given pool
167
+ test_pool_statistics = all_statistics.statistics.find { |i| i.pool_name == @test_pool_name }
168
+ # => #<IControl::LocalLB::Pool::PoolStatisticEntry:0xa492f8c @attributes={:pool_name=>@test_pool_name, :statistics=>["<..... The statistics for a given pool
170
169
  test_pool_statistics.statistics
171
170
  # => [#<IControl::Common::Statistic:0xa497d34 @attributes={:type=>:STATISTIC_SERVER_SIDE_BYTES_IN, :value=>#<IControl::Common::ULong64:0xa497d98 @attributes={:high=>"0", :low=>"0", :id=>nil}>, :time_stamp=>"0", :id=>nil}>, #<IControl::Common::Statistic:0xa497780.... The actual values
172
171
 
@@ -284,7 +283,7 @@ describe IControl::LocalLB::Pool do
284
283
  end
285
284
 
286
285
  it "works this way" do
287
- @pool.lb_method.inspect
286
+ @pool.lb_method
288
287
  # => :LB_METHOD_DYNAMIC_RATIO
289
288
  end
290
289
 
@@ -334,7 +333,7 @@ describe IControl::LocalLB::Pool do
334
333
  end
335
334
 
336
335
  it "works this way" do
337
- puts @pool.minimum_active_member.inspect
336
+ @pool.minimum_active_member
338
337
  # => 0
339
338
  end
340
339
 
@@ -353,7 +352,7 @@ describe IControl::LocalLB::Pool do
353
352
  end
354
353
 
355
354
  it "works this way" do
356
- @pool.minimum_up_member.inspect
355
+ @pool.minimum_up_member
357
356
  # => 0
358
357
  end
359
358
 
@@ -421,7 +420,7 @@ describe IControl::LocalLB::Pool do
421
420
  describe "#monitor_instance" do
422
421
 
423
422
  before(:each) do
424
- IControl::LocalLB::Pool.set_monitor_association(:monitor_association => {:pool_name => TEST_POOL_NAME,:monitor_rule => {:type => IControl::LocalLB::MonitorRuleType::MONITOR_RULE_TYPE_SINGLE,:monitor_templates => ["tcp"],:quorum => 0} })
423
+ IControl::LocalLB::Pool.set_monitor_association(:monitor_association => {:pool_name => @test_pool_name,:monitor_rule => {:type => IControl::LocalLB::MonitorRuleType::MONITOR_RULE_TYPE_SINGLE,:monitor_templates => ["tcp"],:quorum => 0} })
425
424
  end
426
425
 
427
426
  it "should return without raising any exception" do
@@ -567,7 +566,7 @@ describe IControl::LocalLB::Pool do
567
566
 
568
567
  it "works this way" do
569
568
  statistics = @pool.statistics
570
- statistics.time_stamp.inspect
569
+ statistics.time_stamp
571
570
  # => #<IControl::Common::TimeStamp:0x7f4bdea1f5c8 @attributes={:month=>"1", :year=>"2011", :second=>"46", :hour=>"14", :day=>"4", :id=>nil, :minute=>"33"}>
572
571
  statistics.statistics.statistics.first.type
573
572
  # => :STATISTIC_SERVER_SIDE_BYTES_IN
@@ -590,7 +589,7 @@ describe IControl::LocalLB::Pool do
590
589
  end
591
590
 
592
591
  it "works this way" do
593
- @pool.version.inspect
592
+ @pool.version
594
593
  # => "BIG-IP_v10.0.1"
595
594
  end
596
595
 
@@ -619,17 +618,17 @@ describe IControl::LocalLB::Pool do
619
618
 
620
619
  describe "#set_monitor_association" do
621
620
  it "Sets/creates the monitor associations for the specified pools. This basically creates the monitor associations between a pool and a monitor rule." do
622
- lambda { IControl::LocalLB::Pool.set_monitor_association(:monitor_association => {:pool_name => TEST_POOL_NAME,:monitor_rule => {:type => IControl::LocalLB::MonitorRuleType::MONITOR_RULE_TYPE_SINGLE,:monitor_templates => ["tcp"],:quorum => 0} })}.should_not raise_exception
621
+ lambda { IControl::LocalLB::Pool.set_monitor_association(:monitor_association => {:pool_name => @test_pool_name,:monitor_rule => {:type => IControl::LocalLB::MonitorRuleType::MONITOR_RULE_TYPE_SINGLE,:monitor_templates => ["tcp"],:quorum => 0} })}.should_not raise_exception
623
622
  end
624
623
 
625
624
  it "works this way" do
626
625
  IControl::LocalLB::Pool.set_monitor_association(:monitor_association =>
627
- {:pool_name => TEST_POOL_NAME,
626
+ {:pool_name => @test_pool_name,
628
627
  :monitor_rule => {
629
628
  :type => IControl::LocalLB::MonitorRuleType::MONITOR_RULE_TYPE_SINGLE,
630
629
  :monitor_templates => ["http"],
631
630
  :quorum => 0}
632
- }).inspect
631
+ })
633
632
  # Note that this does not add a new monitor association but replaces the one currently set
634
633
  end
635
634
  end
@@ -15,7 +15,7 @@ describe IControl::LocalLB::ProfileHttpClass do
15
15
 
16
16
  describe "#add_cookie_match_pattern" do
17
17
  it "Adds to the lists of patterns used to match the cookies." do
18
- @profile_http_class.cookie_match_pattern.values.should be_nil
18
+ @profile_http_class.cookie_match_pattern.values.should == nil
19
19
  @profile_http_class.add_cookie_match_pattern(:patterns => [{:pattern => "/test/",:is_glob => false}])
20
20
  @profile_http_class.add_cookie_match_pattern(:patterns => [{:pattern => "/test/2",:is_glob => true }])
21
21
  @profile_http_class.cookie_match_pattern.values.length.should == 2
@@ -28,7 +28,7 @@ describe IControl::LocalLB::ProfileHttpClass do
28
28
 
29
29
  describe "#add_header_match_pattern" do
30
30
  it "Adds to the lists of patterns used to match the headers." do
31
- @profile_http_class.header_match_pattern.values.should be_nil
31
+ @profile_http_class.header_match_pattern.values.should == nil
32
32
  @profile_http_class.add_header_match_pattern(:patterns => [{:pattern => "/test/",:is_glob => false}])
33
33
  @profile_http_class.add_header_match_pattern(:patterns => [{:pattern => "/test/2",:is_glob => true }])
34
34
  @profile_http_class.header_match_pattern.values.length.should == 2
@@ -41,7 +41,7 @@ describe IControl::LocalLB::ProfileHttpClass do
41
41
 
42
42
  describe "#add_host_match_pattern" do
43
43
  it "Adds to the lists of patterns used to match the hosts." do
44
- @profile_http_class.host_match_pattern.values.should be_nil
44
+ @profile_http_class.host_match_pattern.values.should == nil
45
45
  @profile_http_class.add_host_match_pattern(:patterns => [{:pattern => "/test/",:is_glob => false}])
46
46
  @profile_http_class.add_host_match_pattern(:patterns => [{:pattern => "/test/2",:is_glob => true }])
47
47
  @profile_http_class.host_match_pattern.values.length.should == 2
@@ -54,7 +54,7 @@ describe IControl::LocalLB::ProfileHttpClass do
54
54
 
55
55
  describe "#add_path_match_pattern" do
56
56
  it "Adds to the lists of patterns used to match the URI paths." do
57
- @profile_http_class.path_match_pattern.values.should be_nil
57
+ @profile_http_class.path_match_pattern.values.should == nil
58
58
  @profile_http_class.add_path_match_pattern(:patterns => [{:pattern => "/test/",:is_glob => false}])
59
59
  @profile_http_class.add_path_match_pattern(:patterns => [{:pattern => "/test/2",:is_glob => true }])
60
60
  @profile_http_class.path_match_pattern.values.length.should == 2
@@ -83,11 +83,11 @@ describe IControl::LocalLB::ProfileHttpClass do
83
83
 
84
84
  describe "#delete_all_profiles" do
85
85
  it "Deletes all HTTP class profiles." do
86
- pending "I not deleting all of the profiles just for the sake of it !"
86
+ pending "I'm not deleting all of the profiles just for the sake of it !"
87
87
  end
88
88
 
89
89
  it "works this way" do
90
- pending "I not deleting all of the profiles just for the sake of it !"
90
+ pending "I'm not deleting all of the profiles just for the sake of it !"
91
91
  end
92
92
  end
93
93
 
@@ -250,7 +250,7 @@ describe IControl::LocalLB::ProfileHttpClass do
250
250
  end
251
251
 
252
252
  it "works this way" do
253
- @profile_http_class.pool_name.inspect
253
+ @profile_http_class.pool_name
254
254
  end
255
255
 
256
256
  it "returns an instance of IControl::LocalLB::ProfileString" do
@@ -264,15 +264,16 @@ describe IControl::LocalLB::ProfileHttpClass do
264
264
  end
265
265
 
266
266
  it "Gets the string (which may include a TCL expression) to indicates where to redirect the original HTTP request once a match occurs. For example, to redirect requests to https://myserver.com to http://myotherserver.com." do
267
- pending
267
+ @profile_http_class.redirect_location.should_not be_nil
268
268
  end
269
269
 
270
270
  it "works this way" do
271
- pending
271
+ @profile_http_class.redirect_location
272
+ # => #<IControl::LocalLB::ProfileString:0xa9b4790 @attributes={:value=>nil, :default_flag=>"true"}>
272
273
  end
273
274
 
274
275
  it "returns an instance of ProfileString" do
275
- pending
276
+ @profile_http_class.redirect_location.class == IControl::LocalLB::ProfileString
276
277
  end
277
278
  end
278
279
 
@@ -282,15 +283,16 @@ describe IControl::LocalLB::ProfileHttpClass do
282
283
  end
283
284
 
284
285
  it "Gets the strings (which may include a TCL expression) with which to rewrite the URLs." do
285
- pending
286
+ @profile_http_class.rewrite_url.should_not be_nil
286
287
  end
287
288
 
288
289
  it "works this way" do
289
- pending
290
+ @profile_http_class.rewrite_url
291
+ # => #<IControl::LocalLB::ProfileString:0xa9b4790 @attributes={:value=>nil, :default_flag=>"true"}>
290
292
  end
291
293
 
292
294
  it "returns an instance of ProfileString" do
293
- pending
295
+ @profile_http_class.rewrite_url.class.should == IControl::LocalLB::ProfileString
294
296
  end
295
297
  end
296
298
 
@@ -300,15 +302,7 @@ describe IControl::LocalLB::ProfileHttpClass do
300
302
  end
301
303
 
302
304
  it "Gets the statistics for the specified profiles." do
303
- pending
304
- end
305
-
306
- it "works this way" do
307
- pending
308
- end
309
-
310
- it "returns an instance of ProfileHttpClassStatistics" do
311
- pending
305
+ @profile_http_class.statistics.should_not be_nil
312
306
  end
313
307
  end
314
308
 
@@ -318,15 +312,16 @@ describe IControl::LocalLB::ProfileHttpClass do
318
312
  end
319
313
 
320
314
  it "Gets the version information for this interface." do
321
- pending
315
+ @profile_http_class.version.should_not be_nil
322
316
  end
323
317
 
324
318
  it "works this way" do
325
- pending
319
+ @profile_http_class.version
320
+ # => "BIGIP..."
326
321
  end
327
322
 
328
323
  it "returns an instance of String" do
329
- pending
324
+ @profile_http_class.version.class.should == String
330
325
  end
331
326
  end
332
327
 
@@ -336,179 +331,266 @@ describe IControl::LocalLB::ProfileHttpClass do
336
331
  end
337
332
 
338
333
  it "Gets the states that specify whether specified classes are Web Accelerator classes." do
339
- pending
334
+ @profile_http_class.web_accelerator_module_enabled_state.should_not be_nil
340
335
  end
341
336
 
342
337
  it "works this way" do
343
- pending
338
+ @profile_http_class.web_accelerator_module_enabled_state
339
+ # => #<IControl::LocalLB::ProfileEnabledState:0xa10facc @attributes={:value=>:STATE_DISABLED, :default_flag=>"true"}>
344
340
  end
345
341
 
346
342
  it "returns an instance of ProfileEnabledState" do
347
- pending
343
+ @profile_http_class.web_accelerator_module_enabled_state.class.should == IControl::LocalLB::ProfileEnabledState
348
344
  end
349
345
  end
350
346
 
351
347
  describe "#is_base_profile" do
348
+
352
349
  it "Determines whether the specified profiles are base/pre-configured profiles, or user-defined profiles." do
353
- pending
350
+ @profile_http_class.is_base_profile.should_not == true
351
+ IControl::LocalLB::ProfileHttpClass.find("httpclass").is_base_profile.should == true
354
352
  end
355
353
 
356
354
  it "works this way" do
357
- pending
355
+ @profile_http_class.is_base_profile
356
+ # => false
357
+ IControl::LocalLB::ProfileHttpClass.find("httpclass")
358
+ # => true
358
359
  end
359
360
 
360
- it "returns an instance of boolean" do
361
- pending
362
- end
363
361
  end
364
362
 
365
363
  describe "#remove_cookie_match_pattern" do
366
364
  it "Removes from the lists of patterns used to match the cookies." do
367
- pending
365
+ @profile_http_class.cookie_match_pattern.values.should == nil
366
+ @profile_http_class.add_cookie_match_pattern(:patterns => [{:pattern => "/test/",:is_glob => false}])
367
+ @profile_http_class.add_cookie_match_pattern(:patterns => [{:pattern => "/test/2",:is_glob => true }])
368
+ @profile_http_class.cookie_match_pattern.values.length.should == 2
369
+ @profile_http_class.remove_cookie_match_pattern(:patterns => [{:pattern => "/test/",:is_glob => false}])
370
+ @profile_http_class.remove_cookie_match_pattern(:patterns => [{:pattern => "/test/2",:is_glob => true }])
371
+ @profile_http_class.cookie_match_pattern.values.should == nil
368
372
  end
369
373
 
370
374
  it "works this way" do
371
- pending
375
+ @profile_http_class.cookie_match_pattern.values
376
+ # => nil
377
+ @profile_http_class.add_cookie_match_pattern(:patterns => [{:pattern => "/test/",:is_glob => false}])
378
+ @profile_http_class.add_cookie_match_pattern(:patterns => [{:pattern => "/test/2",:is_glob => true }])
379
+ @profile_http_class.cookie_match_pattern.values.length
380
+ # => 2
381
+ @profile_http_class.remove_cookie_match_pattern(:patterns => [{:pattern => "/test/",:is_glob => false}])
382
+ @profile_http_class.remove_cookie_match_pattern(:patterns => [{:pattern => "/test/2",:is_glob => true }])
383
+ @profile_http_class.cookie_match_pattern.values
384
+ # => nil
372
385
  end
373
386
  end
374
387
 
375
388
  describe "#remove_header_match_pattern" do
376
389
  it "Removes from the lists of patterns used to match the headers." do
377
- pending
390
+ @profile_http_class.header_match_pattern.values.should == nil
391
+ @profile_http_class.add_header_match_pattern(:patterns => [{:pattern => "/test/",:is_glob => false}])
392
+ @profile_http_class.add_header_match_pattern(:patterns => [{:pattern => "/test/2",:is_glob => true }])
393
+ @profile_http_class.header_match_pattern.values.length.should == 2
394
+ @profile_http_class.remove_header_match_pattern(:patterns => [{:pattern => "/test/",:is_glob => false}])
395
+ @profile_http_class.remove_header_match_pattern(:patterns => [{:pattern => "/test/2",:is_glob => true }])
396
+ @profile_http_class.header_match_pattern.values.should == nil
378
397
  end
379
398
 
380
399
  it "works this way" do
381
- pending
400
+ @profile_http_class.header_match_pattern.values
401
+ # => nil
402
+ @profile_http_class.add_header_match_pattern(:patterns => [{:pattern => "/test/",:is_glob => false}])
403
+ @profile_http_class.add_header_match_pattern(:patterns => [{:pattern => "/test/2",:is_glob => true }])
404
+ @profile_http_class.header_match_pattern.values.length
405
+ # => 2
406
+ @profile_http_class.remove_header_match_pattern(:patterns => [{:pattern => "/test/",:is_glob => false}])
407
+ @profile_http_class.remove_header_match_pattern(:patterns => [{:pattern => "/test/2",:is_glob => true }])
408
+ @profile_http_class.header_match_pattern.values
409
+ # => nil
382
410
  end
383
411
  end
384
412
 
385
413
  describe "#remove_host_match_pattern" do
386
414
  it "Removes from the lists of patterns used to match the hosts." do
387
- pending
415
+ @profile_http_class.host_match_pattern.values.should == nil
416
+ @profile_http_class.add_host_match_pattern(:patterns => [{:pattern => "/test/",:is_glob => false}])
417
+ @profile_http_class.add_host_match_pattern(:patterns => [{:pattern => "/test/2",:is_glob => true }])
418
+ @profile_http_class.host_match_pattern.values.length.should == 2
419
+ @profile_http_class.remove_host_match_pattern(:patterns => [{:pattern => "/test/",:is_glob => false}])
420
+ @profile_http_class.remove_host_match_pattern(:patterns => [{:pattern => "/test/2",:is_glob => true }])
421
+ @profile_http_class.host_match_pattern.values.should == nil
388
422
  end
389
423
 
390
424
  it "works this way" do
391
- pending
425
+ @profile_http_class.host_match_pattern.values
426
+ # => nil
427
+ @profile_http_class.add_host_match_pattern(:patterns => [{:pattern => "/test/",:is_glob => false}])
428
+ @profile_http_class.add_host_match_pattern(:patterns => [{:pattern => "/test/2",:is_glob => true }])
429
+ @profile_http_class.host_match_pattern.values.length
430
+ # => 2
431
+ @profile_http_class.remove_host_match_pattern(:patterns => [{:pattern => "/test/",:is_glob => false}])
432
+ @profile_http_class.remove_host_match_pattern(:patterns => [{:pattern => "/test/2",:is_glob => true }])
433
+ @profile_http_class.host_match_pattern.values
434
+ # => nil
392
435
  end
393
436
  end
394
437
 
395
438
  describe "#remove_path_match_pattern" do
396
439
  it "Removes from the lists of patterns used to match the URI paths." do
397
- pending
440
+ @profile_http_class.path_match_pattern.values.should == nil
441
+ @profile_http_class.add_path_match_pattern(:patterns => [{:pattern => "/test/",:is_glob => false}])
442
+ @profile_http_class.add_path_match_pattern(:patterns => [{:pattern => "/test/2",:is_glob => true }])
443
+ @profile_http_class.path_match_pattern.values.length.should == 2
444
+ @profile_http_class.remove_path_match_pattern(:patterns => [{:pattern => "/test/",:is_glob => false}])
445
+ @profile_http_class.remove_path_match_pattern(:patterns => [{:pattern => "/test/2",:is_glob => true }])
446
+ @profile_http_class.path_match_pattern.values.should == nil
398
447
  end
399
448
 
400
449
  it "works this way" do
401
- pending
450
+ @profile_http_class.path_match_pattern.values
451
+ # => nil
452
+ @profile_http_class.add_path_match_pattern(:patterns => [{:pattern => "/test/",:is_glob => false}])
453
+ @profile_http_class.add_path_match_pattern(:patterns => [{:pattern => "/test/2",:is_glob => true }])
454
+ @profile_http_class.path_match_pattern.values.length
455
+ # => 2
456
+ @profile_http_class.remove_path_match_pattern(:patterns => [{:pattern => "/test/",:is_glob => false}])
457
+ @profile_http_class.remove_path_match_pattern(:patterns => [{:pattern => "/test/2",:is_glob => true }])
458
+ @profile_http_class.path_match_pattern.values
459
+ # => nil
402
460
  end
403
461
  end
404
462
 
405
463
  describe "#reset_statistics" do
406
464
  it "Resets the statistics for the specified profiles." do
407
- pending
465
+ lambda { @profile_http_class.reset_statistics }.should_not raise_exception
408
466
  end
409
467
 
410
468
  it "works this way" do
411
- pending
469
+ @profile_http_class.reset_statistics
470
+ # => Statistics reset
412
471
  end
413
472
  end
414
473
 
415
474
  describe "#set_application_security_module_enabled_state" do
416
475
  it "Sets the states that specify whether specified classes are Application Security Module classes." do
417
- pending
476
+ value_before = @profile_http_class.application_security_module_enabled_state.value
477
+ @profile_http_class.set_application_security_module_enabled_state(:state => {:value => IControl::Common::EnabledState::STATE_ENABLED,:default_flag => false})
478
+ @profile_http_class.application_security_module_enabled_state.value.should_not == value_before
418
479
  end
419
480
 
420
481
  it "works this way" do
421
- pending
482
+ @profile_http_class.set_application_security_module_enabled_state(:state => {:value => IControl::Common::EnabledState::STATE_ENABLED,:default_flag => false})
422
483
  end
423
484
  end
424
485
 
425
486
  describe "#set_default_cookie_match_pattern" do
426
487
  it "Resets the lists to parent defaults." do
427
- pending
428
- end
429
-
430
- it "works this way" do
431
- pending
488
+ lambda { @profile_http_class.set_default_cookie_match_pattern }.should_not raise_exception
432
489
  end
433
490
  end
434
491
 
435
492
  describe "#set_default_header_match_pattern" do
436
493
  it "Resets the lists to parent defaults." do
437
- pending
438
- end
439
-
440
- it "works this way" do
441
- pending
494
+ lambda { @profile_http_class.set_default_header_match_pattern }.should_not raise_exception
442
495
  end
443
496
  end
444
497
 
445
498
  describe "#set_default_host_match_pattern" do
446
499
  it "Resets the lists to parent defaults." do
447
- pending
448
- end
449
-
450
- it "works this way" do
451
- pending
500
+ lambda { @profile_http_class.set_default_host_match_pattern }.should_not raise_exception
452
501
  end
453
502
  end
454
503
 
455
504
  describe "#set_default_path_match_pattern" do
456
505
  it "Resets the lists to parent defaults." do
457
- pending
458
- end
459
-
460
- it "works this way" do
461
- pending
506
+ lambda { @profile_http_class.set_default_path_match_pattern }.should_not raise_exception
462
507
  end
463
508
  end
464
509
 
465
510
  describe "#set_default_profile" do
466
511
  it "Sets the names of the default profiles from which the specified profiles will derive default values for its attributes." do
467
- pending
512
+ lambda { @profile_http_class.set_default_profile(:default => "httpclass") }.should_not raise_exception
468
513
  end
469
514
 
470
515
  it "works this way" do
471
- pending
516
+ @profile_http_class.set_default_profile(:default => "httpclass")
472
517
  end
473
518
  end
474
519
 
475
520
  describe "#set_pool_name" do
521
+
522
+ before(:each) do
523
+ @pool_name = "___test_pool____"
524
+ IControl::LocalLB::Pool.create(:pool_name => @pool_name,
525
+ :lb_method => IControl::LocalLB::LBMethod::LB_METHOD_ROUND_ROBIN,
526
+ :members => [{:address => "192.168.50.1",:port => "80"},
527
+ {:address => "192.168.50.2",:port => "80"},
528
+ {:address => "192.168.50.3",:port => "80"},
529
+ {:address => "192.168.50.4",:port => "80"},
530
+ {:address => "192.168.50.5",:port => "80"},
531
+ {:address => "192.168.50.6",:port => "80"}
532
+ ])
533
+ end
534
+
535
+ after(:each) do
536
+ @pool = IControl::LocalLB::Pool.find(@pool_name)
537
+ @pool.delete_pool
538
+ end
539
+
476
540
  it "Sets the pool names to use when the specified classes match." do
477
- pending
541
+
542
+ @profile_http_class.set_pool_name(:pool_name => {:value => @pool_name,:default_flag => false})
543
+ @profile_http_class.pool_name.value.should == @pool_name
544
+ @profile_http_class.set_pool_name(:pool_name => {:value => nil,:default_flag => false})
545
+ @profile_http_class.pool_name.value.should be_nil
546
+
478
547
  end
479
548
 
480
549
  it "works this way" do
481
- pending
550
+ @profile_http_class.set_pool_name(:pool_name => {:value => @pool_name,:default_flag => false})
551
+ # This sets the pool
552
+ @profile_http_class.set_pool_name(:pool_name => {:value => nil,:default_flag => false})
553
+ # This empty it
482
554
  end
483
555
  end
484
556
 
485
557
  describe "#set_redirect_location" do
486
558
  it "Sets the string (which may include a TCL expression) to indicates where to redirect the original HTTP request once a match occurs. For example, to redirect requests to https://myserver.com to http://myotherserver.com." do
487
- pending
559
+ @profile_http_class.redirect_location.value.should == nil
560
+ @profile_http_class.set_redirect_location(:redirect_location => {:default_flag => false, :value => "http://test.test.com"})
561
+ @profile_http_class.redirect_location.value.should == "http://test.test.com"
488
562
  end
489
563
 
490
564
  it "works this way" do
491
- pending
565
+ @profile_http_class.set_redirect_location(:redirect_location => {:default_flag => false, :value => "http://test.test.com"})
492
566
  end
493
567
  end
494
568
 
495
569
  describe "#set_rewrite_url" do
496
570
  it "Sets the strings (which may include a TCL expression) with which to rewrite the URLs." do
497
- pending
571
+ @profile_http_class.rewrite_url.value.should == nil
572
+ @profile_http_class.set_rewrite_url(:url => {:default_flag => false, :value => "http://test.test.com"})
573
+ @profile_http_class.rewrite_url.value.should == "http://test.test.com"
498
574
  end
499
575
 
500
576
  it "works this way" do
501
- pending
577
+ @profile_http_class.set_rewrite_url(:url => {:default_flag => false, :value => "http://test.test.com"})
502
578
  end
503
579
  end
504
580
 
505
581
  describe "#set_web_accelerator_module_enabled_state" do
506
582
  it "Sets the states that specify whether specified classes are Web Accelerator classes." do
507
- pending
583
+ value_before = @profile_http_class.web_accelerator_module_enabled_state.value
584
+ @profile_http_class.set_web_accelerator_module_enabled_state(:state => {:value => IControl::Common::EnabledState::STATE_ENABLED,
585
+ :default_flag => false})
586
+ @profile_http_class.web_accelerator_module_enabled_state.value.should_not == value_before
508
587
  end
509
588
 
510
589
  it "works this way" do
511
- pending
590
+ @profile_http_class.set_web_accelerator_module_enabled_state(:state => {
591
+ :value => IControl::Common::EnabledState::STATE_ENABLED,
592
+ :default_flag => false}
593
+ )
512
594
  end
513
595
  end
514
596
  end