[PATCH 0/3] unit tests - Power arch fixes
by Daniel Henrique Barboza
This patch set contains fixes to several unit tests that had
somewhat the same root cause - the differences between x86
and power/ppc64le in osinfo.py template configurations.
Daniel Henrique Barboza (3):
tests/test_osinfo.py: fixes for Power architecture
Kimchi tests: Power system fixes - removing hardcoded values
test/test_model: Power architecture fixes
src/kimchi/osinfo.py | 9 +++++++++
tests/iso_gen.py | 3 ++-
tests/test_mockmodel.py | 4 +++-
tests/test_model.py | 10 ++++++----
tests/test_osinfo.py | 36 ++++++++++++++++++++++++++----------
tests/test_rest.py | 6 ++++--
tests/test_vmtemplate.py | 8 ++++++--
7 files changed, 56 insertions(+), 20 deletions(-)
--
1.9.3
9 years, 9 months
[PATCH 0/3] Fix storage volume issues
by Crístian Viana
Crístian Viana (3):
Remove ISO permission check when creating a template
issue #565: Allow a template's ISO to be a block device
issue #564: Parse logical volumes to find out their actual formats
src/kimchi/i18n.py | 5 ---
src/kimchi/isoinfo.py | 7 +++-
src/kimchi/kvmusertests.py | 75 --------------------------------------
src/kimchi/model/storagevolumes.py | 19 +++++++++-
src/kimchi/model/templates.py | 12 ------
src/kimchi/vmtemplate.py | 10 ++++-
6 files changed, 31 insertions(+), 97 deletions(-)
delete mode 100644 src/kimchi/kvmusertests.py
--
2.1.0
9 years, 9 months
[PATCH] tests/test_osinfo.py: fixes for Power architecture
by Daniel Henrique Barboza
- osinfo tests weren't considering config differences between
x86 and Power archs, resulting in errors.
- a new test was added to explictly test the case where an
unknown distro/version should return the configuration of
an old distro/version after the lookup.
Signed-off-by: Daniel Henrique Barboza <dhbarboza82(a)gmail.com>
---
tests/test_osinfo.py | 29 ++++++++++++++++++++++++-----
1 file changed, 24 insertions(+), 5 deletions(-)
diff --git a/tests/test_osinfo.py b/tests/test_osinfo.py
index d5e90b4..f2837f0 100644
--- a/tests/test_osinfo.py
+++ b/tests/test_osinfo.py
@@ -30,13 +30,23 @@ class OSInfoTests(unittest.TestCase):
self.assertEquals('unknown', entry['os_version'])
self.assertEquals(['default'], entry['networks'])
+ def _check_old_distro_diskbus_nic_multi_arch(self, disk_bus, nic_model):
+ if _get_arch() == 'x86':
+ self.assertEquals(disk_bus, 'ide')
+ self.assertEquals(nic_model, 'e1000')
+ else:
+ self.assertEquals(disk_bus, 'scsi')
+ self.assertEquals(nic_model, 'spapr-vlan')
+
def test_old_distros(self):
old_versions = {'debian': '5.0', 'ubuntu': '7.04', 'opensuse': '10.1',
'centos': '5.1', 'rhel': '5.1', 'fedora': '15'}
for distro, version in old_versions.iteritems():
entry = lookup(distro, version)
- self.assertEquals(entry['disk_bus'], 'ide')
- self.assertEquals(entry['nic_model'], 'e1000')
+ self._check_old_distro_diskbus_nic_multi_arch(
+ entry['disk_bus'],
+ entry['nic_model']
+ )
def test_modern_bases(self):
for distro, version in modern_version_bases[_get_arch()].iteritems():
@@ -45,10 +55,19 @@ class OSInfoTests(unittest.TestCase):
self.assertEquals(entry['nic_model'], 'virtio')
def test_modern_distros(self):
- modern_versions = {'debian': '7.0', 'ubuntu': '12.04',
- 'opensuse': '12.3', 'centos': '6.4', 'rhel': '6.3',
- 'fedora': '18', 'gentoo': '12.1'}
+ # versions based on ppc64 modern distros
+ modern_versions = {'ubuntu': '14.04', 'opensuse': '13.1',
+ 'rhel': '6.5', 'fedora': '19', 'sles': '11sp3'}
for distro, version in modern_versions.iteritems():
entry = lookup(distro, version)
self.assertEquals(entry['disk_bus'], 'virtio')
self.assertEquals(entry['nic_model'], 'virtio')
+
+ def test_lookup_unknown_distro_version_returns_old_distro(self):
+ distro = 'unknown_distro'
+ version = 'unknwon_version'
+ entry = lookup(distro, version)
+ self._check_old_distro_diskbus_nic_multi_arch(
+ entry['disk_bus'],
+ entry['nic_model']
+ )
--
1.9.3
9 years, 9 months
[PATCH] test/vmtemplate.py: fixes for Power architecture
by Daniel Henrique Barboza
- changing 'fields' variable to a dict instead of an array
to manipulate specific fields easier
- changing 'memory', 'disk_bus' and 'nic_model' fields
when running the tests in a Power host
Signed-off-by: Daniel Henrique Barboza <dhbarboza82(a)gmail.com>
---
tests/test_vmtemplate.py | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/tests/test_vmtemplate.py b/tests/test_vmtemplate.py
index 550bb2a..372f54a 100644
--- a/tests/test_vmtemplate.py
+++ b/tests/test_vmtemplate.py
@@ -22,6 +22,7 @@ import unittest
import uuid
+from kimchi.osinfo import _get_arch
from kimchi.vmtemplate import VMTemplate
from kimchi.xmlutils.utils import xpath_get_text
@@ -35,16 +36,21 @@ class VMTemplateTests(unittest.TestCase):
os.unlink(self.iso)
def test_minimal_construct(self):
- fields = (('name', 'test'), ('os_distro', 'unknown'),
- ('os_version', 'unknown'), ('cpus', 1),
- ('memory', 1024), ('networks', ['default']),
- ('disk_bus', 'ide'), ('nic_model', 'e1000'),
- ('graphics', {'type': 'vnc', 'listen': '127.0.0.1'}),
- ('cdrom', self.iso))
+ fields = {'name': 'test', 'os_distro': 'unknown',
+ 'os_version': 'unknown', 'cpus': 1,
+ 'memory': 1024, 'networks': ['default'],
+ 'disk_bus': 'ide', 'nic_model': 'e1000',
+ 'graphics': {'type': 'vnc', 'listen': '127.0.0.1'},
+ 'cdrom': self.iso}
+
+ if _get_arch() in ('power', 'ppc64le'):
+ fields['memory'] = 1280
+ fields['disk_bus'] = 'scsi'
+ fields['nic_model'] = 'spapr-vlan'
args = {'name': 'test', 'cdrom': self.iso}
t = VMTemplate(args)
- for name, val in fields:
+ for name, val in fields.iteritems():
self.assertEquals(val, t.info.get(name))
def test_construct_overrides(self):
--
1.9.3
9 years, 9 months
[PATCH] tests/test_mockmodel.py: fixes for Power architecture
by Daniel Henrique Barboza
Testing for the right amount of default memory when running the
test in a Power system.
Signed-off-by: Daniel Henrique Barboza <dhbarboza82(a)gmail.com>
---
tests/test_mockmodel.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/tests/test_mockmodel.py b/tests/test_mockmodel.py
index 542f845..ed3a0f9 100644
--- a/tests/test_mockmodel.py
+++ b/tests/test_mockmodel.py
@@ -28,6 +28,7 @@ import kimchi.mockmodel
from utils import get_free_port, patch_auth, request, run_server
from utils import wait_task
from kimchi.control.base import Collection, Resource
+from kimchi.osinfo import _get_arch
test_server = None
@@ -155,10 +156,13 @@ class MockModelTests(unittest.TestCase):
'io_throughput', 'io_throughput_peak'))
info = model.vm_lookup(u'test-vm')
+ mem_expected = 1024
+ if _get_arch() in ('power', 'ppc64le'):
+ mem_expected = 1280
self.assertEquals(keys, set(info.keys()))
self.assertEquals('shutoff', info['state'])
self.assertEquals('test-vm', info['name'])
- self.assertEquals(1024, info['memory'])
+ self.assertEquals(mem_expected, info['memory'])
self.assertEquals(1, info['cpus'])
self.assertEquals('images/icon-vm.png', info['icon'])
self.assertEquals(stats_keys, set(info['stats'].keys()))
--
1.9.3
9 years, 9 months
[PATCH v3 0/5] Create VMs Asynchronously
by Christy Perez
v3 Changes:
Instead of adding a description key to the task, just
append the action desciptor to the target_uri.
If a guest has a large disk, and uses a filesystem that requires
preallocation, it can take several minutes to create a VM. During that
time, kimchi is tied up by the VM creation.
This patch changes the VMs Collection to be an AsyncCollection.
Another change required for this was to create a more granular way to
query tasks. Currently it is not possible (using the API) to query tasks
for the same collection or resource type that may have different operations.
For example, VM cloning is also an asynchronous operation. For the guests tab,
the UI was querying all running tasks and displaying them with the Cloning
label. This picked up VMs that were being created as well. For more information
about how the tasks can be queried, see the updated API doc and the UI change.
Christy Perez (5):
Granular Task Queries: Backend
Granular task query test updates
Granular Task Queries: UI
Create guests asynchronously: Backend
Async vm creation test updates
docs/API.md | 16 ++++++++
src/kimchi/control/vms.py | 4 +-
src/kimchi/mockmodel.py | 7 ++--
src/kimchi/model/debugreports.py | 4 +-
src/kimchi/model/host.py | 4 +-
src/kimchi/model/storagepools.py | 2 +-
src/kimchi/model/storagevolumes.py | 12 +++---
src/kimchi/model/vms.py | 33 +++++++++++++---
src/kimchi/model/vmsnapshots.py | 5 ++-
tests/test_authorization.py | 23 +++++++-----
tests/test_mockmodel.py | 12 ++++--
tests/test_model.py | 60 +++++++++++++++++++----------
tests/test_model_storagevolume.py | 2 +-
tests/test_rest.py | 77 ++++++++++++++++++++++++++++----------
ui/js/src/kimchi.guest_main.js | 4 +-
15 files changed, 188 insertions(+), 77 deletions(-)
--
2.1.0
9 years, 9 months
[PATCH] Remove slash "/" filter in template name when create VM
by Rodrigo Trujillo
Users are allowed to create or update template names with "slash",
this generates an error when he tries to create a guest with that
template because the guest paramters validation prohibits slashes
in templates names. This patch fixes this problem.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
src/kimchi/API.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/kimchi/API.json b/src/kimchi/API.json
index 0cfa20c..f507251 100644
--- a/src/kimchi/API.json
+++ b/src/kimchi/API.json
@@ -233,7 +233,7 @@
"template": {
"description": "The URI of a template to use when building a VM",
"type": "string",
- "pattern": "^/templates/[^/]+/?$",
+ "pattern": "^/templates/(.*?)/?$",
"required": true,
"error": "KCHVM0012E"
},
--
2.1.0
9 years, 9 months
[PATCH v3] Issue #587: Man page submission for kimchid
by Frédéric Bonnard
From: Frederic Bonnard <frediz(a)linux.vnet.ibm.com>
Hi,
I added the federation information into a section within the manpage with a bit of cosmetic.
F.
Frederic Bonnard (1):
Issue #587: Man page submission for kimchid
COPYING | 5 +-
Makefile.am | 2 +
contrib/kimchi.spec.fedora.in | 4 ++
contrib/kimchi.spec.suse.in | 4 ++
docs/Makefile.am | 1 +
docs/kimchid.8 | 156 ++++++++++++++++++++++++++++++++++++++++++
6 files changed, 170 insertions(+), 2 deletions(-)
create mode 100644 docs/kimchid.8
--
1.9.1
9 years, 9 months
[PATCH V2] Remove slash "/" filter in template name when create VM
by Rodrigo Trujillo
Users are allowed to create or update template names with "slash",
this generates an error when he tries to create a guest with that
template because the guest paramters validation prohibits slashes
in templates names. This patch fixes this problem.
Signed-off-by: Rodrigo Trujillo <rodrigo.trujillo(a)linux.vnet.ibm.com>
---
src/kimchi/API.json | 2 +-
src/kimchi/utils.py | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/kimchi/API.json b/src/kimchi/API.json
index 0cfa20c..f507251 100644
--- a/src/kimchi/API.json
+++ b/src/kimchi/API.json
@@ -233,7 +233,7 @@
"template": {
"description": "The URI of a template to use when building a VM",
"type": "string",
- "pattern": "^/templates/[^/]+/?$",
+ "pattern": "^/templates/(.*?)/?$",
"required": true,
"error": "KCHVM0012E"
},
diff --git a/src/kimchi/utils.py b/src/kimchi/utils.py
index f1ef12c..0d5f988 100644
--- a/src/kimchi/utils.py
+++ b/src/kimchi/utils.py
@@ -45,7 +45,7 @@ task_id = 0
def _uri_to_name(collection, uri):
- expr = '/%s/(.*?)/?$' % collection
+ expr = '/%s/(.*?)$' % collection
m = re.match(expr, uri)
if not m:
raise InvalidParameter("KCHUTILS0001E", {'uri': uri})
--
2.1.0
9 years, 9 months