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:39:09 +0000 |
commit | c856ed29dfd84ada1da9c403f53593b4ed653f6b (patch) | |
tree | 59f8c95ba4565e598ccda0d60bb6f5251cd85464 /meta | |
parent | c5f7615505b2a51125932065014edbf272bd6798 (diff) | |
download | poky-c856ed29dfd84ada1da9c403f53593b4ed653f6b.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.
(From OE-Core rev: e219fe5329599cd6c3682f521eaee3852a2c8980)
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/testimage.bbclass | 3 | ||||
-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 |
4 files changed, 6 insertions, 6 deletions
diff --git a/meta/classes/testimage.bbclass b/meta/classes/testimage.bbclass index 73cd375dcb..cb8c12acce 100644 --- a/meta/classes/testimage.bbclass +++ b/meta/classes/testimage.bbclass | |||
@@ -77,7 +77,7 @@ TESTIMAGEDEPENDS += "${@bb.utils.contains('IMAGE_PKGTYPE', 'deb', 'apt-native:do | |||
77 | TESTIMAGELOCK = "${TMPDIR}/testimage.lock" | 77 | TESTIMAGELOCK = "${TMPDIR}/testimage.lock" |
78 | TESTIMAGELOCK_qemuall = "" | 78 | TESTIMAGELOCK_qemuall = "" |
79 | 79 | ||
80 | TESTIMAGE_DUMP_DIR ?= "/tmp/oe-saved-tests/" | 80 | TESTIMAGE_DUMP_DIR ?= "${LOG_DIR}/runtime-hostdump/" |
81 | 81 | ||
82 | TESTIMAGE_UPDATE_VARS ?= "DL_DIR WORKDIR DEPLOY_DIR" | 82 | TESTIMAGE_UPDATE_VARS ?= "DL_DIR WORKDIR DEPLOY_DIR" |
83 | 83 | ||
@@ -249,6 +249,7 @@ def testimage_main(d): | |||
249 | 'bootlog' : bootlog, | 249 | 'bootlog' : bootlog, |
250 | 'kvm' : kvm, | 250 | 'kvm' : kvm, |
251 | 'slirp' : slirp, | 251 | 'slirp' : slirp, |
252 | 'dump_dir' : d.getVar("TESTIMAGE_DUMP_DIR"), | ||
252 | } | 253 | } |
253 | 254 | ||
254 | # TODO: Currently BBPATH is needed for custom loading of targets. | 255 | # TODO: Currently BBPATH is needed for custom loading of targets. |
diff --git a/meta/lib/oeqa/runtime/context.py b/meta/lib/oeqa/runtime/context.py index 943e29b0d9..db0482d68d 100644 --- a/meta/lib/oeqa/runtime/context.py +++ b/meta/lib/oeqa/runtime/context.py | |||
@@ -49,7 +49,6 @@ class OERuntimeTestContextExecutor(OETestContextExecutor): | |||
49 | default_manifest = 'data/manifest' | 49 | default_manifest = 'data/manifest' |
50 | default_server_ip = '192.168.7.1' | 50 | default_server_ip = '192.168.7.1' |
51 | default_target_ip = '192.168.7.2' | 51 | default_target_ip = '192.168.7.2' |
52 | default_host_dumper_dir = '/tmp/oe-saved-tests' | ||
53 | default_extract_dir = 'packages/extracted' | 52 | default_extract_dir = 'packages/extracted' |
54 | 53 | ||
55 | def register_commands(self, logger, subparsers): | 54 | def register_commands(self, logger, subparsers): |
@@ -71,9 +70,7 @@ class OERuntimeTestContextExecutor(OETestContextExecutor): | |||
71 | % self.default_server_ip) | 70 | % self.default_server_ip) |
72 | 71 | ||
73 | runtime_group.add_argument('--host-dumper-dir', action='store', | 72 | runtime_group.add_argument('--host-dumper-dir', action='store', |
74 | default=self.default_host_dumper_dir, | 73 | help="Directory where host status is dumped, if tests fails") |
75 | help="Directory where host status is dumped, if tests fails, default: %s" \ | ||
76 | % self.default_host_dumper_dir) | ||
77 | 74 | ||
78 | runtime_group.add_argument('--packages-manifest', action='store', | 75 | runtime_group.add_argument('--packages-manifest', action='store', |
79 | default=self.default_manifest, | 76 | default=self.default_manifest, |
diff --git a/meta/lib/oeqa/targetcontrol.py b/meta/lib/oeqa/targetcontrol.py index 97d67adbde..1868ad3206 100644 --- a/meta/lib/oeqa/targetcontrol.py +++ b/meta/lib/oeqa/targetcontrol.py | |||
@@ -107,6 +107,8 @@ class QemuTarget(BaseTarget): | |||
107 | dump_target_cmds = d.getVar("testimage_dump_target") | 107 | dump_target_cmds = d.getVar("testimage_dump_target") |
108 | dump_host_cmds = d.getVar("testimage_dump_host") | 108 | dump_host_cmds = d.getVar("testimage_dump_host") |
109 | dump_dir = d.getVar("TESTIMAGE_DUMP_DIR") | 109 | dump_dir = d.getVar("TESTIMAGE_DUMP_DIR") |
110 | if not dump_dir: | ||
111 | dump_dir = os.path.join(d.getVar('LOG_DIR'), 'runtime-hostdump') | ||
110 | use_kvm = oe.types.qemu_use_kvm(d.getVar('QEMU_USE_KVM'), d.getVar('TARGET_ARCH')) | 112 | use_kvm = oe.types.qemu_use_kvm(d.getVar('QEMU_USE_KVM'), d.getVar('TARGET_ARCH')) |
111 | 113 | ||
112 | # Log QemuRunner log output to a file | 114 | # Log QemuRunner log output to a file |
diff --git a/meta/lib/oeqa/utils/dump.py b/meta/lib/oeqa/utils/dump.py index 5a7edc1a86..79c22b75c4 100644 --- a/meta/lib/oeqa/utils/dump.py +++ b/meta/lib/oeqa/utils/dump.py | |||
@@ -12,7 +12,7 @@ class BaseDumper(object): | |||
12 | self.cmds = [] | 12 | self.cmds = [] |
13 | # Some testing doesn't inherit testimage, so it is needed | 13 | # Some testing doesn't inherit testimage, so it is needed |
14 | # to set some defaults. | 14 | # to set some defaults. |
15 | self.parent_dir = parent_dir or "/tmp/oe-saved-tests" | 15 | self.parent_dir = parent_dir |
16 | dft_cmds = """ top -bn1 | 16 | dft_cmds = """ top -bn1 |
17 | iostat -x -z -N -d -p ALL 20 2 | 17 | iostat -x -z -N -d -p ALL 20 2 |
18 | ps -ef | 18 | ps -ef |