summaryrefslogtreecommitdiff
path: root/lib/leap_cli/commands/test.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2013-01-31 04:30:12 -0800
committerelijah <elijah@riseup.net>2013-01-31 04:30:12 -0800
commitdf8ee516a7c556de447322d48d8ac2e4d26c27a4 (patch)
tree7097f94eb7ecae86d56ad1b8acfe167eb762ceca /lib/leap_cli/commands/test.rb
parente8ae3f3fd59f86e59ef511d62d31eacaf3d7c17b (diff)
generate better testing openvpn client configs in test/openvpn
Diffstat (limited to 'lib/leap_cli/commands/test.rb')
-rw-r--r--lib/leap_cli/commands/test.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/leap_cli/commands/test.rb b/lib/leap_cli/commands/test.rb
index dd505b6..e895a5e 100644
--- a/lib/leap_cli/commands/test.rb
+++ b/lib/leap_cli/commands/test.rb
@@ -24,8 +24,14 @@ module LeapCli; module Commands
def generate_test_client_openvpn_config
template = read_file! Path.find_file(:test_client_openvpn_template)
- config = Util.erb_eval(template, binding)
- write_file! :test_client_openvpn_config, config
+
+ ['production', 'testing', 'local'].each do |tag|
+ vpn_nodes = manager.nodes[:tags => tag][:services => 'openvpn']
+ if vpn_nodes.any?
+ config = Util.erb_eval(template, binding)
+ write_file! ('test_openvpn_'+tag).to_sym, config
+ end
+ end
end
end; end