未验证 提交 4c479147 编写于 作者: B Beraldo Leal 提交者: GitHub

Merge pull request #4090 from richtja/vmimage_doc_v2

Vmimage automatic documentation [v2]
......@@ -21,6 +21,7 @@ docs/source/api/test
docs/source/api/utils
docs/source/api/plugins
docs/source/api/optional-plugins
docs/source/guides/writer/libs/data/vmimage
# This file should be generated with:
# avocado config reference > docs/source/config/reference.rst
......
......@@ -6,6 +6,8 @@ import importlib
import os
import sys
from avocado.core import parameters
from avocado.core.varianter import Varianter
from avocado.utils import genio # pylint: disable=C0413
from avocado.utils import path # pylint: disable=C0413
from avocado.utils import process # pylint: disable=C0413
......@@ -42,7 +44,40 @@ def generate_reference():
reference.write(result.stdout_text)
def generate_vmimage_distro():
yaml_path = [os.path.join(ROOT_PATH, 'selftests', 'pre_release', 'tests',
'vmimage.py.data', 'variants.yml')]
reference_dir_path = os.path.join(ROOT_PATH, 'docs', 'source', 'guides',
'writer', 'libs', 'data', 'vmimage')
reference_path = os.path.join(reference_dir_path, 'supported_images.csv')
config = {'yaml_to_mux.files': yaml_path, 'yaml_to_mux.inject': []}
varianter = Varianter()
varianter.parse(config)
try:
os.makedirs(reference_dir_path)
except FileExistsError:
pass
with open(reference_path, 'w') as reference:
reference.write("Provider, Version, Architecture\n")
for v in varianter.itertests():
vmimage_params = parameters.AvocadoParams(v['variant'], ['/run/*'])
vmimage_name = vmimage_params.get('name')
vmimage_version = vmimage_params.get('version')
vmimage_arch = vmimage_params.get('arch', path='*/architectures/*')
distro_arch_path = '/run/distro/%s/%s/*' % (vmimage_name,
vmimage_arch)
vmimage_arch = vmimage_params.get('arch', path=distro_arch_path,
default=vmimage_arch)
reference.write("%s,%s,%s\n" % (str(vmimage_name),
str(vmimage_version),
str(vmimage_arch)))
generate_reference()
generate_vmimage_distro()
# Documentation sections. Key is the name of the section, followed by:
# Second level module name (after avocado), Module description,
......
......@@ -102,3 +102,14 @@ with::
def test(self):
...
Supported images
----------------
The vmimage library has no hardcoded limitations of versions or architectures
that can be supported. You can use it as you wish. This is the list of images
that we tested and they work with vmimage:
.. csv-table::
:file: ./data/vmimage/supported_images.csv
:header-rows: 1
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册