mirror of
https://github.com/turbot/steampipe.git
synced 2026-02-22 05:00:21 -05:00
Update acceptance tests to use new functionality_test_mod. Closes #1056
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
benchmark "check_cache_benchmark" {
|
||||
title = "Benchmark to test the cache functionality in steampipe"
|
||||
children = [
|
||||
control.cache_test_1,
|
||||
control.cache_test_2
|
||||
]
|
||||
}
|
||||
|
||||
control "cache_test_1" {
|
||||
title = "Control to test cache functionality 1"
|
||||
description = "Control to test cache functionality in steampipe."
|
||||
sql = query.check_cache.sql
|
||||
severity = "high"
|
||||
}
|
||||
|
||||
control "cache_test_2" {
|
||||
title = "Control to test cache functionality 2"
|
||||
description = "Control to test cache functionality in steampipe."
|
||||
sql = query.check_cache.sql
|
||||
severity = "high"
|
||||
}
|
||||
@@ -0,0 +1,191 @@
|
||||
benchmark "query_and_control_parameters_benchmark" {
|
||||
title = "Benchmark to test the query and control parameter functionalities in steampipe"
|
||||
children = [
|
||||
control.query_params_with_defaults_and_no_args,
|
||||
control.query_params_with_defaults_and_partial_named_args,
|
||||
control.query_params_with_defaults_and_partial_positional_args,
|
||||
control.query_params_with_defaults_and_all_named_args,
|
||||
control.query_params_with_defaults_and_all_positional_args,
|
||||
control.query_params_with_no_defaults_and_no_args,
|
||||
control.query_params_with_no_defaults_with_named_args,
|
||||
control.query_params_with_no_defaults_with_positional_args,
|
||||
control.query_params_array_with_default,
|
||||
control.query_params_map_with_default,
|
||||
control.query_params_invalid_arg_syntax,
|
||||
control.query_inline_sql_from_control_with_partial_named_args,
|
||||
control.query_inline_sql_from_control_with_partial_positional_args,
|
||||
control.query_inline_sql_from_control_with_no_args,
|
||||
control.query_inline_sql_from_control_with_all_positional_args,
|
||||
control.query_inline_sql_from_control_with_all_named_args
|
||||
]
|
||||
}
|
||||
|
||||
control "query_params_with_defaults_and_no_args" {
|
||||
title = "Control to test query param functionality with defaults(and no args passed)"
|
||||
query = query.query_params_with_all_defaults
|
||||
}
|
||||
|
||||
control "query_params_with_defaults_and_partial_named_args" {
|
||||
title = "Control to test query param functionality with defaults(and some named args passed in query)"
|
||||
query = query.query_params_with_all_defaults
|
||||
args = {
|
||||
"p2" = "command_parameter_2"
|
||||
}
|
||||
}
|
||||
|
||||
control "query_params_with_defaults_and_partial_positional_args" {
|
||||
title = "Control to test query param functionality with defaults(and some positional args passed in query)"
|
||||
query = query.query_params_with_all_defaults
|
||||
args = [ "command_parameter_1" ]
|
||||
}
|
||||
|
||||
control "query_params_with_defaults_and_all_named_args" {
|
||||
title = "Control to test query param functionality with defaults(and all named args passed in query)"
|
||||
query = query.query_params_with_all_defaults
|
||||
args = {
|
||||
"p1" = "command_parameter_1"
|
||||
"p2" = "command_parameter_2"
|
||||
"p3" = "command_parameter_3"
|
||||
}
|
||||
}
|
||||
|
||||
control "query_params_with_defaults_and_all_positional_args" {
|
||||
title = "Control to test query param functionality with defaults(and all positional args passed in query)"
|
||||
query = query.query_params_with_all_defaults
|
||||
args = [ "command_parameter_1", "command_parameter_2", "command_parameter_3" ]
|
||||
}
|
||||
|
||||
control "query_params_with_no_defaults_and_no_args" {
|
||||
title = "Control to test query param functionality with no defaults(and no args passed)"
|
||||
query = query.query_params_with_no_defaults
|
||||
}
|
||||
|
||||
control "query_params_with_no_defaults_with_named_args" {
|
||||
title = "Control to test query param functionality with no defaults(and args passed in query)"
|
||||
query = query.query_params_with_no_defaults
|
||||
args = {
|
||||
"p1" = "command_parameter_1"
|
||||
"p2" = "command_parameter_2"
|
||||
"p3" = "command_parameter_3"
|
||||
}
|
||||
}
|
||||
|
||||
control "query_params_with_no_defaults_with_positional_args" {
|
||||
title = "Control to test query param functionality with no defaults(and positional args passed in query)"
|
||||
query = query.query_params_with_no_defaults
|
||||
args = [ "command_parameter_1", "command_parameter_2","command_parameter_3" ]
|
||||
}
|
||||
|
||||
control "query_params_array_with_default" {
|
||||
title = "Control to test query param functionality with an array param with default(and no args passed)"
|
||||
query = query.query_array_params_with_default
|
||||
}
|
||||
|
||||
control "query_params_map_with_default" {
|
||||
title = "Control to test query param functionality with a map param with default(and no args passed)"
|
||||
query = query.query_map_params_with_default
|
||||
}
|
||||
|
||||
control "query_params_invalid_arg_syntax" {
|
||||
title = "Control to test query param functionality with a map param with no default(and invalid args passed in query)"
|
||||
query = query.query_map_params_with_no_default
|
||||
args = {
|
||||
"p1" = "command_parameter_1"
|
||||
}
|
||||
}
|
||||
|
||||
control "query_inline_sql_from_control_with_partial_named_args" {
|
||||
title = "Control to test the inline sql functionality within a control with defaults(and some named args passed in control)"
|
||||
sql = "select 'ok' as status, 'steampipe' as resource, concat($1::text, ' ', $2::text, ' ', $3::text) as reason"
|
||||
param "p1"{
|
||||
description = "p1"
|
||||
default = "default_parameter_1"
|
||||
}
|
||||
param "p2"{
|
||||
description = "p2"
|
||||
default = "default_parameter_2"
|
||||
}
|
||||
param "p3"{
|
||||
description = "p3"
|
||||
default = "default_parameter_3"
|
||||
}
|
||||
args = {
|
||||
"p1" = "command_parameter_1"
|
||||
"p3" = "command_parameter_3"
|
||||
}
|
||||
}
|
||||
|
||||
control "query_inline_sql_from_control_with_partial_positional_args" {
|
||||
title = "Control to test the inline sql functionality within a control with defaults(and some positional args passed in control)"
|
||||
sql = "select 'ok' as status, 'steampipe' as resource, concat($1::text, ' ', $2::text, ' ', $3::text) as reason"
|
||||
param "p1"{
|
||||
description = "p1"
|
||||
default = "default_parameter_1"
|
||||
}
|
||||
param "p2"{
|
||||
description = "p2"
|
||||
default = "default_parameter_2"
|
||||
}
|
||||
param "p3"{
|
||||
description = "p3"
|
||||
default = "default_parameter_3"
|
||||
}
|
||||
args = [ "command_parameter_1", "command_parameter_2" ]
|
||||
}
|
||||
|
||||
control "query_inline_sql_from_control_with_no_args" {
|
||||
title = "Control to test the inline sql functionality within a control with defaults(and no args passed in control)"
|
||||
sql = "select 'ok' as status, 'steampipe' as resource, concat($1::text, ' ', $2::text, ' ', $3::text) as reason"
|
||||
param "p1"{
|
||||
description = "p1"
|
||||
default = "default_parameter_1"
|
||||
}
|
||||
param "p2"{
|
||||
description = "p2"
|
||||
default = "default_parameter_2"
|
||||
}
|
||||
param "p3"{
|
||||
description = "p3"
|
||||
default = "default_parameter_3"
|
||||
}
|
||||
}
|
||||
|
||||
control "query_inline_sql_from_control_with_all_positional_args" {
|
||||
title = "Control to test the inline sql functionality within a control with defaults(and all positional args passed in control)"
|
||||
sql = "select 'ok' as status, 'steampipe' as resource, concat($1::text, ' ', $2::text, ' ', $3::text) as reason"
|
||||
param "p1"{
|
||||
description = "p1"
|
||||
default = "default_parameter_1"
|
||||
}
|
||||
param "p2"{
|
||||
description = "p2"
|
||||
default = "default_parameter_2"
|
||||
}
|
||||
param "p3"{
|
||||
description = "p3"
|
||||
default = "default_parameter_3"
|
||||
}
|
||||
args = [ "command_parameter_1", "command_parameter_2", "command_parameter_3" ]
|
||||
}
|
||||
|
||||
control "query_inline_sql_from_control_with_all_named_args" {
|
||||
title = "Control to test the inline sql functionality within a control with defaults(and all named args passed in control)"
|
||||
sql = "select 'ok' as status, 'steampipe' as resource, concat($1::text, ' ', $2::text, ' ', $3::text) as reason"
|
||||
param "p1"{
|
||||
description = "p1"
|
||||
default = "default_parameter_1"
|
||||
}
|
||||
param "p2"{
|
||||
description = "p2"
|
||||
default = "default_parameter_2"
|
||||
}
|
||||
param "p3"{
|
||||
description = "p3"
|
||||
default = "default_parameter_3"
|
||||
}
|
||||
args = {
|
||||
"p1" = "command_parameter_1"
|
||||
"p2" = "command_parameter_2"
|
||||
"p3" = "command_parameter_3"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
benchmark "control_summary_benchmark" {
|
||||
title = "Benchmark to test the check summary output in steampipe"
|
||||
children = [
|
||||
control.sample_control_1,
|
||||
control.sample_control_2,
|
||||
control.sample_control_3,
|
||||
control.sample_control_4,
|
||||
control.sample_control_5
|
||||
]
|
||||
}
|
||||
|
||||
control "sample_control_1" {
|
||||
title = "Sample control 1"
|
||||
description = "A sample control"
|
||||
sql = query.static_query.sql
|
||||
severity = "high"
|
||||
}
|
||||
|
||||
control "sample_control_2" {
|
||||
title = "Sample control 2"
|
||||
description = "A sample control"
|
||||
sql = query.static_query.sql
|
||||
severity = "critical"
|
||||
}
|
||||
|
||||
control "sample_control_3" {
|
||||
title = "Sample control 3"
|
||||
description = "A sample control"
|
||||
sql = query.static_query.sql
|
||||
severity = "high"
|
||||
}
|
||||
|
||||
control "sample_control_4" {
|
||||
title = "Sample control 4"
|
||||
description = "A sample control that returns ERROR"
|
||||
sql = query.static_query.sql
|
||||
severity = "critical"
|
||||
}
|
||||
|
||||
control "sample_control_5" {
|
||||
title = "Sample control 5"
|
||||
description = "A sample control"
|
||||
sql = query.static_query.sql
|
||||
severity = "high"
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
benchmark "check_plugin_crash_benchmark" {
|
||||
title = "Benchmark to test the plugin crash bug while running controls"
|
||||
children = [
|
||||
control.plugin_chaos_test_1,
|
||||
control.plugin_crash_test,
|
||||
control.plugin_chaos_test_2
|
||||
]
|
||||
}
|
||||
|
||||
control "plugin_chaos_test_1" {
|
||||
title = "Control to query a chaos table"
|
||||
description = "Control to query a chaos table to test all flavours of integer and float data types"
|
||||
sql = query.check_plugincrash_normalquery1.sql
|
||||
severity = "high"
|
||||
}
|
||||
|
||||
control "plugin_crash_test" {
|
||||
title = "Control to simulate a plugin crash"
|
||||
description = "Control to query a chaos table that prints 50 rows and do an os.Exit(-1) to simulate a plugin crash"
|
||||
sql = "select * from chaos_plugin_crash"
|
||||
severity = "high"
|
||||
}
|
||||
|
||||
control "plugin_chaos_test_2" {
|
||||
title = "Control to query a chaos table"
|
||||
description = "Control to query a chaos table test the Get call with all the possible scenarios like errors, panics and delays"
|
||||
sql = query.check_plugincrash_normalquery2.sql
|
||||
severity = "high"
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
benchmark "check_search_path_benchmark" {
|
||||
title = "Benchmark to test search path and search path prefix functionalities in steampipe check"
|
||||
children = [
|
||||
control.search_path_test_1,
|
||||
control.search_path_test_2,
|
||||
control.search_path_test_3,
|
||||
control.search_path_test_4,
|
||||
control.search_path_test_5,
|
||||
control.search_path_test_6
|
||||
]
|
||||
}
|
||||
|
||||
control "search_path_test_1" {
|
||||
title = "Control to test search path prefix functionality when entered through CLI"
|
||||
description = "Control to test search path prefix functionality when entered through CLI."
|
||||
sql = query.search_path_1.sql
|
||||
severity = "high"
|
||||
}
|
||||
|
||||
control "search_path_test_2" {
|
||||
title = "Control to test search path functionality when entered through CLI"
|
||||
description = "Control to test search path functionality when entered through CLI."
|
||||
sql = query.search_path_2.sql
|
||||
severity = "high"
|
||||
}
|
||||
|
||||
control "search_path_test_3" {
|
||||
title = "Control to test search path and prefix functionality when entered through CLI"
|
||||
description = "Control to test search path and prefix functionality when entered through CLI."
|
||||
sql = query.search_path_1.sql
|
||||
severity = "high"
|
||||
}
|
||||
|
||||
control "search_path_test_4" {
|
||||
title = "Control to test search path prefix functionality when entered through control"
|
||||
description = "Control to test search path prefix functionality when entered through control."
|
||||
sql = query.search_path_1.sql
|
||||
search_path_prefix = "aws"
|
||||
severity = "high"
|
||||
}
|
||||
|
||||
control "search_path_test_5" {
|
||||
title = "Control to test search path functionality when entered through control"
|
||||
description = "Control to test search path functionality when entered through control."
|
||||
sql = query.search_path_2.sql
|
||||
search_path = "chaos,b,c"
|
||||
severity = "high"
|
||||
}
|
||||
|
||||
control "search_path_test_6" {
|
||||
title = "Control to test search path and prefix functionality when entered through control"
|
||||
description = "Control to test search path and prefix functionality when entered through control."
|
||||
sql = query.search_path_1.sql
|
||||
search_path_prefix = "aws"
|
||||
search_path = "a,b,c"
|
||||
severity = "high"
|
||||
}
|
||||
Reference in New Issue
Block a user