Кухня проверить вывод показать двойной протокол испытаний
С помощью kitchen verify
Я получил двойной отчет о моем тесте. Я не знаю почему, и это происходит только в этой кулинарной книге. Я бегал так же kitchen verify
Команда и вывод понятен, так что же теперь отличается?
Это вывод (с двойным отчетом):
-----> Setting up <default-centos-72>...
Finished setting up <default-centos-72> (0m0.00s).
-----> Verifying <default-centos-72>...
Detected alternative framework tests for `inspec`
Loaded
Loaded
Target: ssh://kitchen@localhost:32785
✔ When OS is Redhat :: Nginx service need to be installed and configured
✔ System Package nginx should be installed
✔ Group www-data should exist
✔ User www-data should exist
✔ File /etc/nginx/sites-available/mysite should be file
✔ File /etc/nginx/sites-available/mysite content should match "listen 80;"
✔ File /etc/nginx/sites-available/mysite content should match "server_name docs.mydomain.com default;"
✔ File /etc/nginx/sites-available/mysite content should match "access_log /var/www/mysite/doc_access.log;"
✔ File /etc/nginx/sites-available/mysite content should match "error_log /var/www/mysite/doc_error.log;"
✔ File /etc/nginx/sites-available/mysite content should match "root /var/www/mysite;"
✔ Service nginx should be enabled
✔ Service nginx should be running
✔ System Package nginx should be installed
✔ Group www-data should exist
✔ User www-data should exist
✔ File /etc/nginx/sites-available/mysite should be file
✔ File /etc/nginx/sites-available/mysite content should match "listen 80;"
✔ File /etc/nginx/sites-available/mysite content should match "server_name docs.mydomain.com default;"
✔ File /etc/nginx/sites-available/mysite content should match "access_log /var/www/mysite/doc_access.log;"
✔ File /etc/nginx/sites-available/mysite content should match "error_log /var/www/mysite/doc_error.log;"
✔ File /etc/nginx/sites-available/mysite content should match "root /var/www/mysite;"
✔ Service nginx should be enabled
✔ Service nginx should be running
Target: ssh://kitchen@localhost:32785
No tests executed.
Profile Summary: 1 successful, 0 failures, 0 skipped
Test Summary: 22 successful, 0 failures, 0 skipped
Finished verifying <default-centos-72> (0m1.24s).
-----> Kitchen is finished. (0m4.86s)
Версия инструментов
chef -v
Chef Development Kit Version: 1.0.3
chef-client version: 12.16.42
delivery version: master (83358fb62c0f711c70ad5a81030a6cae4017f103)
berks version: 5.2.0
kitchen version: 1.13.2
Проверить версию
chef gem list | grep inspec
debug_inspector (0.0.2)
inspec (1.9.0, 1.4.1)
kitchen-inspec (0.17.0, 0.16.1)
Конфигурация кухни
---
driver:
name: docker
use_sudo: false
privileged: true
provisioner:
name: chef_zero
verifier: inspec
platforms:
- name: centos-7.2
driver:
platform: rhel
run_command: /usr/lib/systemd/systemd
provision_command:
- /bin/yum install -y iniscripts net-tools wget
suites:
- name: default
run_list:
- recipe[nginx::default]
verifier:
inspec_tests:
- test/integration/default/inspec/
attributes:
Осмотрите хозяина
Когда я проверяю целевой хост, вывод inspec является правильным.
inspec exec test/integration/default/inspec -t ssh://centos@10.0.10.10 -i $HOME/key.pem
Target: ssh://centos@10.0.10.10:22
✔ When OS is Redhat Nginx:: Nginx service need to be installed and configured
✔ System Package nginx should be installed
✔ Group www-data should exist
✔ User www-data should exist
✔ File /etc/nginx/sites-available/mysite should be file
✔ File /etc/nginx/sites-available/mysite content should match "listen 80;"
✔ File /etc/nginx/sites-available/mysite content should match "server_name docs.mydomain.com default;"
✔ File /etc/nginx/sites-available/mysite content should match "access_log /var/www/mysite/doc_access.log;"
✔ File /etc/nginx/sites-available/mysite content should match "error_log /var/www/mysite/doc_error.log;"
✔ File /etc/nginx/sites-available/mysite content should match "root /var/www/mysite;"
✔ Service nginx should be enabled
✔ Service nginx should be running
Так что я думаю, что проблема с кухонным плагином или докером, но я не уверен в этом? Есть предложения или идеи?
1 ответ
Это происходит, если test_base_path отличается от, но содержит путь, который вы указываете в верификаторе.
Вы заметите, что
kitchen verify docker
-----> Starting Kitchen (v1.18.0)
-----> Verifying <base-centos-73-docker>...
Loaded tests from {:path=>"<...>/test/integration/base"}
Loaded tests from test/integration/base
фактически загружает два пути, которые совпадают.
призвание
kitchen verify -t null docker
-----> Starting Kitchen (v1.18.0)
-----> Verifying <base-centos-73-docker>...
Loaded tests from test/integration/base
устраняет проблему, если в системе нет нулевого "пути".