norad_cli 0.1.6 → 0.1.8

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6845add9cfabc34338bc67744b6d3b4509f3a0bd
4
- data.tar.gz: 870a0347fd4929e075c877eaec20034d3471317e
3
+ metadata.gz: 3f606aeaa79482bbf32e5d7f6afff6e1178a35a5
4
+ data.tar.gz: 2cd7aef8152ce1623e20bb82fc0670a309f1866c
5
5
  SHA512:
6
- metadata.gz: 31bfb046789af2d16a86f912db431b5b10e4e9ec1b7fead6fd6be4db6841c04748d3c9cc5e7ee68d9ece1d606167cfaa9127864c5b44b6d59811450f9ffe4a30
7
- data.tar.gz: 05d22bb8f7ff35bf7abd624003c2d023f9778370d791a6558b92296c48458a20a318a0a3d05609be97cb4a74d7dcde205c5a43b44c78d7c13ef499c1f066885c
6
+ metadata.gz: 6c461bd847cd10274b816ae1e29b9445e835315d85a296238f9649e809bddb86a20a4f221607be68a19fba687f04c3c919e07f37aa6239bcbd76b70359509be0
7
+ data.tar.gz: 9264b190fdcbc625b61101142690ce24e2ddbfeaeb55e550ca4fe08e2462ba0ea7baac90fb678f6e1205a265624fef1231a26c1c584ddc70a41ae70ff3efcdd6
@@ -25,6 +25,13 @@ class Sectest < Thor
25
25
  # Check for the root_dir
26
26
  root_dir?
27
27
 
28
+ # Check for valid test types
29
+ if !%w(authenticated web_application brute_force ssl_crypto ssh_crypto whole_host).include?(options[:test_type])
30
+ say("#{options[:test_type]} is not a supported test type", :red)
31
+ say('Exiting...', :red)
32
+ exit(1)
33
+ end
34
+
28
35
  # Set options for templates
29
36
  options[:name] = sectest_name
30
37
  options[:spec_class_name] = sectest_name.split('-').map { |t| t =~ /\d+/ ? t : t.capitalize! }.join
@@ -149,6 +156,7 @@ class Sectest < Thor
149
156
 
150
157
  desc 'spec:image SECTESTNAME', 'Run the rspec tests for SECTESTNAME'
151
158
  option :verbose, aliases: '-v', type: :boolean, desc: 'Turn on verbose logging'
159
+ option :debug, aliases: '-d', type: :boolean, desc: 'Turn on debugging'
152
160
  define_method 'spec:image' do |name|
153
161
  # Check for the root_dir
154
162
  root_dir?
@@ -158,6 +166,10 @@ class Sectest < Thor
158
166
  ENV['ENABLE_LOGS'] = 'true'
159
167
  end
160
168
 
169
+ if options[:debug]
170
+ ENV['ENABLE_NORAD_DEBUG'] = 'true'
171
+ end
172
+
161
173
  ENV['SCAN_ASSESSMENT'] = 'true'
162
174
  ENV['TEST_RESULTS_SERVER_IMAGE'] = 'docker-images-test-results-server'
163
175
  ENV['UBUNTU_SSH_SERVER_IMAGE'] = 'docker-images-test-ubuntu-ssh-server'
@@ -168,7 +180,7 @@ class Sectest < Thor
168
180
 
169
181
  desc 'spec', 'Run all rspec tests for the entire repo (all sectests)'
170
182
  option :verbose, aliases: '-v', type: :boolean, default: false, desc: 'Turn on verbose logging'
171
- option :scan_assessment, aliases: '-s', type: :boolean, default: true, desc: 'Fix me'
183
+ option :debug, aliases: '-d', type: :boolean, desc: 'Turn on debugging'
172
184
  def spec
173
185
  # Check for the root_dir
174
186
  root_dir?
@@ -239,7 +251,7 @@ class Sectest < Thor
239
251
  def root_dir?
240
252
  %w(base spec sectests).each do |dirrepo_name|
241
253
  if !File.exist?(dirrepo_name)
242
- say("Commands must be run from the root directory\nExiting....", :red)
254
+ say("Commands must be run from the root of the test repository\nExiting....", :red)
243
255
  exit(1)
244
256
  end
245
257
  end
@@ -181,7 +181,10 @@ if ENV['SCAN_ASSESSMENT']
181
181
 
182
182
  define_method :stop_target_machine do |machine|
183
183
  machine.stop
184
- machine.delete(force: true)
184
+ # Do not delete targets if debugging enabled
185
+ if !ENV['ENABLE_NORAD_DEBUG']
186
+ machine.delete(force: true)
187
+ end
185
188
  machine.id
186
189
  end
187
190
 
@@ -9,9 +9,12 @@ def run(args)
9
9
  ['FIXME:TOOL_OPTION', 'FIXME:TOOL_OPTION', 'FIXME:TOOL_OPTION'].flatten,
10
10
  timeout)
11
11
 
12
- # Execute the runner
12
+ # Execute the runner, write output to a file, and process
13
13
  runner.execute
14
14
 
15
+ # Or Execute the runner and process stdout
16
+ # runner.execute(true)
17
+
15
18
  # Ensure the tool created results
16
19
  runner.parse_results do |fh|
17
20
  ############################
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module NoradCli
3
- VERSION = '0.1.6'
3
+ VERSION = '0.1.8'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: norad_cli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Blake Hitchcock