All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2 v2] oeqa/runtime/cases/rpm.py: Enable rpm install dependency testing
@ 2019-05-16  1:22 Yeoh Ee Peng
  2019-05-16  1:22 ` [PATCH 2/2 v2] oeqa/manual/bsp-hw.json: Remove rpm install dependency Yeoh Ee Peng
  2019-05-16 19:29 ` [PATCH 1/2 v2] oeqa/runtime/cases/rpm.py: Enable rpm install dependency testing Richard Purdie
  0 siblings, 2 replies; 4+ messages in thread
From: Yeoh Ee Peng @ 2019-05-16  1:22 UTC (permalink / raw)
  To: openembedded-core

Convert manual testcase bsps-hw.bsps-hw.rpm_-__install_dependency_package
from oeqa/manual/bsp-hw.json to runtime automated test.

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
---
 meta/lib/oeqa/runtime/cases/rpm.py | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/meta/lib/oeqa/runtime/cases/rpm.py b/meta/lib/oeqa/runtime/cases/rpm.py
index d8cabd3..f71125f 100644
--- a/meta/lib/oeqa/runtime/cases/rpm.py
+++ b/meta/lib/oeqa/runtime/cases/rpm.py
@@ -135,3 +135,33 @@ class RpmInstallRemoveTest(OERuntimeTestCase):
         # Check that there's enough of them
         self.assertGreaterEqual(int(output), 80,
                                    'Cound not find sufficient amount of rpm entries in /var/log/messages, found {} entries'.format(output))
+
+    @OETestDepends(['rpm.RpmBasicTest.test_rpm_query'])
+    def test_rpm_install_dependency(self):
+        rpmdir = os.path.join(self.tc.td['DEPLOY_DIR'], 'rpm', 'noarch')
+        rpm_tests = {'run-postinsts-dev': '', 'run-postinsts': ''}
+        rpm_pattern = 'run-postinsts-*.noarch.rpm'
+        for f in fnmatch.filter(os.listdir(rpmdir), rpm_pattern):
+            if 'run-postinsts-dev' not in f and 'run-postinsts-dbg' not in f:
+                rpm_tests['run-postinsts'] = f
+                continue
+            if 'run-postinsts-dev' in f:
+                rpm_tests['run-postinsts-dev'] = f
+                continue
+        rpm_dest_dir = '/tmp'
+        for rpm in rpm_tests:
+            self.tc.target.copyTo(os.path.join(rpmdir, rpm_tests[rpm]), os.path.join(rpm_dest_dir, rpm_tests[rpm]))
+        # remove existing rpm before testing install with dependency
+        self.tc.target.run('rpm -e %s' % 'run-postinsts-dev')
+        self.tc.target.run('rpm -e %s' % 'run-postinsts')
+        status, output = self.tc.target.run('rpm -ivh %s' % os.path.join(rpm_dest_dir, rpm_tests['run-postinsts-dev']))
+        self.assertTrue(status == 1, 'rpm installed should have failed but it was getting %s' % status)
+        self.assertTrue('error: Failed dependencies:' in output,
+                        'rpm installed should have failed with error but it was getting: %s' % output)
+        # reinstall rpm with dependency
+        status, output = self.tc.target.run('rpm -ivh %s' % os.path.join(rpm_dest_dir, rpm_tests['run-postinsts']))
+        self.assertTrue(status == 0, 'rpm (%s) installed with error: %s (%s)' % (rpm_tests['run-postinsts'], status, output))
+        status, output = self.tc.target.run('rpm -ivh %s' % os.path.join(rpm_dest_dir, rpm_tests['run-postinsts-dev']))
+        self.assertTrue(status == 0, 'rpm (%s) installed with error: %s (%s)' % (rpm_tests['run-postinsts-dev'], status, output))
+        for rpm in rpm_tests:
+            self.tc.target.run('rm -f %s' % os.path.join(rpm_dest_dir, rpm_tests[rpm]))
-- 
2.7.4



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

* [PATCH 2/2 v2] oeqa/manual/bsp-hw.json: Remove rpm install dependency
  2019-05-16  1:22 [PATCH 1/2 v2] oeqa/runtime/cases/rpm.py: Enable rpm install dependency testing Yeoh Ee Peng
@ 2019-05-16  1:22 ` Yeoh Ee Peng
  2019-05-16 19:29 ` [PATCH 1/2 v2] oeqa/runtime/cases/rpm.py: Enable rpm install dependency testing Richard Purdie
  1 sibling, 0 replies; 4+ messages in thread
From: Yeoh Ee Peng @ 2019-05-16  1:22 UTC (permalink / raw)
  To: openembedded-core

Remove the bsps-hw.bsps-hw.rpm_-__install_dependency_package
as it was replaced by the test_rpm_install_dependency inside
oeqa/runtime/cases/rpm.py.

Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
---
 meta/lib/oeqa/manual/bsp-hw.json | 26 --------------------------
 1 file changed, 26 deletions(-)

diff --git a/meta/lib/oeqa/manual/bsp-hw.json b/meta/lib/oeqa/manual/bsp-hw.json
index 4b7c76f..017de9d 100644
--- a/meta/lib/oeqa/manual/bsp-hw.json
+++ b/meta/lib/oeqa/manual/bsp-hw.json
@@ -1,32 +1,6 @@
 [
     {
         "test": {
-            "@alias": "bsps-hw.bsps-hw.rpm_-__install_dependency_package",
-            "author": [
-                {
-                    "email": "alexandru.c.georgescu@intel.com",
-                    "name": "alexandru.c.georgescu@intel.com"
-                }
-            ],
-            "execution": {
-                "1": {
-                    "action": "Get a not previously installed RPM package or build one on local machine, which should have run-time dependency.For example, \"mc\" (Midnight Commander, which is a visual file manager) should depend on \"ncurses-terminfo\".   \n\n$ bitbake mc  \n\n\n",
-                    "expected_results": ""
-                },
-                "2": {
-                    "action": "Copy the package into a system folder (for example /home/root/rpm_packages).  \n\n\n",
-                    "expected_results": ""
-                },
-                "3": {
-                    "action": "Run \"rpm -ivh package_name\" and check the output, for example \"rpm -ivh mc.rpm*\" should report the dependency on \"ncurses-terminfo\".\n\n\n\n",
-                    "expected_results": "3 . rpm command should report message when some RPM installation depends on other packages."
-                }
-            },
-            "summary": "rpm_-__install_dependency_package"
-        }
-    },
-    {
-        "test": {
             "@alias": "bsps-hw.bsps-hw.boot_and_install_from_USB",
             "author": [
                 {
-- 
2.7.4



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

* Re: [PATCH 1/2 v2] oeqa/runtime/cases/rpm.py: Enable rpm install dependency testing
  2019-05-16  1:22 [PATCH 1/2 v2] oeqa/runtime/cases/rpm.py: Enable rpm install dependency testing Yeoh Ee Peng
  2019-05-16  1:22 ` [PATCH 2/2 v2] oeqa/manual/bsp-hw.json: Remove rpm install dependency Yeoh Ee Peng
@ 2019-05-16 19:29 ` Richard Purdie
  2019-05-17  2:09   ` Yeoh, Ee Peng
  1 sibling, 1 reply; 4+ messages in thread
From: Richard Purdie @ 2019-05-16 19:29 UTC (permalink / raw)
  To: Yeoh Ee Peng, openembedded-core

On Thu, 2019-05-16 at 09:22 +0800, Yeoh Ee Peng wrote:
> Convert manual testcase bsps-hw.bsps-hw.rpm_-
> __install_dependency_package
> from oeqa/manual/bsp-hw.json to runtime automated test.
> 
> Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
> ---
>  meta/lib/oeqa/runtime/cases/rpm.py | 30
> ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)

Much better, only one failure this time in multilib:

https://autobuilder.yoctoproject.org/typhoon/#/builders/44/builds/612

Cheers,

Richard



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

* Re: [PATCH 1/2 v2] oeqa/runtime/cases/rpm.py: Enable rpm install dependency testing
  2019-05-16 19:29 ` [PATCH 1/2 v2] oeqa/runtime/cases/rpm.py: Enable rpm install dependency testing Richard Purdie
@ 2019-05-17  2:09   ` Yeoh, Ee Peng
  0 siblings, 0 replies; 4+ messages in thread
From: Yeoh, Ee Peng @ 2019-05-17  2:09 UTC (permalink / raw)
  To: Richard Purdie, openembedded-core

Hi Richard,

I verified that this test was failing in multilib because the target package to be used for testing was not available. 

I had added skipTest logic in case the target package needed was not available. Sent the updated patches. Thank you very much for your inputs. 

Thanks,
Yeoh Ee Peng 

-----Original Message-----
From: Richard Purdie [mailto:richard.purdie@linuxfoundation.org] 
Sent: Friday, May 17, 2019 3:29 AM
To: Yeoh, Ee Peng <ee.peng.yeoh@intel.com>; openembedded-core@lists.openembedded.org
Subject: Re: [OE-core] [PATCH 1/2 v2] oeqa/runtime/cases/rpm.py: Enable rpm install dependency testing

On Thu, 2019-05-16 at 09:22 +0800, Yeoh Ee Peng wrote:
> Convert manual testcase bsps-hw.bsps-hw.rpm_- 
> __install_dependency_package from oeqa/manual/bsp-hw.json to runtime 
> automated test.
> 
> Signed-off-by: Yeoh Ee Peng <ee.peng.yeoh@intel.com>
> ---
>  meta/lib/oeqa/runtime/cases/rpm.py | 30
> ++++++++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)

Much better, only one failure this time in multilib:

https://autobuilder.yoctoproject.org/typhoon/#/builders/44/builds/612

Cheers,

Richard


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

end of thread, other threads:[~2019-05-17  2:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-16  1:22 [PATCH 1/2 v2] oeqa/runtime/cases/rpm.py: Enable rpm install dependency testing Yeoh Ee Peng
2019-05-16  1:22 ` [PATCH 2/2 v2] oeqa/manual/bsp-hw.json: Remove rpm install dependency Yeoh Ee Peng
2019-05-16 19:29 ` [PATCH 1/2 v2] oeqa/runtime/cases/rpm.py: Enable rpm install dependency testing Richard Purdie
2019-05-17  2:09   ` Yeoh, Ee Peng

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.