test-kitchen 1.4.2 → 1.5.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -1
  3. data/.travis.yml +27 -2
  4. data/CHANGELOG.md +40 -1
  5. data/Gemfile.proxy_tests +6 -0
  6. data/features/kitchen_driver_discover_command.feature +6 -0
  7. data/features/kitchen_init_command.feature +5 -3
  8. data/features/step_definitions/gem_steps.rb +12 -4
  9. data/features/step_definitions/git_steps.rb +1 -1
  10. data/features/step_definitions/output_steps.rb +1 -1
  11. data/features/support/env.rb +13 -9
  12. data/lib/kitchen/cli.rb +3 -0
  13. data/lib/kitchen/command/driver_discover.rb +8 -0
  14. data/lib/kitchen/configurable.rb +32 -0
  15. data/lib/kitchen/driver/ssh_base.rb +18 -4
  16. data/lib/kitchen/generator/driver_create.rb +2 -2
  17. data/lib/kitchen/lazy_hash.rb +20 -0
  18. data/lib/kitchen/provisioner/base.rb +16 -1
  19. data/lib/kitchen/provisioner/chef_base.rb +42 -98
  20. data/lib/kitchen/provisioner/chef_solo.rb +6 -4
  21. data/lib/kitchen/provisioner/chef_zero.rb +7 -5
  22. data/lib/kitchen/transport/winrm.rb +36 -2
  23. data/lib/kitchen/verifier/base.rb +18 -1
  24. data/lib/kitchen/verifier/busser.rb +12 -5
  25. data/lib/kitchen/verifier/shell.rb +101 -0
  26. data/lib/kitchen/version.rb +1 -1
  27. data/spec/kitchen/configurable_spec.rb +211 -2
  28. data/spec/kitchen/driver/ssh_base_spec.rb +131 -8
  29. data/spec/kitchen/lazy_hash_spec.rb +27 -0
  30. data/spec/kitchen/provisioner/base_spec.rb +25 -0
  31. data/spec/kitchen/provisioner/chef_base_spec.rb +133 -252
  32. data/spec/kitchen/provisioner/chef_solo_spec.rb +17 -0
  33. data/spec/kitchen/provisioner/chef_zero_spec.rb +14 -2
  34. data/spec/kitchen/provisioner/shell_spec.rb +60 -12
  35. data/spec/kitchen/transport/winrm_spec.rb +50 -0
  36. data/spec/kitchen/verifier/base_spec.rb +26 -0
  37. data/spec/kitchen/verifier/busser_spec.rb +69 -3
  38. data/spec/kitchen/verifier/shell_spec.rb +157 -0
  39. data/support/busser_install_command.sh +1 -2
  40. data/test-kitchen.gemspec +10 -2
  41. metadata +86 -6
@@ -0,0 +1,101 @@
1
+ # -*- encoding: utf-8 -*-
2
+ #
3
+ # Author:: SAWANOBORI Yukihiko (<sawanoboriyu@higanworks.com>)
4
+ #
5
+ # Copyright (C) 2015, HiganWorks LLC
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+
19
+ require "kitchen/verifier/base"
20
+
21
+ module Kitchen
22
+
23
+ module Verifier
24
+
25
+ # Shell verifier for Kitchen. This verifier just execute shell command from local.
26
+ #
27
+ # @author SAWANOBORI Yukihiko (<sawanoboriyu@higanworks.com>)
28
+ class Shell < Kitchen::Verifier::Base
29
+ require "mixlib/shellout"
30
+
31
+ kitchen_verifier_api_version 1
32
+
33
+ plugin_version Kitchen::VERSION
34
+
35
+ default_config :sleep, 0
36
+ default_config :command, "true"
37
+ default_config :shellout_opts, {}
38
+ default_config :live_stream, $stdout
39
+ default_config :remote_exec, false
40
+
41
+ # (see Base#call)
42
+ def call(state)
43
+ info("[#{name}] Verify on instance=#{instance} with state=#{state}")
44
+ sleep_if_set
45
+ merge_state_to_env(state)
46
+ if config[:remote_exec]
47
+ instance.transport.connection(state) do |conn|
48
+ conn.execute(config[:command])
49
+ end
50
+ else
51
+ shellout
52
+ end
53
+ debug("[#{name}] Verify completed.")
54
+ end
55
+
56
+ # for legacy drivers.
57
+ def run_command
58
+ if config[:remote_exec]
59
+ config[:command]
60
+ else
61
+ shellout
62
+ nil
63
+ end
64
+ end
65
+
66
+ private
67
+
68
+ # Sleep for a period of time, if a value is set in the config.
69
+ #
70
+ # @api private
71
+ def sleep_if_set
72
+ config[:sleep].to_i.times do
73
+ info(".")
74
+ sleep 1
75
+ end
76
+ end
77
+
78
+ def shellout
79
+ cmd = Mixlib::ShellOut.new(config[:command], config[:shellout_opts])
80
+ cmd.live_stream = config[:live_stream]
81
+ cmd.run_command
82
+ begin
83
+ cmd.error!
84
+ rescue Mixlib::ShellOut::ShellCommandFailed
85
+ raise ActionFailed, "Action #verify failed for #{instance.to_str}."
86
+ end
87
+ end
88
+
89
+ def merge_state_to_env(state)
90
+ env_state = { :environment => {} }
91
+ env_state[:environment]["KITCHEN_INSTANCE"] = instance.name
92
+ env_state[:environment]["KITCHEN_PLATFORM"] = instance.platform.name
93
+ env_state[:environment]["KITCHEN_SUITE"] = instance.suite.name
94
+ state.each_pair do |key, value|
95
+ env_state[:environment]["KITCHEN_" + key.to_s.upcase] = value
96
+ end
97
+ config[:shellout_opts].merge!(env_state)
98
+ end
99
+ end
100
+ end
101
+ end
@@ -18,5 +18,5 @@
18
18
 
19
19
  module Kitchen
20
20
 
21
- VERSION = "1.4.2"
21
+ VERSION = "1.5.0.rc.1"
22
22
  end
@@ -727,6 +727,19 @@ describe Kitchen::Configurable do
727
727
 
728
728
  let(:cmd) { subject.send(:wrap_shell_code, "mkdir foo") }
729
729
 
730
+ before do
731
+ @original_env = ENV.to_hash
732
+ ENV.replace("http_proxy" => nil, "HTTP_PROXY" => nil,
733
+ "https_proxy" => nil, "HTTPS_PROXY" => nil,
734
+ "ftp_proxy" => nil, "FTP_PROXY" => nil,
735
+ "no_proxy" => nil, "NO_PROXY" => nil)
736
+ end
737
+
738
+ after do
739
+ ENV.clear
740
+ ENV.replace(@original_env)
741
+ end
742
+
730
743
  describe "for bourne shells" do
731
744
 
732
745
  before { platform.stubs(:shell_type).returns("bourne") }
@@ -764,16 +777,121 @@ describe Kitchen::Configurable do
764
777
  CODE
765
778
  end
766
779
 
767
- it "exports all http proxy variables when both are set" do
780
+ it "exports ftp_proxy & FTP_PROXY when :ftp_proxy is set" do
781
+ config[:ftp_proxy] = "ftp://proxy"
782
+
783
+ cmd.must_equal(outdent!(<<-CODE.chomp))
784
+ sh -c '
785
+ ftp_proxy="ftp://proxy"; export ftp_proxy
786
+ FTP_PROXY="ftp://proxy"; export FTP_PROXY
787
+ mkdir foo
788
+ '
789
+ CODE
790
+ end
791
+
792
+ it "exports all http proxy variables when all are set" do
768
793
  config[:http_proxy] = "http://proxy"
769
794
  config[:https_proxy] = "https://proxy"
795
+ config[:ftp_proxy] = "ftp://proxy"
796
+
797
+ cmd.must_equal(outdent!(<<-CODE.chomp))
798
+ sh -c '
799
+ http_proxy="http://proxy"; export http_proxy
800
+ HTTP_PROXY="http://proxy"; export HTTP_PROXY
801
+ https_proxy="https://proxy"; export https_proxy
802
+ HTTPS_PROXY="https://proxy"; export HTTPS_PROXY
803
+ ftp_proxy="ftp://proxy"; export ftp_proxy
804
+ FTP_PROXY="ftp://proxy"; export FTP_PROXY
805
+ mkdir foo
806
+ '
807
+ CODE
808
+ end
809
+
810
+ it "exports http_proxy & HTTP_PROXY from workstation when :http_proxy isn't set" do
811
+ ENV["http_proxy"] = "http://proxy"
812
+ ENV["HTTP_PROXY"] = "http://proxy"
813
+
814
+ cmd.must_equal(outdent!(<<-CODE.chomp))
815
+ sh -c '
816
+ http_proxy="http://proxy"; export http_proxy
817
+ HTTP_PROXY="http://proxy"; export HTTP_PROXY
818
+ mkdir foo
819
+ '
820
+ CODE
821
+ end
822
+
823
+ it "exports https_proxy & HTTPS_PROXY from workstation when :https_proxy isn't set" do
824
+ ENV["https_proxy"] = "https://proxy"
825
+ ENV["HTTPS_PROXY"] = "https://proxy"
826
+
827
+ cmd.must_equal(outdent!(<<-CODE.chomp))
828
+ sh -c '
829
+ https_proxy="https://proxy"; export https_proxy
830
+ HTTPS_PROXY="https://proxy"; export HTTPS_PROXY
831
+ mkdir foo
832
+ '
833
+ CODE
834
+ end
835
+
836
+ it "exports ftp_proxy & FTP_PROXY from workstation when :ftp_proxy isn't set" do
837
+ ENV["ftp_proxy"] = "ftp://proxy"
838
+ ENV["FTP_PROXY"] = "ftp://proxy"
839
+
840
+ cmd.must_equal(outdent!(<<-CODE.chomp))
841
+ sh -c '
842
+ ftp_proxy="ftp://proxy"; export ftp_proxy
843
+ FTP_PROXY="ftp://proxy"; export FTP_PROXY
844
+ mkdir foo
845
+ '
846
+ CODE
847
+ end
848
+
849
+ it "exports no_proxy & NO_PROXY from workstation when http_proxy is set from workstation" do
850
+ ENV["http_proxy"] = "http://proxy"
851
+ ENV["HTTP_PROXY"] = "http://proxy"
852
+ ENV["no_proxy"] = "http://no"
853
+ ENV["NO_PROXY"] = "http://no"
770
854
 
771
855
  cmd.must_equal(outdent!(<<-CODE.chomp))
772
856
  sh -c '
773
857
  http_proxy="http://proxy"; export http_proxy
774
858
  HTTP_PROXY="http://proxy"; export HTTP_PROXY
859
+ no_proxy="http://no"; export no_proxy
860
+ NO_PROXY="http://no"; export NO_PROXY
861
+ mkdir foo
862
+ '
863
+ CODE
864
+ end
865
+
866
+ it "exports no_proxy & NO_PROXY from workstation when https_proxy is set from workstation" do
867
+ ENV["https_proxy"] = "https://proxy"
868
+ ENV["HTTPS_PROXY"] = "https://proxy"
869
+ ENV["no_proxy"] = "http://no"
870
+ ENV["NO_PROXY"] = "http://no"
871
+
872
+ cmd.must_equal(outdent!(<<-CODE.chomp))
873
+ sh -c '
775
874
  https_proxy="https://proxy"; export https_proxy
776
875
  HTTPS_PROXY="https://proxy"; export HTTPS_PROXY
876
+ no_proxy="http://no"; export no_proxy
877
+ NO_PROXY="http://no"; export NO_PROXY
878
+ mkdir foo
879
+ '
880
+ CODE
881
+ end
882
+
883
+ it "exports no_proxy & NO_PROXY from workstation when ftp_proxy is set from workstation" do
884
+ ENV["ftp_proxy"] = "ftp://proxy"
885
+ ENV["FTP_PROXY"] = "ftp://proxy"
886
+ ENV["no_proxy"] = "http://no"
887
+ ENV["NO_PROXY"] = "http://no"
888
+
889
+ cmd.must_equal(outdent!(<<-CODE.chomp))
890
+ sh -c '
891
+ ftp_proxy="ftp://proxy"; export ftp_proxy
892
+ FTP_PROXY="ftp://proxy"; export FTP_PROXY
893
+ no_proxy="http://no"; export no_proxy
894
+ NO_PROXY="http://no"; export NO_PROXY
777
895
  mkdir foo
778
896
  '
779
897
  CODE
@@ -808,15 +926,106 @@ describe Kitchen::Configurable do
808
926
  CODE
809
927
  end
810
928
 
811
- it "exports all http proxy variables when both are set" do
929
+ it "exports ftp_proxy & FTP_PROXY when :ftp_proxy is set" do
930
+ config[:ftp_proxy] = "ftp://proxy"
931
+
932
+ cmd.must_equal(outdent!(<<-CODE.chomp))
933
+ $env:ftp_proxy = "ftp://proxy"
934
+ $env:FTP_PROXY = "ftp://proxy"
935
+ mkdir foo
936
+ CODE
937
+ end
938
+
939
+ it "exports all http proxy variables when all are set" do
812
940
  config[:http_proxy] = "http://proxy"
813
941
  config[:https_proxy] = "https://proxy"
942
+ config[:ftp_proxy] = "ftp://proxy"
943
+
944
+ cmd.must_equal(outdent!(<<-CODE.chomp))
945
+ $env:http_proxy = "http://proxy"
946
+ $env:HTTP_PROXY = "http://proxy"
947
+ $env:https_proxy = "https://proxy"
948
+ $env:HTTPS_PROXY = "https://proxy"
949
+ $env:ftp_proxy = "ftp://proxy"
950
+ $env:FTP_PROXY = "ftp://proxy"
951
+ mkdir foo
952
+ CODE
953
+ end
954
+
955
+ it "exports http_proxy & HTTP_PROXY from workstation when :http_proxy isn't set" do
956
+ ENV["http_proxy"] = "http://proxy"
957
+ ENV["HTTP_PROXY"] = "http://proxy"
958
+
959
+ cmd.must_equal(outdent!(<<-CODE.chomp))
960
+ $env:http_proxy = "http://proxy"
961
+ $env:HTTP_PROXY = "http://proxy"
962
+ mkdir foo
963
+ CODE
964
+ end
965
+
966
+ it "exports https_proxy & HTTPS_PROXY from workstation when :https_proxy isn't set" do
967
+ ENV["https_proxy"] = "https://proxy"
968
+ ENV["HTTPS_PROXY"] = "https://proxy"
969
+
970
+ cmd.must_equal(outdent!(<<-CODE.chomp))
971
+ $env:https_proxy = "https://proxy"
972
+ $env:HTTPS_PROXY = "https://proxy"
973
+ mkdir foo
974
+ CODE
975
+ end
976
+
977
+ it "exports ftp_proxy & FTP_PROXY from workstation when :ftp_proxy isn't set" do
978
+ ENV["ftp_proxy"] = "ftp://proxy"
979
+ ENV["FTP_PROXY"] = "ftp://proxy"
980
+
981
+ cmd.must_equal(outdent!(<<-CODE.chomp))
982
+ $env:ftp_proxy = "ftp://proxy"
983
+ $env:FTP_PROXY = "ftp://proxy"
984
+ mkdir foo
985
+ CODE
986
+ end
987
+
988
+ it "exports no_proxy & NO_PROXY from workstation when http_proxy is set from workstation" do
989
+ ENV["http_proxy"] = "http://proxy"
990
+ ENV["HTTP_PROXY"] = "http://proxy"
991
+ ENV["no_proxy"] = "http://no"
992
+ ENV["NO_PROXY"] = "http://no"
814
993
 
815
994
  cmd.must_equal(outdent!(<<-CODE.chomp))
816
995
  $env:http_proxy = "http://proxy"
817
996
  $env:HTTP_PROXY = "http://proxy"
997
+ $env:no_proxy = "http://no"
998
+ $env:NO_PROXY = "http://no"
999
+ mkdir foo
1000
+ CODE
1001
+ end
1002
+
1003
+ it "exports no_proxy & NO_PROXY from workstation when https_proxy is set from workstation" do
1004
+ ENV["https_proxy"] = "https://proxy"
1005
+ ENV["HTTPS_PROXY"] = "https://proxy"
1006
+ ENV["no_proxy"] = "http://no"
1007
+ ENV["NO_PROXY"] = "http://no"
1008
+
1009
+ cmd.must_equal(outdent!(<<-CODE.chomp))
818
1010
  $env:https_proxy = "https://proxy"
819
1011
  $env:HTTPS_PROXY = "https://proxy"
1012
+ $env:no_proxy = "http://no"
1013
+ $env:NO_PROXY = "http://no"
1014
+ mkdir foo
1015
+ CODE
1016
+ end
1017
+
1018
+ it "exports no_proxy & NO_PROXY from workstation when ftp_proxy is set from workstation" do
1019
+ ENV["ftp_proxy"] = "ftp://proxy"
1020
+ ENV["FTP_PROXY"] = "ftp://proxy"
1021
+ ENV["no_proxy"] = "http://no"
1022
+ ENV["NO_PROXY"] = "http://no"
1023
+
1024
+ cmd.must_equal(outdent!(<<-CODE.chomp))
1025
+ $env:ftp_proxy = "ftp://proxy"
1026
+ $env:FTP_PROXY = "ftp://proxy"
1027
+ $env:no_proxy = "http://no"
1028
+ $env:NO_PROXY = "http://no"
820
1029
  mkdir foo
821
1030
  CODE
822
1031
  end
@@ -288,11 +288,18 @@ describe Kitchen::Driver::SSHBase do
288
288
  provisioner.stubs(:[]).with(:root_path).returns("/rooty")
289
289
  FakeFS.activate!
290
290
  FileUtils.mkdir_p("/tmp")
291
+ @original_env = ENV.to_hash
292
+ ENV.replace("http_proxy" => nil, "HTTP_PROXY" => nil,
293
+ "https_proxy" => nil, "HTTPS_PROXY" => nil,
294
+ "ftp_proxy" => nil, "FTP_PROXY" => nil,
295
+ "no_proxy" => nil, "NO_PROXY" => nil)
291
296
  end
292
297
 
293
298
  after do
294
299
  FakeFS.deactivate!
295
300
  FakeFS::FileSystem.clear
301
+ ENV.clear
302
+ ENV.replace(@original_env)
296
303
  end
297
304
 
298
305
  constructs_an_ssh_connection
@@ -333,6 +340,33 @@ describe Kitchen::Driver::SSHBase do
333
340
  cmd
334
341
  end
335
342
 
343
+ it "invokes the #install_command with ENV[\"http_proxy\"] set" do
344
+ ENV["http_proxy"] = "http://proxy"
345
+ transport.stubs(:connection).yields(connection)
346
+ if running_tests_on_windows?
347
+ connection.expects(:execute).
348
+ with("env http_proxy=http://proxy HTTP_PROXY=http://proxy install")
349
+ else
350
+ connection.expects(:execute).with("env http_proxy=http://proxy install")
351
+ end
352
+ cmd
353
+ end
354
+
355
+ it "invokes the #install_command with ENV[\"http_proxy\"] and ENV[\"no_proxy\"] set" do
356
+ ENV["http_proxy"] = "http://proxy"
357
+ ENV["no_proxy"] = "http://no"
358
+ transport.stubs(:connection).yields(connection)
359
+ if running_tests_on_windows?
360
+ connection.expects(:execute).
361
+ with("env http_proxy=http://proxy HTTP_PROXY=http://proxy " \
362
+ "no_proxy=http://no NO_PROXY=http://no install")
363
+ else
364
+ connection.expects(:execute).with("env http_proxy=http://proxy " \
365
+ "no_proxy=http://no install")
366
+ end
367
+ cmd
368
+ end
369
+
336
370
  it "invokes the #install_command with :https_proxy set in config" do
337
371
  config[:https_proxy] = "https://proxy"
338
372
  transport.stubs(:connection).yields(connection)
@@ -341,12 +375,75 @@ describe Kitchen::Driver::SSHBase do
341
375
  cmd
342
376
  end
343
377
 
344
- it "invokes the #install_command with :http_proxy & :https_proxy set" do
378
+ it "invokes the #install_command with ENV[\"https_proxy\"] set" do
379
+ ENV["https_proxy"] = "https://proxy"
380
+ transport.stubs(:connection).yields(connection)
381
+ if running_tests_on_windows?
382
+ connection.expects(:execute).
383
+ with("env https_proxy=https://proxy HTTPS_PROXY=https://proxy install")
384
+ else
385
+ connection.expects(:execute).with("env https_proxy=https://proxy install")
386
+ end
387
+ cmd
388
+ end
389
+
390
+ it "invokes the #install_command with ENV[\"https_proxy\"] and ENV[\"no_proxy\"] set" do
391
+ ENV["https_proxy"] = "https://proxy"
392
+ ENV["no_proxy"] = "https://no"
393
+ transport.stubs(:connection).yields(connection)
394
+ if running_tests_on_windows?
395
+ connection.expects(:execute).
396
+ with("env https_proxy=https://proxy HTTPS_PROXY=https://proxy " \
397
+ "no_proxy=https://no NO_PROXY=https://no install")
398
+ else
399
+ connection.expects(:execute).with("env https_proxy=https://proxy " \
400
+ "no_proxy=https://no install")
401
+ end
402
+ cmd
403
+ end
404
+
405
+ it "invokes the #install_command with :ftp_proxy set in config" do
406
+ config[:ftp_proxy] = "ftp://proxy"
407
+ transport.stubs(:connection).yields(connection)
408
+ connection.expects(:execute).with("env ftp_proxy=ftp://proxy install")
409
+
410
+ cmd
411
+ end
412
+
413
+ it "invokes the #install_command with ENV[\"ftp_proxy\"] set" do
414
+ ENV["ftp_proxy"] = "ftp://proxy"
415
+ transport.stubs(:connection).yields(connection)
416
+ if running_tests_on_windows?
417
+ connection.expects(:execute).
418
+ with("env ftp_proxy=ftp://proxy FTP_PROXY=ftp://proxy install")
419
+ else
420
+ connection.expects(:execute).with("env ftp_proxy=ftp://proxy install")
421
+ end
422
+ cmd
423
+ end
424
+
425
+ it "invokes the #install_command with ENV[\"ftp_proxy\"] and ENV[\"no_proxy\"] set" do
426
+ ENV["ftp_proxy"] = "ftp://proxy"
427
+ ENV["no_proxy"] = "http://no"
428
+ transport.stubs(:connection).yields(connection)
429
+ if running_tests_on_windows?
430
+ connection.expects(:execute).
431
+ with("env ftp_proxy=ftp://proxy FTP_PROXY=http://proxy " \
432
+ "no_proxy=http://no NO_PROXY=http://no install")
433
+ else
434
+ connection.expects(:execute).with("env ftp_proxy=ftp://proxy " \
435
+ "no_proxy=http://no install")
436
+ end
437
+ cmd
438
+ end
439
+
440
+ it "invokes the #install_command with :http_proxy & :https_proxy & :ftp_proxy set" do
345
441
  config[:http_proxy] = "http://proxy"
346
442
  config[:https_proxy] = "https://proxy"
443
+ config[:ftp_proxy] = "ftp://proxy"
347
444
  transport.stubs(:connection).yields(connection)
348
445
  connection.expects(:execute).with(
349
- "env http_proxy=http://proxy https_proxy=https://proxy install")
446
+ "env http_proxy=http://proxy https_proxy=https://proxy ftp_proxy=ftp://proxy install")
350
447
 
351
448
  cmd
352
449
  end
@@ -428,12 +525,21 @@ describe Kitchen::Driver::SSHBase do
428
525
  cmd
429
526
  end
430
527
 
431
- it "invokes the Verifier#install_command with :http_proxy & :https_proxy set" do
528
+ it "invokes the Verifier#install_command with :ftp_proxy set in config" do
529
+ config[:ftp_proxy] = "ftp://proxy"
530
+ transport.stubs(:connection).yields(connection)
531
+ connection.expects(:execute).with("env ftp_proxy=ftp://proxy install")
532
+
533
+ cmd
534
+ end
535
+
536
+ it "invokes the Verifier#install_command with :http_proxy & :https_proxy & :ftp_proxy set" do
432
537
  config[:http_proxy] = "http://proxy"
433
538
  config[:https_proxy] = "https://proxy"
539
+ config[:ftp_proxy] = "ftp://proxy"
434
540
  transport.stubs(:connection).yields(connection)
435
541
  connection.expects(:execute).with(
436
- "env http_proxy=http://proxy https_proxy=https://proxy install")
542
+ "env http_proxy=http://proxy https_proxy=https://proxy ftp_proxy=ftp://proxy install")
437
543
 
438
544
  cmd
439
545
  end
@@ -505,11 +611,19 @@ describe Kitchen::Driver::SSHBase do
505
611
  cmd
506
612
  end
507
613
 
508
- it "invokes Verifier##{phase}_command with :http_proxy & :https_proxy set" do
614
+ it "invokes Verifier##{phase}_command with :ftp_proxy set in config" do
615
+ config[:ftp_proxy] = "ftp://proxy"
616
+ connection.expects(:execute).with("env ftp_proxy=ftp://proxy #{phase}")
617
+
618
+ cmd
619
+ end
620
+
621
+ it "invokes Verifier##{phase}_command with :http_proxy & :https_proxy & :ftp_proxy set" do
509
622
  config[:http_proxy] = "http://proxy"
510
623
  config[:https_proxy] = "https://proxy"
624
+ config[:ftp_proxy] = "ftp://proxy"
511
625
  connection.expects(:execute).with(
512
- "env http_proxy=http://proxy https_proxy=https://proxy #{phase}")
626
+ "env http_proxy=http://proxy https_proxy=https://proxy ftp_proxy=ftp://proxy #{phase}")
513
627
 
514
628
  cmd
515
629
  end
@@ -919,12 +1033,21 @@ describe Kitchen::Driver::SSHBase do
919
1033
  cmd
920
1034
  end
921
1035
 
922
- it "invokes the #install_command with :http_proxy & :https_proxy set" do
1036
+ it "invokes the #install_command with :ftp_proxy set in config" do
1037
+ config[:ftp_proxy] = "ftp://proxy"
1038
+ Kitchen::SSH.stubs(:new).returns(connection)
1039
+ connection.expects(:exec).with("env ftp_proxy=ftp://proxy huh")
1040
+
1041
+ cmd
1042
+ end
1043
+
1044
+ it "invokes the #install_command with :http_proxy & :https_proxy & :ftp_proxy set" do
923
1045
  config[:http_proxy] = "http://proxy"
924
1046
  config[:https_proxy] = "https://proxy"
1047
+ config[:ftp_proxy] = "ftp://proxy"
925
1048
  Kitchen::SSH.stubs(:new).returns(connection)
926
1049
  connection.expects(:exec).with(
927
- "env http_proxy=http://proxy https_proxy=https://proxy huh")
1050
+ "env http_proxy=http://proxy https_proxy=https://proxy ftp_proxy=ftp://proxy huh")
928
1051
 
929
1052
  cmd
930
1053
  end