[oe-commits] Lucian Musat : oeqa/smart: Added some new test cases

git at git.openembedded.org git at git.openembedded.org
Sat Feb 14 22:27:39 UTC 2015


Module: openembedded-core.git
Branch: master-next
Commit: 945cdab87ed247524059183e1376923a8655069c
URL:    http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=945cdab87ed247524059183e1376923a8655069c

Author: Lucian Musat <george.l.musat at intel.com>
Date:   Tue Jan 27 18:08:08 2015 +0200

oeqa/smart: Added some new test cases

Signed-off-by: Lucian Musat <george.l.musat at intel.com>
Signed-off-by: Ross Burton <ross.burton at intel.com>

---

 meta/lib/oeqa/runtime/smart.py | 48 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 48 insertions(+)

diff --git a/meta/lib/oeqa/runtime/smart.py b/meta/lib/oeqa/runtime/smart.py
index 3b49314..dba3bd6 100644
--- a/meta/lib/oeqa/runtime/smart.py
+++ b/meta/lib/oeqa/runtime/smart.py
@@ -53,12 +53,15 @@ class SmartRepoTest(SmartTest):
 
     @classmethod
     def setUpClass(self):
+        self.repolist = []
         self.repo_server = HTTPService(oeRuntimeTest.tc.d.getVar('DEPLOY_DIR', True), oeRuntimeTest.tc.target.server_ip)
         self.repo_server.start()
 
     @classmethod
     def tearDownClass(self):
         self.repo_server.stop()
+        for i in self.repolist:
+            oeRuntimeTest.tc.target.run('smart channel -y --remove '+str(i))
 
     def test_smart_channel(self):
         self.smart('channel', 1)
@@ -71,6 +74,7 @@ class SmartRepoTest(SmartTest):
         for arch in os.listdir('%s/%s' % (self.repo_server.root_dir, image_pkgtype)):
             if arch in pkgarchs:
                 self.smart('channel -y --add {a} type=rpm-md baseurl={u}/{a}'.format(a=arch, u=deploy_url))
+                self.repolist.append(arch)
         self.smart('update')
 
     def test_smart_channel_help(self):
@@ -119,3 +123,47 @@ class SmartRepoTest(SmartTest):
     @skipUnlessPassed('test_smart_install')
     def test_smart_reinstall(self):
         self.smart('reinstall -y psplash-default')
+
+    @testcase(727)
+    @skipUnlessPassed('test_smart_channel_add')
+    def test_smart_remote_repo(self):
+        self.smart('update')
+        self.smart('install -y psplash')
+        self.smart('remove -y psplash')
+
+    @testcase(726)
+    def test_smart_local_dir(self):
+        self.target.run('mkdir /tmp/myrpmdir')
+        self.smart('channel --add myrpmdir type=rpm-dir path=/tmp/myrpmdir -y')
+        self.target.run('cd /tmp/myrpmdir')
+        self.smart('download psplash')
+        output = self.smart('channel --list')
+        for i in output.split("\n"):
+            if ("rpmsys" != str(i)) and ("myrpmdir" != str(i)):
+                self.smart('channel --disable '+str(i))
+        self.target.run('cd /home/root')
+        self.smart('install psplash')
+        for i in output.split("\n"):
+            if ("rpmsys" != str(i)) and ("myrpmdir" != str(i)):
+                self.smart('channel --enable '+str(i))
+        self.smart('channel --remove myrpmdir -y')
+        self.target.run("rm -rf /tmp/myrpmdir")
+
+    @testcase(718)
+    def test_smart_add_rpmdir(self):
+        self.target.run('mkdir /tmp/myrpmdir')
+        self.smart('channel --add myrpmdir type=rpm-dir path=/tmp/myrpmdir -y')
+        self.smart('channel --disable myrpmdir -y')
+        output = self.smart('channel --show myrpmdir')
+        self.assertTrue("disabled = yes" in output, msg="Failed to disable rpm dir")
+        self.smart('channel --enable  myrpmdir -y')
+        output = self.smart('channel --show myrpmdir')
+        self.assertFalse("disabled = yes" in output, msg="Failed to enable rpm dir")
+        self.smart('channel --remove myrpmdir -y')
+        self.target.run("rm -rf /tmp/myrpmdir")
+
+    @testcase(731)
+    @skipUnlessPassed('test_smart_channel_add')
+    def test_smart_remove_package(self):
+        self.smart('install -y psplash')
+        self.smart('remove -y psplash')
\ No newline at end of file



More information about the Openembedded-commits mailing list