I got the following errors after applying this patch set:
======================================================================
ERROR: test_default_lookup (test_osinfo.OSInfoTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/alinefm/kimchi/tests/test_osinfo.py", line 35, in
test_default_lookup
self.assertEquals('default', entry['network'])
KeyError: 'network'
======================================================================
ERROR: test_delete_running_vm (test_model.ModelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/alinefm/kimchi/tests/test_model.py", line 546, in
test_delete_running_vm
self.assertFalse(u'kīмkhī-∨м' in vms)
File "/home/alinefm/kimchi/tests/test_model.py", line 537, in
test_delete_running_vm
inst.vms_create(params)
File "/home/alinefm/kimchi/src/kimchi/model.py", line 622, in vms_create
t.validate()
File "/home/alinefm/kimchi/src/kimchi/vmtemplate.py", line 249, in validate
self._network_validate()
File "/home/alinefm/kimchi/src/kimchi/model.py", line 1383, in
_network_validate
name = self.info['network']
KeyError: 'network'
======================================================================
ERROR: test_template_storage_customise (test_model.ModelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/alinefm/kimchi/tests/test_model.py", line 257, in
test_template_storage_customise
self.assertTrue(os.access(disk_path, os.F_OK))
File "/home/alinefm/kimchi/tests/test_model.py", line 253, in
test_template_storage_customise
inst.vms_create(params)
File "/home/alinefm/kimchi/src/kimchi/model.py", line 622, in vms_create
t.validate()
File "/home/alinefm/kimchi/src/kimchi/vmtemplate.py", line 249, in validate
self._network_validate()
File "/home/alinefm/kimchi/src/kimchi/model.py", line 1383, in
_network_validate
name = self.info['network']
KeyError: 'network'
======================================================================
ERROR: test_use_test_host (test_model.ModelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/alinefm/kimchi/tests/test_model.py", line 583, in
test_use_test_host
self.assertTrue('kimchi-vm' in vms)
File "/home/alinefm/kimchi/tests/test_model.py", line 578, in
test_use_test_host
inst.vms_create(params)
File "/home/alinefm/kimchi/src/kimchi/model.py", line 622, in vms_create
t.validate()
File "/home/alinefm/kimchi/src/kimchi/vmtemplate.py", line 249, in validate
self._network_validate()
File "/home/alinefm/kimchi/src/kimchi/model.py", line 1383, in
_network_validate
name = self.info['network']
KeyError: 'network'
======================================================================
ERROR: test_vm_edit (test_model.ModelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/alinefm/kimchi/tests/test_model.py", line 371, in test_vm_edit
rollback.prependDefer(inst.vm_delete, 'new-vm')
File "/home/alinefm/kimchi/tests/test_model.py", line 349, in test_vm_edit
inst.vms_create(params_1)
File "/home/alinefm/kimchi/src/kimchi/model.py", line 622, in vms_create
t.validate()
File "/home/alinefm/kimchi/src/kimchi/vmtemplate.py", line 249, in validate
self._network_validate()
File "/home/alinefm/kimchi/src/kimchi/model.py", line 1383, in
_network_validate
name = self.info['network']
KeyError: 'network'
======================================================================
ERROR: test_vm_lifecycle (test_model.ModelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/alinefm/kimchi/tests/test_model.py", line 91, in
test_vm_lifecycle
self.assertEquals('running', info['state'])
File "/home/alinefm/kimchi/tests/test_model.py", line 81, in
test_vm_lifecycle
inst.vms_create(params)
File "/home/alinefm/kimchi/src/kimchi/model.py", line 622, in vms_create
t.validate()
File "/home/alinefm/kimchi/src/kimchi/vmtemplate.py", line 249, in validate
self._network_validate()
File "/home/alinefm/kimchi/src/kimchi/model.py", line 1383, in
_network_validate
name = self.info['network']
KeyError: 'network'
======================================================================
ERROR: test_vm_list_sorted (test_model.ModelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/alinefm/kimchi/tests/test_model.py", line 563, in
test_vm_list_sorted
self.assertEquals(vms, sorted(vms, key=unicode.lower))
File "/home/alinefm/kimchi/tests/test_model.py", line 558, in
test_vm_list_sorted
inst.vms_create(params)
File "/home/alinefm/kimchi/src/kimchi/model.py", line 622, in vms_create
t.validate()
File "/home/alinefm/kimchi/src/kimchi/vmtemplate.py", line 249, in validate
self._network_validate()
File "/home/alinefm/kimchi/src/kimchi/model.py", line 1383, in
_network_validate
name = self.info['network']
KeyError: 'network'
======================================================================
ERROR: test_vm_storage_provisioning (test_model.ModelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/alinefm/kimchi/tests/test_model.py", line 111, in
test_vm_storage_provisioning
self.assertTrue(os.access(disk_path, os.F_OK))
File "/home/alinefm/kimchi/tests/test_model.py", line 106, in
test_vm_storage_provisioning
inst.vms_create(params)
File "/home/alinefm/kimchi/src/kimchi/model.py", line 622, in vms_create
t.validate()
File "/home/alinefm/kimchi/src/kimchi/vmtemplate.py", line 249, in validate
self._network_validate()
File "/home/alinefm/kimchi/src/kimchi/model.py", line 1383, in
_network_validate
name = self.info['network']
KeyError: 'network'
======================================================================
FAIL: test_minimal_construct (test_vmtemplate.VMTemplateTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/alinefm/kimchi/tests/test_vmtemplate.py", line 41, in
test_minimal_construct
self.assertEquals(val, t.info.get(name))
AssertionError: 'default' != None
----------------------------------------------------------------------
Ran 113 tests in 74.058s
FAILED (failures=1, errors=8)
On 12/30/2013 02:04 PM, shaohef(a)linux.vnet.ibm.com wrote:
From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
V2 -> V3
fix typo.
support creating a vm without network.
V1 -> V2:
update mockmodel and test case
add 'networks' option for template get/create/update
ShaoHe Feng (6):
template supports networks: let template xml support more networks
template supports networks: update API
template supports networks: update controller and json schema
template supports networks: update model
template supports networks: update mockmodel
template supports networks: update test case
docs/API.md | 4 +++
src/kimchi/API.json | 12 +++++++
src/kimchi/controller.py | 3 +-
src/kimchi/mockmodel.py | 7 +++-
src/kimchi/model.py | 6 ++++
src/kimchi/osinfo.py | 5 +--
src/kimchi/vmtemplate.py | 20 ++++++++---
tests/test_model.py | 86 +++++++++++++++++++++++++++++++++++++-----------
tests/test_rest.py | 56 +++++++++++++++++++++++++++++++
9 files changed, 172 insertions(+), 27 deletions(-)