mirror of
https://github.com/turbot/steampipe.git
synced 2025-12-19 18:12:43 -05:00
14.17.0-dev.6
This commit is contained in:
@@ -27,12 +27,12 @@ const (
|
||||
|
||||
// constants for installing db and fdw images
|
||||
const (
|
||||
DatabaseVersion = "14.17.0-dev.5"
|
||||
DatabaseVersion = "14.17.0-dev.6"
|
||||
FdwVersion = "1.12.4"
|
||||
|
||||
// PostgresImageRef is the OCI Image ref for the database binaries
|
||||
PostgresImageRef = "ghcr.io/turbot/steampipe/db:14.17.0-dev.5"
|
||||
PostgresImageDigest = "sha256:bf7dcd73414ba12ca867b281ecc3b55ab9cfc828fab73b435ea02d3582e1e532"
|
||||
PostgresImageRef = "ghcr.io/turbot/steampipe/db:14.17.0-dev.6"
|
||||
PostgresImageDigest = "sha256:acfa481e3f8fc0f62729e0ba9c25ea69ccd9788e31d5c598cbf5394759529e32"
|
||||
|
||||
FdwImageRef = "ghcr.io/turbot/steampipe/fdw:" + FdwVersion
|
||||
FdwBinaryFileName = "steampipe_postgres_fdw.so"
|
||||
|
||||
@@ -9,7 +9,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
steampipe query "select 1" --install-dir $target_install_directory
|
||||
|
||||
# check postgres binary is present in correct location
|
||||
run file $target_install_directory/db/14.17.0/postgres/bin/postgres
|
||||
run file $target_install_directory/db/14.17.0-dev.6/postgres/bin/postgres
|
||||
if [[ "$arch" == "x86_64" && "$os" == "Darwin" ]]; then
|
||||
assert_output --partial 'Mach-O 64-bit executable x86_64'
|
||||
elif [[ "$arch" == "arm64" && "$os" == "Darwin" ]]; then
|
||||
@@ -21,7 +21,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
fi
|
||||
|
||||
# check initdb binary is present in the correct location
|
||||
run file $target_install_directory/db/14.17.0/postgres/bin/initdb
|
||||
run file $target_install_directory/db/14.17.0-dev.6/postgres/bin/initdb
|
||||
if [[ "$arch" == "arm64" && "$os" == "Darwin" ]]; then
|
||||
assert_output --partial 'Mach-O 64-bit executable arm64'
|
||||
elif [[ "$arch" == "x86_64" && "$os" == "Darwin" ]]; then
|
||||
@@ -33,7 +33,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
fi
|
||||
|
||||
# check fdw binary(steampipe_postgres_fdw.so) is present in the correct location
|
||||
run file $target_install_directory/db/14.17.0/postgres/lib/postgresql/steampipe_postgres_fdw.so
|
||||
run file $target_install_directory/db/14.17.0-dev.6/postgres/lib/postgresql/steampipe_postgres_fdw.so
|
||||
if [[ "$arch" == "arm64" && "$os" == "Darwin" ]]; then
|
||||
assert_output --partial 'Mach-O 64-bit bundle arm64'
|
||||
elif [[ "$arch" == "x86_64" && "$os" == "Darwin" ]]; then
|
||||
@@ -45,7 +45,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
fi
|
||||
|
||||
# check fdw extension(steampipe_postgres_fdw.control) is present in the correct location
|
||||
run file $target_install_directory/db/14.17.0/postgres/share/postgresql/extension/steampipe_postgres_fdw.control
|
||||
run file $target_install_directory/db/14.17.0-dev.6/postgres/share/postgresql/extension/steampipe_postgres_fdw.control
|
||||
assert_output --partial 'ASCII text'
|
||||
}
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
|
||||
## public schema migration
|
||||
|
||||
@test "verify data is properly migrated when upgrading from v0.13.6" {
|
||||
@test "verify data is properly migrated when upgrading from v1.0.3" {
|
||||
# setup sql statements
|
||||
setup_sql[0]="create table sample(sample_col_1 char(10), sample_col_2 char(10))"
|
||||
setup_sql[1]="insert into sample(sample_col_1,sample_col_2) values ('foo','bar')"
|
||||
@@ -14,7 +14,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
verify_sql[0]="select * from sample"
|
||||
verify_sql[1]="select * from sample_func()"
|
||||
|
||||
# create a temp directory to install steampipe(0.13.6)
|
||||
# create a temp directory to install steampipe(1.0.3)
|
||||
tmpdir="$(mktemp -d)"
|
||||
mkdir -p "${tmpdir}"
|
||||
tmpdir="${tmpdir%/}"
|
||||
@@ -29,7 +29,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
esac
|
||||
|
||||
# download the zip and extract
|
||||
steampipe_uri="https://github.com/turbot/steampipe/releases/download/v0.13.6/steampipe_${target}"
|
||||
steampipe_uri="https://github.com/turbot/steampipe/releases/download/v1.0.3/steampipe_${target}"
|
||||
case $(uname -s) in
|
||||
"Darwin") zip_location="${tmpdir}/steampipe.zip" ;;
|
||||
"Linux") zip_location="${tmpdir}/steampipe.tar.gz" ;;
|
||||
@@ -46,7 +46,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
$tmpdir/steampipe --install-dir $tmpdir query "${setup_sql[$i]}"
|
||||
done
|
||||
|
||||
# store the result of the verification statements(0.13.6)
|
||||
# store the result of the verification statements(1.0.3)
|
||||
for ((i = 0; i < ${#verify_sql[@]}; i++)); do
|
||||
$tmpdir/steampipe --install-dir $tmpdir query "${verify_sql[$i]}" > verify$i.txt
|
||||
done
|
||||
|
||||
@@ -5,7 +5,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
current_year=$(date +"%Y")
|
||||
steampipe service start
|
||||
|
||||
run openssl x509 -enddate -noout -in $STEAMPIPE_INSTALL_DIR/db/14.17.0/data/root.crt
|
||||
run openssl x509 -enddate -noout -in $STEAMPIPE_INSTALL_DIR/db/14.17.0-dev.6/data/root.crt
|
||||
echo $output
|
||||
# check enddate
|
||||
assert_output --partial "notAfter=Dec 31 23:59:59 9999 GMT"
|
||||
@@ -13,7 +13,7 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
server_expiry=$((current_year + 3))
|
||||
echo $server_expiry
|
||||
|
||||
run openssl x509 -enddate -noout -in $STEAMPIPE_INSTALL_DIR/db/14.17.0/data/server.crt
|
||||
run openssl x509 -enddate -noout -in $STEAMPIPE_INSTALL_DIR/db/14.17.0-dev.6/data/server.crt
|
||||
echo $output
|
||||
# check enddate
|
||||
assert_output --partial "$server_expiry"
|
||||
@@ -23,25 +23,25 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
steampipe service start
|
||||
|
||||
# save file hash
|
||||
run cksum $STEAMPIPE_INSTALL_DIR/db/14.17.0/data/root.crt
|
||||
run cksum $STEAMPIPE_INSTALL_DIR/db/14.17.0-dev.6/data/root.crt
|
||||
id_root=$(echo $output | awk '{print $1}')
|
||||
echo $id_root
|
||||
|
||||
# save file hash
|
||||
run cksum $STEAMPIPE_INSTALL_DIR/db/14.17.0/data/server.crt
|
||||
run cksum $STEAMPIPE_INSTALL_DIR/db/14.17.0-dev.6/data/server.crt
|
||||
id_server=$(echo $output | awk '{print $1}')
|
||||
echo $id_server
|
||||
|
||||
steampipe service restart
|
||||
|
||||
# check file hash after restart
|
||||
run cksum $STEAMPIPE_INSTALL_DIR/db/14.17.0/data/root.crt
|
||||
run cksum $STEAMPIPE_INSTALL_DIR/db/14.17.0-dev.6/data/root.crt
|
||||
id_root_new=$(echo $output | awk '{print $1}')
|
||||
echo $id_root_new
|
||||
assert_equal $id_root $id_root_new
|
||||
|
||||
# check file hash after restart
|
||||
run cksum $STEAMPIPE_INSTALL_DIR/db/14.17.0/data/server.crt
|
||||
run cksum $STEAMPIPE_INSTALL_DIR/db/14.17.0-dev.6/data/server.crt
|
||||
id_server_new=$(echo $output | awk '{print $1}')
|
||||
echo $id_server_new
|
||||
|
||||
@@ -52,17 +52,17 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
|
||||
@test "deleting root certificate, service start should regenerate server and root certs" {
|
||||
# save file hash
|
||||
run cksum $STEAMPIPE_INSTALL_DIR/db/14.17.0/data/server.crt
|
||||
run cksum $STEAMPIPE_INSTALL_DIR/db/14.17.0-dev.6/data/server.crt
|
||||
id_server=$(echo $output | awk '{print $1}')
|
||||
echo $id_server
|
||||
|
||||
# delete root certificate
|
||||
rm -f $STEAMPIPE_INSTALL_DIR/db/14.17.0/data/root.crt
|
||||
rm -f $STEAMPIPE_INSTALL_DIR/db/14.17.0-dev.6/data/root.crt
|
||||
|
||||
steampipe service start
|
||||
|
||||
# save new file hash
|
||||
run cksum $STEAMPIPE_INSTALL_DIR/db/14.17.0/data/server.crt
|
||||
run cksum $STEAMPIPE_INSTALL_DIR/db/14.17.0-dev.6/data/server.crt
|
||||
id_server_new=$(echo $output | awk '{print $1}')
|
||||
echo $id_server_new
|
||||
|
||||
@@ -77,9 +77,9 @@ load "$LIB_BATS_SUPPORT/load.bash"
|
||||
}
|
||||
|
||||
@test "adding an encrypted private key should work fine and service should start successfully" {
|
||||
run openssl genrsa -aes256 -out $STEAMPIPE_INSTALL_DIR/db/14.17.0/data/server.key -passout pass:steampipe -traditional 2048
|
||||
run openssl genrsa -aes256 -out $STEAMPIPE_INSTALL_DIR/db/14.17.0-dev.6/data/server.key -passout pass:steampipe -traditional 2048
|
||||
|
||||
run openssl req -key $STEAMPIPE_INSTALL_DIR/db/14.17.0/data/server.key -passin pass:steampipe -new -x509 -out $STEAMPIPE_INSTALL_DIR/db/14.17.0/data/server.crt -subj "/CN=steampipe.io"
|
||||
run openssl req -key $STEAMPIPE_INSTALL_DIR/db/14.17.0-dev.6/data/server.key -passin pass:steampipe -new -x509 -out $STEAMPIPE_INSTALL_DIR/db/14.17.0-dev.6/data/server.crt -subj "/CN=steampipe.io"
|
||||
|
||||
steampipe service start --database-ssl-password steampipe
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user