]> code.ossystems Code Review - openembedded-core.git/commitdiff
oeqa/selftest/recipetool: Fix test_recipetool_create_simple
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 13 Mar 2016 18:12:31 +0000 (18:12 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Sun, 13 Mar 2016 18:15:41 +0000 (18:15 +0000)
Correctly handle the any other files/directories that may exist
during the test.

======================================================================
FAIL: test_recipetool_create_simple (oeqa.selftest.recipetool.RecipetoolTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/utils/decorators.py", line 106, in wrapped_f
    return func(*args, **kwargs)
  File "/home/pokybuild/yocto-autobuilder/yocto-worker/nightly-oe-selftest/build/meta/lib/oeqa/selftest/recipetool.py", line 414, in test_recipetool_create_simple
    self.fail('recipetool did not create recipe file; output:\n%s\ndirlist:\n%s' % (result.output, str(dirlist)))
AssertionError: recipetool did not create recipe file; output:
NOTE: Fetching http://www.dest-unreach.org/socat/download/socat-1.7.3.0.tar.bz2...
NOTE: Unpacking /srv/www/vhosts/autobuilder.yoctoproject.org/current_sources/socat-1.7.3.0.tar.bz2 to /tmp/recipetool-Uj7MIh/
NOTE: Recipe /tmp/recipetoolqaebTo9s/recipe/socat_1.7.3.0.bb has been created; further editing may be required to make it fully functional
dirlist:
['socat', 'socat_1.7.3.0.bb']

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
meta/lib/oeqa/selftest/recipetool.py

index 5b54ba60b4d2331ef6d9082b59ad027a6810ab54..72ee11087611c2fa23d5fa7c1ef76aeb05c92b51 100644 (file)
@@ -410,9 +410,9 @@ class RecipetoolTests(RecipetoolBase):
         srcuri = 'http://www.dest-unreach.org/socat/download/socat-%s.tar.bz2' % pv
         result = runCmd('recipetool create %s -o %s' % (srcuri, temprecipe))
         dirlist = os.listdir(temprecipe)
-        if len(dirlist) < 1 or not os.path.isfile(os.path.join(temprecipe, dirlist[0])):
+        if len(dirlist) < 1 or not os.path.isfile(os.path.join(temprecipe, 'socat_%s.bb' % pv)):
             self.fail('recipetool did not create recipe file; output:\n%s\ndirlist:\n%s' % (result.output, str(dirlist)))
-        self.assertEqual(dirlist[0], 'socat_%s.bb' % pv, 'Recipe file incorrectly named')
+        self.assertIn('socat_%s.bb' % pv, dirlist, 'Recipe file incorrectly named')
         checkvars = {}
         checkvars['LICENSE'] = set(['Unknown', 'GPLv2'])
         checkvars['LIC_FILES_CHKSUM'] = set(['file://COPYING.OpenSSL;md5=5c9bccc77f67a8328ef4ebaf468116f4', 'file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263'])