diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2019-01-10 15:49:49 +0800 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2019-01-11 10:38:21 +0000 |
commit | e219fe5329599cd6c3682f521eaee3852a2c8980 (patch) | |
tree | 89d28769fdb0518fd0e85c6a3ed1891f58a54361 /meta/lib | |
parent | 475a5d9ec21a329be973691734f9e8bcb332338c (diff) | |
download | openembedded-core-contrib-e219fe5329599cd6c3682f521eaee3852a2c8980.tar.gz |
oeqa: make it work for multiple users
There are failures when multiple users run oe-selftest on the same
host:
PermissionError: [Errno 13] Permission denied: '/tmp/oe-saved-
tests/201812250324_qemu'
This is because /tmp/oe-saved-tests was created by user A, while user B tries
to write data in it, then the error will happen. This patch can fix the
problem.
Move the dumped data to ${LOG_DIR}/runtime-hostdump/ rather than
/tmp/oe-saved-tests/ to fix the problem.
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/lib')
-rw-r--r-- | meta/lib/oeqa/runtime/context.py | 5 | ||||
-rw-r--r-- | meta/lib/oeqa/targetcontrol.py | 2 | ||||
-rw-r--r-- | meta/lib/oeqa/utils/dump.py | 2 |
3 files changed, 4 insertions, 5 deletions
diff --git a/meta/lib/oeqa/runtime/context.py b/meta/lib/oeqa/runtime/context.py index 943e29b0d99..db0482d68d6 100644 --- a/meta/lib/oeqa/runtime/context.py +++ b/meta/lib/oeqa/runtime/context.py @@ -49,7 +49,6 @@ class OERuntimeTestContextExecutor(OETestContextExecutor): default_manifest = 'data/manifest' default_server_ip = '192.168.7.1' default_target_ip = '192.168.7.2' - default_host_dumper_dir = '/tmp/oe-saved-tests' default_extract_dir = 'packages/extracted' def register_commands(self, logger, subparsers): @@ -71,9 +70,7 @@ class OERuntimeTestContextExecutor(OETestContextExecutor): % self.default_server_ip) runtime_group.add_argument('--host-dumper-dir', action='store', - default=self.default_host_dumper_dir, - help="Directory where host status is dumped, if tests fails, default: %s" \ - % self.default_host_dumper_dir) + help="Directory where host status is dumped, if tests fails") runtime_group.add_argument('--packages-manifest', action='store', default=self.default_manifest, diff --git a/meta/lib/oeqa/targetcontrol.py b/meta/lib/oeqa/targetcontrol.py index 97d67adbde3..1868ad32066 100644 --- a/meta/lib/oeqa/targetcontrol.py +++ b/meta/lib/oeqa/targetcontrol.py @@ -107,6 +107,8 @@ class QemuTarget(BaseTarget): dump_target_cmds = d.getVar("testimage_dump_target") dump_host_cmds = d.getVar("testimage_dump_host") dump_dir = d.getVar("TESTIMAGE_DUMP_DIR") + if not dump_dir: + dump_dir = os.path.join(d.getVar('LOG_DIR'), 'runtime-hostdump') use_kvm = oe.types.qemu_use_kvm(d.getVar('QEMU_USE_KVM'), d.getVar('TARGET_ARCH')) # Log QemuRunner log output to a file diff --git a/meta/lib/oeqa/utils/dump.py b/meta/lib/oeqa/utils/dump.py index 5a7edc1a863..79c22b75c4d 100644 --- a/meta/lib/oeqa/utils/dump.py +++ b/meta/lib/oeqa/utils/dump.py @@ -12,7 +12,7 @@ class BaseDumper(object): self.cmds = [] # Some testing doesn't inherit testimage, so it is needed # to set some defaults. - self.parent_dir = parent_dir or "/tmp/oe-saved-tests" + self.parent_dir = parent_dir dft_cmds = """ top -bn1 iostat -x -z -N -d -p ALL 20 2 ps -ef |