from oeqa.selftest.case import OESelftestTestCase
from oeqa.utils.commands import bitbake, get_bb_vars, runCmd
+from oeqa.core.decorator.oeid import OETestID
# This test builds an image with using the "container" IMAGE_FSTYPE, and
# ensures that then files in the image are only the ones expected.
# Verify that when specifying a IMAGE_TYPEDEP_ of the form "foo.bar" that
# the conversion type bar gets added as a dep as well
+ @OETestID(1619)
def test_expected_files(self):
def get_each_path_part(path):
result = runCmd('devtool status')
self.assertNotIn('mdadm', result.output)
+ @OETestID(1620)
def test_devtool_buildclean(self):
def assertFile(path, *paths):
f = os.path.join(path, *paths)
('??', '.*/0001-Add-new-file.patch$')]
self._check_repo_status(os.path.dirname(recipefile), expected_status)
+ @OETestID(1627)
def test_devtool_update_recipe_local_files_3(self):
# First, modify the recipe
testrecipe = 'devtool-test-localonly'
expected_status = [(' M', '.*/%s/file2$' % testrecipe)]
self._check_repo_status(os.path.dirname(recipefile), expected_status)
+ @OETestID(1629)
def test_devtool_update_recipe_local_patch_gz(self):
# First, modify the recipe
testrecipe = 'devtool-test-patch-gz'
if 'gzip compressed data' not in result.output:
self.fail('New patch file is not gzipped - file reports:\n%s' % result.output)
+ @OETestID(1628)
def test_devtool_update_recipe_local_files_subdir(self):
# Try devtool extract on a recipe that has a file with subdir= set in
# SRC_URI such that it overwrites a file that was in an archive that
shutil.copy(srcfile, dstfile)
self.track_for_cleanup(dstfile)
+ @OETestID(1625)
def test_devtool_load_plugin(self):
"""Test that devtool loads only the first found plugin in BBPATH."""
self.assertExists(os.path.join(olddir, patchfn), 'Original patch file does not exist')
return recipe, oldrecipefile, recipedir, olddir, newversion, patchfn
+ @OETestID(1623)
def test_devtool_finish_upgrade_origlayer(self):
recipe, oldrecipefile, recipedir, olddir, newversion, patchfn = self._setup_test_devtool_finish_upgrade()
# Ensure the recipe is where we think it should be (so that cleanup doesn't trash things)
self.assertExists(os.path.join(newdir, patchfn), 'Patch file should have been copied into new directory but wasn\'t')
self.assertExists(os.path.join(newdir, '0002-Add-a-comment-to-the-code.patch'), 'New patch file should have been created but wasn\'t')
+ @OETestID(1624)
def test_devtool_finish_upgrade_otherlayer(self):
recipe, oldrecipefile, recipedir, olddir, newversion, patchfn = self._setup_test_devtool_finish_upgrade()
# Ensure the recipe is where we think it should be (so that cleanup doesn't trash things)
self.fail('Unable to find recipe files directory for %s' % recipe)
return recipe, oldrecipefile, recipedir, filesdir
+ @OETestID(1621)
def test_devtool_finish_modify_origlayer(self):
recipe, oldrecipefile, recipedir, filesdir = self._setup_test_devtool_finish_modify()
# Ensure the recipe is where we think it should be (so that cleanup doesn't trash things)
('??', '.*/.*-Add-a-comment-to-the-code.patch$')]
self._check_repo_status(recipedir, expected_status)
+ @OETestID(1622)
def test_devtool_finish_modify_otherlayer(self):
recipe, oldrecipefile, recipedir, filesdir = self._setup_test_devtool_finish_modify()
# Ensure the recipe is where we think it should be (so that cleanup doesn't trash things)
if files:
self.fail('Unexpected file(s) copied next to bbappend: %s' % ', '.join(files))
+ @OETestID(1626)
def test_devtool_rename(self):
# Check preconditions
self.assertTrue(not os.path.exists(self.workspacedir), 'This test cannot be run with a workspace directory under the build directory')
from oeqa.selftest.case import OESelftestTestCase
from oeqa.utils.commands import bitbake
+from oeqa.core.decorator.oeid import OETestID
class ImageTypeDepTests(OESelftestTestCase):
# Verify that when specifying a IMAGE_TYPEDEP_ of the form "foo.bar" that
# the conversion type bar gets added as a dep as well
+ @OETestID(1633)
def test_conversion_typedep_added(self):
self.write_recipeinc('emptytest', """
# Build a core-image-weston
bitbake('core-image-weston')
+ @OETestID(1497)
def test_bmap(self):
"""
Summary: Check bmap support
from oeqa.selftest.case import OESelftestTestCase
+from oeqa.core.decorator.oeid import OETestID
from oeqa.utils.commands import get_bb_var, get_bb_vars, bitbake, runCmd
import oe.path
import os
super(LibOE, cls).setUpClass()
cls.tmp_dir = get_bb_var('TMPDIR')
+ @OETestID(1635)
def test_copy_tree_special(self):
"""
Summary: oe.path.copytree() should copy files with special character
oe.path.remove(testloc)
+ @OETestID(1636)
def test_copy_tree_xattr(self):
"""
Summary: oe.path.copytree() should preserve xattr on copied files
oe.path.remove(testloc)
+ @OETestID(1634)
def test_copy_hardlink_tree_count(self):
"""
Summary: oe.path.copyhardlinktree() shouldn't miss out files
from oeqa.selftest.case import OESelftestTestCase
import tempfile
from oeqa.utils.commands import get_bb_var
+from oeqa.core.decorator.oeid import OETestID
class TestBlobParsing(OESelftestTestCase):
self.repo.git.add("--all")
self.repo.git.commit(message=msg)
+ @OETestID(1859)
def test_blob_to_dict(self):
"""
Test convertion of git blobs to dictionary
self.assertEqual(valuesmap, blob_to_dict(blob),
"commit was not translated correctly to dictionary")
+ @OETestID(1860)
def test_compare_dict_blobs(self):
"""
Test comparisson of dictionaries extracted from git blobs
var_changes = { x.fieldname : (x.oldvalue, x.newvalue) for x in change_records}
self.assertEqual(changesmap, var_changes, "Changes not reported correctly")
+ @OETestID(1861)
def test_compare_dict_blobs_default(self):
"""
Test default values for comparisson of git blob dictionaries
from oeqa.selftest.case import OESelftestTestCase
+from oeqa.core.decorator.oeid import OETestID
from oeqa.utils.commands import bitbake, get_bb_vars
import subprocess, os
import oe.path
self.bindir = type(self).bindir
self.libdir = type(self).libdir
+ @OETestID(1880)
def test_dpkg(self):
for ver1, ver2, sort in self.tests:
op = { -1: "<<", 0: "=", 1: ">>" }[sort]
status = subprocess.call((oe.path.join(self.bindir, "dpkg"), "--compare-versions", ver1, op, ver2))
self.assertNotEqual(status, 0, "%s %s %s failed" % (ver1, op, ver2))
+ @OETestID(1881)
def test_opkg(self):
for ver1, ver2, sort in self.tests:
op = { -1: "<<", 0: "=", 1: ">>" }[sort]
status = subprocess.call((oe.path.join(self.bindir, "opkg"), "compare-versions", ver1, op, ver2))
self.assertNotEqual(status, 0, "%s %s %s failed" % (ver1, op, ver2))
+ @OETestID(1882)
def test_rpm(self):
# Need to tell the Python bindings where to find its configuration
env = os.environ.copy()
inherits = ['cmake', 'python-dir', 'gettext', 'pkgconfig']
self._test_recipe_contents(recipefile, checkvars, inherits)
+ @OETestID(1638)
def test_recipetool_create_github(self):
# Basic test to see if github URL mangling works
temprecipe = os.path.join(self.tempdir, 'recipe')
inherits = ['setuptools']
self._test_recipe_contents(recipefile, checkvars, inherits)
+ @OETestID(1639)
def test_recipetool_create_github_tarball(self):
# Basic test to ensure github URL mangling doesn't apply to release tarballs
temprecipe = os.path.join(self.tempdir, 'recipe')
inherits = ['setuptools']
self._test_recipe_contents(recipefile, checkvars, inherits)
+ @OETestID(1637)
def test_recipetool_create_git_http(self):
# Basic test to check http git URL mangling works
temprecipe = os.path.join(self.tempdir, 'recipe')
shutil.copy(srcfile, dstfile)
self.track_for_cleanup(dstfile)
+ @OETestID(1640)
def test_recipetool_load_plugin(self):
"""Test that recipetool loads only the first found plugin in BBPATH."""
runCmd("rm -rf /tmp/sdk")
super(TestExport, cls).tearDownClass()
+ @OETestID(1499)
def test_testexport_basic(self):
"""
Summary: Check basic testexport functionality with only ping test enabled.
# Verify ping test was succesful
self.assertEqual(0, result.status, 'oe-test runtime returned a non 0 status')
+ @OETestID(1641)
def test_testexport_sdk(self):
"""
Summary: Check sdk functionality for testexport.
class TestImage(OESelftestTestCase):
+ @OETestID(1644)
def test_testimage_install(self):
"""
Summary: Check install packages functionality for testimage/testexport.
bitbake('core-image-full-cmdline socat')
bitbake('-c testimage core-image-full-cmdline')
+ @OETestID(1883)
def test_testimage_dnf(self):
"""
Summary: Check package feeds functionality for dnf
"""
self.sstate_allarch_samesigs(configA, configB)
+ @OETestID(1645)
def test_sstate_allarch_samesigs_multilib(self):
"""
The sstate checksums of allarch multilib packages should be independent of whichever
self.assertCountEqual(files1, files2)
+ @OETestID(1498)
def test_sstate_noop_samesigs(self):
"""
The sstate checksums of two builds with these variables changed or
value = tinfoil.run_command('getVariable', 'TESTVAR')
self.assertEqual(value, 'specialvalue', 'Value set using config_data.setVar() is not reflected in config_data.getVar()')
+ @OETestID(1884)
def test_datastore_operations(self):
with bb.tinfoil.Tinfoil() as tinfoil:
tinfoil.prepare(config_only=True)
"-D -o %s" % self.resultdir).status)
self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
+ @OETestID(1658)
def test_debug_long(self):
"""Test --debug option"""
self.assertEqual(0, runCmd("wic create wictestdisk "
"-s -o %s" % self.resultdir).status)
self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
+ @OETestID(1671)
def test_skip_build_check_long(self):
"""Test --skip-build-check option"""
self.assertEqual(0, runCmd("wic create wictestdisk "
"-f -o %s" % self.resultdir).status)
self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*.direct")))
+ @OETestID(1656)
def test_build_rootfs_long(self):
"""Test --build-rootfs option"""
self.assertEqual(0, runCmd("wic create wictestdisk "
self.assertEqual(0, status)
self.assertEqual(1, len(glob(self.resultdir + "%(wks)s-*.direct" % bbvars)))
+ @OETestID(1661)
def test_exclude_path(self):
"""Test --exclude-path wks option."""
finally:
os.environ['PATH'] = oldpath
+ @OETestID(1662)
def test_exclude_path_errors(self):
"""Test --exclude-path wks option error handling."""
wks_file = 'temp.wks'
self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct")))
self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct.bmap")))
+ @OETestID(1655)
def test_bmap_long(self):
"""Test generation of .bmap file --bmap option"""
cmd = "wic create wictestdisk -e core-image-minimal --bmap -o %s" % self.resultdir
% (image, imgenvdir, self.resultdir)).status)
self.assertEqual(1, len(glob(self.resultdir + "wictestdisk-*direct")))
+ @OETestID(1665)
def test_image_vars_dir_long(self):
"""Test image vars directory selection --vars option"""
image = 'core-image-minimal'
self.assertEqual(output, '/dev/root /\r\n/dev/sda3 /mnt')
@only_for_arch(['i586', 'i686', 'x86_64'])
+ @OETestID(1852)
def test_qemu_efi(self):
"""Test core-image-minimal efi image under qemu"""
config = 'IMAGE_FSTYPES = "wic"\nWKS_FILE = "mkefidisk.wks"\n'
return wkspath, wksname
+ @OETestID(1847)
def test_fixed_size(self):
"""
Test creation of a simple image with partition size controlled through
self.assertEqual(1, len(partlns))
self.assertEqual("1:0.00MiB:200MiB:200MiB:ext4::;", partlns[0])
+ @OETestID(1848)
def test_fixed_size_error(self):
"""
Test creation of a simple image with partition size controlled through
self.assertEqual(0, len(wicout))
@only_for_arch(['i586', 'i686', 'x86_64'])
+ @OETestID(1854)
def test_rawcopy_plugin_qemu(self):
"""Test rawcopy plugin in qemu"""
# build ext4 and wic images
self.assertEqual(1, status, 'Failed to run command "%s": %s' % (cmd, output))
self.assertEqual(output, '2')
+ @OETestID(1853)
def test_rawcopy_plugin(self):
"""Test rawcopy plugin"""
img = 'core-image-minimal'
out = glob(self.resultdir + "%s-*direct" % wksname)
self.assertEqual(1, len(out))
+ @OETestID(1849)
def test_fs_types(self):
"""Test filesystem types for empty and not empty partitions"""
img = 'core-image-minimal'
out = glob(self.resultdir + "%s-*direct" % wksname)
self.assertEqual(1, len(out))
+ @OETestID(1851)
def test_kickstart_parser(self):
"""Test wks parser options"""
with NamedTemporaryFile("w", suffix=".wks") as wks:
out = glob(self.resultdir + "%s-*direct" % wksname)
self.assertEqual(1, len(out))
+ @OETestID(1850)
def test_image_bootpart_globbed(self):
"""Test globbed sources with image-bootpart plugin"""
img = "core-image-minimal"
self.remove_config(config)
self.assertEqual(1, len(glob(self.resultdir + "sdimage-bootpart-*direct")))
+ @OETestID(1855)
def test_sparse_copy(self):
"""Test sparse_copy with FIEMAP and SEEK_HOLE filemap APIs"""
libpath = os.path.join(get_bb_var('COREBASE'), 'scripts', 'lib', 'wic')
self.assertEqual(dest_stat.st_blocks, 8)
os.unlink(dest)
+ @OETestID(1857)
def test_wic_ls(self):
"""Test listing image content using 'wic ls'"""
self.assertEqual(0, runCmd("wic create wictestdisk "
self.assertEqual(0, result.status)
self.assertEqual(6, len(result.output.split('\n')))
+ @OETestID(1856)
def test_wic_cp(self):
"""Test copy files and directories to the the wic image."""
self.assertEqual(0, runCmd("wic create wictestdisk "
self.assertEqual(8, len(result.output.split('\n')))
self.assertTrue(os.path.basename(testdir) in result.output)
+ @OETestID(1858)
def test_wic_rm(self):
"""Test removing files and directories from the the wic image."""
self.assertEqual(0, runCmd("wic create mkefidisk "