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

[Ovirt-devel] First batch of oVirt wui Test Fixtures



Attached is the patch containing the first set of test fixtures. There isn't a huge collection of them yet, but I tried to make sure I covered every possible data relationship. The tests still fail, quite ugly might I add, and I started checking in small improvements to the actual cases to start getting them to work.
diff --git a/wui/src/test/fixtures/hardware_pools.yml b/wui/src/test/fixtures/hardware_pools.yml
index b49c4eb..08d8374 100644
--- a/wui/src/test/fixtures/hardware_pools.yml
+++ b/wui/src/test/fixtures/hardware_pools.yml
@@ -1,5 +1,26 @@
 # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
 one:
   id: 1
+  name: 'master pool'
+  type: 'OrganizationalPool'
+  superpool_id: 1
 two:
   id: 2
+  name: 'foobar hosts'
+  type: 'HostCollection'
+  superpool_id: 1
+three:
+  id: 3
+  name: 'corp.com'
+  type: 'OrganizationalPool'
+  superpool_id: 1
+four:
+ id: 4
+ name: 'corp.com dev'
+ type: 'HostCollection'
+ superpool_id: 3
+five:
+  id: 5
+  name: 'corp.com qa'
+  type: 'NetworkMap'
+  superpool_id: 3
diff --git a/wui/src/test/fixtures/hosts.yml b/wui/src/test/fixtures/hosts.yml
index e57ff02..d4363f3 100644
--- a/wui/src/test/fixtures/hosts.yml
+++ b/wui/src/test/fixtures/hosts.yml
@@ -1,15 +1,89 @@
 # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
 one:
   id: 1
-  uuid: 1148fdf8-961d-11dc-9387-001558c41534
-  num_cpus:
-  cpu_speed:
-  arch:
-  memory:
+  uuid: '1148fdf8-961d-11dc-9387-001558c41534'
+  hostname: 'prod.corp.com'
+  num_cpus: 8
+  cpu_speed: 4096
+  arch: 'i686'
+  memory: 18384
+  is_disabled: 0
+  hypervisor_type: 'xen'
+  hardware_pool_id: 3
 two:
   id: 2
-  uuid: 1f2a8694-961d-11dc-9387-001558c41534
-  num_cpus:
-  cpu_speed:
-  arch:
-  memory:
+  uuid: '1f2a8694-961d-11dc-9387-001558c41534'
+  hostname: 'myworkstation.dev.corp.com'
+  num_cpus: 4
+  cpu_speed: 2048
+  arch: 'i386'
+  memory: 2048
+  is_disabled: 0
+  hypervisor_type: 'qemu'
+  hardware_pool_id: 4
+three:
+  id: 3
+  uuid: '58a85f44-75fd-4934-805f-88e45b40d4b4'
+  hostname: 'macworkstation.foobar.com'
+  num_cpus: 8
+  cpu_speed: 1024
+  arch: 'mips'
+  memory: 2048
+  is_disabled: 0 
+  hypervisor_type: 'kvm'
+  hardware_pool_id: 2
+four:
+  id: 4
+  uuid: '520bbb34-6515-490e-9d07-0c8b14f76805'
+  hostname: 'fedoraworkstation.foobar.com'
+  num_cpus: 8
+  cpu_speed: 3072
+  arch: 'i386'
+  memory: 2048
+  is_disabled: 1 
+  hypervisor_type: 'kvm'
+  hardware_pool_id: 2
+five:
+  id: 5
+  uuid: '2e422f66-324e-48d4-973f-0b91b33070f9'
+  hostname: 'pipeline.foobar.com'
+  num_cpus: 32
+  cpu_speed: 4096
+  arch: 'xeon'
+  memory: 16384
+  is_disabled: 0 
+  hypervisor_type: 'kvm'
+  hardware_pool_id: 2
+six:
+  id: 6
+  uuid: 'bb0ce7c7-f234-49ae-84b5-6f4fd8bddcaa'
+  hostname: 'prod.foobar.com'
+  num_cpus: 32
+  cpu_speed: 4096
+  arch: 'xeon'
+  memory: 16384
+  is_disabled: 0 
+  hypervisor_type: 'kvm'
+  hardware_pool_id: 2
+seven:
+  id: 7
+  uuid: '6ae3d22e-97e0-4d86-9712-5395b20a0f45'
+  hostname: 'mystation.dev.corp.com'
+  num_cpus: 4
+  cpu_speed: 3072
+  arch: 'i686'
+  memory: 2048
+  is_disabled: 0
+  hypervisor_type: 'xen'
+  hardware_pool_id: 4
+eight:
+ id: 8
+ uuid: 'ec0d86de-657b-48f6-b7cc-e733a3f9a834'
+ hostname: 'issue.qa.corp.com'
+ num_cpus: 8
+ cpu_speed: 4096
+ arch: 'x86'
+ memory: 4096
+ is_disabled: 0
+ hypervisor_type: 'kvm'
+ hardware_pool_id: 5
diff --git a/wui/src/test/fixtures/nics.yml b/wui/src/test/fixtures/nics.yml
index b49c4eb..008cfb7 100644
--- a/wui/src/test/fixtures/nics.yml
+++ b/wui/src/test/fixtures/nics.yml
@@ -1,5 +1,22 @@
 # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
 one:
   id: 1
+  mac: '00:11:22:33:44:55'
+  ip_addr: '1.2.3.4'
+  usage_type: '1'
+  bandwidth: 100
+  host_id: 1
 two:
   id: 2
+  mac: 'AA:BB:CC:DD:EE:FF'
+  ip_addr: '2.3.4.5'
+  usage_type: '2'
+  bandwidth: 1000
+  host_id: 1
+three:
+  id: 3
+  mac: '00:FF:11:EE:22:DD'
+  ip_addr: '3.4.5.6'
+  usage_type: '1'
+  bandwidth: 10
+  host_id: 2
diff --git a/wui/src/test/fixtures/permissions.yml b/wui/src/test/fixtures/permissions.yml
index b49c4eb..3b63e39 100644
--- a/wui/src/test/fixtures/permissions.yml
+++ b/wui/src/test/fixtures/permissions.yml
@@ -1,5 +1,68 @@
 # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
 one:
   id: 1
+  privilege: 'delegate'
+  user: 'admin'
+  hardware_pool_id: 1
+  vm_library_id:
 two:
   id: 2
+  privilege: 'admin'
+  user: 'admin'
+  hardware_pool_id: 1
+  vm_library_id:
+three:
+  id: 3
+  privilege: 'monitor'
+  user: 'admin'
+  hardware_pool_id: 1
+  vm_library_id:
+four:
+  id: 4
+  privilege: 'delegate'
+  user: 'admin'
+  hardware_pool_id:
+  vm_library_id: 1
+five:
+  id: 5
+  privilege: 'admin'
+  user: 'admin'
+  hardware_pool_id:
+  vm_library_id: 1
+six:
+  id: 6
+  privilege: 'monitor'
+  user: 'admin'
+  hardware_pool_id:
+  vm_library_id: 1
+
+seven:
+ id: 7
+ privilege: 'delegate'
+ user: 'corp-admin'
+ hardware_pool_id: 3
+ vm_library_id:
+eight:
+ id: 8
+ privilege: 'admin'
+ user: 'corp-dev-admin'
+ hardware_pool_id: 4
+ vm_library_id: 
+nine:
+ id: 9
+ privilege: 'monitor'
+ user: 'joe-developer'
+ hardware_pool_id: 4
+ vm_library_id: 
+ten:
+ id: 10
+ privilege: 'admin'
+ user: 'corp-qa-admin'
+ hardware_pool_id:
+ vm_library_id: 3
+eleven:
+ id: 11
+ privilege: 'monitor'
+ user: 'joe-qa'
+ hardware_pool_id:
+ vm_library_id: 3
diff --git a/wui/src/test/fixtures/quotas.yml b/wui/src/test/fixtures/quotas.yml
index b49c4eb..ef677d9 100644
--- a/wui/src/test/fixtures/quotas.yml
+++ b/wui/src/test/fixtures/quotas.yml
@@ -1,5 +1,46 @@
 # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
 one:
   id: 1
+  total_vcpus: 8
+  total_vmemory: 4096
+  total_vnics: 3
+  total_storage: 500
+  total_vms: 2
+  host_collection_id:
+  vm_library_id: 1
 two:
   id: 2
+  total_vcpus: 32
+  total_vmemory: 16765
+  total_vnics: 5
+  total_storage: 1000000
+  total_vms: 13
+  host_collection_id: 3
+  vm_library_id: 
+three:
+  id: 3
+  total_vcpus: 2
+  total_vmemory: 
+  total_vnics: 
+  total_storage:
+  total_vms:
+  host_collection_id:
+  vm_library_id: 4
+four:
+  id: 4
+  total_vcpus: 
+  total_vmemory: 
+  total_vnics: 
+  total_storage:
+  total_vms: 2
+  host_collection_id:
+  vm_library_id: 4
+five:
+  id: 5
+  total_vcpus: 3
+  total_vmemory: 1024 
+  total_vnics: 
+  total_storage: 150
+  total_vms: 
+  host_collection_id:
+  vm_library_id: 5
diff --git a/wui/src/test/fixtures/storage_volumes.yml b/wui/src/test/fixtures/storage_volumes.yml
index b49c4eb..d085d61 100644
--- a/wui/src/test/fixtures/storage_volumes.yml
+++ b/wui/src/test/fixtures/storage_volumes.yml
@@ -1,5 +1,19 @@
 # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
 one:
   id: 1
+  lun: 'abcd'
+  size: '10485760'
+  path: '/tmp/foobar'
+  storage_pool_id: 1
 two:
   id: 2
+  lun: 'abcd'
+  size: '20485760'
+  path: '/home/secretstuff'
+  storage_pool_id: 1
+three:
+  id: 3
+  lun: 'abcd'
+  size: '20485760'
+  path: 
+  storage_pool_id: 2
diff --git a/wui/src/test/fixtures/tasks.yml b/wui/src/test/fixtures/tasks.yml
index b49c4eb..fba3799 100644
--- a/wui/src/test/fixtures/tasks.yml
+++ b/wui/src/test/fixtures/tasks.yml
@@ -1,5 +1,53 @@
 # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
 one:
   id: 1
+  user: 'admin'
+  action: 'create_vm'
+  state: 'queued'
+  args:
+  created_at: '2008-02-13 15:42:43.417883'
+  time_started:
+  time_ended:
+  message:
+  type: 'VmTask'
+  vm_id: 5
+  storage_pool_id:
 two:
   id: 2
+  user: 'admin'
+  action: 'refresh_pool'
+  state: 'queued'
+  args:
+  created_at: '2008-01-13 15:40:13.417883'
+  time_started:
+  time_ended:
+  message:
+  type: 'StorageTask'
+  vm_id:
+  storage_pool_id: 1
+three:
+  id: 3
+  user: 'admin'
+  action: 'refresh_vm'
+  state: 'completed'
+  args:
+  created_at: '2002-12-14 05:12:23.417883'
+  time_started: '2002-12-14 05:12:23.417884'
+  time_ended: '2002-12-14 05:12:23.417885'
+  message: 'finished!'
+  type: 'VmTask'
+  vm_id: 5
+  storage_pool_id:
+four:
+  id: 4
+  user: 'admin'
+  action: 'pause_vm'
+  state: 'running'
+  args:
+  created_at: '2015-11-23 15:12:43.417883'
+  time_started: '2015-11-23 15:12:43.417885'
+  time_ended:
+  message:
+  type: 'VmTask'
+  vm_id: 3
+  storage_pool_id:
diff --git a/wui/src/test/fixtures/vm_libraries.yml b/wui/src/test/fixtures/vm_libraries.yml
index 5bf0293..c03dc23 100644
--- a/wui/src/test/fixtures/vm_libraries.yml
+++ b/wui/src/test/fixtures/vm_libraries.yml
@@ -1,7 +1,13 @@
 # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
-
-# one:
-#   column: value
-#
-# two:
-#   column: value
+one:
+  id: 1
+  name: 'corp.com production vms'
+  host_collection_id: 3
+two:
+  id: 2
+  name: 'foobar.com pipeline vms'
+  host_collection_id: 2
+three:
+  id: 3
+  name: 'corp.com qa'
+  host_collection_id: 5
diff --git a/wui/src/test/fixtures/vms.yml b/wui/src/test/fixtures/vms.yml
index b49c4eb..91080bc 100644
--- a/wui/src/test/fixtures/vms.yml
+++ b/wui/src/test/fixtures/vms.yml
@@ -1,5 +1,169 @@
 # Read about fixtures at http://ar.rubyonrails.org/classes/Fixtures.html
 one:
   id: 1
+  uuid: 'dd2573c3-b97d-493d-bedf-6a8369c965e9'
+  description: 'production httpd appliance'
+  num_vcpus_allocated: 2
+  num_vcpus_used: 2
+  memory_allocated: 2048
+  memory_used: 1024
+  vnic_mac_addr: '23:51:90:A1:13:37'
+  state: 'running'
+  needs_restart: 0
+  boot_device: '/dev/sda1'
+  host_id: 1
+  vm_library_id: 1
 two:
   id: 2
+  uuid: '89e62d32-04d9-4351-b573-b1a253397296'
+  description: 'production mysqld appliance'
+  num_vcpus_allocated: 2
+  num_vcpus_used: 1
+  memory_allocated: 2048
+  memory_used: 512
+  vnic_mac_addr: '15:99:FE:ED:11:EE'
+  state: 'running'
+  needs_restart: 0
+  boot_device: '/dev/sda2'
+  host_id: 1
+  vm_library_id: 1
+three:
+  id: 3
+  uuid: 'e2714087-3a71-460c-8112-23e044f0aa1c'
+  description: 'production ftpd appliance'
+  num_vcpus_allocated: 2
+  num_vcpus_used: 1
+  memory_allocated: 1024
+  memory_used: 512
+  vnic_mac_addr: 'FF:AA:BB:00:11:55'
+  state: 'kernel panic'
+  needs_restart: 1
+  boot_device: '/dev/sda3'
+  host_id: 1
+  vm_library_id: 1
+four:
+  id: 4
+  uuid: '95454587-24e0-4a52-bb0f-c16abf7433d0'
+  description: 'production postgresql appliance'
+  num_vcpus_allocated: 2
+  num_vcpus_used: 2
+  memory_allocated: 2048
+  memory_used: 1536
+  vnic_mac_addr: '48:24:12:93:42:11'
+  state: 'running'
+  needs_restart: 0
+  boot_device: '/dev/sda4'
+  host_id: 1
+  vm_library_id: 1
+five:
+  id: 5
+  uuid: 'aae029b7-0e9a-4327-8f8a-8447f473a75b'
+  description: 'foobar pipeline stage1: dev'
+  num_vcpus_allocated: 2
+  num_vcpus_used: 2
+  memory_allocated: 2048
+  memory_used: 2048
+  vnic_mac_addr: '19:18:17:16:15:14'
+  state: 'running'
+  needs_restart: 0
+  boot_device: '/var/disks/foobar/dev'
+  host_id: 5
+  vm_library_id: 2
+six:
+  id: 6
+  uuid: 'd02d27b9-328b-4d70-8237-28557e053cb6'
+  description: 'foobar pipeline stage2: qa'
+  num_vcpus_allocated: 2
+  num_vcpus_used: 2
+  memory_allocated: 4096
+  memory_used: 4098
+  vnic_mac_addr: '25:62:A1:0F:EE:BB'
+  state: 'running'
+  needs_restart: 0
+  boot_device: '/var/disks/foobar/qa'
+  host_id: 5
+  vm_library_id: 2
+seven:
+  id: 7
+  uuid: '56f9d73d-d7bb-48d1-bc0e-0308fc22c504'
+  description: 'foobar pipeline stage3: stage1'
+  num_vcpus_allocated: 2
+  num_vcpus_used: 2
+  memory_allocated: 4096 
+  memory_used: 4096
+  vnic_mac_addr: '42:42:42:42:42:42'
+  state: 'running'
+  needs_restart: 0
+  boot_device: '/var/disks/foobar/stage1'
+  host_id: 5
+  vm_library_id: 2
+eight:
+  id: 8
+  uuid: '1135ffad-78c7-437c-95c6-74302cf48198'
+  description: 'foobar pipeline stage3: stage2'
+  num_vcpus_allocated: 2
+  num_vcpus_used: 2
+  memory_allocated: 4096 
+  memory_used: 4096
+  vnic_mac_addr: '24:24:24:24:24:24'
+  state: 'running'
+  needs_restart: 0
+  boot_device: '/var/disks/foobar/stage2'
+  host_id: 5
+  vm_library_id: 2
+nine:
+  id: 9
+  uuid: '786c824a-392f-4bce-b5bb-6765f810acd1'
+  description: 'foobar prod1'
+  num_vcpus_allocated: 2
+  num_vcpus_used: 2
+  memory_allocated: 4096 
+  memory_used: 4096
+  vnic_mac_addr: 'FF:FF:FF:EE:EE:EE'
+  state: 'running'
+  needs_restart: 0
+  boot_device: '/var/disks/foobar/prod1'
+  host_id: 6
+  vm_library_id: 2
+ten:
+  id: 10
+  uuid: '24b9a994-d415-481d-ace8-1d810b601eb6'
+  description: 'foobar prod2'
+  num_vcpus_allocated: 2
+  num_vcpus_used: 2
+  memory_allocated: 4096 
+  memory_used: 4096
+  vnic_mac_addr: 'EE:EE:EE:FF:FF:FF'
+  state: 'running'
+  needs_restart: 0
+  boot_device: '/var/disks/foobar/prod2'
+  host_id: 6
+  vm_library_id: 2
+eleven:
+  id: 11
+  uuid: '9b2c3c73-1abe-460e-b671-b8b7b6719e4c'
+  description: 'corp.com errata appliance'
+  num_vcpus_allocated: 2
+  num_vcpus_used: 2
+  memory_allocated: 2048 
+  memory_used: 2048
+  vnic_mac_addr: '77:77:77:77:77:77'
+  state: 'running'
+  needs_restart: 0
+  boot_device: '/dev/hda1'
+  host_id: 8
+  vm_library_id: 3
+twelve:
+  id: 12
+  uuid: '552134c7-b0ad-4607-bbf5-d6b9a33c2476'
+  description: 'corp.com bugzilla appliance'
+  num_vcpus_allocated: 2
+  num_vcpus_used: 2
+  memory_allocated: 2048 
+  memory_used: 2048
+  vnic_mac_addr: '77:77:77:77:77:77'
+  state: 'running'
+  needs_restart: 0
+  boot_device: '/dev/hda2'
+  host_id: 8
+  vm_library_id: 3
diff --git a/wui/src/test/functional/nic_controller_test.rb b/wui/src/test/functional/nic_controller_test.rb
index b207deb..31bc5cc 100644
--- a/wui/src/test/functional/nic_controller_test.rb
+++ b/wui/src/test/functional/nic_controller_test.rb
@@ -31,7 +31,7 @@ class NicControllerTest < Test::Unit::TestCase
     @request    = ActionController::TestRequest.new
     @response   = ActionController::TestResponse.new
 
-    @first_id = nics(:first).id
+    @first_id = nics(:one).id
   end
 
   def test_index
diff --git a/wui/src/test/functional/permission_controller_test.rb b/wui/src/test/functional/permission_controller_test.rb
index 6275b24..9045329 100644
--- a/wui/src/test/functional/permission_controller_test.rb
+++ b/wui/src/test/functional/permission_controller_test.rb
@@ -31,7 +31,7 @@ class PermissionControllerTest < Test::Unit::TestCase
     @request    = ActionController::TestRequest.new
     @response   = ActionController::TestResponse.new
 
-    @first_id = permissions(:first).id
+    @first_id = permissions(:one).id
   end
 
   def test_index
diff --git a/wui/src/test/functional/pool_controller_test.rb b/wui/src/test/functional/pool_controller_test.rb
index 4d4171f..d01fe1e 100644
--- a/wui/src/test/functional/pool_controller_test.rb
+++ b/wui/src/test/functional/pool_controller_test.rb
@@ -31,7 +31,7 @@ class PoolControllerTest < Test::Unit::TestCase
     @request    = ActionController::TestRequest.new
     @response   = ActionController::TestResponse.new
 
-    @first_id = hardware_pools(:first).id
+    @first_id = hardware_pools(:one).id
   end
 
   def test_index
diff --git a/wui/src/test/functional/quota_controller_test.rb b/wui/src/test/functional/quota_controller_test.rb
index b5c5bf1..ba35f98 100644
--- a/wui/src/test/functional/quota_controller_test.rb
+++ b/wui/src/test/functional/quota_controller_test.rb
@@ -31,7 +31,7 @@ class QuotaControllerTest < Test::Unit::TestCase
     @request    = ActionController::TestRequest.new
     @response   = ActionController::TestResponse.new
 
-    @first_id = quotas(:first).id
+    @first_id = quotas(:one).id
   end
 
   def test_index
diff --git a/wui/src/test/functional/storage_controller_test.rb b/wui/src/test/functional/storage_controller_test.rb
index 1e1adcd..73ffa8b 100644
--- a/wui/src/test/functional/storage_controller_test.rb
+++ b/wui/src/test/functional/storage_controller_test.rb
@@ -31,7 +31,7 @@ class StorageControllerTest < Test::Unit::TestCase
     @request    = ActionController::TestRequest.new
     @response   = ActionController::TestResponse.new
 
-    @first_id = storage_volumes(:first).id
+    @first_id = storage_volumes(:one).id
   end
 
   def test_index
diff --git a/wui/src/test/functional/task_controller_test.rb b/wui/src/test/functional/task_controller_test.rb
index 17690e5..6d4e805 100644
--- a/wui/src/test/functional/task_controller_test.rb
+++ b/wui/src/test/functional/task_controller_test.rb
@@ -31,7 +31,7 @@ class TaskControllerTest < Test::Unit::TestCase
     @request    = ActionController::TestRequest.new
     @response   = ActionController::TestResponse.new
 
-    @first_id = tasks(:first).id
+    @first_id = tasks(:one).id
   end
 
   def test_index
diff --git a/wui/src/test/functional/vm_controller_test.rb b/wui/src/test/functional/vm_controller_test.rb
index 54da5a2..b63cc0f 100644
--- a/wui/src/test/functional/vm_controller_test.rb
+++ b/wui/src/test/functional/vm_controller_test.rb
@@ -31,7 +31,7 @@ class VmControllerTest < Test::Unit::TestCase
     @request    = ActionController::TestRequest.new
     @response   = ActionController::TestResponse.new
 
-    @first_id = vms(:first).id
+    @first_id = vms(:one).id
   end
 
   def test_index


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