1
0
mirror of https://git.yoctoproject.org/poky synced 2026-05-30 12:29:55 +00:00

sanity.bbclass: pass the data object to the less frequent test harnesses

By passing the data object to the less frequently run test harnesses
(check_sanity_tmpdir_change(), check_sanity_sstate_dir_change() and
check_sanity_version_change()) we can run tests against BitBake data here
too.

(From OE-Core rev: 7df8376c28d991dd07c0915d3ccade4cf51c2fee)

Signed-off-by: Joshua Lock <josh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
Joshua Lock
2011-04-28 15:31:19 -07:00
committed by Richard Purdie
parent 49a9426ce3
commit 3e6746aa1d
+8 -8
View File
@@ -21,7 +21,7 @@ def check_conf_exists(fn, data):
return True return True
return False return False
def check_sanity_sstate_dir_change(sstate_dir): def check_sanity_sstate_dir_change(sstate_dir, data):
# Sanity checks to be done when the value of SSTATE_DIR changes # Sanity checks to be done when the value of SSTATE_DIR changes
# Check that SSTATE_DIR isn't on a filesystem with limited filename length (eg. eCryptFS) # Check that SSTATE_DIR isn't on a filesystem with limited filename length (eg. eCryptFS)
@@ -30,14 +30,14 @@ def check_sanity_sstate_dir_change(sstate_dir):
testmsg = check_create_long_filename(sstate_dir, "SSTATE_DIR") testmsg = check_create_long_filename(sstate_dir, "SSTATE_DIR")
return testmsg return testmsg
def check_sanity_tmpdir_change(tmpdir): def check_sanity_tmpdir_change(tmpdir, data):
# Sanity checks to be done when the value of TMPDIR changes # Sanity checks to be done when the value of TMPDIR changes
# Check that TMPDIR isn't on a filesystem with limited filename length (eg. eCryptFS) # Check that TMPDIR isn't on a filesystem with limited filename length (eg. eCryptFS)
testmsg = check_create_long_filename(tmpdir, "TMPDIR") testmsg = check_create_long_filename(tmpdir, "TMPDIR")
return testmsg return testmsg
def check_sanity_version_change(): def check_sanity_version_change(data):
# Sanity checks to be done when SANITY_VERSION changes # Sanity checks to be done when SANITY_VERSION changes
return "" return ""
@@ -266,14 +266,14 @@ def check_sanity(e):
sanity_version = int(data.getVar('SANITY_VERSION', e.data, True) or 1) sanity_version = int(data.getVar('SANITY_VERSION', e.data, True) or 1)
if last_sanity_version < sanity_version: if last_sanity_version < sanity_version:
messages = messages + check_sanity_version_change() messages = messages + check_sanity_version_change(e.data)
messages = messages + check_sanity_tmpdir_change(tmpdir) messages = messages + check_sanity_tmpdir_change(tmpdir, e.data)
messages = messages + check_sanity_sstate_dir_change(sstate_dir) messages = messages + check_sanity_sstate_dir_change(sstate_dir, e.data)
else: else:
if last_tmpdir != tmpdir: if last_tmpdir != tmpdir:
messages = messages + check_sanity_tmpdir_change(tmpdir) messages = messages + check_sanity_tmpdir_change(tmpdir, e.data)
if last_sstate_dir != sstate_dir: if last_sstate_dir != sstate_dir:
messages = messages + check_sanity_sstate_dir_change(sstate_dir) messages = messages + check_sanity_sstate_dir_change(sstate_dir, e.data)
if os.path.exists("conf"): if os.path.exists("conf"):
f = file(sanityverfile, 'w') f = file(sanityverfile, 'w')