* [PATCH 1/4] toaster: only prevent duplicate custom image names within a project
2016-04-11 11:27 [PATCH 0/4] Validate custom image names correctly Elliot Smith
@ 2016-04-11 11:27 ` Elliot Smith
2016-04-11 11:27 ` [PATCH 2/4] toaster: prevent exception when Project.release is null Elliot Smith
` (3 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Elliot Smith @ 2016-04-11 11:27 UTC (permalink / raw)
To: toaster
We currently prevent the same name being used for multiple custom
images, but make the check across all projects. This means that
custom image names have to be unique across all projects in
the Toaster installation.
Modify how we validate the name of a custom image so that we
only prevent duplication of custom image names within a project,
while ensuring that the name of a custom image doesn't duplicate
the name of a recipe which is not a custom image recipe.
[YOCTO #9209]
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
---
.../toastergui/static/js/newcustomimage_modal.js | 8 ++++--
bitbake/lib/toaster/toastergui/views.py | 33 ++++++++++++----------
2 files changed, 24 insertions(+), 17 deletions(-)
diff --git a/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js b/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js
index 328997a..98e87f4 100644
--- a/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js
+++ b/bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js
@@ -9,6 +9,8 @@ function newCustomImageModalInit(){
var nameInput = imgCustomModal.find('input');
var invalidMsg = "Image names cannot contain spaces or capital letters. The only allowed special character is dash (-).";
+ var duplicateImageMsg = "An image with this name already exists in this project.";
+ var duplicateRecipeMsg = "A non-image recipe with this name already exists.";
newCustomImgBtn.click(function(e){
e.preventDefault();
@@ -22,8 +24,10 @@ function newCustomImageModalInit(){
console.warn(ret.error);
if (ret.error === "invalid-name") {
showError(invalidMsg);
- } else if (ret.error === "already-exists") {
- showError("An image with this name already exists. Image names must be unique.");
+ } else if (ret.error === "image-already-exists") {
+ showError(duplicateImageMsg);
+ } else if (ret.error === "recipe-already-exists") {
+ showError(duplicateRecipeMsg);
}
} else {
imgCustomModal.modal('hide');
diff --git a/bitbake/lib/toaster/toastergui/views.py b/bitbake/lib/toaster/toastergui/views.py
index 30295a7..bd7ada9 100755
--- a/bitbake/lib/toaster/toastergui/views.py
+++ b/bitbake/lib/toaster/toastergui/views.py
@@ -2409,21 +2409,24 @@ if True:
if re.search(r'[^a-z|0-9|-]', request.POST["name"]):
return {"error": "invalid-name"}
- # Are there any recipes with the name already?
- for existing_recipe in Recipe.objects.filter(
- name=request.POST["name"]):
- try:
- ci = CustomImageRecipe.objects.get(pk=existing_recipe.pk)
- if ci.project == params["project"]:
- return {"error": "already-exists" }
- else:
- # It is a CustomImageRecipe but not in our project
- # this is fine so
- continue
- except:
- # It isn't a CustomImageRecipe so is a recipe from
- # another source.
- return {"error": "already-exists" }
+ custom_images = CustomImageRecipe.objects.all()
+
+ # Are there any recipes with this name already in our project?
+ existing_image_recipes_in_project = custom_images.filter(
+ name=request.POST["name"], project=params["project"])
+
+ if existing_image_recipes_in_project.count() > 0:
+ return {"error": "image-already-exists"}
+
+ # Are there any recipes with this name which aren't custom
+ # image recipes?
+ custom_image_ids = custom_images.values_list('id', flat=True)
+ existing_non_image_recipes = Recipe.objects.filter(
+ Q(name=request.POST["name"]) & ~Q(pk__in=custom_image_ids)
+ )
+
+ if existing_non_image_recipes.count() > 0:
+ return {"error": "recipe-already-exists"}
# create layer 'Custom layer' and verion if needed
layer = Layer.objects.get_or_create(
--
1.9.3
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 2/4] toaster: prevent exception when Project.release is null
2016-04-11 11:27 [PATCH 0/4] Validate custom image names correctly Elliot Smith
2016-04-11 11:27 ` [PATCH 1/4] toaster: only prevent duplicate custom image names within a project Elliot Smith
@ 2016-04-11 11:27 ` Elliot Smith
2016-04-11 11:27 ` [PATCH 3/4] toaster-tests: add tests for new custom image page Elliot Smith
` (2 subsequent siblings)
4 siblings, 0 replies; 8+ messages in thread
From: Elliot Smith @ 2016-04-11 11:27 UTC (permalink / raw)
To: toaster
Project.release can be null. This causes an exception when calling
get_all_compatible_layer_versions(), as the query to fetch
the layer versions references release.branch_name.
Add a guard to the function so that an empty queryset is returned
if the release isn't set for a project.
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
---
bitbake/lib/toaster/orm/models.py | 16 +++++++++++-----
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/bitbake/lib/toaster/orm/models.py b/bitbake/lib/toaster/orm/models.py
index 68c3072..f0a8786 100644
--- a/bitbake/lib/toaster/orm/models.py
+++ b/bitbake/lib/toaster/orm/models.py
@@ -264,11 +264,17 @@ class Project(models.Model):
def get_all_compatible_layer_versions(self):
""" Returns Queryset of all Layer_Versions which are compatible with
this project"""
- queryset = Layer_Version.objects.filter(
- (Q(up_branch__name=self.release.branch_name) &
- Q(build=None) &
- Q(project=None)) |
- Q(project=self))
+ queryset = None
+
+ # guard on release, as it can be null
+ if self.release:
+ queryset = Layer_Version.objects.filter(
+ (Q(up_branch__name=self.release.branch_name) &
+ Q(build=None) &
+ Q(project=None)) |
+ Q(project=self))
+ else:
+ queryset = Layer_Version.objects.none()
return queryset
--
1.9.3
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 3/4] toaster-tests: add tests for new custom image page
2016-04-11 11:27 [PATCH 0/4] Validate custom image names correctly Elliot Smith
2016-04-11 11:27 ` [PATCH 1/4] toaster: only prevent duplicate custom image names within a project Elliot Smith
2016-04-11 11:27 ` [PATCH 2/4] toaster: prevent exception when Project.release is null Elliot Smith
@ 2016-04-11 11:27 ` Elliot Smith
2016-04-11 11:27 ` [PATCH 4/4] toaster-tests: make helper click on input before entering text Elliot Smith
2016-04-13 20:57 ` [PATCH 0/4] Validate custom image names correctly Lerner, Dave
4 siblings, 0 replies; 8+ messages in thread
From: Elliot Smith @ 2016-04-11 11:27 UTC (permalink / raw)
To: toaster
Test adding a new custom image when:
1. No custom images are in the project yet.
2. User tries to add custom image which duplicates the name of
an existing custom image.
3. User tries to add custom image which duplicates the name
of a non-image recipe.
[YOCTO #9209]
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
---
.../tests/browser/test_new_custom_image_page.py | 160 +++++++++++++++++++++
1 file changed, 160 insertions(+)
create mode 100644 bitbake/lib/toaster/tests/browser/test_new_custom_image_page.py
diff --git a/bitbake/lib/toaster/tests/browser/test_new_custom_image_page.py b/bitbake/lib/toaster/tests/browser/test_new_custom_image_page.py
new file mode 100644
index 0000000..8906cb2
--- /dev/null
+++ b/bitbake/lib/toaster/tests/browser/test_new_custom_image_page.py
@@ -0,0 +1,160 @@
+#! /usr/bin/env python
+# ex:ts=4:sw=4:sts=4:et
+# -*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
+#
+# BitBake Toaster Implementation
+#
+# Copyright (C) 2013-2016 Intel Corporation
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License version 2 as
+# published by the Free Software Foundation.
+#
+# This program 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 General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+from django.core.urlresolvers import reverse
+from tests.browser.selenium_helpers import SeleniumTestCase
+
+from orm.models import BitbakeVersion, Release, Project, ProjectLayer, Layer
+from orm.models import Layer_Version, Recipe, CustomImageRecipe
+
+class TestNewCustomImagePage(SeleniumTestCase):
+ CUSTOM_IMAGE_NAME = 'roopa-doopa'
+
+ def setUp(self):
+ release = Release.objects.create(
+ name='baz',
+ bitbake_version=BitbakeVersion.objects.create(name='v1')
+ )
+
+ # project to add new custom images to
+ self.project = Project.objects.create(name='foo', release=release)
+
+ # layer associated with the project
+ layer = Layer.objects.create(name='bar')
+ layer_version = Layer_Version.objects.create(
+ layer=layer,
+ project=self.project
+ )
+
+ # properly add the layer to the project
+ ProjectLayer.objects.create(
+ project=self.project,
+ layercommit=layer_version,
+ optional=False
+ )
+
+ # add a fake image recipe to the layer that can be customised
+ self.recipe = Recipe.objects.create(
+ name='core-image-minimal',
+ layer_version=layer_version,
+ is_image=True
+ )
+
+ # another project with a custom image already in it
+ project2 = Project.objects.create(name='whoop', release=release)
+ layer_version2 = Layer_Version.objects.create(
+ layer=layer,
+ project=project2
+ )
+ ProjectLayer.objects.create(
+ project=project2,
+ layercommit=layer_version2,
+ optional=False
+ )
+ recipe2 = Recipe.objects.create(
+ name='core-image-minimal',
+ layer_version=layer_version2,
+ is_image=True
+ )
+ CustomImageRecipe.objects.create(
+ name=self.CUSTOM_IMAGE_NAME,
+ base_recipe=recipe2,
+ layer_version=layer_version2,
+ file_path='/1/2',
+ project=project2
+ )
+
+ def _create_custom_image(self, new_custom_image_name):
+ """
+ 1. Go to the 'new custom image' page
+ 2. Click the button for the fake core-image-minimal
+ 3. Wait for the dialog box for setting the name of the new custom
+ image
+ 4. Insert new_custom_image_name into that dialog's text box
+ """
+ url = reverse('newcustomimage', args=(self.project.id,))
+ self.get(url)
+
+ self.click('button[data-recipe="%s"]' % self.recipe.id)
+
+ selector = '#new-custom-image-modal input[type="text"]'
+ self.enter_text(selector, new_custom_image_name)
+
+ self.click('#create-new-custom-image-btn')
+
+ def _check_for_custom_image(self, image_name):
+ """
+ Fetch the list of custom images for the project and check the
+ image with name image_name is listed there
+ """
+ url = reverse('projectcustomimages', args=(self.project.id,))
+ self.get(url)
+
+ self.wait_until_visible('#customimagestable')
+
+ element = self.find('#customimagestable td[class="name"] a')
+ msg = 'should be a custom image link with text %s' % image_name
+ self.assertEqual(element.text.strip(), image_name, msg)
+
+ def test_new_image(self):
+ """
+ Should be able to create a new custom image
+ """
+ custom_image_name = 'boo-image'
+ self._create_custom_image(custom_image_name)
+ self.wait_until_visible('#image-created-notification')
+ self._check_for_custom_image(custom_image_name)
+
+ def test_new_duplicates_other_project_image(self):
+ """
+ Should be able to create a new custom image if its name is the same
+ as a custom image in another project
+ """
+ self._create_custom_image(self.CUSTOM_IMAGE_NAME)
+ self.wait_until_visible('#image-created-notification')
+ self._check_for_custom_image(self.CUSTOM_IMAGE_NAME)
+
+ def test_new_duplicates_non_image_recipe(self):
+ """
+ Should not be able to create a new custom image whose name is the
+ same as an existing non-image recipe
+ """
+ self._create_custom_image(self.recipe.name)
+ element = self.wait_until_visible('#invalid-name-help')
+ self.assertRegexpMatches(element.text.strip(),
+ 'recipe with this name already exists')
+
+ def test_new_duplicates_project_image(self):
+ """
+ Should not be able to create a new custom image whose name is the same
+ as a custom image in this project
+ """
+ # create the image
+ custom_image_name = 'doh-image'
+ self._create_custom_image(custom_image_name)
+ self.wait_until_visible('#image-created-notification')
+ self._check_for_custom_image(custom_image_name)
+
+ # try to create an image with the same name
+ self._create_custom_image(custom_image_name)
+ element = self.wait_until_visible('#invalid-name-help')
+ expected = 'An image with this name already exists in this project'
+ self.assertRegexpMatches(element.text.strip(), expected)
--
1.9.3
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply related [flat|nested] 8+ messages in thread* [PATCH 4/4] toaster-tests: make helper click on input before entering text
2016-04-11 11:27 [PATCH 0/4] Validate custom image names correctly Elliot Smith
` (2 preceding siblings ...)
2016-04-11 11:27 ` [PATCH 3/4] toaster-tests: add tests for new custom image page Elliot Smith
@ 2016-04-11 11:27 ` Elliot Smith
2016-04-13 20:57 ` [PATCH 0/4] Validate custom image names correctly Lerner, Dave
4 siblings, 0 replies; 8+ messages in thread
From: Elliot Smith @ 2016-04-11 11:27 UTC (permalink / raw)
To: toaster
The Selenium helper's enter_text() method doesn't cause
keyup events to trigger unless the element where text is
being entered has been clicked.
Prefix all text entry with a click() on the element to ensure
that keyup events fire.
Signed-off-by: Elliot Smith <elliot.smith@intel.com>
---
bitbake/lib/toaster/tests/browser/selenium_helpers.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/bitbake/lib/toaster/tests/browser/selenium_helpers.py b/bitbake/lib/toaster/tests/browser/selenium_helpers.py
index d3ab3ca..56dbe2b 100644
--- a/bitbake/lib/toaster/tests/browser/selenium_helpers.py
+++ b/bitbake/lib/toaster/tests/browser/selenium_helpers.py
@@ -185,7 +185,11 @@ class SeleniumTestCase(StaticLiveServerTestCase):
def enter_text(self, selector, value):
""" Insert text into element matching selector """
- field = self.wait_until_present(selector)
+ # note that keyup events don't occur until the element is clicked
+ # (in the case of <input type="text"...>, for example), so simulate
+ # user clicking the element before inserting text into it
+ field = self.click(selector)
+
field.send_keys(value)
return field
--
1.9.3
---------------------------------------------------------------------
Intel Corporation (UK) Limited
Registered No. 1134945 (England)
Registered Office: Pipers Way, Swindon SN3 1RJ
VAT No: 860 2173 47
This e-mail and any attachments may contain confidential material for
the sole use of the intended recipient(s). Any review or distribution
by others is strictly prohibited. If you are not the intended
recipient, please contact the sender and delete all copies.
^ permalink raw reply related [flat|nested] 8+ messages in thread* Re: [PATCH 0/4] Validate custom image names correctly
2016-04-11 11:27 [PATCH 0/4] Validate custom image names correctly Elliot Smith
` (3 preceding siblings ...)
2016-04-11 11:27 ` [PATCH 4/4] toaster-tests: make helper click on input before entering text Elliot Smith
@ 2016-04-13 20:57 ` Lerner, Dave
2016-04-14 7:13 ` Smith, Elliot
4 siblings, 1 reply; 8+ messages in thread
From: Lerner, Dave @ 2016-04-13 20:57 UTC (permalink / raw)
To: SMITH, ELLIOT, toaster@yoctoproject.org, BARROS PENA, BELEN
Hi Elliot,
I cannot reproduce the original symptom in your steps, outlined at https://lists.yoctoproject.org/pipermail/toaster/2016-April/004425.html. Specifically step 6 passes without your patches. Or using Belen's steps in the defect:
======
1. Create a Toaster project.
2. Create a custom image
3. Create a second Toaster project
4. Create a custom image and try to give it the same name you used for the custom
image you created in step 2
Toaster will complain that a custom image with that name already exists.
======
The complaint is gone, this symptom no longer occurs without your patch 1/4.
Neither her steps nor yours in the 0/4 RR email state that the custom image must be built, just created, so my baseline steps don't build the custom image.
Patch 2/4 addresses a different issue, but I don't know how to test the baseline fault nor test the fix.
Since patch 1/4 isn't necessary with respect to the defect, shouldn't it be dropped?You could provide a defect with or without a test for the fix in patch 2/4.
Dave
> -----Original Message-----
> From: toaster-bounces@yoctoproject.org [mailto:toaster-bounces@yoctoproject.org] On
> Behalf Of Elliot Smith
> Sent: Monday, April 11, 2016 6:27 AM
> To: toaster@yoctoproject.org
> Subject: [Toaster] [PATCH 0/4] Validate custom image names correctly
>
> We currently validate the name of a new custom image across all projects.
> This means you can't use the same custom image name in multiple projects.
>
> Modify the code to do validation correctly, and add UI tests to verify.
>
> To test:
>
> 1. Create a project.
> 2. Create a custom image with name 'goo' in this project; it should work.
> 3. Try to create another custom image called 'goo' in this project; it should fail.
> 4. Try to create a custom image called 'core-image-minimal' in this project; it should
> fail.
> 5. Create another project.
> 6. Create a custom image called 'goo' in the second project; it should work.
>
> The following changes since commit 4bb6fb30b0d660eaeaf4af134b99b2feaf0b3db2:
>
> toaster: fixes for customimage package not found (2016-04-08 09:38:50 +0100)
>
> are available in the git repository at:
>
> git://git.yoctoproject.org/poky-contrib elliot/toaster/recipe_name_validation-9209
> http://git.yoctoproject.org/cgit.cgi/poky-
> contrib/log/?h=elliot/toaster/recipe_name_validation-9209
>
> Related bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=9209
>
> Elliot Smith (4):
> toaster: only prevent duplicate custom image names within a project
> toaster: prevent exception when Project.release is null
> toaster-tests: add tests for new custom image page
> toaster-tests: make helper click on input before entering text
>
> bitbake/lib/toaster/orm/models.py | 16 ++-
> .../lib/toaster/tests/browser/selenium_helpers.py | 6 +-
> .../tests/browser/test_new_custom_image_page.py | 160 +++++++++++++++++++++
> .../toastergui/static/js/newcustomimage_modal.js | 8 +-
> bitbake/lib/toaster/toastergui/views.py | 33 +++--
> 5 files changed, 200 insertions(+), 23 deletions(-)
> create mode 100644 bitbake/lib/toaster/tests/browser/test_new_custom_image_page.py
>
> --
> 1.9.3
>
> ---------------------------------------------------------------------
> Intel Corporation (UK) Limited
> Registered No. 1134945 (England)
> Registered Office: Pipers Way, Swindon SN3 1RJ
> VAT No: 860 2173 47
>
> This e-mail and any attachments may contain confidential material for
> the sole use of the intended recipient(s). Any review or distribution
> by others is strictly prohibited. If you are not the intended
> recipient, please contact the sender and delete all copies.
>
> --
> _______________________________________________
> toaster mailing list
> toaster@yoctoproject.org
> https://lists.yoctoproject.org/listinfo/toaster
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH 0/4] Validate custom image names correctly
2016-04-13 20:57 ` [PATCH 0/4] Validate custom image names correctly Lerner, Dave
@ 2016-04-14 7:13 ` Smith, Elliot
2016-04-19 16:33 ` Michael Wood
0 siblings, 1 reply; 8+ messages in thread
From: Smith, Elliot @ 2016-04-14 7:13 UTC (permalink / raw)
To: Lerner, Dave M (Wind River); +Cc: toaster@yoctoproject.org
[-- Attachment #1: Type: text/plain, Size: 4455 bytes --]
Thanks for the review, Dave. I'll have another look at this once the
Bootstrap 3 work is done.
Elliot
On 13 April 2016 at 21:57, Lerner, Dave M (Wind River) <
dave.lerner@windriver.com> wrote:
> Hi Elliot,
>
> I cannot reproduce the original symptom in your steps, outlined at
> https://lists.yoctoproject.org/pipermail/toaster/2016-April/004425.html.
> Specifically step 6 passes without your patches. Or using Belen's steps in
> the defect:
> ======
> 1. Create a Toaster project.
> 2. Create a custom image
> 3. Create a second Toaster project
> 4. Create a custom image and try to give it the same name you used for
> the custom
> image you created in step 2
> Toaster will complain that a custom image with that name already exists.
> ======
> The complaint is gone, this symptom no longer occurs without your patch
> 1/4.
>
> Neither her steps nor yours in the 0/4 RR email state that the custom
> image must be built, just created, so my baseline steps don't build the
> custom image.
>
> Patch 2/4 addresses a different issue, but I don't know how to test the
> baseline fault nor test the fix.
>
> Since patch 1/4 isn't necessary with respect to the defect, shouldn't it
> be dropped?You could provide a defect with or without a test for the fix in
> patch 2/4.
>
> Dave
> > -----Original Message-----
> > From: toaster-bounces@yoctoproject.org [mailto:
> toaster-bounces@yoctoproject.org] On
> > Behalf Of Elliot Smith
> > Sent: Monday, April 11, 2016 6:27 AM
> > To: toaster@yoctoproject.org
> > Subject: [Toaster] [PATCH 0/4] Validate custom image names correctly
> >
> > We currently validate the name of a new custom image across all projects.
> > This means you can't use the same custom image name in multiple projects.
> >
> > Modify the code to do validation correctly, and add UI tests to verify.
> >
> > To test:
> >
> > 1. Create a project.
> > 2. Create a custom image with name 'goo' in this project; it should work.
> > 3. Try to create another custom image called 'goo' in this project; it
> should fail.
> > 4. Try to create a custom image called 'core-image-minimal' in this
> project; it should
> > fail.
> > 5. Create another project.
> > 6. Create a custom image called 'goo' in the second project; it should
> work.
> >
> > The following changes since commit
> 4bb6fb30b0d660eaeaf4af134b99b2feaf0b3db2:
> >
> > toaster: fixes for customimage package not found (2016-04-08 09:38:50
> +0100)
> >
> > are available in the git repository at:
> >
> > git://git.yoctoproject.org/poky-contrib
> elliot/toaster/recipe_name_validation-9209
> > http://git.yoctoproject.org/cgit.cgi/poky-
> > contrib/log/?h=elliot/toaster/recipe_name_validation-9209
> >
> > Related bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=9209
> >
> > Elliot Smith (4):
> > toaster: only prevent duplicate custom image names within a project
> > toaster: prevent exception when Project.release is null
> > toaster-tests: add tests for new custom image page
> > toaster-tests: make helper click on input before entering text
> >
> > bitbake/lib/toaster/orm/models.py | 16 ++-
> > .../lib/toaster/tests/browser/selenium_helpers.py | 6 +-
> > .../tests/browser/test_new_custom_image_page.py | 160
> +++++++++++++++++++++
> > .../toastergui/static/js/newcustomimage_modal.js | 8 +-
> > bitbake/lib/toaster/toastergui/views.py | 33 +++--
> > 5 files changed, 200 insertions(+), 23 deletions(-)
> > create mode 100644
> bitbake/lib/toaster/tests/browser/test_new_custom_image_page.py
> >
> > --
> > 1.9.3
> >
> > ---------------------------------------------------------------------
> > Intel Corporation (UK) Limited
> > Registered No. 1134945 (England)
> > Registered Office: Pipers Way, Swindon SN3 1RJ
> > VAT No: 860 2173 47
> >
> > This e-mail and any attachments may contain confidential material for
> > the sole use of the intended recipient(s). Any review or distribution
> > by others is strictly prohibited. If you are not the intended
> > recipient, please contact the sender and delete all copies.
> >
> > --
> > _______________________________________________
> > toaster mailing list
> > toaster@yoctoproject.org
> > https://lists.yoctoproject.org/listinfo/toaster
>
--
Elliot Smith
Software Engineer
Intel Open Source Technology Centre
[-- Attachment #2: Type: text/html, Size: 6125 bytes --]
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/4] Validate custom image names correctly
2016-04-14 7:13 ` Smith, Elliot
@ 2016-04-19 16:33 ` Michael Wood
0 siblings, 0 replies; 8+ messages in thread
From: Michael Wood @ 2016-04-19 16:33 UTC (permalink / raw)
To: toaster
Sent to bitbake-devel and added to toaster-next
Thanks,
Michael
On 14/04/16 08:13, Smith, Elliot wrote:
> Thanks for the review, Dave. I'll have another look at this once the
> Bootstrap 3 work is done.
>
> Elliot
>
> On 13 April 2016 at 21:57, Lerner, Dave M (Wind River)
> <dave.lerner@windriver.com <mailto:dave.lerner@windriver.com>> wrote:
>
> Hi Elliot,
>
> I cannot reproduce the original symptom in your steps, outlined at
> https://lists.yoctoproject.org/pipermail/toaster/2016-April/004425.html.
> Specifically step 6 passes without your patches. Or using Belen's
> steps in the defect:
> ======
> 1. Create a Toaster project.
> 2. Create a custom image
> 3. Create a second Toaster project
> 4. Create a custom image and try to give it the same name you
> used for the custom
> image you created in step 2
> Toaster will complain that a custom image with that name already
> exists.
> ======
> The complaint is gone, this symptom no longer occurs without your
> patch 1/4.
>
> Neither her steps nor yours in the 0/4 RR email state that the
> custom image must be built, just created, so my baseline steps
> don't build the custom image.
>
> Patch 2/4 addresses a different issue, but I don't know how to
> test the baseline fault nor test the fix.
>
> Since patch 1/4 isn't necessary with respect to the defect,
> shouldn't it be dropped?You could provide a defect with or without
> a test for the fix in patch 2/4.
>
> Dave
> > -----Original Message-----
> > From: toaster-bounces@yoctoproject.org
> <mailto:toaster-bounces@yoctoproject.org>
> [mailto:toaster-bounces@yoctoproject.org
> <mailto:toaster-bounces@yoctoproject.org>] On
> > Behalf Of Elliot Smith
> > Sent: Monday, April 11, 2016 6:27 AM
> > To: toaster@yoctoproject.org <mailto:toaster@yoctoproject.org>
> > Subject: [Toaster] [PATCH 0/4] Validate custom image names correctly
> >
> > We currently validate the name of a new custom image across all
> projects.
> > This means you can't use the same custom image name in multiple
> projects.
> >
> > Modify the code to do validation correctly, and add UI tests to
> verify.
> >
> > To test:
> >
> > 1. Create a project.
> > 2. Create a custom image with name 'goo' in this project; it
> should work.
> > 3. Try to create another custom image called 'goo' in this
> project; it should fail.
> > 4. Try to create a custom image called 'core-image-minimal' in
> this project; it should
> > fail.
> > 5. Create another project.
> > 6. Create a custom image called 'goo' in the second project; it
> should work.
> >
> > The following changes since commit
> 4bb6fb30b0d660eaeaf4af134b99b2feaf0b3db2:
> >
> > toaster: fixes for customimage package not found (2016-04-08
> 09:38:50 +0100)
> >
> > are available in the git repository at:
> >
> > git://git.yoctoproject.org/poky-contrib
> <http://git.yoctoproject.org/poky-contrib>
> elliot/toaster/recipe_name_validation-9209
> > http://git.yoctoproject.org/cgit.cgi/poky-
> > contrib/log/?h=elliot/toaster/recipe_name_validation-9209
> >
> > Related bug: https://bugzilla.yoctoproject.org/show_bug.cgi?id=9209
> >
> > Elliot Smith (4):
> > toaster: only prevent duplicate custom image names within a
> project
> > toaster: prevent exception when Project.release is null
> > toaster-tests: add tests for new custom image page
> > toaster-tests: make helper click on input before entering text
> >
> > bitbake/lib/toaster/orm/models.py | 16 ++-
> > .../lib/toaster/tests/browser/selenium_helpers.py | 6 +-
> > .../tests/browser/test_new_custom_image_page.py | 160
> +++++++++++++++++++++
> > .../toastergui/static/js/newcustomimage_modal.js | 8 +-
> > bitbake/lib/toaster/toastergui/views.py | 33 +++--
> > 5 files changed, 200 insertions(+), 23 deletions(-)
> > create mode 100644
> bitbake/lib/toaster/tests/browser/test_new_custom_image_page.py
> >
> > --
> > 1.9.3
> >
> >
> ---------------------------------------------------------------------
> > Intel Corporation (UK) Limited
> > Registered No. 1134945 (England)
> > Registered Office: Pipers Way, Swindon SN3 1RJ
> > VAT No: 860 2173 47
> >
> > This e-mail and any attachments may contain confidential
> material for
> > the sole use of the intended recipient(s). Any review or
> distribution
> > by others is strictly prohibited. If you are not the intended
> > recipient, please contact the sender and delete all copies.
> >
> > --
> > _______________________________________________
> > toaster mailing list
> > toaster@yoctoproject.org <mailto:toaster@yoctoproject.org>
> > https://lists.yoctoproject.org/listinfo/toaster
>
>
>
>
> --
> Elliot Smith
> Software Engineer
> Intel Open Source Technology Centre
>
>
^ permalink raw reply [flat|nested] 8+ messages in thread