Ресурс docker_plugin
Используйте ресурс проверки docker_plugin Chef InSpec для проверки плагина Docker.
Синтаксис
Блок ресурса docker_plugin объявляет плагин:
describe docker_plugin('rexray/ebs') do
it { should exist }
its('id') { should_not eq '0ac30b93ad40' }
its('version') { should eq '0.11.1' }
it { should be_enabled }
end
Примеры параметров ресурса
Ресурс позволяет передать идентификатор плагина:
describe docker_plugin(id: plugin_id) do
it { should be_enabled }
end
Свойства
id
Свойство id возвращает полный идентификатор плагина:
its('id') { should eq '0ac30b93ad40' }
version
Свойство version проверяет значение версии плагина:
its('version') { should eq '0.11.0' }
Примеры
Проверка плагина Docker
describe docker_plugin('rexray/ebs') do
it { should exist }
its('id') { should_not eq '0ac30b93ad40' }
its('version') { should eq '0.11.1' }
it { should be_enabled }
end
Матчеры
Полный список доступных матчеров можно найти на странице Универсальные матчеры.
exist
Матчер exist проверяет, доступен ли плагин на узле:
describe docker_plugin('rexray/ebs') do
it { should exist }
end
enabled
Матчер be_enabled проверяет, включен ли плагин
© Chef Software, Inc.
Licensed under the Creative Commons Attribution 3.0 Unported License.
The Chef™ Mark and Chef Logo are either registered trademarks/service marks or trademarks/servicemarks of Chef, in the United States and other countries and are used with Chef Inc's permission.
We are not affiliated with, endorsed or sponsored by Chef Inc.
https://docs.chef.io/inspec/resources/docker_plugin/