diff options
| author | Paul Eggleton <paul.eggleton@linux.intel.com> | 2015-05-07 14:52:25 +0100 |
|---|---|---|
| committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-06-28 09:44:15 +0100 |
| commit | d7f6451ad143a5af5fbb88975baa31418a121656 (patch) | |
| tree | 4c785b621e6c9dffc7b28b39653c7d1ff2ef0665 /meta/lib/oeqa/selftest | |
| parent | 520c455b83159bf9d6159f2667c8e601890dc9b6 (diff) | |
| download | poky-d7f6451ad143a5af5fbb88975baa31418a121656.tar.gz | |
oe-selftest: devtool: add a proper test to see if tap devices exist
Check up front in test_devtool_deploy_target whether the tap devices
exist and skip if not. If we don't do this we get a significantly less
comprehensible error via pexpect.
(From OE-Core master rev: 2258345e19efff7717fe19a5026ec55f1b6f90b6)
(From OE-Core rev: cdad3ea375590f6fa9330f481b6712681ad00cd2)
Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib/oeqa/selftest')
| -rw-r--r-- | meta/lib/oeqa/selftest/devtool.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/meta/lib/oeqa/selftest/devtool.py b/meta/lib/oeqa/selftest/devtool.py index c1988371ef..9010cb1588 100644 --- a/meta/lib/oeqa/selftest/devtool.py +++ b/meta/lib/oeqa/selftest/devtool.py | |||
| @@ -483,6 +483,16 @@ class DevtoolTests(oeSelfTest): | |||
| 483 | self.skipTest('This test only works with qemu machines') | 483 | self.skipTest('This test only works with qemu machines') |
| 484 | if not os.path.exists('/etc/runqemu-nosudo'): | 484 | if not os.path.exists('/etc/runqemu-nosudo'): |
| 485 | self.skipTest('You must set up tap devices with scripts/runqemu-gen-tapdevs before running this test') | 485 | self.skipTest('You must set up tap devices with scripts/runqemu-gen-tapdevs before running this test') |
| 486 | result = runCmd('PATH="$PATH:/sbin:/usr/sbin" ip tuntap show', ignore_status=True) | ||
| 487 | if result.status != 0: | ||
| 488 | result = runCmd('PATH="$PATH:/sbin:/usr/sbin" ifconfig -a', ignore_status=True) | ||
| 489 | if result.status != 0: | ||
| 490 | self.skipTest('Failed to determine if tap devices exist with ifconfig or ip: %s' % result.output) | ||
| 491 | for line in result.output.splitlines(): | ||
| 492 | if line.startswith('tap'): | ||
| 493 | break | ||
| 494 | else: | ||
| 495 | self.skipTest('No tap devices found - you must set up tap devices with scripts/runqemu-gen-tapdevs before running this test') | ||
| 486 | workspacedir = os.path.join(self.builddir, 'workspace') | 496 | workspacedir = os.path.join(self.builddir, 'workspace') |
| 487 | self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory') | 497 | self.assertTrue(not os.path.exists(workspacedir), 'This test cannot be run with a workspace directory under the build directory') |
| 488 | import pexpect | 498 | import pexpect |
