On 02/21/2014 08:52 AM, Aline Manera wrote:
I got the following errors while running the tests
Seems listAllNetworks() is not supported in all libvirt versions.
sure, should use
conn.listNetworks() + conn.listDefinedNetworks()
======================================================================
ERROR: test_template_clone (test_model.ModelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/alinefm/kimchi/tests/test_model.py", line 483, in
test_template_clone
orig_temp = inst.template_lookup(orig_params['name'])
File "/home/alinefm/kimchi/src/kimchi/model/templates.py", line 87, in
lookup
return t.validate_integrity()
File "/home/alinefm/kimchi/src/kimchi/vmtemplate.py", line 355, in
validate_integrity
set(self._get_all_networks_name()))
File "/home/alinefm/kimchi/src/kimchi/model/templates.py", line 164,
in _get_all_networks_name
return [net.name() for net in conn.listAllNetworks()]
AttributeError: virConnect instance has no attribute 'listAllNetworks'
======================================================================
ERROR: test_template_create (test_model.ModelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/alinefm/kimchi/tests/test_model.py", line 427, in
test_template_create
info = inst.template_lookup('test')
File "/home/alinefm/kimchi/src/kimchi/model/templates.py", line 87, in
lookup
return t.validate_integrity()
File "/home/alinefm/kimchi/src/kimchi/vmtemplate.py", line 355, in
validate_integrity
set(self._get_all_networks_name()))
File "/home/alinefm/kimchi/src/kimchi/model/templates.py", line 164,
in _get_all_networks_name
return [net.name() for net in conn.listAllNetworks()]
AttributeError: virConnect instance has no attribute 'listAllNetworks'
======================================================================
ERROR: test_template_integrity (test_model.ModelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/alinefm/kimchi/tests/test_model.py", line 471, in
test_template_integrity
info = inst.template_lookup('test')
File "/home/alinefm/kimchi/src/kimchi/model/templates.py", line 87, in
lookup
return t.validate_integrity()
File "/home/alinefm/kimchi/src/kimchi/vmtemplate.py", line 355, in
validate_integrity
set(self._get_all_networks_name()))
File "/home/alinefm/kimchi/src/kimchi/model/templates.py", line 164,
in _get_all_networks_name
return [net.name() for net in conn.listAllNetworks()]
AttributeError: virConnect instance has no attribute 'listAllNetworks'
======================================================================
ERROR: test_template_storage_customise (test_model.ModelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/alinefm/kimchi/tests/test_model.py", line 381, in
test_template_storage_customise
'test', params)
File "/usr/lib/python2.7/unittest/case.py", line 476, in assertRaises
callableObj(*args, **kwargs)
File "/home/alinefm/kimchi/src/kimchi/model/templates.py", line 110,
in update
old_t = self.lookup(name)
File "/home/alinefm/kimchi/src/kimchi/model/templates.py", line 87, in
lookup
return t.validate_integrity()
File "/home/alinefm/kimchi/src/kimchi/vmtemplate.py", line 355, in
validate_integrity
set(self._get_all_networks_name()))
File "/home/alinefm/kimchi/src/kimchi/model/templates.py", line 164,
in _get_all_networks_name
return [net.name() for net in conn.listAllNetworks()]
AttributeError: virConnect instance has no attribute 'listAllNetworks'
======================================================================
ERROR: test_template_update (test_model.ModelTests)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/alinefm/kimchi/tests/test_model.py", line 508, in
test_template_update
self.assertEquals('new-test', inst.template_update('test', params))
File "/home/alinefm/kimchi/src/kimchi/model/templates.py", line 110,
in update
old_t = self.lookup(name)
File "/home/alinefm/kimchi/src/kimchi/model/templates.py", line 87, in
lookup
return t.validate_integrity()
File "/home/alinefm/kimchi/src/kimchi/vmtemplate.py", line 355, in
validate_integrity
set(self._get_all_networks_name()))
File "/home/alinefm/kimchi/src/kimchi/model/templates.py", line 164,
in _get_all_networks_name
return [net.name() for net in conn.listAllNetworks()]
AttributeError: virConnect instance has no attribute 'listAllNetworks'
----------------------------------------------------------------------
Ran 157 tests in 128.049s
FAILED (errors=5)
[20/Feb/2014:21:50:29] ENGINE Waiting for child threads to terminate...
make[3]: *** [check-local] Error 1
make[3]: Leaving directory `/home/alinefm/kimchi/tests'
make[2]: *** [check-am] Error 2
make[2]: Leaving directory `/home/alinefm/kimchi/tests'
make[1]: *** [check] Error 2
make[1]: Leaving directory `/home/alinefm/kimchi/tests'
make: *** [check-recursive] Error 1
On 02/20/2014 03:00 AM, shaohef(a)linux.vnet.ibm.com wrote:
> From: ShaoHe Feng <shaohef(a)linux.vnet.ibm.com>
>
> V1 -> V2
> rename invalid_integrity to validate_integrity
> change list to array in API.md
> list is the python semantic, array is json semantic.
>
> Implement integrity verification: verify template integrity, update
> API.md
> Sometimes, user create a template, but networks, cdrom, disks or
> storagepool will change later.
> So users can not create a vm from this template successfully.
> It is necessary to check some paramenters of template.
>
> ShaoHe Feng (4):
> Implement integrity verification: verify template integrity, update
> API.md
> add a new method to get iso info for VMTemplate class
> Implement integrity verification: verify template integrity in backend
> Implement integrity verification: update test case
>
> docs/API.md | 4 +++
> src/kimchi/control/templates.py | 1 +
> src/kimchi/mockmodel.py | 5 +++-
> src/kimchi/model/templates.py | 7 +++++-
> src/kimchi/vmtemplate.py | 54 ++++++++++++++++++++++++++++++++---------
> tests/test_model.py | 33 +++++++++++++++++++++++++
> tests/test_rest.py | 40 ++++++++++++++++++++++++++++++
> 7 files changed, 131 insertions(+), 13 deletions(-)
>
--
Thanks and best regards!
Sheldon Feng(冯少合)<shaohef(a)linux.vnet.ibm.com>
IBM Linux Technology Center