From 3e7c500dda3a1998a892a9ee06dabf5a2fa70f38 Mon Sep 17 00:00:00 2001 From: elijah Date: Thu, 5 Dec 2013 16:26:36 -0800 Subject: added no-deploy check and simple `leap test run`. --- lib/leap_cli/commands/deploy.rb | 5 +++-- lib/leap_cli/commands/test.rb | 10 +++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'lib/leap_cli/commands') diff --git a/lib/leap_cli/commands/deploy.rb b/lib/leap_cli/commands/deploy.rb index 23af0f7..61323c9 100644 --- a/lib/leap_cli/commands/deploy.rb +++ b/lib/leap_cli/commands/deploy.rb @@ -39,6 +39,7 @@ module LeapCli ssh_connect(nodes, connect_options(options)) do |ssh| ssh.leap.log :checking, 'node' do + ssh.leap.check_for_no_deploy ssh.leap.assert_initialized end ssh.leap.log :synching, "configuration files" do @@ -94,13 +95,13 @@ module LeapCli def sync_puppet_files(ssh) ssh.rsync.update do |server| - ssh.leap.log(Path.platform + '/[bin,puppet] -> ' + server.host + ':' + LeapCli::PUPPET_DESTINATION) + ssh.leap.log(Path.platform + '/[bin,tests,puppet] -> ' + server.host + ':' + LeapCli::PUPPET_DESTINATION) { :dest => LeapCli::PUPPET_DESTINATION, :source => '.', :chdir => Path.platform, :excludes => '*', - :includes => ['/bin', '/bin/**', '/puppet', '/puppet/**'], + :includes => ['/bin', '/bin/**', '/puppet', '/puppet/**', '/tests', '/tests/**'], :flags => "-rlt --relative --delete --copy-links" } end diff --git a/lib/leap_cli/commands/test.rb b/lib/leap_cli/commands/test.rb index c240a70..7066241 100644 --- a/lib/leap_cli/commands/test.rb +++ b/lib/leap_cli/commands/test.rb @@ -12,7 +12,11 @@ module LeapCli; module Commands test.desc 'Run tests.' test.command :run do |run| run.action do |global_options,options,args| - log 'not yet implemented' + manager.filter!(args).each_node do |node| + ssh_connect(node) do |ssh| + ssh.run(test_cmd) + end + end end end @@ -21,6 +25,10 @@ module LeapCli; module Commands private + def test_cmd + "#{PUPPET_DESTINATION}/bin/run_tests" + end + # # generates a whole bunch of openvpn configs that can be used to connect to different openvpn gateways # -- cgit v1.2.3