Re: [Kimchi-devel] [PATCH V4] [Kimchi] Handle Libvirt host ENOSPC event
by Lucio Correia
On 24-05-2016 17:39, joserz(a)linux.vnet.ibm.com wrote:
> Hello Lucio,
>
> Can I ask you to test your patch using my patch "[Kimchi] Decrease the
> sleep time for libvirt event timout" as base to see if you
> get any side effect?
>
> Thank you
That patch broke this fix. The fix works without that patch, but doesn't
work with it. The enospc event simply is not caught.
--
Lucio Correia
Software Engineer
IBM LTC Brazil
8 years, 7 months
[PATCH][Wok 11/11] FVT: Added Readme instruction for running fvt testcases.
by archus@linux.vnet.ibm.com
From: Archana Singh <archus(a)linux.vnet.ibm.com>
Added Readme instruction for running fvt testcases.
Signed-off-by: Archana Singh <archus(a)linux.vnet.ibm.com>
---
docs/README.md | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/docs/README.md b/docs/README.md
index 8e14672..56e8144 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -74,6 +74,14 @@ Build and Install
# Optional if running from the source tree
$ sudo make install
+FVT Testing
+-----------------
+
+ $ sudo pip install virtualenv
+ $ make check-fvt
+
+After all fvt tests are executed, a summary will be displayed containing any errors/failures which might have occurred.
+
Starting up Wok
---------------
--
2.5.0
8 years, 7 months
[PATCH][Wok 10/11] FVT: Added check-fvt to run FVT testcases using make and venv dir to be cleaned.
by archus@linux.vnet.ibm.com
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`
--
2.5.0
8 years, 7 months
[PATCH][Wok 09/11] FVT: Added FVT Makefile path in AC_CONFIG_FILES list.
by archus@linux.vnet.ibm.com
From: Archana Singh <archus(a)linux.vnet.ibm.com>
Added fvt's Makefile path in AC_CONFIG_FILES list.
Signed-off-by: Archana Singh <archus(a)linux.vnet.ibm.com>
---
configure.ac | 1 +
1 file changed, 1 insertion(+)
diff --git a/configure.ac b/configure.ac
index 002774d..1c64367 100644
--- a/configure.ac
+++ b/configure.ac
@@ -153,6 +153,7 @@ AC_CONFIG_FILES([
contrib/wok.spec.fedora
contrib/wok.spec.suse
tests/Makefile
+ tests/fvt/Makefile
],[
chmod +x po/gen-pot
])
--
2.5.0
8 years, 7 months
[PATCH][Wok 08/11] FVT: Added fvt as subdirs and check-fvt to run fvt testcases using make.
by archus@linux.vnet.ibm.com
From: Archana Singh <archus(a)linux.vnet.ibm.com>
Added fvt as subdirs and check-fvt to run fvt testcases using make.
Signed-off-by: Archana Singh <archus(a)linux.vnet.ibm.com>
---
tests/Makefile.am | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 9ead666..656cfae 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -17,6 +17,8 @@
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+SUBDIRS = fvt
+
EXTRA_DIST = \
Makefile.am \
run_tests.sh.in \
@@ -46,5 +48,10 @@ check-local:
$(MKDIR_P) $(top_srcdir)/data/screenshots
./run_tests.sh
+check-fvt:
+ fvt/run_tests.sh
+ rm -fr venv
+
+
BUILT_SOURCES = test_config.py
CLEANFILES = run_tests.sh test_config.py
--
2.5.0
8 years, 7 months
[PATCH][Wok 07/11] FVT: Makefile needed for build and run fvt.
by archus@linux.vnet.ibm.com
From: Archana Singh <archus(a)linux.vnet.ibm.com>
Makefile for building and running fvt.
Signed-off-by: Archana Singh <archus(a)linux.vnet.ibm.com>
---
tests/fvt/Makefile.am | 43 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 43 insertions(+)
create mode 100644 tests/fvt/Makefile.am
diff --git a/tests/fvt/Makefile.am b/tests/fvt/Makefile.am
new file mode 100644
index 0000000..c1d3934
--- /dev/null
+++ b/tests/fvt/Makefile.am
@@ -0,0 +1,43 @@
+#
+# 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-1301 USA
+
+EXTRA_DIST = \
+ Makefile.am \
+ run_tests.sh.in \
+ $(wildcard *.py) \
+ $(NULL)
+
+noinst_SCRIPTS = run_tests.sh
+
+do_substitution = \
+ sed -e 's,[@]HAVE_PYMOD_UNITTEST[@],$(HAVE_PYMOD_UNITTEST),g' \
+ -e 's,[@]PYTHON_VERSION[@],$(PYTHON_VERSION),g'
+
+run_tests.sh: run_tests.sh.in Makefile
+ $(do_substitution) < $(srcdir)/run_tests.sh.in > run_tests.sh
+ chmod +x run_tests.sh
+
+CLEANFILES = run_tests.sh
+
+check-fvt:
+ ./run_tests.sh
+ rm -fr venv
+
+clean-local:
+ rm -fr venv
--
2.5.0
8 years, 7 months
[PATCH][Wok 06/11] FVT: Install all the dependencies from requirements.txt and runs FVT testcases
by archus@linux.vnet.ibm.com
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.
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..7f8046d
--- /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
--
2.5.0
8 years, 7 months
[PATCH][Wok 05/11] FVT: Base test class, takes care common actions required for any FVT test cases.
by archus@linux.vnet.ibm.com
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.
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..87df4fd
--- /dev/null
+++ b/tests/fvt/fvt_base.py
@@ -0,0 +1,92 @@
+#!/usr/bin/python
+# -*- coding: utf-8 -*-
+#
+# 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
+
+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__()
--
2.5.0
8 years, 7 months
[PATCH][Wok 03/11] FVT: Lists all dependecies for fvt testcases.
by archus@linux.vnet.ibm.com
From: Archana Singh <archus(a)linux.vnet.ibm.com>
All the dependecies to be installed which is required by fvt
testcases should be added here.
Signed-off-by: Archana Singh <archus(a)linux.vnet.ibm.com>
---
tests/fvt/requirements.txt | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
create mode 100644 tests/fvt/requirements.txt
diff --git a/tests/fvt/requirements.txt b/tests/fvt/requirements.txt
new file mode 100644
index 0000000..aa20241
--- /dev/null
+++ b/tests/fvt/requirements.txt
@@ -0,0 +1,23 @@
+# This requirements file lists all dependecies for fvt testcases.
+# Run 'pip install -r requirements.txt' to install these dependencies
+#
+# 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
+
+jsonschema
+requests
--
2.5.0
8 years, 7 months
[PATCH][Wok 02/11] FVT: Wok level config file to have 'sectionsi required for fvt common across plugins.
by archus@linux.vnet.ibm.com
From: Archana Singh <archus(a)linux.vnet.ibm.com>
Wok level config file to have 'sections' required for functional verification
test common across plugins.
Signed-off-by: Archana Singh <archus(a)linux.vnet.ibm.com>
---
tests/fvt/config | 7 +++++++
1 file changed, 7 insertions(+)
create mode 100644 tests/fvt/config
diff --git a/tests/fvt/config b/tests/fvt/config
new file mode 100644
index 0000000..7b20c01
--- /dev/null
+++ b/tests/fvt/config
@@ -0,0 +1,7 @@
+[Session]
+user :
+passwd :
+host : localhost
+port : 8001
+logfile : wok-api-test-suite.log
+loglevel : DEBUG
--
2.5.0
8 years, 7 months