summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Stanacar <stefanx.stanacar@intel.com>2013-08-26 11:51:46 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-08-26 16:29:18 +0100
commit44c3f72684c5c920ce8af1da54a2268047342589 (patch)
treec901fd5401dbcf4ab96ca0eb93b9ae4ded16d499
parenta855180fe6f078b0afb0f5741074f8bdb5eb2e66 (diff)
downloadast2050-yocto-poky-44c3f72684c5c920ce8af1da54a2268047342589.zip
ast2050-yocto-poky-44c3f72684c5c920ce8af1da54a2268047342589.tar.gz
lib/oeqa/runtime: smart: add checks for smart output
Sometimes smart throws: Committing transaction... Preparing... ######################################## [ 0%] 1:Removing psplash-default ######################################## [100%] error: Couldn't fork %postun: Cannot allocate memory and returns a 0 exit code (it thinks it succesfully removed the package, when in reality it didn't), so we need to catch those specifically. Also, sometimes output from download command is: Saving cache...http://192.168.7.1:49456/rpm/x86_64_x32/psplash-default-0.1+git0+afd4e228c6-r15.x86_64_x32.rpm and that tricks our smart download test, so use a regex there. (From OE-Core rev: 2ac7783e04f5e8e6005f967e1a6dd65d2fc6a19a) Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/lib/oeqa/runtime/smart.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/meta/lib/oeqa/runtime/smart.py b/meta/lib/oeqa/runtime/smart.py
index 4ea2699..6e20f96 100644
--- a/meta/lib/oeqa/runtime/smart.py
+++ b/meta/lib/oeqa/runtime/smart.py
@@ -1,4 +1,5 @@
import unittest
+import re
from oeqa.oetest import oeRuntimeTest
from oeqa.utils.decorators import *
from oeqa.utils.httpserver import HTTPService
@@ -19,6 +20,7 @@ class SmartTest(oeRuntimeTest):
status, output = self.target.run(command)
message = os.linesep.join([command, output])
self.assertEqual(status, expected, message)
+ self.assertFalse("Cannot allocate memory" in output, message)
return output
class SmartBasicTest(SmartTest):
@@ -95,13 +97,11 @@ class SmartRepoTest(SmartTest):
@skipUnlessPassed('test_smart_channel_add')
def test_smart_install_from_http(self):
- url = 'http://'
output = self.smart('download --urls psplash-default')
- for line in output.splitlines():
- if line.startswith(url):
- url = line
+ url = re.search('(http://.*/psplash-default.*\.rpm)', output)
+ self.assertTrue(url, msg="Couln't find download url in %s" % output)
self.smart('remove -y psplash-default')
- self.smart('install -y %s' % url)
+ self.smart('install -y %s' % url.group(0))
@skipUnlessPassed('test_smart_install')
def test_smart_reinstall(self):
OpenPOWER on IntegriCloud