diff options
Diffstat (limited to 'meta/lib/oeqa/selftest/oescripts.py')
| -rw-r--r-- | meta/lib/oeqa/selftest/oescripts.py | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/meta/lib/oeqa/selftest/oescripts.py b/meta/lib/oeqa/selftest/oescripts.py index c2e2b45fba..29547f56a9 100644 --- a/meta/lib/oeqa/selftest/oescripts.py +++ b/meta/lib/oeqa/selftest/oescripts.py | |||
| @@ -10,33 +10,6 @@ from oeqa.selftest.buildhistory import BuildhistoryBase | |||
| 10 | from oeqa.utils.commands import Command, runCmd, bitbake, get_bb_var, get_test_layer | 10 | from oeqa.utils.commands import Command, runCmd, bitbake, get_bb_var, get_test_layer |
| 11 | from oeqa.utils.decorators import testcase | 11 | from oeqa.utils.decorators import testcase |
| 12 | 12 | ||
| 13 | class TestScripts(oeSelfTest): | ||
| 14 | |||
| 15 | @testcase(300) | ||
| 16 | def test_cleanup_workdir(self): | ||
| 17 | path = os.path.dirname(get_bb_var('WORKDIR', 'selftest-ed')) | ||
| 18 | old_version_recipe = os.path.join(get_bb_var('COREBASE'), 'meta-selftest/recipes-test/selftest-ed/selftest-ed_0.5.bb') | ||
| 19 | old_version = '0.5' | ||
| 20 | bitbake("-c clean selftest-ed") | ||
| 21 | bitbake("-c clean -b %s" % old_version_recipe) | ||
| 22 | |||
| 23 | if os.path.exists(path): | ||
| 24 | initial_contents = os.listdir(path) | ||
| 25 | else: | ||
| 26 | initial_contents = [] | ||
| 27 | |||
| 28 | bitbake('selftest-ed') | ||
| 29 | intermediary_contents = os.listdir(path) | ||
| 30 | bitbake("-b %s" % old_version_recipe) | ||
| 31 | runCmd('cleanup-workdir') | ||
| 32 | remaining_contents = os.listdir(path) | ||
| 33 | |||
| 34 | expected_contents = [x for x in intermediary_contents if x not in initial_contents] | ||
| 35 | remaining_not_expected = [x for x in remaining_contents if x not in expected_contents] | ||
| 36 | self.assertFalse(remaining_not_expected, msg="Not all necessary content has been deleted from %s: %s" % (path, ', '.join(map(str, remaining_not_expected)))) | ||
| 37 | expected_not_remaining = [x for x in expected_contents if x not in remaining_contents] | ||
| 38 | self.assertFalse(expected_not_remaining, msg="The script removed extra contents from %s: %s" % (path, ', '.join(map(str, expected_not_remaining)))) | ||
| 39 | |||
| 40 | class BuildhistoryDiffTests(BuildhistoryBase): | 13 | class BuildhistoryDiffTests(BuildhistoryBase): |
| 41 | 14 | ||
| 42 | @testcase(295) | 15 | @testcase(295) |
