From a3ebb13bb697344fa3a1839b152d8dc977767135 Mon Sep 17 00:00:00 2001 From: Carrie Roberts Date: Wed, 5 Feb 2020 10:31:08 -0700 Subject: [PATCH] Build check (#816) * move emond test into correct T# * only show cleanup with inputs if there are inputs * ensure both prereq and get_prereq commands are specified Co-authored-by: Tony M Lambert Co-authored-by: Michael Haag --- atomic_red_team/atomic_red_team.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/atomic_red_team/atomic_red_team.rb b/atomic_red_team/atomic_red_team.rb index 6634dfa2..bf104bf8 100755 --- a/atomic_red_team/atomic_red_team.rb +++ b/atomic_red_team/atomic_red_team.rb @@ -90,7 +90,14 @@ class AtomicRedTeam raise("`atomic_tests[#{i}].supported_platforms` '#{platform}' must be one of #{valid_supported_platforms.join(', ')}") end end - + + if atomic['dependencies'] + atomic['dependencies'].each do |dependency| + raise("`atomic_tests[#{i}].dependencies` '#{dependency}' must be have a description}") unless dependency.has_key?('description') + raise("`atomic_tests[#{i}].dependencies` '#{dependency}' must be have a prereq_command}") unless dependency.has_key?('prereq_command') + raise("`atomic_tests[#{i}].dependencies` '#{dependency}' must be have a get_prereq_command}") unless dependency.has_key?('get_prereq_command') + end + end (atomic['input_arguments'] || {}).each_with_index do |arg_kvp, iai| arg_name, arg = arg_kvp raise("`atomic_tests[#{i}].input_arguments[#{iai}].description` element is required") unless arg.has_key?('description')