diff options
Diffstat (limited to 'meta/lib/oeqa/selftest/cases/devtool.py')
| -rw-r--r-- | meta/lib/oeqa/selftest/cases/devtool.py | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/meta/lib/oeqa/selftest/cases/devtool.py b/meta/lib/oeqa/selftest/cases/devtool.py index 0985434238..9efe342a0d 100644 --- a/meta/lib/oeqa/selftest/cases/devtool.py +++ b/meta/lib/oeqa/selftest/cases/devtool.py | |||
| @@ -8,6 +8,7 @@ import shutil | |||
| 8 | import tempfile | 8 | import tempfile |
| 9 | import glob | 9 | import glob |
| 10 | import fnmatch | 10 | import fnmatch |
| 11 | import unittest | ||
| 11 | 12 | ||
| 12 | import oeqa.utils.ftools as ftools | 13 | import oeqa.utils.ftools as ftools |
| 13 | from oeqa.selftest.case import OESelftestTestCase | 14 | from oeqa.selftest.case import OESelftestTestCase |
| @@ -38,6 +39,13 @@ def setUpModule(): | |||
| 38 | canonical_layerpath = os.path.realpath(canonical_layerpath) + '/' | 39 | canonical_layerpath = os.path.realpath(canonical_layerpath) + '/' |
| 39 | edited_layers.append(layerpath) | 40 | edited_layers.append(layerpath) |
| 40 | oldmetapath = os.path.realpath(layerpath) | 41 | oldmetapath = os.path.realpath(layerpath) |
| 42 | |||
| 43 | # when downloading poky from tar.gz some tests will be skipped (BUG 12389) | ||
| 44 | try: | ||
| 45 | runCmd('git rev-parse --is-inside-work-tree', cwd=canonical_layerpath) | ||
| 46 | except: | ||
| 47 | raise unittest.SkipTest("devtool tests require folder to be a git repo") | ||
| 48 | |||
| 41 | result = runCmd('git rev-parse --show-toplevel', cwd=canonical_layerpath) | 49 | result = runCmd('git rev-parse --show-toplevel', cwd=canonical_layerpath) |
| 42 | oldreporoot = result.output.rstrip() | 50 | oldreporoot = result.output.rstrip() |
| 43 | newmetapath = os.path.join(corecopydir, os.path.relpath(oldmetapath, oldreporoot)) | 51 | newmetapath = os.path.join(corecopydir, os.path.relpath(oldmetapath, oldreporoot)) |
| @@ -340,7 +348,7 @@ class DevtoolAddTests(DevtoolBase): | |||
| 340 | checkvars['LIC_FILES_CHKSUM'] = 'file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263' | 348 | checkvars['LIC_FILES_CHKSUM'] = 'file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263' |
| 341 | checkvars['S'] = '${WORKDIR}/git' | 349 | checkvars['S'] = '${WORKDIR}/git' |
| 342 | checkvars['PV'] = '0.1+git${SRCPV}' | 350 | checkvars['PV'] = '0.1+git${SRCPV}' |
| 343 | checkvars['SRC_URI'] = 'git://git.yoctoproject.org/git/dbus-wait;protocol=https' | 351 | checkvars['SRC_URI'] = 'git://git.yoctoproject.org/git/dbus-wait;protocol=https;branch=master' |
| 344 | checkvars['SRCREV'] = srcrev | 352 | checkvars['SRCREV'] = srcrev |
| 345 | checkvars['DEPENDS'] = set(['dbus']) | 353 | checkvars['DEPENDS'] = set(['dbus']) |
| 346 | self._test_recipe_contents(recipefile, checkvars, []) | 354 | self._test_recipe_contents(recipefile, checkvars, []) |
| @@ -442,6 +450,7 @@ class DevtoolAddTests(DevtoolBase): | |||
| 442 | tempdir = tempfile.mkdtemp(prefix='devtoolqa') | 450 | tempdir = tempfile.mkdtemp(prefix='devtoolqa') |
| 443 | self.track_for_cleanup(tempdir) | 451 | self.track_for_cleanup(tempdir) |
| 444 | url = 'gitsm://git.yoctoproject.org/mraa' | 452 | url = 'gitsm://git.yoctoproject.org/mraa' |
| 453 | url_branch = '%s;branch=master' % url | ||
| 445 | checkrev = 'ae127b19a50aa54255e4330ccfdd9a5d058e581d' | 454 | checkrev = 'ae127b19a50aa54255e4330ccfdd9a5d058e581d' |
| 446 | testrecipe = 'mraa' | 455 | testrecipe = 'mraa' |
| 447 | srcdir = os.path.join(tempdir, testrecipe) | 456 | srcdir = os.path.join(tempdir, testrecipe) |
| @@ -462,7 +471,7 @@ class DevtoolAddTests(DevtoolBase): | |||
| 462 | checkvars = {} | 471 | checkvars = {} |
| 463 | checkvars['S'] = '${WORKDIR}/git' | 472 | checkvars['S'] = '${WORKDIR}/git' |
| 464 | checkvars['PV'] = '1.0+git${SRCPV}' | 473 | checkvars['PV'] = '1.0+git${SRCPV}' |
| 465 | checkvars['SRC_URI'] = url | 474 | checkvars['SRC_URI'] = url_branch |
| 466 | checkvars['SRCREV'] = '${AUTOREV}' | 475 | checkvars['SRCREV'] = '${AUTOREV}' |
| 467 | self._test_recipe_contents(recipefile, checkvars, []) | 476 | self._test_recipe_contents(recipefile, checkvars, []) |
| 468 | # Try with revision and version specified | 477 | # Try with revision and version specified |
| @@ -481,7 +490,7 @@ class DevtoolAddTests(DevtoolBase): | |||
| 481 | checkvars = {} | 490 | checkvars = {} |
| 482 | checkvars['S'] = '${WORKDIR}/git' | 491 | checkvars['S'] = '${WORKDIR}/git' |
| 483 | checkvars['PV'] = '1.5+git${SRCPV}' | 492 | checkvars['PV'] = '1.5+git${SRCPV}' |
| 484 | checkvars['SRC_URI'] = url | 493 | checkvars['SRC_URI'] = url_branch |
| 485 | checkvars['SRCREV'] = checkrev | 494 | checkvars['SRCREV'] = checkrev |
| 486 | self._test_recipe_contents(recipefile, checkvars, []) | 495 | self._test_recipe_contents(recipefile, checkvars, []) |
| 487 | 496 | ||
| @@ -880,7 +889,7 @@ class DevtoolUpdateTests(DevtoolBase): | |||
| 880 | self._check_repo_status(os.path.dirname(recipefile), expected_status) | 889 | self._check_repo_status(os.path.dirname(recipefile), expected_status) |
| 881 | 890 | ||
| 882 | result = runCmd('git diff %s' % os.path.basename(recipefile), cwd=os.path.dirname(recipefile)) | 891 | result = runCmd('git diff %s' % os.path.basename(recipefile), cwd=os.path.dirname(recipefile)) |
| 883 | addlines = ['SRCREV = ".*"', 'SRC_URI = "git://git.infradead.org/mtd-utils.git"'] | 892 | addlines = ['SRCREV = ".*"', 'SRC_URI = "git://git.infradead.org/mtd-utils.git;branch=master"'] |
| 884 | srcurilines = src_uri.split() | 893 | srcurilines = src_uri.split() |
| 885 | srcurilines[0] = 'SRC_URI = "' + srcurilines[0] | 894 | srcurilines[0] = 'SRC_URI = "' + srcurilines[0] |
| 886 | srcurilines.append('"') | 895 | srcurilines.append('"') |
| @@ -1322,7 +1331,7 @@ class DevtoolExtractTests(DevtoolBase): | |||
| 1322 | # Now really test deploy-target | 1331 | # Now really test deploy-target |
| 1323 | result = runCmd('devtool deploy-target -c %s root@%s' % (testrecipe, qemu.ip)) | 1332 | result = runCmd('devtool deploy-target -c %s root@%s' % (testrecipe, qemu.ip)) |
| 1324 | # Run a test command to see if it was installed properly | 1333 | # Run a test command to see if it was installed properly |
| 1325 | sshargs = '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no' | 1334 | sshargs = '-o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o HostKeyAlgorithms=+ssh-rsa' |
| 1326 | result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand)) | 1335 | result = runCmd('ssh %s root@%s %s' % (sshargs, qemu.ip, testcommand)) |
| 1327 | # Check if it deployed all of the files with the right ownership/perms | 1336 | # Check if it deployed all of the files with the right ownership/perms |
| 1328 | # First look on the host - need to do this under pseudo to get the correct ownership/perms | 1337 | # First look on the host - need to do this under pseudo to get the correct ownership/perms |
