Skip to contentSkip to conversation

Validate custom image names correctly

PATCH In review Elliot Smith 3 participants 8 messages Apr 11, 2016 – Apr 19, 2016

lore
Share & tools
lore
#0 lore raw

cover 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.

#1 lore raw

PATCH 1/4 toaster: only prevent duplicate custom image names within a project

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]

---
 .../toastergui/static/js/newcustomimage_modal.js   |  8 ++++--
 bitbake/lib/toaster/toastergui/views.py            | 33 ++++++++++++----------
 2 files changed, 24 insertions(+), 17 deletions(-)
bitbake/lib/toaster/toastergui/static/js/newcustomimage_modal.js +6 -2
index 328997a..98e87f4 100644
@@ -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');
bitbake/lib/toaster/toastergui/views.py +18 -15
index 30295a7..bd7ada9 100755
@@ -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(
Signature · 12 lines
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.
#2 lore raw

PATCH 2/4 toaster: prevent exception when Project.release is null

In reply to Elliot Smith

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.

---
 bitbake/lib/toaster/orm/models.py | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)
bitbake/lib/toaster/orm/models.py +11 -5
index 68c3072..f0a8786 100644
@@ -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
 
Signature · 12 lines
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.
#3 lore raw

PATCH 3/4 toaster-tests: add tests for new custom image page

In reply to Elliot Smith

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]

---
 .../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
bitbake/lib/toaster/tests/browser/test_new_custom_image_page.py new file +160 -0
new file mode 100644
index 0000000..8906cb2
@@ -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)
Signature · 12 lines
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.
#4 lore raw

PATCH 4/4 toaster-tests: make helper click on input before entering text

In reply to Elliot Smith

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.

---
 bitbake/lib/toaster/tests/browser/selenium_helpers.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
bitbake/lib/toaster/tests/browser/selenium_helpers.py +5 -1
index d3ab3ca..56dbe2b 100644
@@ -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
 
Signature · 12 lines
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.
#5 lore raw
In reply to Elliot Smith

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

Quoted 67 lines

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Elliot Smith
Sent: Monday, April 11, 2016 6:27 AM
To: [email protected]
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
[email protected]
https://lists.yoctoproject.org/listinfo/toaster

#6 lore raw

Thanks for the review, Dave. I'll have another look at this once the Bootstrap 3 work is done.

Elliot

Quoted 107 lines · Dave M (Wind River)

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

Quoted 2 lines

-----Original Message-----
From: [email protected] [mailto:

[email protected]] On

Quoted 8 lines

Behalf Of Elliot Smith
Sent: Monday, April 11, 2016 6:27 AM
To: [email protected]
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.

Quoted 7 lines

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.

Quoted 1 line

4. Try to create a custom image called 'core-image-minimal' in this

project; it should

Quoted 3 lines

fail.
5. Create another project.
6. Create a custom image called 'goo' in the second project; it should

work.

Quoted 2 lines

The following changes since commit

4bb6fb30b0d660eaeaf4af134b99b2feaf0b3db2:

Quoted 2 lines

toaster: fixes for customimage package not found (2016-04-08 09:38:50

+0100)

Quoted 4 lines

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib

elliot/toaster/recipe_name_validation-9209

Quoted 11 lines

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

Quoted 3 lines
 bitbake/lib/toaster/orm/models.py                  |  16 ++-
 .../lib/toaster/tests/browser/selenium_helpers.py  |   6 +-
 .../tests/browser/test_new_custom_image_page.py    | 160

+++++++++++++++++++++

Quoted 4 lines
 .../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

Quoted 20 lines

--
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
[email protected]
https://lists.yoctoproject.org/listinfo/toaster

Signature · 3 lines
Elliot Smith
Software Engineer
Intel Open Source Technology Centre
#7 lore raw

Sent to bitbake-devel and added to toaster-next

Thanks,

Michael

Quoted 134 lines · Elliot

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) <[email protected] <mailto:[email protected]>> 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: [email protected] <mailto:[email protected]> [mailto:[email protected] <mailto:[email protected]>] On
> Behalf Of Elliot Smith
> Sent: Monday, April 11, 2016 6:27 AM
> To: [email protected] <mailto:[email protected]> > 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
> [email protected] <mailto:[email protected]> > https://lists.yoctoproject.org/listinfo/toaster

Signature · 3 lines
Elliot Smith
Software Engineer
Intel Open Source Technology Centre