2.9. 使用 debug 模式
使用 debug 模式,如果测试完成或出现故障时,您可以保持 pod 运行,并使用远程 shell 获取更多信息和详细信息。
流程
编辑 Tempest 测试配置文件,例如使用
vim
:$ vim <Tempest_config>
-
将
<Tempest_config
> 替换为 Tempest 测试配置文件的名称,如test_v1beta1_tempest.yaml
。
-
将
将
debug:
参数的值改为true
,或者在配置文件中添加debug: true
行:apiVersion: test.openstack.org/v1beta1 kind: Tempest metadata: name: tempest-tests namespace: openstack spec: containerImage: registry.redhat.io/rhoso/openstack-tempest-all-rhel9:18.0 debug: true
- 保存并关闭 Tempest 测试配置文件。
为 Tempest 测试创建新 pod:
$ oc apply -f <Tempest_config>
-
将
<Tempest_config
> 替换为 Tempest 测试配置文件的名称,如test_v1beta1_tempest.yaml
。
-
将
验证
获取您在上一步中创建的 pod 的名称:
$ oc get pods | grep -i <pod_name>
-
将 <
pod_name
> 替换为您在 Tempest 自定义资源配置文件中指定的名称,如tempest-tests
,或者只能使用$ oc get pods
并搜索相关的 pod。
-
将 <
远程访问 pod:
$ oc rsh <pod_name>
-
将 <
pod_name
> 替换为您在上一步中获取的 pod 的名称。
-
将 <
更改或检查正在运行的 pod 中的错误:
$ sh-5.1$ ls –lah /var/lib/tempest