mirror of
https://github.com/turbot/steampipe.git
synced 2025-12-19 18:12:43 -05:00
Merge remote-tracking branch 'origin/v0.21.x'
# Conflicts: # tests/acceptance/test_files/chaos_and_query.bats
This commit is contained in:
@@ -1,7 +1,3 @@
|
||||
connection "chaos_ttl_options" {
|
||||
plugin = "chaos"
|
||||
options "connection" {
|
||||
cache = true
|
||||
cache_ttl = 10
|
||||
}
|
||||
}
|
||||
@@ -1,164 +1,132 @@
|
||||
[
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
{
|
||||
"column_0": "column_0-0",
|
||||
"column_1": "column_1-0",
|
||||
"column_2": "column_2-0",
|
||||
"column_3": "column_3-0",
|
||||
"column_4": "column_4-0",
|
||||
"column_5": "column_5-0",
|
||||
"column_6": "column_6-0",
|
||||
"column_7": "column_7-0",
|
||||
"column_8": "column_8-0",
|
||||
"column_9": "column_9-0",
|
||||
"id": 0
|
||||
},
|
||||
"column_0": "column_0-0",
|
||||
"column_1": "column_1-0",
|
||||
"column_2": "column_2-0",
|
||||
"column_3": "column_3-0",
|
||||
"column_4": "column_4-0",
|
||||
"column_5": "column_5-0",
|
||||
"column_6": "column_6-0",
|
||||
"column_7": "column_7-0",
|
||||
"column_8": "column_8-0",
|
||||
"column_9": "column_9-0",
|
||||
"id": 0
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
{
|
||||
"column_0": "column_0-1",
|
||||
"column_1": "column_1-1",
|
||||
"column_2": "column_2-1",
|
||||
"column_3": "column_3-1",
|
||||
"column_4": "column_4-1",
|
||||
"column_5": "column_5-1",
|
||||
"column_6": "column_6-1",
|
||||
"column_7": "column_7-1",
|
||||
"column_8": "column_8-1",
|
||||
"column_9": "column_9-1",
|
||||
"id": 1
|
||||
},
|
||||
"column_0": "column_0-1",
|
||||
"column_1": "column_1-1",
|
||||
"column_2": "column_2-1",
|
||||
"column_3": "column_3-1",
|
||||
"column_4": "column_4-1",
|
||||
"column_5": "column_5-1",
|
||||
"column_6": "column_6-1",
|
||||
"column_7": "column_7-1",
|
||||
"column_8": "column_8-1",
|
||||
"column_9": "column_9-1",
|
||||
"id": 1
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
{
|
||||
"column_0": "column_0-10",
|
||||
"column_1": "column_1-10",
|
||||
"column_2": "column_2-10",
|
||||
"column_3": "column_3-10",
|
||||
"column_4": "column_4-10",
|
||||
"column_5": "column_5-10",
|
||||
"column_6": "column_6-10",
|
||||
"column_7": "column_7-10",
|
||||
"column_8": "column_8-10",
|
||||
"column_9": "column_9-10",
|
||||
"id": 10
|
||||
},
|
||||
"column_0": "column_0-10",
|
||||
"column_1": "column_1-10",
|
||||
"column_2": "column_2-10",
|
||||
"column_3": "column_3-10",
|
||||
"column_4": "column_4-10",
|
||||
"column_5": "column_5-10",
|
||||
"column_6": "column_6-10",
|
||||
"column_7": "column_7-10",
|
||||
"column_8": "column_8-10",
|
||||
"column_9": "column_9-10",
|
||||
"id": 10
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
{
|
||||
"column_0": "column_0-100",
|
||||
"column_1": "column_1-100",
|
||||
"column_2": "column_2-100",
|
||||
"column_3": "column_3-100",
|
||||
"column_4": "column_4-100",
|
||||
"column_5": "column_5-100",
|
||||
"column_6": "column_6-100",
|
||||
"column_7": "column_7-100",
|
||||
"column_8": "column_8-100",
|
||||
"column_9": "column_9-100",
|
||||
"id": 100
|
||||
},
|
||||
"column_0": "column_0-100",
|
||||
"column_1": "column_1-100",
|
||||
"column_2": "column_2-100",
|
||||
"column_3": "column_3-100",
|
||||
"column_4": "column_4-100",
|
||||
"column_5": "column_5-100",
|
||||
"column_6": "column_6-100",
|
||||
"column_7": "column_7-100",
|
||||
"column_8": "column_8-100",
|
||||
"column_9": "column_9-100",
|
||||
"id": 100
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
{
|
||||
"column_0": "column_0-1000",
|
||||
"column_1": "column_1-1000",
|
||||
"column_2": "column_2-1000",
|
||||
"column_3": "column_3-1000",
|
||||
"column_4": "column_4-1000",
|
||||
"column_5": "column_5-1000",
|
||||
"column_6": "column_6-1000",
|
||||
"column_7": "column_7-1000",
|
||||
"column_8": "column_8-1000",
|
||||
"column_9": "column_9-1000",
|
||||
"id": 1000
|
||||
},
|
||||
"column_0": "column_0-1000",
|
||||
"column_1": "column_1-1000",
|
||||
"column_2": "column_2-1000",
|
||||
"column_3": "column_3-1000",
|
||||
"column_4": "column_4-1000",
|
||||
"column_5": "column_5-1000",
|
||||
"column_6": "column_6-1000",
|
||||
"column_7": "column_7-1000",
|
||||
"column_8": "column_8-1000",
|
||||
"column_9": "column_9-1000",
|
||||
"id": 1000
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
{
|
||||
"column_0": "column_0-1001",
|
||||
"column_1": "column_1-1001",
|
||||
"column_2": "column_2-1001",
|
||||
"column_3": "column_3-1001",
|
||||
"column_4": "column_4-1001",
|
||||
"column_5": "column_5-1001",
|
||||
"column_6": "column_6-1001",
|
||||
"column_7": "column_7-1001",
|
||||
"column_8": "column_8-1001",
|
||||
"column_9": "column_9-1001",
|
||||
"id": 1001
|
||||
},
|
||||
"column_0": "column_0-1001",
|
||||
"column_1": "column_1-1001",
|
||||
"column_2": "column_2-1001",
|
||||
"column_3": "column_3-1001",
|
||||
"column_4": "column_4-1001",
|
||||
"column_5": "column_5-1001",
|
||||
"column_6": "column_6-1001",
|
||||
"column_7": "column_7-1001",
|
||||
"column_8": "column_8-1001",
|
||||
"column_9": "column_9-1001",
|
||||
"id": 1001
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
{
|
||||
"column_0": "column_0-1002",
|
||||
"column_1": "column_1-1002",
|
||||
"column_2": "column_2-1002",
|
||||
"column_3": "column_3-1002",
|
||||
"column_4": "column_4-1002",
|
||||
"column_5": "column_5-1002",
|
||||
"column_6": "column_6-1002",
|
||||
"column_7": "column_7-1002",
|
||||
"column_8": "column_8-1002",
|
||||
"column_9": "column_9-1002",
|
||||
"id": 1002
|
||||
},
|
||||
"column_0": "column_0-1002",
|
||||
"column_1": "column_1-1002",
|
||||
"column_2": "column_2-1002",
|
||||
"column_3": "column_3-1002",
|
||||
"column_4": "column_4-1002",
|
||||
"column_5": "column_5-1002",
|
||||
"column_6": "column_6-1002",
|
||||
"column_7": "column_7-1002",
|
||||
"column_8": "column_8-1002",
|
||||
"column_9": "column_9-1002",
|
||||
"id": 1002
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
{
|
||||
"column_0": "column_0-1003",
|
||||
"column_1": "column_1-1003",
|
||||
"column_2": "column_2-1003",
|
||||
"column_3": "column_3-1003",
|
||||
"column_4": "column_4-1003",
|
||||
"column_5": "column_5-1003",
|
||||
"column_6": "column_6-1003",
|
||||
"column_7": "column_7-1003",
|
||||
"column_8": "column_8-1003",
|
||||
"column_9": "column_9-1003",
|
||||
"id": 1003
|
||||
},
|
||||
"column_0": "column_0-1003",
|
||||
"column_1": "column_1-1003",
|
||||
"column_2": "column_2-1003",
|
||||
"column_3": "column_3-1003",
|
||||
"column_4": "column_4-1003",
|
||||
"column_5": "column_5-1003",
|
||||
"column_6": "column_6-1003",
|
||||
"column_7": "column_7-1003",
|
||||
"column_8": "column_8-1003",
|
||||
"column_9": "column_9-1003",
|
||||
"id": 1003
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
{
|
||||
"column_0": "column_0-1004",
|
||||
"column_1": "column_1-1004",
|
||||
"column_2": "column_2-1004",
|
||||
"column_3": "column_3-1004",
|
||||
"column_4": "column_4-1004",
|
||||
"column_5": "column_5-1004",
|
||||
"column_6": "column_6-1004",
|
||||
"column_7": "column_7-1004",
|
||||
"column_8": "column_8-1004",
|
||||
"column_9": "column_9-1004",
|
||||
"id": 1004
|
||||
},
|
||||
"column_0": "column_0-1004",
|
||||
"column_1": "column_1-1004",
|
||||
"column_2": "column_2-1004",
|
||||
"column_3": "column_3-1004",
|
||||
"column_4": "column_4-1004",
|
||||
"column_5": "column_5-1004",
|
||||
"column_6": "column_6-1004",
|
||||
"column_7": "column_7-1004",
|
||||
"column_8": "column_8-1004",
|
||||
"column_9": "column_9-1004",
|
||||
"id": 1004
|
||||
},
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
},
|
||||
"column_0": "column_0-1005",
|
||||
"column_1": "column_1-1005",
|
||||
"column_2": "column_2-1005",
|
||||
"column_3": "column_3-1005",
|
||||
"column_4": "column_4-1005",
|
||||
"column_5": "column_5-1005",
|
||||
"column_6": "column_6-1005",
|
||||
"column_7": "column_7-1005",
|
||||
"column_8": "column_8-1005",
|
||||
"column_9": "column_9-1005",
|
||||
"id": 1005
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
{
|
||||
"column_0": "column_0-1005",
|
||||
"column_1": "column_1-1005",
|
||||
"column_2": "column_2-1005",
|
||||
"column_3": "column_3-1005",
|
||||
"column_4": "column_4-1005",
|
||||
"column_5": "column_5-1005",
|
||||
"column_6": "column_6-1005",
|
||||
"column_7": "column_7-1005",
|
||||
"column_8": "column_8-1005",
|
||||
"column_9": "column_9-1005",
|
||||
"id": 1005
|
||||
}
|
||||
]
|
||||
@@ -1,8 +1,5 @@
|
||||
[
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
},
|
||||
"column_1": "parallelHydrate1",
|
||||
"column_10": "parallelHydrate10",
|
||||
"column_11": "parallelHydrate11",
|
||||
@@ -25,6 +22,4 @@
|
||||
"column_9": "parallelHydrate9",
|
||||
"id": 0
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
]
|
||||
@@ -1,8 +1,5 @@
|
||||
[
|
||||
{
|
||||
"_ctx": {
|
||||
"connection_name": "chaos"
|
||||
},
|
||||
"hydrate_column_1": "hydrate1-0",
|
||||
"hydrate_column_2": "hydrate2-0-hydrate1-0",
|
||||
"hydrate_column_3": "hydrate3-0-hydrate2-0-hydrate1-0",
|
||||
@@ -10,6 +7,4 @@
|
||||
"hydrate_column_5": "hydrate5-0-hydrate4-0-hydrate1-0",
|
||||
"id": 0
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
]
|
||||
@@ -1,39 +1,30 @@
|
||||
load "$LIB_BATS_ASSERT/load.bash"
|
||||
load "$LIB_BATS_SUPPORT/load.bash"
|
||||
|
||||
@test "select * from chaos.chaos_high_row_count order by column_0" {
|
||||
steampipe query --output json "select * from chaos.chaos_high_row_count order by column_0 limit 10" > output.json
|
||||
run jd "$TEST_DATA_DIR/expected_1.json" output.json
|
||||
echo $output
|
||||
@test "select from chaos.chaos_high_row_count order by column_0" {
|
||||
run steampipe query --output json "select column_0,column_1,column_2,column_3,column_4,column_5,column_6,column_7,column_8,column_9,id from chaos.chaos_high_row_count order by column_0 limit 10"
|
||||
echo $output > $TEST_DATA_DIR/actual_1.json
|
||||
run jd $TEST_DATA_DIR/actual_1.json $TEST_DATA_DIR/expected_1.json
|
||||
rm -f $TEST_DATA_DIR/actual_1.json
|
||||
assert_success
|
||||
rm -f output.json
|
||||
}
|
||||
|
||||
@test "select id, string_column, json_column, boolean_column from chaos.chaos_all_column_types where id='0'" {
|
||||
steampipe query --output json "select id, string_column, json_column, boolean_column from chaos.chaos_all_column_types where id='0'" > output.json
|
||||
run jd "$TEST_DATA_DIR/expected_2.json" output.json
|
||||
echo $output
|
||||
assert_success
|
||||
rm -f output.json
|
||||
run steampipe query --output json "select id, string_column, json_column, boolean_column from chaos.chaos_all_column_types where id='0'"
|
||||
assert_equal "$output" "$(cat $TEST_DATA_DIR/expected_2.json)"
|
||||
}
|
||||
|
||||
@test "select * from chaos.chaos_high_column_count order by column_0" {
|
||||
steampipe query --output json "select * from chaos.chaos_high_column_count order by column_0 limit 10" > output.json
|
||||
run jd "$TEST_DATA_DIR/expected_3.json" output.json
|
||||
echo $output
|
||||
assert_success
|
||||
rm -f output.json
|
||||
@test "select from chaos.chaos_high_column_count order by column_0" {
|
||||
run steampipe query --output json "select * from chaos.chaos_high_column_count order by column_0 limit 10"
|
||||
assert_equal "$output" "$(cat $TEST_DATA_DIR/expected_3.json)"
|
||||
}
|
||||
|
||||
@test "select * from chaos.chaos_hydrate_columns_dependency where id='0'" {
|
||||
steampipe query --output json "select * from chaos.chaos_hydrate_columns_dependency where id='0'" > output.json
|
||||
run jd "$TEST_DATA_DIR/expected_5.json" output.json
|
||||
echo $output
|
||||
assert_success
|
||||
rm -f output.json
|
||||
@test "select from chaos.chaos_hydrate_columns_dependency where id='0'" {
|
||||
run steampipe query --output json "select hydrate_column_1,hydrate_column_2,hydrate_column_3,hydrate_column_4,hydrate_column_5,id from chaos.chaos_hydrate_columns_dependency where id='0'"
|
||||
assert_equal "$output" "$(cat $TEST_DATA_DIR/expected_5.json)"
|
||||
}
|
||||
|
||||
@test "select * from chaos.chaos_list_error" {
|
||||
@test "select from chaos.chaos_list_error" {
|
||||
run steampipe query "select fatal_error from chaos.chaos_list_errors"
|
||||
assert_output --partial 'fatalError'
|
||||
}
|
||||
@@ -49,33 +40,24 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
assert_output --partial 'TRANSFORM ERROR'
|
||||
}
|
||||
|
||||
@test "select * from chaos.chaos_hydrate_delay" {
|
||||
@test "select from chaos.chaos_hydrate_delay" {
|
||||
run steampipe query --output json "select delay from chaos.chaos_hydrate_errors order by id"
|
||||
assert_success
|
||||
}
|
||||
|
||||
@test "select * from chaos.chaos_parallel_hydrate_columns where id='0'" {
|
||||
steampipe query --output json "select * from chaos.chaos_parallel_hydrate_columns where id='0'" > output.json
|
||||
run jd "$TEST_DATA_DIR/expected_11.json" output.json
|
||||
echo $output
|
||||
assert_success
|
||||
rm -f output.json
|
||||
@test "select from chaos.chaos_parallel_hydrate_columns where id='0'" {
|
||||
run steampipe query --output json "select column_1,column_10,column_11,column_12,column_13,column_14,column_15,column_16,column_17,column_18,column_19,column_2,column_20,column_3,column_4,column_5,column_6,column_7,column_8,column_9,id from chaos.chaos_parallel_hydrate_columns where id='0'"
|
||||
assert_equal "$output" "$(cat $TEST_DATA_DIR/expected_11.json)"
|
||||
}
|
||||
|
||||
@test "select float32_data, id, int64_data, uint16_data from chaos.chaos_all_numeric_column where id='31'" {
|
||||
steampipe query --output json "select float32_data, id, int64_data, uint16_data from chaos.chaos_all_numeric_column where id='31'" > output.json
|
||||
run jd "$TEST_DATA_DIR/expected_12.json" output.json
|
||||
echo $output
|
||||
assert_success
|
||||
rm -f output.json
|
||||
run steampipe query --output json "select float32_data, id, int64_data, uint16_data from chaos.chaos_all_numeric_column where id='31'"
|
||||
assert_equal "$output" "$(cat $TEST_DATA_DIR/expected_12.json)"
|
||||
}
|
||||
|
||||
@test "select transform_method_column from chaos_transforms order by id" {
|
||||
steampipe query --output json "select transform_method_column from chaos_transforms order by id" > output.json
|
||||
run jd "$TEST_DATA_DIR/expected_14.json" output.json
|
||||
echo $output
|
||||
assert_success
|
||||
rm -f output.json
|
||||
run steampipe query --output json "select transform_method_column from chaos_transforms order by id"
|
||||
assert_equal "$output" "$(cat $TEST_DATA_DIR/expected_14.json)"
|
||||
}
|
||||
|
||||
@test "select parent_should_ignore_error from chaos.chaos_list_parent_child" {
|
||||
@@ -84,31 +66,22 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
}
|
||||
|
||||
@test "select from_qual_column from chaos_transforms where id=2" {
|
||||
steampipe query --output json "select from_qual_column from chaos_transforms where id=2" > output.json
|
||||
run jd "$TEST_DATA_DIR/expected_13.json" output.json
|
||||
echo $output
|
||||
assert_success
|
||||
rm -f output.json
|
||||
run steampipe query --output json "select from_qual_column from chaos_transforms where id=2"
|
||||
assert_equal "$output" "$(cat $TEST_DATA_DIR/expected_13.json)"
|
||||
}
|
||||
|
||||
@test "public schema insert select all types" {
|
||||
steampipe query "drop table if exists all_columns"
|
||||
steampipe query "create table all_columns (nullcolumn CHAR(2), booleancolumn boolean, textcolumn1 CHAR(20), textcolumn2 VARCHAR(20), textcolumn3 text, integercolumn1 smallint, integercolumn2 int, integercolumn3 SERIAL, integercolumn4 bigint, integercolumn5 bigserial, numericColumn numeric(6,4), realColumn real, floatcolumn float, date1 DATE, time1 TIME, timestamp1 TIMESTAMP, timestamp2 TIMESTAMPTZ, interval1 INTERVAL, array1 text[], jsondata jsonb, jsondata2 json, uuidcolumn UUID, ipAddress inet, macAddress macaddr, cidrRange cidr, xmlData xml, currency money)"
|
||||
steampipe query "INSERT INTO all_columns (nullcolumn, booleancolumn, textcolumn1, textcolumn2, textcolumn3, integercolumn1, integercolumn2, integercolumn3, integercolumn4, integercolumn5, numericColumn, realColumn, floatcolumn, date1, time1, timestamp1, timestamp2, interval1, array1, jsondata, jsondata2, uuidcolumn, ipAddress, macAddress, cidrRange, xmlData, currency) VALUES (NULL, TRUE, 'Yes', 'test for varchar', 'This is a very long text for the PostgreSQL text column', 3278, 21445454, 2147483645, 92233720368547758, 922337203685477580, 23.5141543, 4660.33777, 4.6816421254887534, '1978-02-05', '08:00:00', '2016-06-22 19:10:25-07', '2016-06-22 19:10:25-07', '1 year 2 months 3 days', '{\"(408)-589-5841\"}','{ \"customer\": \"John Doe\", \"items\": {\"product\": \"Beer\",\"qty\": 6}}', '{ \"customer\": \"John Doe\", \"items\": {\"product\": \"Beer\",\"qty\": 6}}', '6948DF80-14BD-4E04-8842-7668D9C001F5', '192.168.0.0', '08:00:2b:01:02:03', '10.1.2.3/32', '<book><title>Manual</title><chapter>...</chapter></book>', 922337203685477.57)"
|
||||
steampipe query "select * from all_columns" --output json > output.json
|
||||
run jd "$TEST_DATA_DIR/expected_6.json" output.json
|
||||
echo $output
|
||||
assert_success
|
||||
rm -f output.json
|
||||
run steampipe query "select * from all_columns" --output json
|
||||
assert_equal "$output" "$(cat $TEST_DATA_DIR/expected_6.json)"
|
||||
run steampipe query "drop table all_columns"
|
||||
}
|
||||
|
||||
@test "query json" {
|
||||
steampipe query "select 1 as val, 2 as col" --output json > output.json
|
||||
run jd "$TEST_DATA_DIR/expected_query_json.json" output.json
|
||||
echo $output
|
||||
assert_success
|
||||
rm -f output.json
|
||||
run steampipe query "select 1 as val, 2 as col" --output json
|
||||
assert_equal "$output" "$(cat $TEST_DATA_DIR/expected_query_json.json)"
|
||||
}
|
||||
|
||||
@test "query csv" {
|
||||
@@ -181,11 +154,8 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
}
|
||||
|
||||
@test "json" {
|
||||
steampipe query --output json "select id, string_column, json_column from chaos.chaos_all_column_types where id='0'" > output.json
|
||||
run jd "$TEST_DATA_DIR/expected_json.json" output.json
|
||||
echo $output
|
||||
assert_success
|
||||
rm -f output.json
|
||||
run steampipe query --output json "select id, string_column, json_column from chaos.chaos_all_column_types where id='0'"
|
||||
assert_equal "$output" "$(cat $TEST_DATA_DIR/expected_json.json)"
|
||||
}
|
||||
|
||||
@test "line" {
|
||||
@@ -254,11 +224,8 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
steampipe mod install
|
||||
# run steampipe query twice - the bug we are testing for caused the workspace lock to be deleted after the first query
|
||||
steampipe query "select 1 as a" --output json
|
||||
steampipe query "select 1 as a" --output json > output.json
|
||||
run jd "$TEST_DATA_DIR/expected_15.json" output.json
|
||||
echo $output
|
||||
assert_success
|
||||
rm -f output.json
|
||||
run steampipe query "select 1 as a" --output json
|
||||
assert_equal "$output" "$(cat $TEST_DATA_DIR/expected_15.json)"
|
||||
}
|
||||
|
||||
function teardown_file() {
|
||||
@@ -268,4 +235,4 @@ function teardown_file() {
|
||||
# check if any processes are running
|
||||
num=$(ps aux | grep steampipe | grep -v bats | grep -v grep | grep -v tests/acceptance | wc -l | tr -d ' ')
|
||||
assert_equal $num 0
|
||||
}
|
||||
}
|
||||
@@ -129,7 +129,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
steampipe query "select 1"
|
||||
|
||||
# check regions in connection config is being parsed and used
|
||||
run steampipe query "select * from chaos6.chaos_regions order by id" --output json
|
||||
run steampipe query "select id,region_name from chaos6.chaos_regions order by id" --output json
|
||||
result=$(echo $output | tr -d '[:space:]')
|
||||
# set the trimmed result as output
|
||||
run echo $result
|
||||
@@ -138,7 +138,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
# remove the config file
|
||||
rm -f $STEAMPIPE_INSTALL_DIR/config/chaos_options.spc
|
||||
# check output
|
||||
assert_output --partial '[{"_ctx":{"connection_name":"chaos6"},"id":0,"region_name":"us-east-1"},{"_ctx":{"connection_name":"chaos6"},"id":3,"region_name":"us-west-2"}]'
|
||||
assert_output --partial '[{"id":0,"region_name":"us-east-1"},{"id":3,"region_name":"us-west-2"}]'
|
||||
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
steampipe query "select 1"
|
||||
|
||||
# check regions in connection config is being parsed and used
|
||||
run steampipe query "select * from chaos6.chaos_regions order by id" --output json
|
||||
run steampipe query "select id,region_name from chaos6.chaos_regions order by id" --output json
|
||||
result=$(echo $output | tr -d '[:space:]')
|
||||
# set the trimmed result as output
|
||||
run echo $result
|
||||
@@ -157,7 +157,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
# remove the config file
|
||||
rm -f $STEAMPIPE_INSTALL_DIR/config/chaos_options.yml
|
||||
# check output
|
||||
assert_output --partial '[{"_ctx":{"connection_name":"chaos6"},"id":0,"region_name":"us-east-1"},{"_ctx":{"connection_name":"chaos6"},"id":3,"region_name":"us-west-2"}]'
|
||||
assert_output --partial '[{"id":0,"region_name":"us-east-1"},{"id":3,"region_name":"us-west-2"}]'
|
||||
|
||||
}
|
||||
|
||||
@@ -167,7 +167,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
steampipe query "select 1"
|
||||
|
||||
# check regions in connection config is being parsed and used
|
||||
run steampipe query "select * from chaos6.chaos_regions order by id" --output json
|
||||
run steampipe query "select id,region_name from chaos6.chaos_regions order by id" --output json
|
||||
result=$(echo $output | tr -d '[:space:]')
|
||||
# set the trimmed result as output
|
||||
run echo $result
|
||||
@@ -176,7 +176,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
# remove the config file
|
||||
rm -f $STEAMPIPE_INSTALL_DIR/config/chaos_options.json
|
||||
# check output
|
||||
assert_output --partial '[{"_ctx":{"connection_name":"chaos6"},"id":0,"region_name":"us-east-1"},{"_ctx":{"connection_name":"chaos6"},"id":3,"region_name":"us-west-2"}]'
|
||||
assert_output --partial '[{"id":0,"region_name":"us-east-1"},{"id":3,"region_name":"us-west-2"}]'
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user