0

我正在尝试使用Kitchen -ssh 驱动程序在厨房中使用serverspec verifier-name为厨师食谱编写集成测试。以下是我的食谱中文件的排列方式。

        |-- recipes
        |   |-- decompress.rb
        |   |-- default.rb
        |   |-- dir_create.rb
        |   |-- dir_delete.rb
        |   |-- nexus.rb
        |   |-- replace_artefacts.rb
        |   |-- replace_configurations.rb
        |   |-- start_service.rb
        |   `-- stop_service.rb
        |-- spec
        |   |-- spec_helper.rb
        |   `-- unit
        |       `-- recipes
        |           |-- decompress_spec.rb
        |           |-- default_spec.rb
        |           |-- dir_create_spec.rb
        |           |-- dir_delete_spec.rb
        |           |-- nexus_spec.rb
        |           |-- replace_artefacts_spec.rb
        |           |-- replace_configurations_spec.rb
        |           |-- start_service_spec.rb
        |           `-- stop_service_spec.rb
        `-- test
            `-- integration
                |-- default
                |   `-- serverspec
                |       |-- default_spec.rb
                |       `-- dir_create_spec.rb
                `-- helpers
                    `-- serverspec
                        `-- spec_helper.rb

这是 .Kitchen.yml 文件中的内容,

    ---
    driver:
      name: ssh
      hostname: localhost
      port: 22
      user: vagrant
      password: ****

    provisioner:
      name: chef_zero
      cookbook_path: /u01/app/rdf_chef_repo/cookbooks/
      data_path: test/integration/helpers/serverspec/spec_helper.rb

    platforms:
      - name: dummy

    verifier:
      name: serverspec

    suites:
      - name: default
        verifier:
         rspec_path: '/opt/chefdk/embedded/bin'
         env_vars:
           TARGET_HOST: 127.0.0.1
           LOGIN_USER: vagrant
           LOGIN_PASSWORD: *****
           GEM_HOME: '/opt/chefdk/embedded/bin'
        run_list:
         - recipe[cookbook_name::default]

当我运行厨房测试时(从 .kitchen.yml 文件所在的目录,即说明书目录),我正在成功完成 serverspec,如下所示,

Installing ruby, bundler and serverspec remotely on server
Running Serverspec
/opt/chefdk/embedded/bin/rspec
Finished verifying <default-dummy> (0m3.49s).

我找不到任何 serverspec 执行的输出。

有人可以帮我弄清楚我在哪里做错了。

提前致谢

4

0 回答 0