2.9. 使用 debug 模式


使用 debug 模式,如果测试完成或出现故障时,您可以保持 pod 运行,并使用远程 shell 获取更多信息和详细信息。

流程

  1. 编辑 Tempest 测试配置文件,例如使用 vim

    $ vim <Tempest_config>
    • <Tempest_config > 替换为 Tempest 测试配置文件的名称,如 test_v1beta1_tempest.yaml
  2. 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
  3. 保存并关闭 Tempest 测试配置文件。
  4. 为 Tempest 测试创建新 pod:

    $ oc apply -f <Tempest_config>
    • <Tempest_config > 替换为 Tempest 测试配置文件的名称,如 test_v1beta1_tempest.yaml

验证

  1. 获取您在上一步中创建的 pod 的名称:

    $ oc get pods | grep -i <pod_name>
    • 将 < pod_name > 替换为您在 Tempest 自定义资源配置文件中指定的名称,如 tempest-tests,或者只能使用 $ oc get pods 并搜索相关的 pod。
  2. 远程访问 pod:

    $ oc rsh <pod_name>
    • 将 < pod_name > 替换为您在上一步中获取的 pod 的名称。
  3. 更改或检查正在运行的 pod 中的错误:

    $ sh-5.1$ ls –lah /var/lib/tempest
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.