All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] runtime/dnf: Add new dnf test cases
@ 2017-05-10 19:38 jose.perez.carranza
  2017-05-10 19:52 ` Alexander Kanavin
  0 siblings, 1 reply; 19+ messages in thread
From: jose.perez.carranza @ 2017-05-10 19:38 UTC (permalink / raw)
  To: openembedded-core

From: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>

Add test cases to test “exclude” and “installroot“ options, also modify
the logic of filtering packages on the feed to have all the packages
needed by the tests.

[YOCTO #10744]

Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>
---
 meta/classes/testimage.bbclass     | 11 ++++++++---
 meta/lib/oeqa/runtime/cases/dnf.py | 16 +++++++++++++++-
 2 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index fb214604a97..2ae2eed053c 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -329,6 +329,7 @@ def create_index(arg):
     return None
 
 def create_rpm_index(d):
+    import glob
     # Index RPMs
     rpm_createrepo = bb.utils.which(os.getenv('PATH'), "createrepo_c")
     index_cmds = []
@@ -345,9 +346,13 @@ def create_rpm_index(d):
         lf = bb.utils.lockfile(lockfilename, False)
         oe.path.copyhardlinktree(rpm_dir, idx_path)
         # Full indexes overload a 256MB image so reduce the number of rpms
-        # in the feed. Filter to r* since we use the run-postinst packages and
-        # this leaves some allarch and machine arch packages too.
-        bb.utils.remove(idx_path + "*/[a-qs-z]*.rpm")
+        # in the feed by filtering to specific packages needed by the tests.
+        package_list = glob.glob(idx_path + "*/*.rpm")
+
+        for pkg in package_list:
+            if not os.path.basename(pkg).startswith(("rpm", "run-postinsts", "busybox", "bash", "update-alternatives", "libc6")):
+                bb.utils.remove(pkg)
+
         bb.utils.unlockfile(lf)
         cmd = '%s --update -q %s' % (rpm_createrepo, idx_path)
 
diff --git a/meta/lib/oeqa/runtime/cases/dnf.py b/meta/lib/oeqa/runtime/cases/dnf.py
index 2f87296b4e0..4ca4850ed1d 100644
--- a/meta/lib/oeqa/runtime/cases/dnf.py
+++ b/meta/lib/oeqa/runtime/cases/dnf.py
@@ -120,4 +120,18 @@ class DnfRepoTest(DnfTest):
     def test_dnf_reinstall(self):
         self.dnf_with_repo('reinstall -y run-postinsts-dev')
 
-
+    @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
+    @OETestID(1771)
+    def test_dnf_installroot(self):
+        rootpath = '/home/root/chroot/test'
+        self.dnf_with_repo('install --installroot=%s --allowerasing -v -y busybox run-postinsts' % rootpath)
+        status, output = self.target.run('test -e %s/var/cache/dnf' % rootpath, 1500)
+        self.assertEqual(0, status, output)
+
+    @OETestDepends(['dnf.DnfRepoTest.test_dnf_reinstall'])
+    @OETestID(1772)
+    def test_dnf_exclude(self):
+        excludepkg = 'run-postinsts-dev'
+        self.dnf_with_repo('remove -y run-postinsts')
+        self.dnf_with_repo('install -y --exclude=%s run-postinsts' % excludepkg)
+        self.dnf('list %s' % excludepkg, 1)
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH] runtime/dnf: Add new dnf test cases
  2017-05-10 19:38 [PATCH] runtime/dnf: Add new dnf test cases jose.perez.carranza
@ 2017-05-10 19:52 ` Alexander Kanavin
  2017-05-11 17:33   ` [PATCH v2] " jose.perez.carranza
  0 siblings, 1 reply; 19+ messages in thread
From: Alexander Kanavin @ 2017-05-10 19:52 UTC (permalink / raw)
  To: jose.perez.carranza, openembedded-core

On 05/10/2017 10:38 PM, jose.perez.carranza@linux.intel.com wrote:
> +    def test_dnf_installroot(self):
> +        rootpath = '/home/root/chroot/test'
> +        self.dnf_with_repo('install --installroot=%s --allowerasing -v -y busybox run-postinsts' % rootpath)
> +        status, output = self.target.run('test -e %s/var/cache/dnf' % rootpath, 1500)
> +        self.assertEqual(0, status, output)

You could also check there that the files from installed packages are 
indeed there (e.g. /home/root/chroot/test/bin/sh and such). Just in case. :)

> +    def test_dnf_exclude(self):
> +        excludepkg = 'run-postinsts-dev'
> +        self.dnf_with_repo('remove -y run-postinsts')
> +        self.dnf_with_repo('install -y --exclude=%s run-postinsts' % excludepkg)
> +        self.dnf('list %s' % excludepkg, 1)

How does this test work? I do not understand. First run-postinsts is 
removed, then it is installed again with --exclude=run-postinsts-dev, 
then we check that run-postinst-dev is not installed. Would it have been 
installed without the --exclude option? Why, if we're only asking for 
run-postinsts?

If it would, should you test that it does indeed happen, to make sure 
there is indeed a difference in the outcome when --exclude is present 
and absent?

Alex



^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v2] runtime/dnf: Add new dnf test cases
  2017-05-10 19:52 ` Alexander Kanavin
@ 2017-05-11 17:33   ` jose.perez.carranza
  2017-05-11 18:56     ` Alexander Kanavin
  0 siblings, 1 reply; 19+ messages in thread
From: jose.perez.carranza @ 2017-05-11 17:33 UTC (permalink / raw)
  To: openembedded-core

From: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>

Add test cases to test “exclude” and “installroot“ options, also modify
the logic of filtering packages on the feed to have all the packages
needed by the tests.

[YOCTO #10744]

Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>
---
 meta/classes/testimage.bbclass     | 11 ++++++++---
 meta/lib/oeqa/runtime/cases/dnf.py | 19 ++++++++++++++++++-
 2 files changed, 26 insertions(+), 4 deletions(-)

diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index fb214604a97..a0d07c9f003 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -329,6 +329,7 @@ def create_index(arg):
     return None
 
 def create_rpm_index(d):
+    import glob
     # Index RPMs
     rpm_createrepo = bb.utils.which(os.getenv('PATH'), "createrepo_c")
     index_cmds = []
@@ -345,9 +346,13 @@ def create_rpm_index(d):
         lf = bb.utils.lockfile(lockfilename, False)
         oe.path.copyhardlinktree(rpm_dir, idx_path)
         # Full indexes overload a 256MB image so reduce the number of rpms
-        # in the feed. Filter to r* since we use the run-postinst packages and
-        # this leaves some allarch and machine arch packages too.
-        bb.utils.remove(idx_path + "*/[a-qs-z]*.rpm")
+        # in the feed by filtering to specific packages needed by the tests.
+        package_list = glob.glob(idx_path + "*/*.rpm")
+
+        for pkg in package_list:
+            if not os.path.basename(pkg).startswith(("rpm", "run-postinsts", "busybox", "bash", "update-alternatives", "libc6", "curl")):
+                bb.utils.remove(pkg)
+
         bb.utils.unlockfile(lf)
         cmd = '%s --update -q %s' % (rpm_createrepo, idx_path)
 
diff --git a/meta/lib/oeqa/runtime/cases/dnf.py b/meta/lib/oeqa/runtime/cases/dnf.py
index 2f87296b4e0..0baf796278b 100644
--- a/meta/lib/oeqa/runtime/cases/dnf.py
+++ b/meta/lib/oeqa/runtime/cases/dnf.py
@@ -120,4 +120,21 @@ class DnfRepoTest(DnfTest):
     def test_dnf_reinstall(self):
         self.dnf_with_repo('reinstall -y run-postinsts-dev')
 
-
+    @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
+    @OETestID(1771)
+    def test_dnf_installroot(self):
+        rootpath = '/home/root/chroot/test'
+        self.dnf_with_repo('install --installroot=%s --allowerasing -v -y busybox run-postinsts' % rootpath)
+        status, output = self.target.run('test -e %s/var/cache/dnf' % rootpath, 1500)
+        self.assertEqual(0, status, output)
+        status, output = self.target.run('test -e %s/bin/busybox' % rootpath, 1500)
+        self.assertEqual(0, status, output)
+
+    @OETestDepends(['dnf.DnfRepoTest.test_dnf_reinstall'])
+    @OETestID(1772)
+    def test_dnf_exclude(self):
+        excludepkg = 'curl-dev'
+        self.dnf('list %s' % excludepkg, 0)
+        self.dnf_with_repo('remove -y curl')
+        self.dnf_with_repo('install -y --exclude=%s curl' % excludepkg)
+        self.dnf('list %s' % excludepkg, 1)
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH v2] runtime/dnf: Add new dnf test cases
  2017-05-11 17:33   ` [PATCH v2] " jose.perez.carranza
@ 2017-05-11 18:56     ` Alexander Kanavin
  2017-05-11 19:21       ` Jose Perez Carranza
  2017-05-15 13:50       ` [PATCH v3] " jose.perez.carranza
  0 siblings, 2 replies; 19+ messages in thread
From: Alexander Kanavin @ 2017-05-11 18:56 UTC (permalink / raw)
  To: jose.perez.carranza, openembedded-core

On 05/11/2017 08:33 PM, jose.perez.carranza@linux.intel.com wrote:
> +    def test_dnf_exclude(self):
> +        excludepkg = 'curl-dev'
> +        self.dnf('list %s' % excludepkg, 0)
> +        self.dnf_with_repo('remove -y curl')
> +        self.dnf_with_repo('install -y --exclude=%s curl' % excludepkg)
> +        self.dnf('list %s' % excludepkg, 1)

1) Why is curl-dev already installed when the test starts? Will that be 
always the case?

2) I still don't understand how the test works. You are asking for curl 
to be installed and curl-dev to be excluded, but curl-dev would not be 
installed regardless of --exclude option, because curl does not depend 
on it. You need to test a situation where --exclude makes a difference, 
and check that there is indeed a difference.

Alex



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v2] runtime/dnf: Add new dnf test cases
  2017-05-11 18:56     ` Alexander Kanavin
@ 2017-05-11 19:21       ` Jose Perez Carranza
  2017-05-15 13:50       ` [PATCH v3] " jose.perez.carranza
  1 sibling, 0 replies; 19+ messages in thread
From: Jose Perez Carranza @ 2017-05-11 19:21 UTC (permalink / raw)
  To: Alexander Kanavin, openembedded-core



On 05/11/2017 01:56 PM, Alexander Kanavin wrote:
> On 05/11/2017 08:33 PM, jose.perez.carranza@linux.intel.com wrote:
>> +    def test_dnf_exclude(self):
>> +        excludepkg = 'curl-dev'
>> +        self.dnf('list %s' % excludepkg, 0)
>> +        self.dnf_with_repo('remove -y curl')
>> +        self.dnf_with_repo('install -y --exclude=%s curl' % excludepkg)
>> +        self.dnf('list %s' % excludepkg, 1)
>
> 1) Why is curl-dev already installed when the test starts? Will that 
> be always the case?
Will add logic to validate if curl is not installed then not try to 
remove it and go directly to test --exclude option
>
> 2) I still don't understand how the test works. You are asking for 
> curl to be installed and curl-dev to be excluded, but curl-dev would 
> not be installed regardless of --exclude option, because curl does not 
> depend on it. You need to test a situation where --exclude makes a 
> difference, and check that there is indeed a difference.
curl-dev is always installed with curl as a weak dependency, so every 
time you install or remove curl also curl-dev is affected, hence this 
test validate that --exclude option is working correctly by checking 
that curl-dev (weak dependency) is not installed,
>
> Alex
>

-- 
Saludos
José



^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v3] runtime/dnf: Add new dnf test cases
  2017-05-11 18:56     ` Alexander Kanavin
  2017-05-11 19:21       ` Jose Perez Carranza
@ 2017-05-15 13:50       ` jose.perez.carranza
  2017-06-07 10:21         ` Burton, Ross
  2017-06-13 19:56         ` [PATCH v4] " jose.perez.carranza
  1 sibling, 2 replies; 19+ messages in thread
From: jose.perez.carranza @ 2017-05-15 13:50 UTC (permalink / raw)
  To: openembedded-core

From: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>

Add test cases to test “exclude” and “installroot“ options, also modify
the logic of filtering packages on the feed to have all the packages
needed by the tests.

[YOCTO #10744]

Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>
---
 meta/classes/testimage.bbclass     | 11 ++++++++---
 meta/lib/oeqa/runtime/cases/dnf.py | 23 ++++++++++++++++++++++-
 2 files changed, 30 insertions(+), 4 deletions(-)

diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index fb214604a97..a0d07c9f003 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -329,6 +329,7 @@ def create_index(arg):
     return None
 
 def create_rpm_index(d):
+    import glob
     # Index RPMs
     rpm_createrepo = bb.utils.which(os.getenv('PATH'), "createrepo_c")
     index_cmds = []
@@ -345,9 +346,13 @@ def create_rpm_index(d):
         lf = bb.utils.lockfile(lockfilename, False)
         oe.path.copyhardlinktree(rpm_dir, idx_path)
         # Full indexes overload a 256MB image so reduce the number of rpms
-        # in the feed. Filter to r* since we use the run-postinst packages and
-        # this leaves some allarch and machine arch packages too.
-        bb.utils.remove(idx_path + "*/[a-qs-z]*.rpm")
+        # in the feed by filtering to specific packages needed by the tests.
+        package_list = glob.glob(idx_path + "*/*.rpm")
+
+        for pkg in package_list:
+            if not os.path.basename(pkg).startswith(("rpm", "run-postinsts", "busybox", "bash", "update-alternatives", "libc6", "curl")):
+                bb.utils.remove(pkg)
+
         bb.utils.unlockfile(lf)
         cmd = '%s --update -q %s' % (rpm_createrepo, idx_path)
 
diff --git a/meta/lib/oeqa/runtime/cases/dnf.py b/meta/lib/oeqa/runtime/cases/dnf.py
index 2f87296b4e0..4f274d57f8d 100644
--- a/meta/lib/oeqa/runtime/cases/dnf.py
+++ b/meta/lib/oeqa/runtime/cases/dnf.py
@@ -74,7 +74,6 @@ class DnfRepoTest(DnfTest):
     def test_dnf_makecache(self):
         self.dnf_with_repo('makecache')
 
-
 # Does not work when repo is specified on the command line
 #    @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
 #    def test_dnf_repolist(self):
@@ -120,4 +119,26 @@ class DnfRepoTest(DnfTest):
     def test_dnf_reinstall(self):
         self.dnf_with_repo('reinstall -y run-postinsts-dev')
 
+    @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
+    @OETestID(1771)
+    def test_dnf_installroot(self):
+        rootpath = '/home/root/chroot/test'
+        self.dnf_with_repo('install --installroot=%s --allowerasing -v -y busybox run-postinsts' % rootpath)
+        status, output = self.target.run('test -e %s/var/cache/dnf' % rootpath, 1500)
+        self.assertEqual(0, status, output)
+        status, output = self.target.run('test -e %s/bin/busybox' % rootpath, 1500)
+        self.assertEqual(0, status, output)
 
+    @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
+    @OETestID(1772)
+    def test_dnf_exclude(self):
+        excludepkg = 'curl-dev'
+        if self.dnf('list curl %s' % excludepkg ,0):
+            self.dnf_with_repo('remove -y curl*')
+
+        self.dnf('list %s' % excludepkg, 1)
+        self.dnf_with_repo('install -y curl*')
+        self.dnf('list %s' % excludepkg, 0)
+        self.dnf_with_repo('remove -y curl*')
+        self.dnf_with_repo('install -y --exclude=%s curl*' % excludepkg)
+        self.dnf('list %s' % excludepkg, 1)
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH v3] runtime/dnf: Add new dnf test cases
  2017-05-15 13:50       ` [PATCH v3] " jose.perez.carranza
@ 2017-06-07 10:21         ` Burton, Ross
  2017-06-07 17:31           ` Jose Perez Carranza
  2017-06-13 19:56         ` [PATCH v4] " jose.perez.carranza
  1 sibling, 1 reply; 19+ messages in thread
From: Burton, Ross @ 2017-06-07 10:21 UTC (permalink / raw)
  To: Jose Perez Carranza; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 368 bytes --]

On 15 May 2017 at 14:50, <jose.perez.carranza@linux.intel.com> wrote:

> Add test cases to test “exclude” and “installroot“ options, also modify
> the logic of filtering packages on the feed to have all the packages
> needed by the tests.
>

Fails all over the autobuilder, for example:

http://errors.yoctoproject.org/Errors/Details/143886/

Ross

[-- Attachment #2: Type: text/html, Size: 961 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3] runtime/dnf: Add new dnf test cases
  2017-06-07 10:21         ` Burton, Ross
@ 2017-06-07 17:31           ` Jose Perez Carranza
  2017-06-08 11:31             ` Alexander Kanavin
  2017-06-08 16:35             ` Alexander Kanavin
  0 siblings, 2 replies; 19+ messages in thread
From: Jose Perez Carranza @ 2017-06-07 17:31 UTC (permalink / raw)
  To: Burton, Ross; +Cc: OE-core

[-- Attachment #1: Type: text/plain, Size: 976 bytes --]

When I tried this test image was built without using states hence 
"busybox*.rpm" and "curl*.rpm"where present under 
"tmp/deploy/rpm/core2_64" hence the repo i taking tha packages form 
there to add them to repo and used on the image, but when using sstates 
those packages are not being built so are not present on local build 
directory. is there any way to force those packages to be built to have 
them available on tmp/deploy/rpm/core2_64?

On 06/07/2017 05:21 AM, Burton, Ross wrote:
>
> On 15 May 2017 at 14:50, <jose.perez.carranza@linux.intel.com 
> <mailto:jose.perez.carranza@linux.intel.com>> wrote:
>
>     Add test cases to test “exclude” and “installroot“ options, also
>     modify
>     the logic of filtering packages on the feed to have all the packages
>     needed by the tests.
>
>
> Fails all over the autobuilder, for example:
>
> http://errors.yoctoproject.org/Errors/Details/143886/
>
> Ross

-- 
Saludos
José


[-- Attachment #2: Type: text/html, Size: 2318 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3] runtime/dnf: Add new dnf test cases
  2017-06-07 17:31           ` Jose Perez Carranza
@ 2017-06-08 11:31             ` Alexander Kanavin
  2017-06-08 12:49               ` Jose Perez Carranza
  2017-06-08 16:35             ` Alexander Kanavin
  1 sibling, 1 reply; 19+ messages in thread
From: Alexander Kanavin @ 2017-06-08 11:31 UTC (permalink / raw)
  To: Jose Perez Carranza, Burton, Ross; +Cc: OE-core

On 06/07/2017 08:31 PM, Jose Perez Carranza wrote:
> When I tried this test image was built without using states hence
> "busybox*.rpm" and "curl*.rpm"where present under
> "tmp/deploy/rpm/core2_64" hence the repo i taking tha packages form
> there to add them to repo and used on the image, but when using sstates
> those packages are not being built so are not present on local build
> directory. is there any way to force those packages to be built to have
> them available on tmp/deploy/rpm/core2_64?

I can try to help if you provide steps to reproduce: if I merely do

rm -rf build/tmp
bitbake core-image-sato

then the build/tmp/deploy/rpm directory gets fully re-populated.


Alex



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3] runtime/dnf: Add new dnf test cases
  2017-06-08 11:31             ` Alexander Kanavin
@ 2017-06-08 12:49               ` Jose Perez Carranza
  2017-06-08 12:49                 ` Alexander Kanavin
  0 siblings, 1 reply; 19+ messages in thread
From: Jose Perez Carranza @ 2017-06-08 12:49 UTC (permalink / raw)
  To: Alexander Kanavin, Burton, Ross; +Cc: OE-core



On 06/08/2017 06:31 AM, Alexander Kanavin wrote:
> On 06/07/2017 08:31 PM, Jose Perez Carranza wrote:
>> When I tried this test image was built without using states hence
>> "busybox*.rpm" and "curl*.rpm"where present under
>> "tmp/deploy/rpm/core2_64" hence the repo i taking tha packages form
>> there to add them to repo and used on the image, but when using sstates
>> those packages are not being built so are not present on local build
>> directory. is there any way to force those packages to be built to have
>> them available on tmp/deploy/rpm/core2_64?
>
> I can try to help if you provide steps to reproduce: if I merely do
>
> rm -rf build/tmp
> bitbake core-image-sato
>
> then the build/tmp/deploy/rpm directory gets fully re-populated.
>
Sure I'm using this branch [1]

The steps that Iḿ following are :

1. bitbake core-image-sato using shared states (I'm using local sstates)
2. Add to the local.conf
         INHERIT += "testimage"
         TEST_SUITES += " ping ssh dnf"
3. bitbake core-image-sato -c testimage

http://git.yoctoproject.org/cgit/cgit.cgi/poky-contrib/log/?h=jperez/dnf-updates
>
> Alex
>

-- 
Saludos
José



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3] runtime/dnf: Add new dnf test cases
  2017-06-08 12:49               ` Jose Perez Carranza
@ 2017-06-08 12:49                 ` Alexander Kanavin
  2017-06-08 13:11                   ` Jose Perez Carranza
  0 siblings, 1 reply; 19+ messages in thread
From: Alexander Kanavin @ 2017-06-08 12:49 UTC (permalink / raw)
  To: Jose Perez Carranza, Burton, Ross; +Cc: OE-core

On 06/08/2017 03:49 PM, Jose Perez Carranza wrote:

> 1. bitbake core-image-sato using shared states (I'm using local sstates)

When you do this, tmp/deploy/rpm should get re-populated with rpm 
packages, regardless of whether they're taken from sstate, or rebuilt.

Can you check why this does not happen on your side?

Alex


^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3] runtime/dnf: Add new dnf test cases
  2017-06-08 12:49                 ` Alexander Kanavin
@ 2017-06-08 13:11                   ` Jose Perez Carranza
  0 siblings, 0 replies; 19+ messages in thread
From: Jose Perez Carranza @ 2017-06-08 13:11 UTC (permalink / raw)
  To: Alexander Kanavin, Burton, Ross; +Cc: OE-core



On 06/08/2017 07:49 AM, Alexander Kanavin wrote:
> On 06/08/2017 03:49 PM, Jose Perez Carranza wrote:
>
>> 1. bitbake core-image-sato using shared states (I'm using local sstates)
>
> When you do this, tmp/deploy/rpm should get re-populated with rpm 
> packages, regardless of whether they're taken from sstate, or rebuilt.
All those steps are done on a fresh build directory, so the first time 
that image is built packages are not being populated when rebuilding the 
image packages are get pupulated, but AB only built once the image and 
then execute testimage.
>
> Can you check why this does not happen on your side?
>
> Alex

-- 
Saludos
José



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3] runtime/dnf: Add new dnf test cases
  2017-06-07 17:31           ` Jose Perez Carranza
  2017-06-08 11:31             ` Alexander Kanavin
@ 2017-06-08 16:35             ` Alexander Kanavin
  2017-06-09  9:22               ` Alexander Kanavin
  1 sibling, 1 reply; 19+ messages in thread
From: Alexander Kanavin @ 2017-06-08 16:35 UTC (permalink / raw)
  To: Jose Perez Carranza, Burton, Ross; +Cc: OE-core

On 06/07/2017 08:31 PM, Jose Perez Carranza wrote:
> When I tried this test image was built without using states hence
> "busybox*.rpm" and "curl*.rpm"where present under
> "tmp/deploy/rpm/core2_64" hence the repo i taking tha packages form
> there to add them to repo and used on the image, but when using sstates
> those packages are not being built so are not present on local build
> directory. is there any way to force those packages to be built to have
> them available on tmp/deploy/rpm/core2_64?

At least one of the failures has nothing to do with sstate or repositories:

   File 
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-x32/build/meta/lib/oeqa/runtime/cases/dnf.py", 
line 136, in test_dnf_exclude
     if self.dnf('list curl %s' % excludepkg ,0):
   File 
"/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-x32/build/meta/lib/oeqa/runtime/cases/dnf.py", 
line 18, in dnf
     self.assertEqual(status, expected, message)
AssertionError: 1 != 0 : dnf list curl curl-dev
Error: No matching Packages to list


That line is asking if curl package is installed on the image, and, in 
core-image-sato's case it isn't, and so failure occurs. The repositories 
are not even accessed.

I haven't been able to reproduce the installroot failure, works fine here.


Alex



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3] runtime/dnf: Add new dnf test cases
  2017-06-08 16:35             ` Alexander Kanavin
@ 2017-06-09  9:22               ` Alexander Kanavin
  2017-06-09 12:54                 ` Jose Perez Carranza
  0 siblings, 1 reply; 19+ messages in thread
From: Alexander Kanavin @ 2017-06-09  9:22 UTC (permalink / raw)
  To: Jose Perez Carranza, Burton, Ross; +Cc: OE-core

On 06/08/2017 07:35 PM, Alexander Kanavin wrote:
> I haven't been able to reproduce the installroot failure, works fine here.

The installroot issue is most likely due to dnf architectures not being 
properly configured (which causes breakage when the architecture is not 
one of the standard ones that the upstream has hardcoded). Yes, the 
error message is unhelpful and leads one to think the repo is somehow 
broken or is missing packages :)

Copy the contents of /etc/rpm and /etc/dnf into installroot dir before 
running dnf, and you should be good to go. Test on x32, for example.

Alex



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v3] runtime/dnf: Add new dnf test cases
  2017-06-09  9:22               ` Alexander Kanavin
@ 2017-06-09 12:54                 ` Jose Perez Carranza
  0 siblings, 0 replies; 19+ messages in thread
From: Jose Perez Carranza @ 2017-06-09 12:54 UTC (permalink / raw)
  To: Alexander Kanavin, Burton, Ross; +Cc: OE-core

Thank you Alex !

I will work on a patch with your approach

On 06/09/2017 04:22 AM, Alexander Kanavin wrote:
> On 06/08/2017 07:35 PM, Alexander Kanavin wrote:
>> I haven't been able to reproduce the installroot failure, works fine 
>> here.
>
> The installroot issue is most likely due to dnf architectures not 
> being properly configured (which causes breakage when the architecture 
> is not one of the standard ones that the upstream has hardcoded). Yes, 
> the error message is unhelpful and leads one to think the repo is 
> somehow broken or is missing packages :)
>
> Copy the contents of /etc/rpm and /etc/dnf into installroot dir before 
> running dnf, and you should be good to go. Test on x32, for example.
>
> Alex
>

-- 
Saludos
José



^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v4] runtime/dnf: Add new dnf test cases
  2017-05-15 13:50       ` [PATCH v3] " jose.perez.carranza
  2017-06-07 10:21         ` Burton, Ross
@ 2017-06-13 19:56         ` jose.perez.carranza
  2017-06-14 12:00           ` Alexander Kanavin
  1 sibling, 1 reply; 19+ messages in thread
From: jose.perez.carranza @ 2017-06-13 19:56 UTC (permalink / raw)
  To: openembedded-core

From: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>

Add test cases to test “exclude” and “installroot“ options, also modify
the logic of filtering packages on the feed to have all the packages
needed by the tests.

[YOCTO #10744]

Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>
---
 meta/classes/testimage.bbclass     | 11 ++++++++---
 meta/lib/oeqa/runtime/cases/dnf.py | 22 ++++++++++++++++++++++
 2 files changed, 30 insertions(+), 3 deletions(-)

diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 6fa2d6fd9f..d76d64d442 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -329,6 +329,7 @@ def create_index(arg):
     return None
 
 def create_rpm_index(d):
+    import glob
     # Index RPMs
     rpm_createrepo = bb.utils.which(os.getenv('PATH'), "createrepo_c")
     index_cmds = []
@@ -345,9 +346,13 @@ def create_rpm_index(d):
         lf = bb.utils.lockfile(lockfilename, False)
         oe.path.copyhardlinktree(rpm_dir, idx_path)
         # Full indexes overload a 256MB image so reduce the number of rpms
-        # in the feed. Filter to r* since we use the run-postinst packages and
-        # this leaves some allarch and machine arch packages too.
-        bb.utils.remove(idx_path + "*/[a-qs-z]*.rpm")
+        # in the feed by filtering to specific packages needed by the tests.
+        package_list = glob.glob(idx_path + "*/*.rpm")
+
+        for pkg in package_list:
+            if not os.path.basename(pkg).startswith(("rpm", "run-postinsts", "busybox", "bash", "update-alternatives", "libc6", "curl")):
+                bb.utils.remove(pkg)
+
         bb.utils.unlockfile(lf)
         cmd = '%s --update -q %s' % (rpm_createrepo, idx_path)
 
diff --git a/meta/lib/oeqa/runtime/cases/dnf.py b/meta/lib/oeqa/runtime/cases/dnf.py
index 2f87296b4e..25db9bacd2 100644
--- a/meta/lib/oeqa/runtime/cases/dnf.py
+++ b/meta/lib/oeqa/runtime/cases/dnf.py
@@ -120,4 +120,26 @@ class DnfRepoTest(DnfTest):
     def test_dnf_reinstall(self):
         self.dnf_with_repo('reinstall -y run-postinsts-dev')
 
+    @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
+    @OETestID(1771)
+    def test_dnf_installroot(self):
+        rootpath = '/home/root/chroot/test'
+        self.target.run('mkdir -p %s/etc' % rootpath, 1500)
+        self.target.run('cp -r /etc/rpm %s/etc' % rootpath, 1500)
+        self.target.run('cp -r /etc/dnf %s/etc' % rootpath, 1500)
+        self.dnf_with_repo('install --installroot=%s -v -y busybox run-postinsts' % rootpath)
+        status, output = self.target.run('test -e %s/var/cache/dnf' % rootpath, 1500)
+        self.assertEqual(0, status, output)
+        status, output = self.target.run('test -e %s/bin/busybox' % rootpath, 1500)
+        self.assertEqual(0, status, output)
 
+    @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
+    @OETestID(1772)
+    def test_dnf_exclude(self):
+        excludepkg = 'curl-dev'
+        self.dnf_with_repo('install -y curl*')
+        self.dnf('list %s' % excludepkg, 0)
+        self.dnf_with_repo('remove -y curl*')
+        self.dnf('list %s' % excludepkg, 1)
+        self.dnf_with_repo('install -y --exclude=%s curl*' % excludepkg)
+        self.dnf('list %s' % excludepkg, 1)
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [PATCH v4] runtime/dnf: Add new dnf test cases
  2017-06-13 19:56         ` [PATCH v4] " jose.perez.carranza
@ 2017-06-14 12:00           ` Alexander Kanavin
  2017-06-14 12:32             ` Jose Perez Carranza
  0 siblings, 1 reply; 19+ messages in thread
From: Alexander Kanavin @ 2017-06-14 12:00 UTC (permalink / raw)
  To: jose.perez.carranza, openembedded-core

On 06/13/2017 10:56 PM, jose.perez.carranza@linux.intel.com wrote:
> From: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>
>
> Add test cases to test “exclude” and “installroot“ options, also modify
> the logic of filtering packages on the feed to have all the packages
> needed by the tests.

Looks good. Hopefully this is the last time you needed to revise the 
patch :)

Alex



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [PATCH v4] runtime/dnf: Add new dnf test cases
  2017-06-14 12:00           ` Alexander Kanavin
@ 2017-06-14 12:32             ` Jose Perez Carranza
  2017-11-30 16:23               ` [PATCH v5] " jose.perez.carranza
  0 siblings, 1 reply; 19+ messages in thread
From: Jose Perez Carranza @ 2017-06-14 12:32 UTC (permalink / raw)
  To: Alexander Kanavin, openembedded-core



On 06/14/2017 07:00 AM, Alexander Kanavin wrote:
> On 06/13/2017 10:56 PM, jose.perez.carranza@linux.intel.com wrote:
>> From: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>
>>
>> Add test cases to test “exclude” and “installroot“ options, also modify
>> the logic of filtering packages on the feed to have all the packages
>> needed by the tests.
>
> Looks good. Hopefully this is the last time you needed to revise the 
> patch :)
Thanks for you advise on this, I hope so too, this time I do a series of 
tests on AB and they were executed correctly
>
> Alex
>

-- 
Saludos
José



^ permalink raw reply	[flat|nested] 19+ messages in thread

* [PATCH v5] runtime/dnf: Add new dnf test cases
  2017-06-14 12:32             ` Jose Perez Carranza
@ 2017-11-30 16:23               ` jose.perez.carranza
  0 siblings, 0 replies; 19+ messages in thread
From: jose.perez.carranza @ 2017-11-30 16:23 UTC (permalink / raw)
  To: openembedded-core

From: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>

Add test cases to test “exclude” and “installroot“ options, also modify
the logic of filtering packages on the feed to have all the packages
needed by the tests.

[YOCTO #10744]

Signed-off-by: Jose Perez Carranza <jose.perez.carranza@linux.intel.com>
---
 meta/classes/testimage.bbclass     | 11 ++++++++---
 meta/lib/oeqa/runtime/cases/dnf.py | 36 ++++++++++++++++++++++++++++++++++++
 2 files changed, 44 insertions(+), 3 deletions(-)

diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass
index 45bb2bda3b8..c1588da0fd8 100644
--- a/meta/classes/testimage.bbclass
+++ b/meta/classes/testimage.bbclass
@@ -329,6 +329,7 @@ def create_index(arg):
     return None
 
 def create_rpm_index(d):
+    import glob
     # Index RPMs
     rpm_createrepo = bb.utils.which(os.getenv('PATH'), "createrepo_c")
     index_cmds = []
@@ -345,9 +346,13 @@ def create_rpm_index(d):
         lf = bb.utils.lockfile(lockfilename, False)
         oe.path.copyhardlinktree(rpm_dir, idx_path)
         # Full indexes overload a 256MB image so reduce the number of rpms
-        # in the feed. Filter to r* since we use the run-postinst packages and
-        # this leaves some allarch and machine arch packages too.
-        bb.utils.remove(idx_path + "*/[a-qs-z]*.rpm")
+        # in the feed by filtering to specific packages needed by the tests.
+        package_list = glob.glob(idx_path + "*/*.rpm")
+
+        for pkg in package_list:
+            if not os.path.basename(pkg).startswith(("rpm", "run-postinsts", "busybox", "bash", "update-alternatives", "libc6", "curl")):
+                bb.utils.remove(pkg)
+
         bb.utils.unlockfile(lf)
         cmd = '%s --update -q %s' % (rpm_createrepo, idx_path)
 
diff --git a/meta/lib/oeqa/runtime/cases/dnf.py b/meta/lib/oeqa/runtime/cases/dnf.py
index 2f87296b4e0..020e025de4e 100644
--- a/meta/lib/oeqa/runtime/cases/dnf.py
+++ b/meta/lib/oeqa/runtime/cases/dnf.py
@@ -120,4 +120,40 @@ class DnfRepoTest(DnfTest):
     def test_dnf_reinstall(self):
         self.dnf_with_repo('reinstall -y run-postinsts-dev')
 
+    @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
+    @OETestID(1771)
+    def test_dnf_installroot(self):
+        rootpath = '/home/root/chroot/test'
+        #Copy necessary files to avoid errors with not yet installed tools on
+        #installroot directory.
+        self.target.run('mkdir -p %s/etc' % rootpath, 1500)
+        self.target.run('mkdir -p %s/bin' % rootpath, 1500)
+        #Handle different architectures lib dirs
+        self.target.run('mkdir -p %s/lib' % rootpath, 1500)
+        self.target.run('mkdir -p %s/libx32' % rootpath, 1500)
+        self.target.run('cp /lib/libtinfo.so.5 %s/lib' % rootpath, 1500)
+        self.target.run('cp /libx32/libtinfo.so.5 %s/libx32' % rootpath, 1500)
+        self.target.run('cp -r /etc/rpm %s/etc' % rootpath, 1500)
+        self.target.run('cp -r /etc/dnf %s/etc' % rootpath, 1500)
+        self.target.run('cp /bin/sh %s/bin' % rootpath, 1500)
+        self.dnf_with_repo('install --installroot=%s -v -y --rpmverbosity=debug busybox run-postinsts' % rootpath)
+        status, output = self.target.run('test -e %s/var/cache/dnf' % rootpath, 1500)
+        self.assertEqual(0, status, output)
+        status, output = self.target.run('test -e %s/bin/busybox' % rootpath, 1500)
+        self.assertEqual(0, status, output)
 
+    @OETestDepends(['dnf.DnfRepoTest.test_dnf_makecache'])
+    @OETestID(1772)
+    def test_dnf_exclude(self):
+        excludepkg = 'curl-dev'
+        self.dnf_with_repo('install -y curl*')
+        self.dnf('list %s' % excludepkg, 0)
+        #Avoid remove dependencies to skip some errors on different archs and images
+        self.dnf_with_repo('remove --setopt=clean_requirements_on_remove=0 -y curl*')
+        #check curl-dev is not installed adter removing all curl occurrences
+        status, output = self.target.run('dnf list --installed | grep %s'% excludepkg, 1500)
+        self.assertEqual(1, status, "%s was not removed,  is listed as installed"%excludepkg)
+        self.dnf_with_repo('install -y --exclude=%s curl*' % excludepkg)
+        #check curl-dev is not installed after being excluded
+        status, output = self.target.run('dnf list --installed | grep %s'% excludepkg , 1500)
+        self.assertEqual(1, status, "%s was not excluded, is listed as installed"%excludepkg)
-- 
2.11.0



^ permalink raw reply related	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2017-11-30 16:18 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-10 19:38 [PATCH] runtime/dnf: Add new dnf test cases jose.perez.carranza
2017-05-10 19:52 ` Alexander Kanavin
2017-05-11 17:33   ` [PATCH v2] " jose.perez.carranza
2017-05-11 18:56     ` Alexander Kanavin
2017-05-11 19:21       ` Jose Perez Carranza
2017-05-15 13:50       ` [PATCH v3] " jose.perez.carranza
2017-06-07 10:21         ` Burton, Ross
2017-06-07 17:31           ` Jose Perez Carranza
2017-06-08 11:31             ` Alexander Kanavin
2017-06-08 12:49               ` Jose Perez Carranza
2017-06-08 12:49                 ` Alexander Kanavin
2017-06-08 13:11                   ` Jose Perez Carranza
2017-06-08 16:35             ` Alexander Kanavin
2017-06-09  9:22               ` Alexander Kanavin
2017-06-09 12:54                 ` Jose Perez Carranza
2017-06-13 19:56         ` [PATCH v4] " jose.perez.carranza
2017-06-14 12:00           ` Alexander Kanavin
2017-06-14 12:32             ` Jose Perez Carranza
2017-11-30 16:23               ` [PATCH v5] " jose.perez.carranza

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.