• Home
  • Raw
  • Download

Lines Matching +full:pkg +full:- +full:config +full:- +full:meta

2 # Use of this source code is governed by a BSD-style license that can be
4 """Common methods and variables used by Cr-Fuchsia testing infrastructure."""
22 def _find_src_root() -> str:
32 # have folders like third_party/fuchsia-sdk in it.
36 def _find_fuchsia_images_root() -> str:
40 return os.path.join(DIR_SRC_ROOT, 'third_party', 'fuchsia-sdk', 'images')
48 def _find_fuchsia_sdk_root() -> str:
52 return os.path.join(DIR_SRC_ROOT, 'third_party', 'fuchsia-sdk', 'sdk')
61 def set_ffx_isolate_dir(isolate_dir: str) -> None:
71 version_file = os.path.join(SDK_ROOT, 'meta', 'manifest.json')
150 """Scans |output| for a self-repair command to run and, if found, runs it.
156 # "Run `ffx doctor --restart-daemon` for further diagnostics."
174 """Starts the ffx daemon by using doctor --restart-daemon since daemon start
177 Note, doctor --restart-daemon usually fails since the timeout in ffx is
180 Also, doctor --restart-daemon always restarts the daemon, so this function
185 run_ffx_command(cmd=('doctor', '--restart-daemon'), check=False)
191 run_ffx_command(cmd=('daemon', 'stop', '-t', '10000'))
199 **kwargs) -> subprocess.CompletedProcess:
202 If `ffx` exits with a non-zero exit code, the output is scanned for a
203 recommended repair command (e.g., "Run `ffx doctor --restart-daemon` for
217 check: If True, CalledProcessError is raised if ffx returns a non-zero
228 # - Repair does not need to be suppressed
229 # - capture_output is Truthy
271 encoding: Optional[str] = 'utf-8',
272 **kwargs) -> subprocess.Popen:
289 ffx_cmd.extend(('--machine', 'json'))
291 ffx_cmd.extend(('--target', target_id))
293 for config in configs:
294 ffx_cmd.extend(('--config', config))
300 def read_package_paths(out_dir: str, pkg_name: str) -> List[str]:
307 f'{pkg_name}.meta')) as meta_file:
315 def register_common_args(parser: ArgumentParser) -> None:
319 '--out-dir',
320 '-C',
325 def register_device_args(parser: ArgumentParser) -> None:
328 device_args.add_argument('--target-id',
331 'a node-name (e.g. fuchsia-emulator) or an '
338 def register_log_args(parser: ArgumentParser) -> None:
342 log_args.add_argument('--logs-dir',
347 def get_component_uri(package: str) -> str:
350 if package.startswith('fuchsia-pkg://'):
352 return f'fuchsia-pkg://{REPO_ALIAS}/{package}#meta/{package}.cm'
355 def resolve_packages(packages: List[str], target_id: Optional[str]) -> None:
359 subprocess.run(ssh_prefix + ['--', 'pkgctl', 'gc'], check=False)
363 **kwargs) -> Optional[subprocess.CompletedProcess]:
367 if i == retries - 1:
378 '--', 'pkgctl', 'resolve',
379 'fuchsia-pkg://%s/%s' % (REPO_ALIAS, package)
384 def get_ssh_address(target_id: Optional[str]) -> str:
386 return run_ffx_command(cmd=('target', 'get-ssh-address'),
391 def find_in_dir(target_name: str, parent_dir: str) -> Optional[str]:
410 def find_image_in_sdk(product_name: str) -> Optional[str]:
426 def catch_sigterm() -> None:
434 def wait_for_sigterm(extra_msg: str = '') -> None:
436 Spin-wait for either ctrl+c or sigterm. Caller can use try-finally
448 logging.info('Ctrl-C received; %s', extra_msg)
453 def get_system_info(target: Optional[str] = None) -> Tuple[str, str]:
460 info_cmd = run_ffx_command(cmd=('target', 'show', '--json'),