diff --git a/docs/gettingstarted.md b/docs/gettingstarted.md index 84b10966..3574b9e9 100644 --- a/docs/gettingstarted.md +++ b/docs/gettingstarted.md @@ -269,6 +269,19 @@ With either of these, test-kitchen will do the following If `kitchen test` was run, then the `kitchen list` command will show all the instances and what the result of their last command was. +## Run test interactivaly ## + +If your `converge` or `verify` step is failing, by default `kitchen` will keep your VM running, so you can login using +ssh and debug things from there. To run the `state.apply` that converge is doing, run the following : + + kitchen login + sudo salt-call --config-dir=/tmp/kitchen/etc/salt/ --log-level=debug state.apply + +If you are using the `minion_id` argument run : + + kitchen login + sudo salt-call --config-dir=/tmp/kitchen/etc/salt/ --log-level=debug --id=salt-minion-id state.apply + ## Closing ## This instance is now tested. For more information about `kitchen-salt` and `test-kitchen` in general please see the following links: diff --git a/docs/provisioner_options.md b/docs/provisioner_options.md index 62139755..7b2b256d 100644 --- a/docs/provisioner_options.md +++ b/docs/provisioner_options.md @@ -574,7 +574,7 @@ Location to place the minion config in the sandbox. default: `nil` -Local custom minion config template to be used in kitchen-salt. The default is {file:lib/kitchen/provisioner/minion.erb} +Local custom minion config template to be used in kitchen-salt. If filename ends in '.erb' it will be loaded as an Ruby ERB template, else it will be copied without modification. The default is {file:lib/kitchen/provisioner/minion.erb} ### salt_minion_id ### diff --git a/lib/kitchen/provisioner/salt_solo.rb b/lib/kitchen/provisioner/salt_solo.rb index 731d6655..605ec37f 100644 --- a/lib/kitchen/provisioner/salt_solo.rb +++ b/lib/kitchen/provisioner/salt_solo.rb @@ -415,6 +415,13 @@ def prepare_grains end def prepare_dependencies + # Dependency scripts are bash scripts only + # Copying them clobbers the kitchen temp directory + # with a file named `kitchen`. If adding Windows + # support for dependencies, relocate into a + # sub-directory + return if windows_os? + # Write ssh known_hosts write_raw_file(File.join(sandbox_path, config[:ssh_home], "known_hosts"), File.read(File.expand_path("../known_hosts", __FILE__))) # Write general deploy key. @@ -439,6 +446,7 @@ def prepare_dependencies write_raw_file(outfile, contents) end end + # upload scripts sandbox_scripts_path = File.join(sandbox_path, config[:salt_config], 'scripts') info("Preparing scripts into #{config[:salt_config]}/scripts")