aboutsummaryrefslogtreecommitdiff
path: root/lib/leap_cli/commands/test.rb
diff options
context:
space:
mode:
authorelijah <elijah@riseup.net>2012-11-23 01:49:23 -0800
committerelijah <elijah@riseup.net>2012-11-23 01:49:23 -0800
commit30f42d5869f65d3171878b4d6d94e9c3813f02cf (patch)
treeda387d9e24a1722887d06e0f698e96f823f60ec1 /lib/leap_cli/commands/test.rb
parent9d573fb01392ab0fe645b32191d61e4a8bf38afc (diff)
downloadleap_cli-30f42d5869f65d3171878b4d6d94e9c3813f02cf.tar.gz
leap_cli-30f42d5869f65d3171878b4d6d94e9c3813f02cf.tar.bz2
initial work toward 'leap test'. for now, it generates an openvpn config for client testing. try 'leap init-test'
Diffstat (limited to 'lib/leap_cli/commands/test.rb')
-rw-r--r--lib/leap_cli/commands/test.rb26
1 files changed, 26 insertions, 0 deletions
diff --git a/lib/leap_cli/commands/test.rb b/lib/leap_cli/commands/test.rb
new file mode 100644
index 0000000..dc08652
--- /dev/null
+++ b/lib/leap_cli/commands/test.rb
@@ -0,0 +1,26 @@
+module LeapCli; module Commands
+
+ desc 'Creates files needed to run tests'
+ command :'init-test' do |c|
+ c.action do |global_options,options,args|
+ generate_test_client_cert
+ generate_test_client_openvpn_config
+ end
+ end
+
+ desc 'Run tests'
+ command :test do |c|
+ c.action do |global_options,options,args|
+ log 'not yet implemented'
+ end
+ end
+
+ private
+
+ 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
+ end
+
+end; end