我正尝试使用kitchen-ssh驱动程序在 kitchen 中使用 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文件存在的目录,即cookbooks目录)我已成功完成serverspec,如下所示
Installing ruby, bundler and serverspec remotely on server
Running Serverspec
/opt/chefdk/embedded/bin/rspec
Finished verifying <default-dummy> (0m3.49s).
我无法找到任何serverpec执行的输出。
有人可以帮我弄清楚我做错了什么。
先谢谢