[Ovirt-devel] [PATCH] fixes / improvements to test suite

Mohammed Morsi mmorsi at redhat.com
Tue Oct 14 20:58:47 UTC 2008


---
 src/app/models/vm_task.rb                        |    3 ---
 src/test/fixtures/quotas.yml                     |    2 +-
 src/test/fixtures/storage_pools.yml              |    6 +++---
 src/test/functional/host_controller_test.rb      |    2 +-
 src/test/functional/resources_controller_test.rb |    6 +++---
 src/test/functional/storage_controller_test.rb   |    2 +-
 src/test/functional/task_controller_test.rb      |    2 +-
 7 files changed, 10 insertions(+), 13 deletions(-)

diff --git a/src/app/models/vm_task.rb b/src/app/models/vm_task.rb
index 31c4ac8..6251919 100644
--- a/src/app/models/vm_task.rb
+++ b/src/app/models/vm_task.rb
@@ -122,13 +122,10 @@ class VmTask < Task
     ACTIONS.each do |action, hash|
       if hash[:start] == state
         add_action = true
-        print "vm: #{vm}\n user: #{user}\n"
         if (vm and user)
           pool = vm.send(hash[:privilege][1])
-          print "pool: #{pool}\n privilege: #{hash[:privilege][1]}\n"
           add_action = pool ? pool.has_privilege(user, hash[:privilege][0]) : false
         end
-        print "add_action: #{add_action}\n"
         actions << action if add_action
       end
     end
diff --git a/src/test/fixtures/quotas.yml b/src/test/fixtures/quotas.yml
index 757c934..037fd67 100644
--- a/src/test/fixtures/quotas.yml
+++ b/src/test/fixtures/quotas.yml
@@ -46,7 +46,7 @@ six:
   total_vnics: 3
   total_storage: 1024
   total_vms: 2
-  pool_id: 10
+  pool_id: 5
 seven:
   id: 7
   total_vcpus: 
diff --git a/src/test/fixtures/storage_pools.yml b/src/test/fixtures/storage_pools.yml
index 0610333..ac042a0 100644
--- a/src/test/fixtures/storage_pools.yml
+++ b/src/test/fixtures/storage_pools.yml
@@ -45,20 +45,20 @@ seven:
   export_path: '/tmp/apath'
 eight:
   id: 8
-  hardware_pool_id: 6
+  hardware_pool_id: 9
   ip_addr: '192.168.50.2'
   type: 'IscsiStoragePool'
   port: 531
   target: 'bartarget'
 nine:
   id: 9
-  hardware_pool_id: 8
+  hardware_pool_id: 9
   type: 'NfsStoragePool'
   ip_addr: '1.2.3.4'
   export_path: '/tmp/somepath'
 ten:
   id: 10
-  hardware_pool_id: 6
+  hardware_pool_id: 9
   type: 'IscsiStoragePool'
   ip_addr: '192.168.50.3'
   port: 539
diff --git a/src/test/functional/host_controller_test.rb b/src/test/functional/host_controller_test.rb
index e1e977d..7939aca 100644
--- a/src/test/functional/host_controller_test.rb
+++ b/src/test/functional/host_controller_test.rb
@@ -24,7 +24,7 @@ require 'host_controller'
 class HostController; def rescue_action(e) raise e end; end
 
 class HostControllerTest < Test::Unit::TestCase
-  fixtures :hosts
+  fixtures :hosts, :pools
 
   def setup
     @controller = HostController.new
diff --git a/src/test/functional/resources_controller_test.rb b/src/test/functional/resources_controller_test.rb
index fca7aad..49e8d0e 100644
--- a/src/test/functional/resources_controller_test.rb
+++ b/src/test/functional/resources_controller_test.rb
@@ -58,14 +58,14 @@ class ResourcesControllerTest < ActionController::TestCase
   def test_destroy
     pool = nil
     assert_nothing_raised {
-        pool = VmResourcePool.find(2).parent.id
+        pool = VmResourcePool.find(10).parent.id
     }
 
-    post :destroy, :id => 2
+    post :destroy, :id => 10
     assert_response :success
 
     assert_raise(ActiveRecord::RecordNotFound) {
-      VmResourcePool.find(2)
+      VmResourcePool.find(10)
     }
   end
 end
diff --git a/src/test/functional/storage_controller_test.rb b/src/test/functional/storage_controller_test.rb
index ff728b9..a9f7eb9 100644
--- a/src/test/functional/storage_controller_test.rb
+++ b/src/test/functional/storage_controller_test.rb
@@ -24,7 +24,7 @@ require 'storage_controller'
 class StorageController; def rescue_action(e) raise e end; end
 
 class StorageControllerTest < Test::Unit::TestCase
-  fixtures :storage_volumes
+  fixtures :storage_volumes, :storage_pools
 
   def setup
     @controller = StorageController.new
diff --git a/src/test/functional/task_controller_test.rb b/src/test/functional/task_controller_test.rb
index cc07502..a9578b6 100644
--- a/src/test/functional/task_controller_test.rb
+++ b/src/test/functional/task_controller_test.rb
@@ -24,7 +24,7 @@ require 'task_controller'
 class TaskController; def rescue_action(e) raise e end; end
 
 class TaskControllerTest < Test::Unit::TestCase
-  fixtures :tasks
+  fixtures :tasks, :vms, :pools
 
   def setup
     @controller = TaskController.new
-- 
1.5.4.1




More information about the ovirt-devel mailing list