Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ require (
github.com/spf13/viper v1.20.1
github.com/thediveo/enumflag/v2 v2.0.7
github.com/turbot/go-kit v1.3.0
github.com/turbot/pipe-fittings/v2 v2.9.0
github.com/turbot/pipe-fittings/v2 v2.9.1
github.com/turbot/steampipe-plugin-sdk/v5 v5.14.0
github.com/turbot/terraform-components v0.0.0-20250114051614-04b806a9cbed
github.com/zclconf/go-cty v1.16.3 // indirect
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -1247,8 +1247,8 @@ github.com/turbot/go-kit v1.3.0 h1:6cIYPAO5hO9fG7Zd5UBC4Ch3+C6AiiyYS0UQnrUlTV0=
github.com/turbot/go-kit v1.3.0/go.mod h1:piKJMYCF8EYmKf+D2B78Csy7kOHGmnQVOWingtLKWWQ=
github.com/turbot/go-prompt v0.2.6-steampipe.0.0.20221028122246-eb118ec58d50 h1:zs87uA6QZsYLk4RRxDOIxt8ro/B2V6HzoMWm05Lo7ao=
github.com/turbot/go-prompt v0.2.6-steampipe.0.0.20221028122246-eb118ec58d50/go.mod h1:vFnjEGDIIA/Lib7giyE4E9c50Lvl8j0S+7FVlAwDAVw=
github.com/turbot/pipe-fittings/v2 v2.9.0 h1:y5gBg7yLOXvaodH7vvOUAMEDMTMYfxKRHZDTj/vhJxM=
github.com/turbot/pipe-fittings/v2 v2.9.0/go.mod h1:OmmhCd4ALeWwfUpwZN/0pTNhfNmh/kwewOHRVWsRHY4=
github.com/turbot/pipe-fittings/v2 v2.9.1 h1:1dwVsaIsdUIVLfRlvhNEm7KxTmpPuUoyEBbbioaoOUw=
github.com/turbot/pipe-fittings/v2 v2.9.1/go.mod h1:OmmhCd4ALeWwfUpwZN/0pTNhfNmh/kwewOHRVWsRHY4=
github.com/turbot/pipes-sdk-go v0.12.1 h1:mF9Z9Mr6F0uqlWjd1mQn+jqT24GPvWDFDrFTvmkazHc=
github.com/turbot/pipes-sdk-go v0.12.1/go.mod h1:iQE0ebN74yqiCRrfv7izxVMRcNlZftPWWDPsMFwejt4=
github.com/turbot/steampipe-plugin-sdk/v5 v5.14.0 h1:CyufzeM2BMbA2nJRuujucchp9NZ6BEeYA2phhdMXsW4=
Expand Down
14 changes: 7 additions & 7 deletions tests/acceptance/test_files/cloud.bats
Original file line number Diff line number Diff line change
Expand Up @@ -7,46 +7,46 @@ load "$LIB_BATS_SUPPORT/load.bash"

@test "connect to cloud workspace - passing the postgres connection string to workspace-database arg" {
# run steampipe query and fetch an account from the cloud workspace
run steampipe query "select account_aliases from all_aws.aws_account where account_id='632902152528'" --workspace-database $SPIPETOOLS_PG_CONN_STRING --output json
run steampipe query "select account_aliases from all_aws.aws_account where account_id='097350876455'" --workspace-database $SPIPETOOLS_PG_CONN_STRING --output json
echo $output

# fetch the value of account_alias to compare
op=$(echo $output | jq '.rows[0].account_aliases[0]')
echo $op

# check if values match
assert_equal "$op" "\"nagraj-aaa\""
assert_equal "$op" "\"turbot-silverwater\""
}

@test "connect to cloud workspace - passing the cloud-token arg and the workspace name to workspace-database arg" {
# run steampipe query and fetch an account from the cloud workspace
run steampipe query "select account_aliases from all_aws.aws_account where account_id='632902152528'" --pipes-token $SPIPETOOLS_TOKEN --workspace-database turbot-ops/clitesting --output json
run steampipe query "select account_aliases from all_aws.aws_account where account_id='097350876455'" --pipes-token $SPIPETOOLS_TOKEN --workspace-database turbot-ops/clitesting --output json
echo $output

# fetch the value of account_alias to compare
op=$(echo $output | jq '.rows[0].account_aliases[0]')
echo $op

# check if values match
assert_equal "$op" "\"nagraj-aaa\""
assert_equal "$op" "\"turbot-silverwater\""
}

@test "connect to cloud workspace - passing the cloud-host arg, the cloud-token arg and the workspace name to workspace-database arg" {
# run steampipe query and fetch an account from the cloud workspace
run steampipe query "select account_aliases from all_aws.aws_account where account_id='632902152528'" --pipes-host "pipes.turbot.com" --pipes-token $SPIPETOOLS_TOKEN --workspace-database turbot-ops/clitesting --output json
run steampipe query "select account_aliases from all_aws.aws_account where account_id='097350876455'" --pipes-host "pipes.turbot.com" --pipes-token $SPIPETOOLS_TOKEN --workspace-database turbot-ops/clitesting --output json
echo $output

# fetch the value of account_alias to compare
op=$(echo $output | jq '.rows[0].account_aliases[0]')
echo $op

# check if values match
assert_equal "$op" "\"nagraj-aaa\""
assert_equal "$op" "\"turbot-silverwater\""
}

@test "connect to cloud workspace(FAILED TO CONNECT) - passing wrong postgres connection string to workspace-database arg" {
# run steampipe query using wrong connection string
run steampipe query "select account_aliases from all_aws.aws_account where account_id='632902152528'" --workspace-database abcd/efgh --output json
run steampipe query "select account_aliases from all_aws.aws_account where account_id='097350876455'" --workspace-database abcd/efgh --output json
echo $output

# check the error message
Expand Down
Loading