Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
avocado
提交
782a9492
A
avocado
项目概览
openeuler
/
avocado
通知
0
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
avocado
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
782a9492
编写于
1月 24, 2019
作者:
C
Cleber Rosa
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'cacarrara/doc-mux-inject-v2'
Signed-off-by:
N
Cleber Rosa
<
crosa@redhat.com
>
上级
2d98b772
810cdb7c
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
45 addition
and
0 deletion
+45
-0
docs/source/optional_plugins/varianter_yaml_to_mux.rst
docs/source/optional_plugins/varianter_yaml_to_mux.rst
+45
-0
未找到文件。
docs/source/optional_plugins/varianter_yaml_to_mux.rst
浏览文件 @
782a9492
...
...
@@ -567,3 +567,48 @@ From this example you can see that querying for ``/env/debug`` works only in
the first variant, but returns nothing in the second variant. Keep this in mind
and when you use the ``!mux`` flag always query for the pre-mux path,
``/env/*`` in this example.
Injecting values
----------------
Beyond the values injected by YAML files specified it's also possible
inject values directly from command line to the final multiplex tree.
It's done by the argument ``--mux-inject``. The format of expected
value is ``[path:]key:node_value``.
.. warning:: When no path is specified to ``--mux-inject`` the parameter
is added under tree root ``/``. For example: running avocado passing
``--mux-inject my_key:my_value`` the parameter can be accessed calling
``self.params.get('my_key')``. If the test writer wants to put the injected
value in any other path location, like extending the ``/run`` path, it needs
to be informed on avocado run call. For example: ``--mux-inject
/run/:my_key:my_value`` makes possible to access the parameters
calling ``self.params.get('my_key', '/run')``
A test that gets parameters without a defined path, such as
``examples/tests/multiplextest.py``::
os_type = self.params.get('os_type', default='linux')
Running it::
$ avocado --show=test run -- examples/tests/multiplextest.py | grep os_type
PARAMS (key=os_type, path=*, default=linux) => 'linux'
Now, injecting a value, by default will put it in /, which is not in the
default list of paths searched for::
$ avocado --show=test run --mux-inject os_type:myos -- examples/tests/multiplextest.py | grep os_type
PARAMS (key=os_type, path=*, default=linux) => 'linux'
A path that is searched for by default is /run. To set the value to that path use::
$ avocado --show=test run --mux-inject /run:os_type:myos -- examples/tests/multiplextest.py | grep os_type
PARAMS (key=os_type, path=*, default=linux) => 'myos'
Or, add the / to the list of paths searched for by default::
$ avocado --show=test run --mux-inject os_type:myos --mux-path / -- examples/tests/multiplextest.py | grep os_type
PARAMS (key=os_type, path=*, default=linux) => 'myos'
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录