[PATCH v2] Does not list non-bootable images
by Ramon Medeiros
Also fix tests that were using non-bootable isos.
Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
Changes
v2:
Fix tests that were listing non-bootable isos
---
src/kimchi/model/storagevolumes.py | 2 +-
tests/test_rest.py | 16 ++++++++--------
2 files changed, 9 insertions(+), 9 deletions(-)
diff --git a/src/kimchi/model/storagevolumes.py b/src/kimchi/model/storagevolumes.py
index dc807e4..e88c2cb 100644
--- a/src/kimchi/model/storagevolumes.py
+++ b/src/kimchi/model/storagevolumes.py
@@ -530,7 +530,7 @@ class IsoVolumesModel(object):
for volume in volumes:
res = self.storagevolume.lookup(pool_name,
volume.decode("utf-8"))
- if res['format'] == 'iso':
+ if res['format'] == 'iso' and res['bootable']:
res['name'] = '%s' % volume
iso_volumes.append(res)
return iso_volumes
diff --git a/tests/test_rest.py b/tests/test_rest.py
index 914b602..9e5988b 100644
--- a/tests/test_rest.py
+++ b/tests/test_rest.py
@@ -61,13 +61,14 @@ def setUpModule():
# Create fake ISO to do the tests
iso_gen.construct_fake_iso(fake_iso, True, '12.04', 'ubuntu')
-
+ iso_gen.construct_fake_iso("/var/lib/libvirt/images/fedora.iso", True,
+ "17", "fedora")
def tearDownModule():
test_server.stop()
os.unlink('/tmp/obj-store-test')
os.unlink(fake_iso)
-
+ os.unlink("/var/lib/libvirt/images/fedora.iso")
class RestTests(unittest.TestCase):
def _async_op(self, cb, opaque):
@@ -926,9 +927,9 @@ class RestTests(unittest.TestCase):
storagevolume['path'])
self.assertEquals(1073741824, storagevolume['capacity']) # 1 GiB
self.assertEquals(0, storagevolume['allocation'])
- self.assertEquals('unknown', storagevolume['os_version'])
- self.assertEquals('unknown', storagevolume['os_distro'])
- self.assertEquals(False, storagevolume['bootable'])
+ self.assertEquals('17', storagevolume['os_version'])
+ self.assertEquals('fedora', storagevolume['os_distro'])
+ self.assertEquals(True, storagevolume['bootable'])
# Create a template
# In real model os distro/version can be omitted
@@ -943,8 +944,8 @@ class RestTests(unittest.TestCase):
# Verify the template
t = json.loads(self.request('/templates/test').read())
self.assertEquals('test', t['name'])
- self.assertEquals('unknown', t['os_distro'])
- self.assertEquals('unknown', t['os_version'])
+ self.assertEquals('fedora', t['os_distro'])
+ self.assertEquals('17', t['os_version'])
self.assertEquals(get_template_default('old', 'memory'), t['memory'])
# Deactivate or destroy scan pool return 405
@@ -1187,7 +1188,6 @@ class RestTests(unittest.TestCase):
resp = self.request('%s/fedora-fake' % base_uri, '{}', 'DELETE')
self.assertEquals(204, resp.status)
-
class HttpsRestTests(RestTests):
"""
Run all of the same tests as above, but use https instead
--
2.1.0
9 years, 6 months
[PATCH 0/3 V4] Storage volume upload UI
by Aline Manera
V3 - V4:
- Rebase
V2 - V3:
- Adjust error handlers to work with Chrome
V1 - V2:
- Deal with non-existing file and read permission errors
Aline Manera (3):
Storage volume upload: Keep the task tracking to update the UI
Storage volume upload: Let the 'format' parameter be an empty string
Enable storage volume upload on UI
src/kimchi/API.json | 2 +-
src/kimchi/mockmodel.py | 3 +-
src/kimchi/model/storagevolumes.py | 20 ++++--
tests/test_model_storagevolume.py | 2 +-
ui/js/src/kimchi.api.js | 25 +++++--
ui/js/src/kimchi.storagepool_add_volume_main.js | 96 +++++++++++++++++++++----
ui/pages/i18n.json.tmpl | 2 +
ui/pages/storagepool-add-volume.html.tmpl | 4 +-
8 files changed, 126 insertions(+), 28 deletions(-)
--
2.1.0
9 years, 6 months
[PATCH] Add DESTDIR to make install
by Ramon Medeiros
Commit 04d29530 was incomplete by not using DESTDIR on installation.
This can cause trouble when creating the rpm. Also, make install now is
installing correctly service and firewall configuration files.
---
Makefile.am | 54 +++++++++++++++++++++++++++++++------------
contrib/kimchi.spec.fedora.in | 3 ---
2 files changed, 39 insertions(+), 18 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 91a0fa2..46e0e0e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -116,26 +116,50 @@ ChangeLog:
install-data-local:
@if test -d /usr/lib/systemd/system/ ; then \
- $(INSTALL_DATA) contrib/kimchid.service.fedora /usr/lib/systemd/system/kimchid.service; \
- systemctl daemon-reload; \
+ mkdir -p $(DESTDIR)/usr/lib/systemd/system/; \
+ $(INSTALL_DATA) contrib/kimchid.service.fedora $(DESTDIR)/usr/lib/systemd/system/kimchid.service; \
elif test -d /etc/systemd/system; then \
- $(INSTALL_DATA) contrib/kimchid.service.fedora /etc/systemd/system/kimchid.service; \
- systemctl daemon-reload; \
- else \
- $(INSTALL_DATA) contrib/kimchid.sysvinit /etc/init.d/kimchid; \
- chmod +x /etc/init.d/kimchid; \
- fi
+ mkdir -p $(DESTDIR)/etc/systemd/system/; \
+ $(INSTALL_DATA) contrib/kimchid.service.fedora $(DESTDIR)/etc/systemd/system/kimchid.service; \
+ else \
+ mkdir -p $(DESTDIR)/etc/init.d/ \
+ $(INSTALL_DATA) contrib/kimchid.sysvinit $(DESTDIR)/etc/init.d/kimchid; \
+ chmod +x $(DESTDIR)/etc/init.d/kimchid; \
+ if test -f /etc/fedora-release || test -f /etc/redhat-release; then \
+ $(INSTALL_DATA) contrib/kimchid-upstart.conf.fedora $(DESTDIR)/etc/init/kimchi.conf; \
+ elif test -f /etc/debian_version; then \
+ $(INSTALL_DATA) contrib/kimchid-upstart.conf.debian $(DESTDIR)/etc/init/kimchi.conf; \
+ fi; \
+ fi; \
+ if test -d /usr/lib/firewalld/services/; then \
+ mkdir -p $(DESTDIR)/usr/lib/firewalld/services/; \
+ $(INSTALL_DATA) src/firewalld.xml $(DESTDIR)/usr/lib/firewalld/services/kimchid.xml; \
+ fi; \
+ mkdir -p $(DESTDIR)/var/lib/kimchi/{debugreports,screenshots,vnc-tokens,isos}
+ touch $(DESTDIR)/var/lib/kimchi/objectstore
+ mkdir -p $(DESTDIR)/var/log/kimchi/
+ touch $(DESTDIR)/var/log/kimchi/kimchi-access.log
+ touch $(DESTDIR)/var/log/kimchi/kimchi-error.log
+ mkdir -p $(DESTDIR)/etc/kimchi/
+ touch $(DESTDIR)/etc/nginx/conf.d/kimchi.conf
uninstall-local:
@if test -f /usr/lib/systemd/system/kimchid.service; then \
- $(RM) /usr/lib/systemd/system/kimchid.service; \
- systemctl daemon-reload; \
- elif test -f /etc/systemd/system/kimchid.service; then \
- $(RM) /etc/systemd/system/kimchid.service; \
+ $(RM) $(DESTDIR)/usr/lib/systemd/system/kimchid.service; \
+ elif test -f $(DESTDIR)/etc/systemd/system/kimchid.service; then \
+ $(RM) $(DESTDIR)/etc/systemd/system/kimchid.service; \
elif test -f /etc/init.d/kimchid; then \
- $(RM) /etc/init.d/kimchid; \
- fi
-
+ $(RM) $(DESTDIR)/etc/init.d/kimchid; \
+ $(RM) $(DESTDIR)/etc/init/kimchi.conf; \
+ fi; \
+ if test -d /usr/lib/firewalld/services/; then \
+ $(RM) $(DESTDIR)/usr/lib/firewalld/services/kimchid.xml; \
+ fi; \
+ $(RM) -rf $(DESTDIR)/var/lib/kimchi
+ $(RM) -rf $(DESTDIR)/var/log/kimchi
+ $(RM) -rf $(DESTDIR)/etc/kimchi
+ $(RM) $(DESTDIR)/etc/nginx/conf.d/kimchi.conf
+
VERSION:
@if test -d .git; then \
git describe --abbrev=0 > $@; \
diff --git a/contrib/kimchi.spec.fedora.in b/contrib/kimchi.spec.fedora.in
index 30f8417..4e12327 100644
--- a/contrib/kimchi.spec.fedora.in
+++ b/contrib/kimchi.spec.fedora.in
@@ -98,9 +98,6 @@ touch %{buildroot}/%{_localstatedir}/log/kimchi/kimchi-error.log
mkdir -p %{buildroot}/%{_sysconfdir}/kimchi/
touch %{buildroot}/%{_sysconfdir}/nginx/conf.d/kimchi.conf
-# Install the systemd scripts
-install -Dm 0644 contrib/kimchid.service.fedora %{buildroot}%{_unitdir}/kimchid.service
-install -Dm 0640 src/firewalld.xml %{buildroot}%{_prefix}/lib/firewalld/services/kimchid.xml
%endif
%if 0%{?rhel} == 6
--
2.1.0
9 years, 6 months