Re: [Kimchi-devel] [PATCH V2][Wok 10/12] FVT: Added check-fvt to run FVT testcases using make and venv dir to be cleaned.
by Aline Manera
You can join patches 7 to 10 into one single patch.
It is easier to review as they modifies the same file for the same proposal.
On 05/30/2016 04:10 AM, archus(a)linux.vnet.ibm.com wrote:
> From: Archana Singh <archus(a)linux.vnet.ibm.com>
>
> Added check-fvt to run FVT testcases using make and venv dir to be cleaned.
>
> Signed-off-by: Archana Singh <archus(a)linux.vnet.ibm.com>
> ---
> Makefile.am | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/Makefile.am b/Makefile.am
> index 325d0c9..9827e66 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -52,6 +52,7 @@ check-local:
> find . -path './.git' -prune -o \
> -name '*.py' -o -name '*.py.in' | \
> xargs $(PYFLAKES) | \
> + grep -w -v "venv" | \
> while read LINE; do echo "$$LINE"; false; done \
> else \
> find . -name '*.py' -o -name '*.py.in' | \
> @@ -70,6 +71,10 @@ check-local:
> /bin/bash check-IBM-license-header.sh ; \
> fi
>
> +check-fvt:
> + tests/fvt/run_tests.sh
> + rm -fr venv
> +
> # Link built mo files in the source tree to enable use of translations from
> # within the source tree
> all-local:
> @@ -185,5 +190,6 @@ VERSION:
>
> clean-local:
> rm -rf mo rpm
> + rm -rf mo rpm tests/fvt/venv
>
> CLEANFILES = wok.spec `find "$(top_srcdir)" -type f -name "*.pyc" -print`
8 years, 4 months
Re: [Kimchi-devel] [PATCH V2][Wok 06/12] FVT: Install all the dependencies from requirements.txt and runs FVT testcases
by Aline Manera
On 05/30/2016 04:10 AM, archus(a)linux.vnet.ibm.com wrote:
> From: Archana Singh <archus(a)linux.vnet.ibm.com>
>
> Script to run FVT test cases which also take care of
> installing all
> dependencies from requirements.txt.
The part of installing dependencies should be done separated. Thinking
about a completed CI infrastructure, it would be done by a Chef/Puppet
recipe to launch a new server to run the tests.
> Signed-off-by: Archana Singh <archus(a)linux.vnet.ibm.com>
> ---
> tests/fvt/run_tests.sh.in | 92 +++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 92 insertions(+)
> create mode 100755 tests/fvt/run_tests.sh.in
>
> diff --git a/tests/fvt/run_tests.sh.in b/tests/fvt/run_tests.sh.in
> new file mode 100755
> index 0000000..ee31b95
> --- /dev/null
> +++ b/tests/fvt/run_tests.sh.in
> @@ -0,0 +1,92 @@
> +#!/bin/bash
> +#
> +# Project Wok
> +#
> +# Copyright IBM Corp, 2016
> +#
> +# This library is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU Lesser General Public
> +# License as published by the Free Software Foundation; either
> +# version 2.1 of the License, or (at your option) any later version.
> +#
> +# This library is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> +# Lesser General Public License for more details.
> +#
> +# You should have received a copy of the GNU Lesser General Public
> +# License along with this library; if not, write to the Free Software
> +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301USA
> +
> +mkdir -p venv
> +
> +HAVE_UNITTEST=@HAVE_PYMOD_UNITTEST@
> +PYTHON_VER=@PYTHON_VERSION@
> +
> +# Verify if the required commands exists on the system
> +command -v virtualenv >/dev/null 2>&1 || { echo >&2 "virtualenv must be installed for your distribution. Aborting."; exit 1; }
> +command -v pip >/dev/null 2>&1 || { echo >&2 "pip must be installed for your distribution. Aborting."; exit 1; }
> +
> +# Get absolute path of this script
> +pushd `dirname $0` > /dev/null
> +SCRIPTPATH=`pwd -P`
> +reqfile=$SCRIPTPATH'/requirements.txt'
> +
> +# Start the virtual environment
> +virtualenv venv --no-site-packages
> +
> +
> +# Actiate the virtual environment
> +source venv/bin/activate
> +
> +while read line; do
> +
> + case "$line" in
> + \#*)
> + continue ;; # skip comments
> + "")
> + continue ;; # skip empty lines
> + *)
> + venv/bin/python$PYTHON_VER -c "import $line" > /dev/null 2>&1
> + status=$?
> + if [ $status -ne 0 ]; then
> + pip install -r $reqfile # Install the required modules to run tests
> + break
> + fi
> + esac
> +done < $reqfile
> +
> +# Execute the test suite
> +#python registered_tests.py
> +#nosetests --with-html --html-file=test_report.html registered_tests.py
> +
> +if [ "$1" = "-v" ]; then
> + OPTS="-v"
> + shift
> +else
> + OPTS=""
> +fi
> +
> +if [ $# -ne 0 ]; then
> + ARGS="$@"
> +else
> + ARGS=`find -name "fvt_*.py" | xargs -I @ basename @ .py`
> +fi
> +
> +if [ "$HAVE_UNITTEST" != "yes" -o "$PYTHON_VER" == "2.6" ]; then
> + CMD="unit2"
> +else
> + CMD="python -m unittest"
> +fi
> +
> +LIST=($ARGS)
> +FVT_LIST=()
> +for ((i=0;i<${#LIST[@]};i++)); do
> + FVT_LIST+=(${LIST[$i]})
> +done
> +PYTHONPATH=../ $CMD $OPTS ${FVT_LIST[@]}
> +
> +# Deativate the virtual environment
> +deactivate
> +
> +rm -fr venv
8 years, 4 months
Re: [Kimchi-devel] [PATCH V2][Wok 05/12] FVT: Base test class, takes care common actions required for any FVT test cases.
by Aline Manera
On 05/30/2016 04:10 AM, archus(a)linux.vnet.ibm.com wrote:
> From: Archana Singh <archus(a)linux.vnet.ibm.com>
>
> Common action methods like creating/destoring session,
> authorization using wok level fvt config file,
> creating JSON validator and logging.
I'd like to understand better what you are calling 'session'.
Wok works with an internal user session on backend. Why do we need a
different one to do the tests?
> Signed-off-by: Archana Singh <archus(a)linux.vnet.ibm.com>
> ---
> tests/fvt/fvt_base.py | 92 +++++++++++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 92 insertions(+)
> create mode 100644 tests/fvt/fvt_base.py
>
> diff --git a/tests/fvt/fvt_base.py b/tests/fvt/fvt_base.py
> new file mode 100644
> index 0000000..8d152a5
> --- /dev/null
> +++ b/tests/fvt/fvt_base.py
> @@ -0,0 +1,92 @@
> +#!/usr/bin/python
> +# -*- coding: utf-8 -*-
> +#
The same I commented before about that coding macro.
It is only needed when you have non-ASCII characters in the code source
file. And it seems to not be the case. So you can safely remove it.
> +# Project Wok
> +#
> +# Copyright IBM Corp, 2016
> +#
> +# This library is free software; you can redistribute it and/or
> +# modify it under the terms of the GNU Lesser General Public
> +# License as published by the Free Software Foundation; either
> +# version 2.1 of the License, or (at your option) any later version.
> +#
> +# This library is distributed in the hope that it will be useful,
> +# but WITHOUT ANY WARRANTY; without even the implied warranty of
> +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> +# Lesser General Public License for more details.
> +#
> +# You should have received a copy of the GNU Lesser General Public
> +# License along with this library; if not, write to the Free Software
> +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301USA
> +
> +import unittest
> +import os
> +from restapilib import APISession, APIError, APIRequestError
> +from restapilib import Validator
> +
The import section must be in alphabetic order.
> +DEFAULT_CONF = os.path.dirname(os.path.abspath(__file__)) + 'config'
> +
> +
> +class TestBase(unittest.TestCase):
> + """Represents an API session setup with the host Web Services API"""
> +
> + session = None
> +
> + def __init__(self, method='runTest'):
> + """init with default method as runTest"""
> + super(TestBase, self).__init__(method)
> +
> + @classmethod
> + def setUpClass(cls):
> + """
> + Hook method for setting up class fixture
> + before running tests in the class.
> + Create session and set auth to the session
> + """
> + print '--> TestBase.setUpClass(): Create session '
> + cls.session = APISession()
> + # Log on to the API. An exception will be raised if this fails.
> + cls.logging = cls.session.logging
> + cls.logging.debug('--> TestBase.setUpClass()')
> + cls.validator = Validator(cls.logging)
> + cls.logging.debug('TestBase.setUpClass(): Setting auth to session')
> + try:
> + cls.session.auth()
> + cls.logging.debug('TestBase.setUpClass(): Auth details set to '
> + 'session and base URI created as %s'
> + % cls.session._base_uri)
> + except APIError, err:
> + print 'ERROR %s' % err
> + print err.__str__()
> + if cls.session is not None:
> + cls.logging.error('TestBase.setUpClass(): Ending session'
> + ' as API error happened')
> + cls.session.end_session()
> + finally:
> + cls.logging.debug('<-- TestBase.setUpClass()')
> +
> + def setUp(self):
> + """Hook method for setting up the test fixture before exercising it."""
> + pass
> +
> + def tearDown(self):
> + """Hook method for deconstructing the test fixture after testing it."""
> + pass
> +
> + @classmethod
> + def tearDownClass(cls):
> + """
> + Hook method for deconstructing the class
> + fixture after running all tests in the class.
> + """
> + if cls.session is not None:
> + print 'TestBase.tearDownClass(): Ending session'
> + cls.session.end_session()
> +
> + def get(self):
> + try:
> + resp_net = self.session.request_get_json('/')
> + print resp_net
> + except APIRequestError as err:
> + print 'ERROR %s' % err
> + print err.__str__()
8 years, 4 months
[PATCH] [Kimchi] Issue #956: Unable to assign pci passthrough devices through kimchi
by sguimaraes943@gmail.com
From: Samuel Guimarães <sguimaraes943(a)gmail.com>
This commit fixes an issue with PCI passthrough devices through Kimchi.
It also addresses an enhancement to display success messages when some actions doesn't require the Save button and there's no UI feedback to the user (Issue #975).
Samuel Guimarães (1):
Issue #956: Unable to assign pci passthrough devices through kimchi
model/vmhostdevs.py | 2 +-
ui/css/kimchi.css | 5 +
ui/css/src/modules/_edit-guests.scss | 4 +
ui/js/src/kimchi.guest_edit_main.js | 232 ++++++++++++++++++++++-------------
ui/js/src/kimchi.guest_main.js | 10 +-
ui/pages/guest-edit.html.tmpl | 20 ++-
ui/pages/i18n.json.tmpl | 2 +
7 files changed, 176 insertions(+), 99 deletions(-)
--
1.9.3
8 years, 4 months
[PATCH] [Kimchi] Added cursor for tasks in progress
by sguimaraes943@gmail.com
From: Samuel Guimarães <sguimaraes943(a)gmail.com>
This patch updates kimchi.trackTask() progress callback to add a css class and change mouse cursor to "progress" instead of the default mouse pointer. It requires a patch sent to Wok.
Samuel Guimarães (1):
Added cursor for tasks in progress
ui/js/src/kimchi.api.js | 4 ++++
1 file changed, 4 insertions(+)
--
1.9.3
8 years, 4 months
[PATCH v2][Kimchi 0/2] Issue #467: Feature: Show boot menu for a guest
by Ramon Medeiros
Changes:
v2:
fix import order
Ramon Medeiros (2):
Issue #467: Feature: Show boot menu for a guest
Add test to verify bootmenu and update old tests
API.json | 5 +++++
docs/API.md | 1 +
i18n.py | 1 +
model/vms.py | 30 +++++++++++++++++++++---------
tests/test_mockmodel.py | 2 +-
tests/test_model.py | 8 +++++++-
xmlutils/bootorder.py | 4 ++++
7 files changed, 40 insertions(+), 11 deletions(-)
--
2.5.5
8 years, 4 months
Changing the way federation feature (peers) is exposed to user
by Aline Manera
Hi all,
Kimchi provides an feature called federation to discover other Wok
servers running in the same network.
This feature is not enabled by default. To enable it, the user needs to
follow the instructions in
https://github.com/kimchi-project/kimchi/blob/master/docs/README-federati...
The problem is: this feature is exposed by the user as a drop down menu
with a list of servers found. But it is displayed in the top header, ie,
on Wok header.
That way, we have some code on Wok related to a Kimchi feature.
To fix it, we should change the way we expose that feature on UI moving
it as a content tab.
As it is not strictly related to virtualization I don't see it fits in
any current Kimchi tabs and I don't think it justifies a new tab.
But from the other hand, there is a plan to integrate the federation
feature with guest migration, so user don't need to input the server
details to do the migration - he/she only needs to select one from the
list. Said that, the federation feature is still required for Kimchi.
So I have 3 proposals:
1. Move federation feature to WOK
The peers will continue to be displayed as part of the top header but
all code (backend/API) will be moved to Wok.
2. Move federation feature to Ginger Base
The Dashboard tab will display a new section with the peers information
when federation is enabled.
3. Keep federation feature on Kimchi and make Kimchi extend the Ginger
Base UI (the same way Ginger s390x does with Ginger tabs)
The Dashboard tab will be extended by Kimchi to display a new section
with the peers information when federation is enabled.
*I prefer the option 3* as it solves the original issue (having UI code
related to a Kimchi feature on Wok) and do not affect any other plugin
or Wok behavior.
Once we get an agreement on it, I will proper involve Ginger community
if needed.
What are you thoughts on it?
Regards,
Aline Manera
8 years, 4 months
[PATCH v3][Kimchi 0/6] Make Kimchi able to change guest's boot order
by Ramon Medeiros
Changes:
v3:
Update test on test_model to keep working
v2:
Do not manipulate xml on model
Improve parameters checking at API.json
Increase test cases
Ramon Medeiros (6):
Add function get_bootorder_node
Create method to change bootorder of a guest
Update documentation about bootorder on vm update
Update REST API
Add function to retrieve bootorder on vm lookup
Add test to check bootorder
API.json | 23 +++++++++++++++++++++++
docs/API.md | 1 +
i18n.py | 1 +
model/vms.py | 32 ++++++++++++++++++++++++++++++--
tests/test_mockmodel.py | 2 +-
tests/test_model.py | 15 ++++++++++++++-
xmlutils/bootorder.py | 19 +++++++++++++------
7 files changed, 83 insertions(+), 10 deletions(-)
--
2.5.5
8 years, 4 months
[PATCH v3] [Kimchi 0/9] Virt-Viewer launcher backend
by dhbarboza82@gmail.com
From: Daniel Henrique Barboza <danielhb(a)linux.vnet.ibm.com>
v3:
- fixed 'virviewerfiles' dir to 'virtviewerfiles' in Makefile.am
v2:
- fixed typo and capital letters in i18n.py
- fixed 'double dict' error in virtviewer module
- added tests with virtual machine containing utf-8 characters
This patch set adds the Virt-Viewer launcher backend to
Kimchi.
This feature consists of a new resource located in:
**URI:** /plugins/kimchi/vms/*:name*/snapshots/current
that retrieves a download link to a .vv file to be
used by a Virt-Viewer compatible desktop app to connect
to the remote virtual machine.
This backend takes cares of handling firewall rules to
allow the connection to be succesfull. Note that no firewall
port will be opened unless a download is made - if the user
decides to use noVNC or spice-html5 instead Kimchi will
not touch the host firewall.
Example:
[danielhb@arthas kimchi]$ curl -u root -H "Content-Type: application/json" -H "Accept: application/json" -X GET "http://localhost:8010/plugins/kimchi/vms/OpenSUSE-Leap-42.1/virtviewerfile"
Enter host password for user 'root':
[virt-viewer]
type=vnc
host=localhost
port=5904
After this call, port 5904 was opened in the host to allow for a
virt-viewer connection.
When shutting down the virtual machine or WoK, a cleanup is made
to close any ports left opened.
Daniel Henrique Barboza (9):
Virt-Viewer launcher: docs and i18n changes
Virt-Viewer launcher: Makefile and config changes
Virt-Viewer launcher: control/vms.py and model/vms.py changes
Virt-Viewer launcher: virtviewerfile module
Virt-Viewer launcher: test changes
Virt-Viewer launcher: adding FirewallManager class
Virt-Viewer launcher: test changes for firewall manager
Virt-Viewer launcher: libvirt events to control firewall
Virt-Viewer launcher: changes after adding libvirt event listening
Makefile.am | 2 +
config.py.in | 10 ++-
control/vms.py | 12 +++
docs/API.md | 6 ++
i18n.py | 2 +
model/virtviewerfile.py | 234 ++++++++++++++++++++++++++++++++++++++++++++++++
model/vms.py | 9 +-
tests/test_config.py.in | 6 ++
tests/test_model.py | 228 +++++++++++++++++++++++++++++++++++++++++++++-
9 files changed, 503 insertions(+), 6 deletions(-)
create mode 100644 model/virtviewerfile.py
--
2.5.5
8 years, 4 months
[RFC] Feature: Show boot menu for a guest #467
by Ramon Medeiros
Propose: Add bootmenu at guest startup
Questions about it:
Add bootmenu by default on guest creation, or, create a entry at REST
API to enable/disable it, and also change the timeout?
--
Ramon Nunes Medeiros
Kimchi Developer
Linux Technology Center Brazil
IBM Systems & Technology Group
Phone : +55 19 2132 7878
ramonn(a)br.ibm.com
8 years, 4 months