[PATCH 0/3] [WOK] Move Tasks to Wok.

From: Paulo Vital <pvital@linux.vnet.ibm.com> The Tasks collection and Task resource are basic structures from the AsyncTasks feature and will be used by all plugins inside the Wok framework. This patch-set moves the Tasks model and control from Kimchi to Wok, update all model and UI files from Kimchi to use the new structure and update the tests from Kimchi. Paulo Vital (3): Move Tasks to Wok. Update Kimchi to use Tasks from Wok. Update Kimchi tests to use Tasks from Wok. docs/API.md | 30 +++++++++++ plugins/kimchi/control/tasks.py | 37 -------------- plugins/kimchi/docs/API.md | 31 ------------ plugins/kimchi/model/debugreports.py | 2 +- plugins/kimchi/model/host.py | 2 +- plugins/kimchi/model/storagevolumes.py | 2 +- plugins/kimchi/model/tasks.py | 64 ------------------------ plugins/kimchi/model/vms.py | 2 +- plugins/kimchi/model/vmsnapshots.py | 2 +- plugins/kimchi/tests/test_host.py | 4 +- plugins/kimchi/tests/test_mock_storagepool.py | 2 +- plugins/kimchi/tests/test_model_storagevolume.py | 8 +-- plugins/kimchi/tests/test_rest.py | 22 ++++---- plugins/kimchi/tests/test_server.py | 8 +-- plugins/kimchi/ui/js/src/kimchi.api.js | 4 +- src/wok/control/tasks.py | 37 ++++++++++++++ src/wok/model/tasks.py | 64 ++++++++++++++++++++++++ 17 files changed, 160 insertions(+), 161 deletions(-) delete mode 100644 plugins/kimchi/control/tasks.py delete mode 100644 plugins/kimchi/model/tasks.py create mode 100644 src/wok/control/tasks.py create mode 100644 src/wok/model/tasks.py -- 2.4.3

From: Paulo Vital <pvital@linux.vnet.ibm.com> The Tasks collection and Task resource are basic structures and will be used by all plugins inside the Wok framework. Moving them from Kimchi to Wok. Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com> --- docs/API.md | 30 +++++++++++++++++++ plugins/kimchi/control/tasks.py | 37 ------------------------ plugins/kimchi/docs/API.md | 31 -------------------- plugins/kimchi/model/tasks.py | 64 ----------------------------------------- src/wok/control/tasks.py | 37 ++++++++++++++++++++++++ src/wok/model/tasks.py | 64 +++++++++++++++++++++++++++++++++++++++++ 6 files changed, 131 insertions(+), 132 deletions(-) delete mode 100644 plugins/kimchi/control/tasks.py delete mode 100644 plugins/kimchi/model/tasks.py create mode 100644 src/wok/control/tasks.py create mode 100644 src/wok/model/tasks.py diff --git a/docs/API.md b/docs/API.md index 67d966e..0ec1653 100644 --- a/docs/API.md +++ b/docs/API.md @@ -44,3 +44,33 @@ general conventions: * **GET**: Retrieve a summarized list names of all UI Plugins +### Collection: Tasks + +**URI:** /tasks + +**Methods:** + +* **GET**: Retrieve a summarized list of current Tasks + +### Resource: Task + +**URI:** /tasks/*:id* + +A task represents an asynchronous operation that is being performed by the +server. + +**Methods:** + +* **GET**: Retrieve the full description of the Task + * id: The Task ID is used to identify this Task in the API. + * status: The current status of the Task + * running: The task is running + * finished: The task has finished successfully + * failed: The task failed + * message: Human-readable details about the Task status + * target_uri: Resource URI related to the Task +* **POST**: *See Task Actions* + +**Actions (POST):** + +*No actions defined* diff --git a/plugins/kimchi/control/tasks.py b/plugins/kimchi/control/tasks.py deleted file mode 100644 index b25d892..0000000 --- a/plugins/kimchi/control/tasks.py +++ /dev/null @@ -1,37 +0,0 @@ -# -# Project Kimchi -# -# Copyright IBM, Corp. 2013-2014 -# -# 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 - -from wok.control.base import Collection, Resource -from wok.control.utils import UrlSubNode - - -@UrlSubNode("tasks", True) -class Tasks(Collection): - def __init__(self, model): - super(Tasks, self).__init__(model) - self.resource = Task - - -class Task(Resource): - def __init__(self, model, id): - super(Task, self).__init__(model, id) - - @property - def data(self): - return self.info diff --git a/plugins/kimchi/docs/API.md b/plugins/kimchi/docs/API.md index bfefeab..fca424c 100644 --- a/plugins/kimchi/docs/API.md +++ b/plugins/kimchi/docs/API.md @@ -635,37 +635,6 @@ A interface represents available interface on host. * deactivate: Deactivate an active Network -### Collection: Tasks - -**URI:** /plugins/kimchi/tasks - -**Methods:** - -* **GET**: Retrieve a summarized list of current Tasks - -### Resource: Task - -**URI:** /plugins/kimchi/tasks/*:id* - -A task represents an asynchronous operation that is being performed by the -server. - -**Methods:** - -* **GET**: Retrieve the full description of the Task - * id: The Task ID is used to identify this Task in the API. - * status: The current status of the Task - * running: The task is running - * finished: The task has finished successfully - * failed: The task failed - * message: Human-readable details about the Task status - * target_uri: Resource URI related to the Task -* **POST**: *See Task Actions* - -**Actions (POST):** - -*No actions defined* - ### Resource: Configuration **URI:** /plugins/kimchi/config diff --git a/plugins/kimchi/model/tasks.py b/plugins/kimchi/model/tasks.py deleted file mode 100644 index 678fdc2..0000000 --- a/plugins/kimchi/model/tasks.py +++ /dev/null @@ -1,64 +0,0 @@ -# -# Project Kimchi -# -# Copyright IBM, Corp. 2014 -# -# 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 - - -import time - -from wok.exception import TimeoutExpired - - -class TasksModel(object): - def __init__(self, **kargs): - self.objstore = kargs['objstore'] - - def get_list(self): - with self.objstore as session: - return session.get_list('task') - - -class TaskModel(object): - def __init__(self, **kargs): - self.objstore = kargs['objstore'] - - def lookup(self, id): - with self.objstore as session: - return session.get('task', str(id)) - - def wait(self, id, timeout=10): - """Wait for a task until it stops running (successfully or due to - an error). If the Task finishes its execution before <timeout>, this - function returns normally; otherwise an exception is raised. - - Parameters: - id -- The Task ID. - timeout -- The maximum time, in seconds, that this function should wait - for the Task. If the Task runs for more than <timeout>, - "TimeoutExpired" is raised. - """ - for i in range(0, timeout): - with self.objstore as session: - task = session.get('task', str(id)) - - if task['status'] != 'running': - return - - time.sleep(1) - - raise TimeoutExpired('KCHASYNC0003E', {'seconds': timeout, - 'task': task['target_uri']}) diff --git a/src/wok/control/tasks.py b/src/wok/control/tasks.py new file mode 100644 index 0000000..f6e8a80 --- /dev/null +++ b/src/wok/control/tasks.py @@ -0,0 +1,37 @@ +# +# Project Kimchi +# +# Copyright IBM, Corp. 2013-2014 +# +# 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 + +from base import Collection, Resource +from utils import UrlSubNode + + +@UrlSubNode("tasks", True) +class Tasks(Collection): + def __init__(self, model): + super(Tasks, self).__init__(model) + self.resource = Task + + +class Task(Resource): + def __init__(self, model, id): + super(Task, self).__init__(model, id) + + @property + def data(self): + return self.info diff --git a/src/wok/model/tasks.py b/src/wok/model/tasks.py new file mode 100644 index 0000000..678fdc2 --- /dev/null +++ b/src/wok/model/tasks.py @@ -0,0 +1,64 @@ +# +# Project Kimchi +# +# Copyright IBM, Corp. 2014 +# +# 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 + + +import time + +from wok.exception import TimeoutExpired + + +class TasksModel(object): + def __init__(self, **kargs): + self.objstore = kargs['objstore'] + + def get_list(self): + with self.objstore as session: + return session.get_list('task') + + +class TaskModel(object): + def __init__(self, **kargs): + self.objstore = kargs['objstore'] + + def lookup(self, id): + with self.objstore as session: + return session.get('task', str(id)) + + def wait(self, id, timeout=10): + """Wait for a task until it stops running (successfully or due to + an error). If the Task finishes its execution before <timeout>, this + function returns normally; otherwise an exception is raised. + + Parameters: + id -- The Task ID. + timeout -- The maximum time, in seconds, that this function should wait + for the Task. If the Task runs for more than <timeout>, + "TimeoutExpired" is raised. + """ + for i in range(0, timeout): + with self.objstore as session: + task = session.get('task', str(id)) + + if task['status'] != 'running': + return + + time.sleep(1) + + raise TimeoutExpired('KCHASYNC0003E', {'seconds': timeout, + 'task': task['target_uri']}) -- 2.4.3

From: Paulo Vital <pvital@linux.vnet.ibm.com> Update Kimchi model and UI files to import and use the Tasks collection and Task resource from Wok structure. Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com> --- plugins/kimchi/model/debugreports.py | 2 +- plugins/kimchi/model/host.py | 2 +- plugins/kimchi/model/storagevolumes.py | 2 +- plugins/kimchi/model/vms.py | 2 +- plugins/kimchi/model/vmsnapshots.py | 2 +- plugins/kimchi/ui/js/src/kimchi.api.js | 4 ++-- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/kimchi/model/debugreports.py b/plugins/kimchi/model/debugreports.py index bee10b6..48e6b26 100644 --- a/plugins/kimchi/model/debugreports.py +++ b/plugins/kimchi/model/debugreports.py @@ -29,9 +29,9 @@ from wok.exception import InvalidParameter, NotFoundError, OperationFailed from wok.exception import WokException from wok.utils import add_task, wok_log from wok.utils import run_command +from wok.model.tasks import TaskModel from .. import config -from tasks import TaskModel class DebugReportsModel(object): diff --git a/plugins/kimchi/model/host.py b/plugins/kimchi/model/host.py index 8c891a1..75d4de0 100644 --- a/plugins/kimchi/model/host.py +++ b/plugins/kimchi/model/host.py @@ -30,6 +30,7 @@ from wok.exception import InvalidOperation, InvalidParameter from wok.exception import NotFoundError, OperationFailed from wok.utils import add_task, wok_log from wok.xmlutils.utils import xpath_get_text +from wok.model.tasks import TaskModel import hostdev from .. import disks @@ -37,7 +38,6 @@ from .. import netinfo from ..repositories import Repositories from ..swupdate import SoftwareUpdate from config import CapabilitiesModel -from tasks import TaskModel from vms import DOM_STATE_MAP diff --git a/plugins/kimchi/model/storagevolumes.py b/plugins/kimchi/model/storagevolumes.py index 920333c..99b17d3 100644 --- a/plugins/kimchi/model/storagevolumes.py +++ b/plugins/kimchi/model/storagevolumes.py @@ -32,12 +32,12 @@ from wok.exception import MissingParameter, NotFoundError, OperationFailed from wok.utils import add_task, get_next_clone_name, get_unique_file_name from wok.utils import wok_log from wok.xmlutils.utils import xpath_get_text +from wok.model.tasks import TaskModel from ..config import READONLY_POOL_TYPE from ..isoinfo import IsoImage from diskutils import get_disk_used_by, set_disk_used_by from storagepools import StoragePoolModel -from tasks import TaskModel VOLUME_TYPE_MAP = {0: 'file', diff --git a/plugins/kimchi/model/vms.py b/plugins/kimchi/model/vms.py index f446e80..f37b5d6 100644 --- a/plugins/kimchi/model/vms.py +++ b/plugins/kimchi/model/vms.py @@ -36,6 +36,7 @@ from wok.utils import add_task, convert_data_size, get_next_clone_name from wok.utils import import_class, run_setfacl_set_attr, wok_log from wok.xmlutils.utils import xpath_get_text, xml_item_update from wok.xmlutils.utils import dictize +from wok.model.tasks import TaskModel from .. import model from .. import vnc @@ -45,7 +46,6 @@ from ..screenshot import VMScreenshot from ..utils import template_name_from_uri from ..xmlutils.cpu import get_cpu_xml, get_numa_xml from config import CapabilitiesModel -from tasks import TaskModel from templates import TemplateModel from utils import get_vm_name from utils import get_metadata_node diff --git a/plugins/kimchi/model/vmsnapshots.py b/plugins/kimchi/model/vmsnapshots.py index 6abf726..fff1908 100644 --- a/plugins/kimchi/model/vmsnapshots.py +++ b/plugins/kimchi/model/vmsnapshots.py @@ -26,8 +26,8 @@ from lxml.builder import E from wok.exception import InvalidOperation, NotFoundError, OperationFailed from wok.utils import add_task from wok.xmlutils.utils import xpath_get_text +from wok.model.tasks import TaskModel -from tasks import TaskModel from vms import DOM_STATE_MAP, VMModel from vmstorages import VMStorageModel, VMStoragesModel diff --git a/plugins/kimchi/ui/js/src/kimchi.api.js b/plugins/kimchi/ui/js/src/kimchi.api.js index 0ec3747..fde803a 100644 --- a/plugins/kimchi/ui/js/src/kimchi.api.js +++ b/plugins/kimchi/ui/js/src/kimchi.api.js @@ -525,7 +525,7 @@ var kimchi = { getTask : function(taskId, suc, err) { wok.requestJSON({ - url : 'plugins/kimchi/tasks/' + encodeURIComponent(taskId), + url : 'tasks/' + encodeURIComponent(taskId), type : 'GET', contentType : 'application/json', dataType : 'json', @@ -536,7 +536,7 @@ var kimchi = { getTasksByFilter : function(filter, suc, err, sync) { wok.requestJSON({ - url : 'plugins/kimchi/tasks?' + filter, + url : 'tasks?' + filter, type : 'GET', contentType : 'application/json', dataType : 'json', -- 2.4.3

From: Paulo Vital <pvital@linux.vnet.ibm.com> Update Kimchi tests to use the new URL of Tasks from Wok structure. Signed-off-by: Paulo Vital <pvital@linux.vnet.ibm.com> --- plugins/kimchi/tests/test_host.py | 4 ++-- plugins/kimchi/tests/test_mock_storagepool.py | 2 +- plugins/kimchi/tests/test_model_storagevolume.py | 8 ++++---- plugins/kimchi/tests/test_rest.py | 22 +++++++++++----------- plugins/kimchi/tests/test_server.py | 8 ++++---- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/plugins/kimchi/tests/test_host.py b/plugins/kimchi/tests/test_host.py index 9bc9302..6cd0833 100644 --- a/plugins/kimchi/tests/test_host.py +++ b/plugins/kimchi/tests/test_host.py @@ -128,12 +128,12 @@ class HostTests(unittest.TestCase): task_params = [u'id', u'message', u'status', u'target_uri'] self.assertEquals(sorted(task_params), sorted(task.keys())) - resp = self.request('/plugins/kimchi/tasks/' + task[u'id'], None, + resp = self.request('/tasks/' + task[u'id'], None, 'GET') task_info = json.loads(resp.read()) self.assertEquals(task_info['status'], 'running') wait_task(_task_lookup, task_info['id']) - resp = self.request('/plugins/kimchi/tasks/' + task[u'id'], None, + resp = self.request('/tasks/' + task[u'id'], None, 'GET') task_info = json.loads(resp.read()) self.assertEquals(task_info['status'], 'finished') diff --git a/plugins/kimchi/tests/test_mock_storagepool.py b/plugins/kimchi/tests/test_mock_storagepool.py index ea9843b..5cf5b3e 100644 --- a/plugins/kimchi/tests/test_mock_storagepool.py +++ b/plugins/kimchi/tests/test_mock_storagepool.py @@ -61,7 +61,7 @@ class MockStoragepoolTests(unittest.TestCase): def _task_lookup(self, taskid): return json.loads( - self.request('/plugins/kimchi/tasks/%s' % taskid).read() + self.request('/tasks/%s' % taskid).read() ) def test_storagepool(self): diff --git a/plugins/kimchi/tests/test_model_storagevolume.py b/plugins/kimchi/tests/test_model_storagevolume.py index 8a717d3..46c07bd 100644 --- a/plugins/kimchi/tests/test_model_storagevolume.py +++ b/plugins/kimchi/tests/test_model_storagevolume.py @@ -64,7 +64,7 @@ def tearDownModule(): def _do_volume_test(self, model, host, ssl_port, pool_name): def _task_lookup(taskid): return json.loads( - self.request('/plugins/kimchi/tasks/%s' % taskid).read() + self.request('/tasks/%s' % taskid).read() ) uri = '/plugins/kimchi/storagepools/%s/storagevolumes' \ @@ -91,7 +91,7 @@ def _do_volume_test(self, model, host, ssl_port, pool_name): task_id = json.loads(resp.read())['id'] wait_task(_task_lookup, task_id) status = json.loads( - self.request('/plugins/kimchi/tasks/%s' % task_id).read() + self.request('/tasks/%s' % task_id).read() ) self.assertEquals('finished', status['status']) vol_info = json.loads(self.request(vol_uri).read()) @@ -137,7 +137,7 @@ def _do_volume_test(self, model, host, ssl_port, pool_name): cloned_vol_name) wait_task(_task_lookup, task['id']) task = json.loads( - self.request('/plugins/kimchi/tasks/%s' % task['id']).read() + self.request('/tasks/%s' % task['id']).read() ) self.assertEquals('finished', task['status']) resp = self.request(uri + '/' + cloned_vol_name.encode('utf-8')) @@ -177,7 +177,7 @@ def _do_volume_test(self, model, host, ssl_port, pool_name): self.assertEquals(202, resp.status) task_id = json.loads(resp.read())['id'] wait_task(_task_lookup, task_id) - status = json.loads(self.request('/plugins/kimchi/tasks/%s' % + status = json.loads(self.request('/tasks/%s' % task_id).read()) self.assertEquals('ready for upload', status['message']) diff --git a/plugins/kimchi/tests/test_rest.py b/plugins/kimchi/tests/test_rest.py index a420062..243074e 100644 --- a/plugins/kimchi/tests/test_rest.py +++ b/plugins/kimchi/tests/test_rest.py @@ -317,7 +317,7 @@ class RestTests(unittest.TestCase): task = json.loads(resp.read()) wait_task(self._task_lookup, task['id']) task = json.loads( - self.request('/plugins/kimchi/tasks/%s' % task['id'], '{}').read() + self.request('/tasks/%s' % task['id'], '{}').read() ) self.assertEquals('finished', task['status']) clone_vm_name = task['target_uri'].split('/')[-2] @@ -348,7 +348,7 @@ class RestTests(unittest.TestCase): task = json.loads(resp.read()) wait_task(self._task_lookup, task['id']) task = json.loads( - self.request('/plugins/kimchi/tasks/%s' % task['id']).read() + self.request('/tasks/%s' % task['id']).read() ) self.assertEquals('finished', task['status']) @@ -386,7 +386,7 @@ class RestTests(unittest.TestCase): task = json.loads(resp.read()) snap_name = task['target_uri'].split('/')[-1] wait_task(self._task_lookup, task['id']) - resp = self.request('/plugins/kimchi/tasks/%s' % task['id'], '{}', + resp = self.request('/tasks/%s' % task['id'], '{}', 'GET') task = json.loads(resp.read()) self.assertEquals('finished', task['status']) @@ -1132,37 +1132,37 @@ class RestTests(unittest.TestCase): def _task_lookup(self, taskid): return json.loads( - self.request('/plugins/kimchi/tasks/%s' % taskid).read() + self.request('/tasks/%s' % taskid).read() ) def test_tasks(self): - id1 = add_task('/plugins/kimchi/tasks/1', self._async_op, + id1 = add_task('/tasks/1', self._async_op, model.objstore) - id2 = add_task('/plugins/kimchi/tasks/2', self._except_op, + id2 = add_task('/tasks/2', self._except_op, model.objstore) - id3 = add_task('/plugins/kimchi/tasks/3', self._intermid_op, + id3 = add_task('/tasks/3', self._intermid_op, model.objstore) target_uri = urllib2.quote('^/tasks/*', safe="") filter_data = 'status=running&target_uri=%s' % target_uri tasks = json.loads( - self.request('/plugins/kimchi/tasks?%s' % filter_data).read() + self.request('/tasks?%s' % filter_data).read() ) self.assertEquals(3, len(tasks)) - tasks = json.loads(self.request('/plugins/kimchi/tasks').read()) + tasks = json.loads(self.request('/tasks').read()) tasks_ids = [int(t['id']) for t in tasks] self.assertEquals(set([id1, id2, id3]) - set(tasks_ids), set([])) wait_task(self._task_lookup, id2) foo2 = json.loads( - self.request('/plugins/kimchi/tasks/%s' % id2).read() + self.request('/tasks/%s' % id2).read() ) keys = ['id', 'status', 'message', 'target_uri'] self.assertEquals(sorted(keys), sorted(foo2.keys())) self.assertEquals('failed', foo2['status']) wait_task(self._task_lookup, id3) foo3 = json.loads( - self.request('/plugins/kimchi/tasks/%s' % id3).read() + self.request('/tasks/%s' % id3).read() ) self.assertEquals('in progress', foo3['message']) self.assertEquals('running', foo3['status']) diff --git a/plugins/kimchi/tests/test_server.py b/plugins/kimchi/tests/test_server.py index d7f1af0..d5ef565 100644 --- a/plugins/kimchi/tests/test_server.py +++ b/plugins/kimchi/tests/test_server.py @@ -194,7 +194,7 @@ class ServerTests(unittest.TestCase): hdrs = {'AUTHORIZATION': ''} uris = ['/plugins/kimchi/vms', '/plugins/kimchi/vms/doesnotexist', - '/plugins/kimchi/tasks'] + '/tasks'] for uri in uris: resp = self.request(uri, None, 'GET', hdrs) @@ -228,7 +228,7 @@ class ServerTests(unittest.TestCase): 'Accept': 'application/json'} # Test we are logged out - resp = self.request('/plugins/kimchi/tasks', None, 'GET', hdrs) + resp = self.request('/tasks', None, 'GET', hdrs) self.assertEquals(401, resp.status) # Execute a login call @@ -248,7 +248,7 @@ class ServerTests(unittest.TestCase): hdrs['Cookie'] = cookie # Test we are logged in with the cookie - resp = self.request('/plugins/kimchi/tasks', None, 'GET', hdrs) + resp = self.request('/tasks', None, 'GET', hdrs) self.assertEquals(200, resp.status) # Execute a logout call @@ -257,7 +257,7 @@ class ServerTests(unittest.TestCase): del hdrs['Cookie'] # Test we are logged out - resp = self.request('/plugins/kimchi/tasks', None, 'GET', hdrs) + resp = self.request('/tasks', None, 'GET', hdrs) self.assertEquals(401, resp.status) def test_get_param(self): -- 2.4.3
participants (2)
-
Aline Manera
-
pvital@linux.vnet.ibm.com