def test_non_gplv3(self): data = 'INCOMPATIBLE_LICENSE = "GPLv3"' conf = os.path.join(self.builddir, 'conf/local.conf') ftools.append_file(conf ,data) result = bitbake('readline', ignore_status=True) self.assertEqual(result.status, 0) self.assertFalse(os.path.isfile(os.path.join(self.builddir, 'tmp/deploy/licenses/readline/generic_GPLv3'))) self.assertTrue(os.path.isfile(os.path.join(self.builddir, 'tmp/deploy/licenses/readline/generic_GPLv2'))) ftools.remove_from_file(conf ,data)
def remove_include(cls): if "#include added by oe-selftest.py" \ in ftools.read_file(os.path.join(cls.builddir, "conf/local.conf")): cls.logger.info("Removing the include from local.conf") ftools.remove_from_file(os.path.join(cls.builddir, "conf/local.conf"), \ "\n#include added by oe-selftest.py\ninclude machine.inc\ninclude selftest.inc") if "#include added by oe-selftest.py" \ in ftools.read_file(os.path.join(cls.builddir, "conf/bblayers.conf")): cls.logger.info("Removing the include from bblayers.conf") ftools.remove_from_file(os.path.join(cls.builddir, "conf/bblayers.conf"), \ "\n#include added by oe-selftest.py\ninclude bblayers.inc")
def test_non_gplv3(self): data = 'INCOMPATIBLE_LICENSE = "GPLv3"' conf = os.path.join(self.builddir, 'conf/local.conf') ftools.append_file(conf, data) result = bitbake('readline', ignore_status=True) self.assertEqual(result.status, 0) self.assertFalse( os.path.isfile( os.path.join(self.builddir, 'tmp/deploy/licenses/readline/generic_GPLv3'))) self.assertTrue( os.path.isfile( os.path.join(self.builddir, 'tmp/deploy/licenses/readline/generic_GPLv2'))) ftools.remove_from_file(conf, data)
def tearDownLocal(self): if self.layerappend: ftools.remove_from_file(self.builddir + "/conf/bblayers.conf", self.layerappend) super(LayerAppendTests, self).tearDownLocal()
def remove_bblayers_config(self, data): """Remove data from <builddir>/conf/bblayers.inc""" self.logger.debug("Removing from: %s\n%s\n" % (self.testinc_bblayers_path, data)) ftools.remove_from_file(self.testinc_bblayers_path, data)
def remove_recipeinc(self, recipe, data): """Remove data from meta-selftest/recipes-test/<recipe>/test_recipe.inc""" inc_file = self.recipeinc(recipe) self.logger.debug("Removing from: %s\n%s\n" % (inc_file, data)) ftools.remove_from_file(inc_file, data)
def remove_recipeinc(self, recipe, data): inc_file = os.path.join(self.testlayer_path, 'recipes-test', recipe, 'test_recipe.inc') self.log.debug("Removing from: %s\n%s\n" % (inc_file, data)) ftools.remove_from_file(inc_file, data)
def remove_config(self, data): self.log.debug("Removing from: %s\n\%s\n" % (self.testinc_path, data)) ftools.remove_from_file(self.testinc_path, data)
def tearDownLocal(self): ftools.remove_from_file(self.builddir + "/conf/bblayers.conf", self.layerappend.replace("COREBASE", self.builddir + "/.."))
def remove_recipeinc(self, recipe, data): """Remove data from meta-sefltest/recipes-test/<recipe>/test_recipe.inc""" inc_file = os.path.join(self.testlayer_path, 'recipes-test', recipe, 'test_recipe.inc') self.logger.debug("Removing from: %s\n%s\n" % (inc_file, data)) ftools.remove_from_file(inc_file, data)
def remove_bblayers_config(self, data): self.log.debug("Removing from: %s\n\%s\n" % (self.testinc_bblayers_path, data)) ftools.remove_from_file(self.testinc_bblayers_path, data)