diff options
author | Salim Afiune <afiune@chef.io> | 2017-03-13 11:11:11 -0400 |
---|---|---|
committer | Tom Duffield <tom@chef.io> | 2017-03-17 11:46:12 -0500 |
commit | b05a1fedf2993a26139e8ac8d0242c97e7c21351 (patch) | |
tree | b0dcd01dda0ab89c306caafa4d58793d03fe3342 | |
parent | 8dffb0360593377710a2b71ae6493ed6bb30acd7 (diff) | |
download | chef-b05a1fedf2993a26139e8ac8d0242c97e7c21351.tar.gz |
Add Shell SoloSession tests
Signed-off-by: Salim Afiune <afiune@chef.io>
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | spec/data/shef-config.rb | 2 | ||||
-rw-r--r-- | spec/functional/shell_spec.rb | 18 |
3 files changed, 21 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore index 03d53ceb10..aaf9fa045e 100644 --- a/.gitignore +++ b/.gitignore @@ -43,6 +43,7 @@ kitchen-tests/nodes/* # Temporary files present during spec runs spec/data/test-dir +spec/data/nodes /config/ # acceptance binstubs diff --git a/spec/data/shef-config.rb b/spec/data/shef-config.rb index 02d3610e55..efd601d6d8 100644 --- a/spec/data/shef-config.rb +++ b/spec/data/shef-config.rb @@ -7,3 +7,5 @@ ohai[:disabled_plugins] << "solaris2::cpu" << "solaris2::dmi" << "solaris2::file ohai[:disabled_plugins] << "solaris2::virtualization" << "solaris2::zpools" ohai[:disabled_plugins] << "c" << "php" << "mono" << "groovy" << "lua" << "erlang" ohai[:disabled_plugins] << "kernel" << "linux::filesystem" << "ruby" +chef_repo_path File.dirname(__FILE__) +cookbook_path "#{chef_repo_path}/cookbooks" diff --git a/spec/functional/shell_spec.rb b/spec/functional/shell_spec.rb index 636162fb16..8c8d7ba482 100644 --- a/spec/functional/shell_spec.rb +++ b/spec/functional/shell_spec.rb @@ -135,6 +135,24 @@ describe Shell do expect(exitstatus).to eq(0) end + context "on solo mode" do + it "starts correctly" do + output, exitstatus = run_chef_shell_with("--solo") + expect(output).to include("done") + expect(exitstatus).to eq(0) + end + + it "should be able to use the API" do + output, exitstatus = run_chef_shell_with("-s") do |out, keyboard| + simple_api_get = "api.get('data')" + keyboard.puts(simple_api_get) + read_until(out, simple_api_get) + end + expect(output).to include("{}") + expect(exitstatus).to eq(0) + end + end + it "sets the override_runlist from the command line" do output, exitstatus = run_chef_shell_with("-o 'override::foo,override::bar'") do |out, keyboard| show_recipes_code = %q[puts "#{node["recipes"].inspect}"] |