[OE-core] [PATCH] lib/oeqa/selftest/buildoptions.py: added auto test for archiving the work directory and exporting the source files
Costin Constantin
costin.c.constantin at intel.com
Tue Jun 9 12:09:13 UTC 2015
Signed-off-by: Costin Constantin <costin.c.constantin at intel.com>
---
meta/lib/oeqa/selftest/buildoptions.py | 22 ++++++++++++++++++++--
1 file changed, 20 insertions(+), 2 deletions(-)
diff --git a/meta/lib/oeqa/selftest/buildoptions.py b/meta/lib/oeqa/selftest/buildoptions.py
index cddfa48..be75311 100644
--- a/meta/lib/oeqa/selftest/buildoptions.py
+++ b/meta/lib/oeqa/selftest/buildoptions.py
@@ -2,6 +2,8 @@ import unittest
import os
import logging
import re
+import glob as g
+import pexpect as p
from oeqa.selftest.base import oeSelfTest
from oeqa.selftest.buildhistory import BuildhistoryBase
@@ -9,6 +11,7 @@ from oeqa.utils.commands import runCmd, bitbake, get_bb_var
import oeqa.utils.ftools as ftools
from oeqa.utils.decorators import testcase
+
class ImageOptionsTests(oeSelfTest):
@testcase(761)
@@ -133,7 +136,7 @@ class BuildImagesTest(oeSelfTest):
self.remove_config("DISTRO_FEATURES_remove = \"x11\"\nDISTRO_FEATURES_append = \" directfb\"\nMACHINE ??= \"qemuarm\"")
self.assertEqual(self.res, 0, "\ncore-image-directfb failed to build. Please check logs for further details.\n")
- @testcase(283)
+ @testcase(283)
def test_btrfs(self):
"""
This method is used to test the build of an image with btrfs file system. After building it, qemu is launched
@@ -184,4 +187,19 @@ class ArchiverTest(oeSelfTest):
self.license_dir = self.builddir + "/tmp/deploy/licenses/"
for i in self.pkgs:
if os.path.isdir(self.license_dir + i):
- self.assertTrue(g.glob(self.license_dir + i + "/*GPL*"), "couldn't find GPL license in " + self.license_dir + i)
\ No newline at end of file
+ self.assertTrue(g.glob(self.license_dir + i + "/*GPL*"), "couldn't find GPL license in " + self.license_dir + i)
+
+ @testcase(926)
+ def test_arch_work_dir_and_export_source(self):
+ """
+ Test for archiving the work directory and exporting the source files.
+ """
+ self.add_command_to_tearDown('cleanup-workdir')
+ self.write_config("INHERIT += \"archiver\"\nARCHIVER_MODE[src] = \"original\"\nARCHIVER_MODE[srpm] = \"1\"")
+ self.res = bitbake("xcursor-transparent-theme").status
+ self.remove_config("INHERIT += \"archiver\"\nARCHIVER_MODE[src] = \"original\"\nARCHIVER_MODE[srpm] = \"1\"")
+ self.assertEqual(self.res, 0, "\nCouldn't build xcursor-transparent-theme.\n")
+ self.pkgs_path = g.glob(str(self.builddir) + "/tmp/deploy/sources/allarch*/xcurs*")
+ self.src_file_glob = str(self.pkgs_path[0]) + "/xcursor*.src.rpm"
+ self.tar_file_glob = str(self.pkgs_path[0]) + "/xcursor*.tar.gz"
+ self.assertTrue((g.glob(self.src_file_glob) and g.glob(self.tar_file_glob)), "Couldn't find .src.rpm and .tar.gz files under tmp/deploy/sources/allarch*/xcursor*")
\ No newline at end of file
--
2.1.4
More information about the Openembedded-core
mailing list