diff options
author | S.Cavallo <smcavallo@hotmail.com> | 2018-02-15 11:02:17 -0500 |
---|---|---|
committer | S.Cavallo <smcavallo@hotmail.com> | 2018-02-15 11:02:17 -0500 |
commit | 59086f0e757dd92b3b2b14ad21914091e281b498 (patch) | |
tree | 52e5626400aa9edd11dcaeb752381fdd7eda97eb /spec | |
parent | 01ae5aac80444d6e849bb44ba0f5798e46978c7f (diff) | |
download | chef-59086f0e757dd92b3b2b14ad21914091e281b498.tar.gz |
Add support for knife bootstrap-preinstall-command
Signed-off-by: S. Cavallo <smcavallo@hotmail.com>
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/knife/bootstrap_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/unit/knife/bootstrap_spec.rb b/spec/unit/knife/bootstrap_spec.rb index c725526de7..ea4c177d55 100644 --- a/spec/unit/knife/bootstrap_spec.rb +++ b/spec/unit/knife/bootstrap_spec.rb @@ -84,6 +84,18 @@ describe Chef::Knife::Bootstrap do end end + context "with --bootstrap-preinstall-command" do + command = "while sudo fuser /var/lib/dpkg/lock >/dev/null 2>&1; do\n echo 'waiting for dpkg lock';\n sleep 1;\n done;" + let(:bootstrap_cli_options) { [ "--bootstrap-preinstall-command", command ] } + let(:rendered_template) do + knife.merge_configs + knife.render_template + end + it "configures the preinstall command in the bootstrap template correctly" do + expect(rendered_template).to match(%r{command}) + end + end + context "with :distro and :bootstrap_template cli options" do let(:bootstrap_cli_options) { [ "--bootstrap-template", "my-template", "--distro", "other-template" ] } |