All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1] selftest/runtime-test.py: Add test to check PACKAGE_FEED_URIS var
       [not found] <cover.1487616539.git.humberto.ibarra.lopez@intel.com>
@ 2017-02-20 18:54 ` Humberto Ibarra
  2017-02-23 19:46   ` Alexander Kanavin
  0 siblings, 1 reply; 2+ messages in thread
From: Humberto Ibarra @ 2017-02-20 18:54 UTC (permalink / raw)
  To: openembedded-core

Testing that feeds specified with PACKAGE_FEED_URIS var are set
correctly has two parts. First a build with this var set is required,
and then smart update needs to be issued in the running taget.

The previous is not a common selftest practice because this is a
simple test, but requires building and running a specific image,
which takes a lot of time. testimage is not a good fit either,
since the images tested there do not have the PACKAGE_FEED_URIS
var set.

For this test, the runtime-test module is being used, which is a
selftest module but runs a testimage command. The var and test
environment were set in runtime-perf.py and the actual test is
done in a new testcase added to meta-selftest layer.

[YOCTO #10872]

Signed-off-by: Humberto Ibarra <humberto.ibarra.lopez@intel.com>
---
 meta-selftest/lib/oeqa/runtime/cases/selftest.py | 32 ++++++++++++++++++++++++
 meta/lib/oeqa/selftest/runtime-test.py           |  3 +++
 2 files changed, 35 insertions(+)

diff --git a/meta-selftest/lib/oeqa/runtime/cases/selftest.py b/meta-selftest/lib/oeqa/runtime/cases/selftest.py
index 329470f..e49d028 100644
--- a/meta-selftest/lib/oeqa/runtime/cases/selftest.py
+++ b/meta-selftest/lib/oeqa/runtime/cases/selftest.py
@@ -1,5 +1,8 @@
+from oeqa.utils.httpserver import HTTPService
+
 from oeqa.runtime.case import OERuntimeTestCase
 from oeqa.core.decorator.depends import OETestDepends
+from oeqa.runtime.cases.smart import SmartTest
 
 class Selftest(OERuntimeTestCase):
 
@@ -29,3 +32,32 @@ class Selftest(OERuntimeTestCase):
 
         (status, output) = self.target.run("socat -V")
         self.assertNotEqual(status, 0, msg="socat is still installed")
+
+class SmartSelftest(SmartTest):
+
+    @classmethod
+    def setUpClass(cls):
+        cls.repolist = []
+        cls.repo_server = HTTPService(os.path.join(cls.tc.td['WORKDIR'], 'rpms'),
+                                      cls.tc.target.server_ip)
+        cls.repo_server.port = 8080
+        cls.repo_server.start()
+
+    @classmethod
+    def tearDownClass(cls):
+        cls.repo_server.stop()
+        for repo in cls.repolist:
+            cls.tc.target.run('smart channel -y --remove %s' % repo)
+
+    @OETestDepends(['ssh.SSHTest.test_ssh'])
+    def test_verify_package_feeds(self):
+        """
+        Summary: Check correct setting of PACKAGE_FEED_URIS var
+        Expected: 1. Feeds were correctly set for smart
+                  2. Update recovers packages from host's repo
+        Author: Humberto Ibarra <humberto.ibarra.lopez@intel.com>
+        """
+        output = self.smart('update')
+        import re
+        new_pkgs = re.match(r".*Channels have [0-9]+ new packages", output, re.DOTALL)
+        self.assertTrue(new_pkgs is not None, msg = "couldn't update packages")
diff --git a/meta/lib/oeqa/selftest/runtime-test.py b/meta/lib/oeqa/selftest/runtime-test.py
index 52e5b27..d96290e 100644
--- a/meta/lib/oeqa/selftest/runtime-test.py
+++ b/meta/lib/oeqa/selftest/runtime-test.py
@@ -111,6 +111,9 @@ class TestImage(oeSelfTest):
 
         features = 'INHERIT += "testimage"\n'
         features += 'TEST_SUITES = "ping ssh selftest"\n'
+        features += 'PACKAGE_FEED_URIS = "http://192.168.7.1:8080"\n'
+        features += 'EXTRA_IMAGE_FEATURES += "package-management"\n'
+        features += 'PACKAGE_CLASSES = "package_rpm"'
         self.write_config(features)
 
         # Build core-image-sato and testimage
-- 
2.7.4



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

* Re: [PATCH 1/1] selftest/runtime-test.py: Add test to check PACKAGE_FEED_URIS var
  2017-02-20 18:54 ` [PATCH 1/1] selftest/runtime-test.py: Add test to check PACKAGE_FEED_URIS var Humberto Ibarra
@ 2017-02-23 19:46   ` Alexander Kanavin
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Kanavin @ 2017-02-23 19:46 UTC (permalink / raw)
  To: openembedded-core

On 02/20/2017 08:54 PM, Humberto Ibarra wrote:
>          features = 'INHERIT += "testimage"\n'
>          features += 'TEST_SUITES = "ping ssh selftest"\n'
> +        features += 'PACKAGE_FEED_URIS = "http://192.168.7.1:8080"\n'

Can you make the assumption that the IP address will be exactly this? 
I'm seeing various IP addresses in autobuilder logs when for example 
testimages are being tested simultaneously, and they're not always 
192.168.7.1.

Alex


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

end of thread, other threads:[~2017-02-23 19:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1487616539.git.humberto.ibarra.lopez@intel.com>
2017-02-20 18:54 ` [PATCH 1/1] selftest/runtime-test.py: Add test to check PACKAGE_FEED_URIS var Humberto Ibarra
2017-02-23 19:46   ` Alexander Kanavin

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.