|
448 | 448 | allow(IO).to receive_message_chain( |
449 | 449 | :read, :chomp).and_return("template") |
450 | 450 | allow(Process).to receive(:detach) |
451 | | - @sample_config = {:environment=>"_default", :chef_node_name=>"mynode3", :chef_extension_root=>"./", :user_client_rb=>"", :log_location=>nil, :chef_server_url=>"https://api.opscode.com/organizations/clochefacc", :validation_client_name=>"clochefacc-validator", :secret=>nil, :first_boot_attributes => {}} |
| 451 | + @sample_config = {:environment=>nil, :chef_node_name=>"mynode3", :chef_extension_root=>"./", :user_client_rb=>"", :log_location=>nil, :chef_server_url=>"https://api.opscode.com/organizations/clochefacc", :validation_client_name=>"clochefacc-validator", :secret=>nil, :first_boot_attributes => {}} |
452 | 452 | @sample_runlist = ["recipe[getting-started]", "recipe[apt]"] |
453 | 453 | end |
454 | 454 |
|
|
463 | 463 | expect(instance).to_not receive(:load_cloud_attributes_in_hints) |
464 | 464 | expect(instance).to receive(:secret_key) |
465 | 465 | expect(FileUtils).to receive(:rm) |
466 | | - expect(Process).to receive(:spawn).with("chef-client -c #{@bootstrap_directory}/client.rb -j #{@bootstrap_directory}/first-boot.json -E #{@sample_config[:environment]} -L #{@sample_config[:log_location]}/chef-client.log --once ").and_return(123) |
| 466 | + expect(Process).to receive(:spawn).with("chef-client -c #{@bootstrap_directory}/client.rb -j #{@bootstrap_directory}/first-boot.json -L #{@sample_config[:log_location]}/chef-client.log --once ").and_return(123) |
467 | 467 | instance.send(:configure_chef_only_once) |
468 | 468 | expect(instance.instance_variable_get(:@child_pid)).to be == 123 |
469 | 469 | expect(instance.instance_variable_get(:@chef_client_success_file)).to be nil |
|
480 | 480 | expect(Erubis::Eruby.new).to receive(:evaluate) |
481 | 481 | expect(instance).to receive(:shell_out).and_return( |
482 | 482 | OpenStruct.new(:exitstatus => 0, :stdout => "")) |
483 | | - expect(Process).to receive(:spawn).with("chef-client -c #{@bootstrap_directory}/client.rb -j #{@bootstrap_directory}/first-boot.json -E #{@sample_config[:environment]} -L #{@sample_config[:log_location]}/chef-client.log --once ").and_return(456) |
| 483 | + expect(Process).to receive(:spawn).with("chef-client -c #{@bootstrap_directory}/client.rb -j #{@bootstrap_directory}/first-boot.json -L #{@sample_config[:log_location]}/chef-client.log --once ").and_return(456) |
484 | 484 | instance.send(:configure_chef_only_once) |
485 | 485 | expect(instance.instance_variable_get(:@child_pid)).to be == 456 |
486 | 486 | expect(instance.instance_variable_get(:@chef_client_success_file)).to be nil |
|
504 | 504 | allow(IO).to receive_message_chain( |
505 | 505 | :read, :chomp).and_return("template") |
506 | 506 | allow(Process).to receive(:detach) |
507 | | - @sample_config = {:environment=>"_default", :chef_node_name=>"mynode3", :chef_extension_root=>"./", :user_client_rb=>"", :log_location=>nil, :chef_server_url=>"https://api.opscode.com/organizations/clochefacc", :validation_client_name=>"clochefacc-validator", :secret=>nil, :first_boot_attributes => {"container_service"=>{"chef-init-test"=>{"command"=>"C:\\opscode\\chef\\bin"}}} } |
| 507 | + @sample_config = {:environment=>nil, :chef_node_name=>"mynode3", :chef_extension_root=>"./", :user_client_rb=>"", :log_location=>nil, :chef_server_url=>"https://api.opscode.com/organizations/clochefacc", :validation_client_name=>"clochefacc-validator", :secret=>nil, :first_boot_attributes => {"container_service"=>{"chef-init-test"=>{"command"=>"C:\\opscode\\chef\\bin"}}} } |
508 | 508 | @sample_runlist = ["recipe[getting-started]", "recipe[apt]"] |
509 | 509 | end |
510 | 510 |
|
|
519 | 519 | expect(instance).to receive(:load_cloud_attributes_in_hints) |
520 | 520 | expect(instance).to receive(:secret_key) |
521 | 521 | expect(FileUtils).to receive(:rm) |
522 | | - expect(Process).to receive(:spawn).with("chef-client -c #{@bootstrap_directory}/client.rb -j #{@bootstrap_directory}/first-boot.json -E #{@sample_config[:environment]} -L #{@sample_config[:log_location]}/chef-client.log --once && touch c:\\chef_client_success").and_return(789) |
| 522 | + expect(Process).to receive(:spawn).with("chef-client -c #{@bootstrap_directory}/client.rb -j #{@bootstrap_directory}/first-boot.json -L #{@sample_config[:log_location]}/chef-client.log --once && touch c:\\chef_client_success").and_return(789) |
523 | 523 | instance.send(:configure_chef_only_once) |
524 | 524 | expect(instance.instance_variable_get(:@child_pid)).to be == 789 |
525 | 525 | expect(instance.instance_variable_get(:@chef_client_success_file)).to be == 'c:\\chef_client_success' |
|
536 | 536 | expect(Erubis::Eruby.new).to receive(:evaluate) |
537 | 537 | expect(instance).to receive(:shell_out).and_return( |
538 | 538 | OpenStruct.new(:exitstatus => 0, :stdout => "")) |
539 | | - expect(Process).to receive(:spawn).with("chef-client -c #{@bootstrap_directory}/client.rb -j #{@bootstrap_directory}/first-boot.json -E #{@sample_config[:environment]} -L #{@sample_config[:log_location]}/chef-client.log --once && touch /tmp/chef_client_success").and_return(120) |
| 539 | + expect(Process).to receive(:spawn).with("chef-client -c #{@bootstrap_directory}/client.rb -j #{@bootstrap_directory}/first-boot.json -L #{@sample_config[:log_location]}/chef-client.log --once && touch /tmp/chef_client_success").and_return(120) |
540 | 540 | instance.send(:configure_chef_only_once) |
541 | 541 | expect(instance.instance_variable_get(:@child_pid)).to be == 120 |
542 | 542 | expect(instance.instance_variable_get(:@chef_client_success_file)).to be == '/tmp/chef_client_success' |
|
0 commit comments