[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Ovirt-devel] [PATCH] fixed tests for pools.



Not sure if this is everything we need, but with this the only continued failures were in different areas (host browser, etc), so this should fix the pool-related test failures.

Signed-off-by: Scott Seago <sseago redhat com>
---
 src/app/controllers/storage_controller.rb |    2 +-
 src/test/fixtures/pools.yml               |   73 +++++++++++++++++++----------
 src/test/functional/interface_test.rb     |    4 +-
 3 files changed, 51 insertions(+), 28 deletions(-)

diff --git a/src/app/controllers/storage_controller.rb b/src/app/controllers/storage_controller.rb
index 7eec618..bbd7840 100644
--- a/src/app/controllers/storage_controller.rb
+++ b/src/app/controllers/storage_controller.rb
@@ -255,7 +255,7 @@ class StorageController < ApplicationController
     respond_to do |format|
       format.json { render :json => { :object => "storage_pool",
           :success => success, :alert => alert } }
-      format.xml { head (success ? :ok : :method_not_allowed) }
+      format.xml { head(success ? :ok : :method_not_allowed) }
     end
   end
 
diff --git a/src/test/fixtures/pools.yml b/src/test/fixtures/pools.yml
index 1862e40..181a75b 100644
--- a/src/test/fixtures/pools.yml
+++ b/src/test/fixtures/pools.yml
@@ -1,77 +1,100 @@
 one:
   id: 1
-  name: 'master pool'
+  name: 'default'
   type: 'HardwarePool'
+  parent_id: 12
   created_at: '2008-02-13 15:42:43.417883'
   updated_at: '2008-02-14 16:41:42.417883'
-  lft: 1
-  rgt: 20
+  lft: 3
+  rgt: 24
 two:
   id: 2
   name: 'foobar hosts'
   type: 'VmResourcePool'
   parent_id: 1
-  lft: 2
-  rgt: 3
+  lft: 4
+  rgt: 5
 three:
   id: 3
   name: 'corp.com'
   type: 'HardwarePool'
   parent_id: 1
-  lft: 4
-  rgt: 19
+  lft: 6
+  rgt: 23
 four:
   id: 4
   name: 'corp.com dev'
   type: 'HardwarePool'
   parent_id: 3
-  lft: 5
-  rgt: 6
+  lft: 7
+  rgt: 8
 five:
   id: 5
   name: 'corp.com qa'
   type: 'HardwarePool'
   parent_id: 3
-  lft: 7
-  rgt: 16
+  lft: 9
+  rgt: 20
 six:
   id: 6
   name: 'corp.com production vms'
   type: 'VmResourcePool'
   parent_id: 3
-  lft: 17
-  rgt: 18
+  lft: 21
+  rgt: 22
 seven:
   id: 7
   name: 'foobar'
   type: 'VmResourcePool'
   parent_id: 5
-  lft: 8
-  rgt: 9
+  lft: 10
+  rgt: 11
 eight:
   id: 8
   name: 'some foobar hardware'
   type: 'HardwarePool'
   parent_id: 5
-  lft: 10
-  rgt: 13
+  lft: 12
+  rgt: 15
 nine:
   id: 9
   name: 'some more foobar hardware'
   type: 'HardwarePool'
   parent_id: 8
-  lft: 11
-  rgt: 12
+  lft: 13
+  rgt: 14
 ten:
   id: 10
   name: 'yet another pool'
   type: 'VmResourcePool'
   parent_id: 5
-  lft: 14
-  rgt: 15
+  lft: 16
+  rgt: 17
 prodops_pool:
-    id: 11
-    name: 'Production Operations'
-    type: 'HardwarePool'
-    parent_id: 5
+  id: 11
+  name: 'Production Operations'
+  type: 'HardwarePool'
+  parent_id: 5
+  lft: 18
+  rgt: 19
+hw_dir_pool:
+  id: 12
+  name: 'hardware'
+  type: 'DirectoryPool'
+  parent_id: 13
+  lft: 2
+  rgt: 25
+root_dir_pool:
+  id: 13
+  name: 'root'
+  type: 'DirectoryPool'
+  lft: 1
+  rgt: 28
+smart_dir_pool:
+  id: 14
+  name: 'hardware'
+  type: 'DirectoryPool'
+  parent_id: 13
+  lft: 26
+  rgt: 27
 
diff --git a/src/test/functional/interface_test.rb b/src/test/functional/interface_test.rb
index df0d52c..88cebc4 100644
--- a/src/test/functional/interface_test.rb
+++ b/src/test/functional/interface_test.rb
@@ -54,13 +54,13 @@ if File.exists? File.dirname(__FILE__) + '/../selenium.rb'
               "selenium.isElementPresent(\"//div[ id='side']/ul/li/span/a\")",
               10000)
          @browser.click(
-              "//div[ id='side']/ul/li/span/a")  # click 'master pool' link
+              "//div[ id='side']/ul/li/span/a")  # click 'default pool' link
          @browser.wait_for_condition(
               "selenium.isElementPresent(\"//div[ class='summary_title']\")",
                10000)
 
          # verify the title of the pool
-	     assert_equal("master pool",
+	     assert_equal("default",
                       @browser.get_text("//div[ class='summary_title']"))
 	 end
 
-- 
1.5.5.1


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]