Skip to content

pg_tde test PR #3

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 149 commits into
base: TDE_REL_17_STABLE
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
149 commits
Select commit Hold shift + click to select a range
b223d2d
PG-1437 Fix race condition in the event trigger
jeltz Apr 3, 2025
7ea53b4
PG-1455 Add field with random base IV to relation and WAL keys
jeltz Mar 27, 2025
127c568
PG-1455 Add random base numbers to IVs for relation data
jeltz Mar 27, 2025
72050ff
PG-1455 Add random base numbers to IVs for WAL encryption
jeltz Mar 28, 2025
36bc82d
PG-1455 Change xlog base IVs to use addition
jeltz Apr 1, 2025
d788185
PG-1437 Simplify pg_tde_read_one_map_entry2()
jeltz Apr 4, 2025
e9d4927
Use correct type for fd
jeltz Apr 4, 2025
5514727
PG-1416 Sign principal key info to protect against the wrong principa…
jeltz Apr 4, 2025
d83fc90
Use %m for error message in our modification of pg_regress
jeltz Apr 4, 2025
07756f2
PG-1530 Fix off-by-one bug when determining which WAL key to use
jeltz Apr 5, 2025
b11d51c
Use separate variables instead of an array when rotating files
jeltz Apr 4, 2025
2616e27
Clean up tdeheap_xlog_seg_read()
jeltz Apr 5, 2025
7638ec5
Make comment about all-zero pages less scary
jeltz Apr 7, 2025
fef106d
Remove unnecessary seek when we already know the size
jeltz Apr 7, 2025
3b8a234
PG-1457 Key management funcs renaming (#126)
artemgavrilov Apr 8, 2025
3381f84
Clarify some namings in keyring code
AndersAstrand Apr 8, 2025
6576f2a
PG-1532 Rewrite seqeunces using lower level functions
jeltz Apr 7, 2025
0a54910
Remove typedefs.list
AndersAstrand Apr 9, 2025
ab2e9b1
Fix typo in KeyringProvideRecord typedef name
AndersAstrand Apr 9, 2025
e0a3448
Added high level overview to documentation
dutow Mar 7, 2025
afb7151
Improved readability
nastena1606 Mar 10, 2025
9356a40
Updated review comments
dutow Mar 17, 2025
b83ff3d
PG-1468 Fix issue with intolerably slow recovery
jeltz Apr 10, 2025
959a6b6
PG-1457 Rename principal key on user API level to just a key (#154)
artemgavrilov Apr 10, 2025
d158ba5
Update doc link readme (#175)
nastena1606 Apr 10, 2025
725c34d
Modernize our way to call ereport()
jeltz Apr 10, 2025
4c3b0f8
PG-1480 Add regression tests for default key rotation
jeltz Mar 23, 2025
065409d
PG-1437 Remove TODO about tests for changing key provider type
jeltz Apr 4, 2025
c717b69
PG-1437 Clean up frontend and backend sources in meson.build
jeltz Mar 31, 2025
a590cf0
Fix indentation in pg_tde/meson.build
jeltz Apr 1, 2025
93ef451
Fix typo in comment of Makefile/meson.build
jeltz Apr 7, 2025
19bef89
PG-1510 Use a unique IV per relation fork
jeltz Apr 14, 2025
5afe678
PG-1504 Do not abuse checkEncryptionClause() for just one feature
jeltz Apr 7, 2025
9d22ae3
PG-1504 Remove side effects from checkEncryptionStatus()
jeltz Apr 7, 2025
71ce4c9
PG-1504 Avoid early return where it does not improve reasbaility
jeltz Apr 7, 2025
090e356
PG-1504 Remove unused field in tdeCurrentCreateEvent
jeltz Apr 11, 2025
36b17e8
PG-1504 Use castNode() when casting nodes
jeltz Apr 12, 2025
7587e44
PG-1504 Return null pointer from event triggers
jeltz Apr 12, 2025
253c8a4
PG-1504 Open the relation directly with the RangeVar
jeltz Apr 14, 2025
06b671f
PG-1460 Always generate a new WAL key on server start
jeltz Apr 10, 2025
92e40cd
XLog signed info when creating a Principal Key
dAdAbird Apr 15, 2025
9823fb7
Add Dragos Andriciuc to code owners
jeltz Apr 15, 2025
c8dd168
PG-1458 Add default key info/verify funcions
artemgavrilov Apr 11, 2025
dcdcebb
PG-1482, PG-1289 Add coverage to repo and percona server version chec…
Naeem-Akhter Apr 15, 2025
99ef6b2
PG-1440 Only let superusers modify the global key proviers
jeltz Apr 14, 2025
20ab981
PG-1440 Remove unnecesary query for test case
jeltz Apr 14, 2025
a08ed99
Modernize the way we call ereport() part 2
AndersAstrand Apr 16, 2025
6aa4203
Actually run the test of pg_tde_version()
jeltz Apr 16, 2025
c106658
Remove dead code in pg_tde_defs.c
jeltz Apr 16, 2025
44c3619
Stop pretending that we use autotools to build config.h
jeltz Apr 16, 2025
033f7ca
Make sure we have tests which fetch KMIP and Vault keys
jeltz Apr 16, 2025
cc459df
Always pfree tmp WAL key when allocated
dAdAbird Apr 16, 2025
a4818a8
Clean up TAP test helpers
jeltz Apr 14, 2025
945cbe4
Make global variable local in TAP tests
jeltz Apr 16, 2025
233305b
Remove unused includes in TAP tests
jeltz Apr 15, 2025
3bb5edf
Remove pointless white space and comments from TAP tests
jeltz Apr 15, 2025
891adb1
Always restart the server in the same way in our TAP tests
jeltz Apr 15, 2025
b190cd0
Add test helper to TAP tests which runs psql and appends
jeltz Apr 16, 2025
908d077
Rename test helper append_to_file() to append_to_result_file()
jeltz Apr 16, 2025
832cbb4
Convert output of TAP tests to be more like pg_regress
jeltz Apr 14, 2025
cb80b20
pfree tmp key when set principal key
dAdAbird Apr 16, 2025
8a7fc7a
PG-1441 Clean up code formatting of pg_tde WAL resource manager
jeltz Apr 16, 2025
ee8c285
PG-1441 Change the name of the WAL resource manager
jeltz Apr 16, 2025
35ff2fd
PG-1441 Improve pg_tde resource manager record types and decriptions
jeltz Apr 16, 2025
33d7826
PG-1441 Add record type names and descriptions for all types
jeltz Apr 16, 2025
ac53512
PG-1441 Further improve resource manager type names
jeltz Apr 16, 2025
ee3279b
PG-1441 Sort resource manager record types
jeltz Apr 16, 2025
2131faf
Use PostgreSQL's find_typedef script instead of our own
jeltz Apr 11, 2025
14a3d36
Only check pg_tde with the combined typedefs
jeltz Apr 11, 2025
40c32b2
[PG-1545] - Remove pg_tde_revoke_global_key_management_from_role refe…
shahidullah79 Apr 17, 2025
1390dd0
PG-1535 Do not delete global key provider in use
AndersAstrand Apr 17, 2025
3b6d3d4
Use append_conf() helper in TAP tests
jeltz Apr 17, 2025
1df4ff5
Remove unnecesary comments and code in pgtde.pm
jeltz Apr 17, 2025
5fb9291
Drop support for PostgreSQL <15 in pgtde.pm
jeltz Apr 17, 2025
cf2806d
Simplify setup_files_dir() in pgtde.pm
jeltz Apr 17, 2025
eb8b307
PG-1491 Add SQL test cases for pg_tde_is_encrypted() for partitioned …
mohitj1988 Apr 18, 2025
ca37d73
Remove dead code for scanning key providers by type
jeltz Apr 18, 2025
eed2657
Remove pgtde_init_pg() TAP helper
jeltz Apr 17, 2025
607cf93
Remove unused tests
AndersAstrand Apr 21, 2025
54cd79c
PG-1517 - Automate testcase for (#243)
mohitj1988 Apr 22, 2025
71da1f0
Run pgperltidy
AndersAstrand Apr 22, 2025
681b9ff
Run pgperltidy in github actions
AndersAstrand Apr 21, 2025
ec51d08
PG-1444 Remove dead code for relation key deletion redo
jeltz Apr 19, 2025
a6f774e
PG-1444 Move relation key deleteion to smgr_unlink()
jeltz Apr 19, 2025
5f279ad
Fix broken reuse of deleted entries in key map file
jeltz Apr 19, 2025
6f1bb54
Simplify pg_tde_find_map_entry() now that reading is simpler
jeltz Apr 19, 2025
f3719a7
Use restart TAP helper and do not assert result
jeltz Apr 17, 2025
0d86245
XLog a key rotation event rather than the result
dAdAbird Apr 16, 2025
ecabb8b
Do missing renamings in documentation
artemgavrilov Apr 17, 2025
3095a6a
Add 71da1f03f2f0ff18ed11e4ba6b07b6bd56705a5d to .git-blame-ignore-revs
AndersAstrand Apr 22, 2025
2b417da
PG-1366 Clean up architecture documentation and make it up to date
jeltz Apr 14, 2025
5ae34a2
PG-1366 Remove too detailed and incorrect comment from achitecture docs
jeltz Apr 22, 2025
86a43fc
Update a small fix to sequences
Andriciuc Apr 22, 2025
0cc1d56
Fix whitespace in pg_tde tools Makefile
jeltz Apr 22, 2025
b2fb3ff
Rename pg_tde_xlog_encrypt.{c,h} to pg_tde_xlog_smgr.{c,h}
jeltz Apr 22, 2025
332064b
Remove useless comments in pg_tde_tdemap.c
jeltz Apr 22, 2025
676d637
Do not initialize local variables unnecessarily
jeltz Apr 22, 2025
0b2dbd2
Consistently update the position in a pointer passed to the function
jeltz Apr 22, 2025
15ea835
Do not switch between using prev_pos and curr_pos
jeltz Apr 22, 2025
1885236
Simplify error handling in pg_tde_write_map_keydata_file()
jeltz Apr 22, 2025
14a2bd2
Clean up a couple comments in pg_tde_tdemap.c
jeltz Apr 22, 2025
043232e
Change some keyring function to return void
AndersAstrand Apr 10, 2025
ce63840
Remove non-test
AndersAstrand Apr 16, 2025
d6eb31f
Fix error message in keyring_file.c
AndersAstrand Apr 17, 2025
65fa2e2
Rename KeyringProviderXLRecord
AndersAstrand Apr 17, 2025
1b8513c
Refactor some lower level functions in tde_keyring
AndersAstrand Apr 14, 2025
157230d
PG-1419 Validate key provider access
AndersAstrand Apr 16, 2025
4724ecb
Redo of the key provider info now needs a lock
dAdAbird Apr 23, 2025
53f7122
PG-1441 Refactor code for generating keys in SMGR code
jeltz Apr 17, 2025
4d9756d
PG-1441 Write simple TAP test for replication of pg_tde
jeltz Apr 17, 2025
8fe368b
PG-1441 Do not generate relation keys in the SMGR on redo
jeltz Apr 16, 2025
e450170
PG-1441 Do not replicate relation keys
jeltz Apr 16, 2025
b7d2f15
Fix typo
artemgavrilov Apr 23, 2025
e735727
Do not encourage root token use for vault
AndersAstrand Apr 23, 2025
1fa786f
Don't rewrite _map files on the save_principal_key redo
dAdAbird Apr 15, 2025
c8419b8
Add crash recovery tests
dAdAbird Apr 23, 2025
57ac8c8
Fix typo in out param of pg_tde_*_key_info()
jeltz Apr 24, 2025
6b508a0
Make 013_crash_recovery.pl work on repeated runs
AndersAstrand Apr 25, 2025
16ba8ee
Fix release of the not-held lock
dAdAbird Apr 24, 2025
3251aef
Rename the files under $PGDATA/pg_tde
jeltz Apr 25, 2025
f758cc7
Make local variable no longer static
jeltz Apr 25, 2025
e7fa26f
Consistently use HeapTupleIsValid()
jeltz Apr 25, 2025
b639210
Remove duplicate pg_regress alternate expected file
jeltz Apr 25, 2025
aeaae4e
Remove double declarations
AndersAstrand Apr 25, 2025
c1da756
Specifiy extensions required for tde test in EXTRA_INSTALL
artemgavrilov Apr 21, 2025
198af9e
Extract code coverage jobs into separate CI workflow
artemgavrilov Apr 18, 2025
082cc11
Run simple tests for code coverage needs
artemgavrilov Apr 21, 2025
b7d52ab
Highlight that code coverage badge in main readme file related to pg_tde
artemgavrilov Apr 18, 2025
d602c2e
Remove unused return value from check_percona_api_version()
jeltz Apr 25, 2025
d51c498
Remove leftovers from when we remove tde_heap_basic
jeltz Apr 25, 2025
f1d12f1
Stop ignoring nodtags.h for pgindent
jeltz Apr 25, 2025
435ef90
Move pg_tde_change_key_provider .gitignore entry
jeltz Apr 25, 2025
e355f38
Clean up .gitignore
jeltz Apr 25, 2025
5f64c75
Make failure artifact names consistent in Github Actions
jeltz Apr 26, 2025
5a1fe76
Add more test result and logs to the Github failure artifact
jeltz Apr 26, 2025
6fef8bd
Rename event triggers to something more expressive
jeltz Apr 26, 2025
712dcf5
Clean up some switch statements and if chains
jeltz Apr 26, 2025
e979ab7
Harmonize the different Github Actions entry points
jeltz Apr 25, 2025
b7dfa68
Only enable TDE_MODE for the tests with global TDE
jeltz Apr 25, 2025
e4c1cc0
Do not run pg_tde tests in make when in global TDE mode
jeltz Apr 25, 2025
6a1e1b6
Remove support for running pg_tde tests in global TDE mode
jeltz Apr 25, 2025
ae04e97
Clean up test SQL file
jeltz Apr 24, 2025
dffece7
Make ALTER TABLE ... SET ACCESS METHOD logic easier to read
jeltz Apr 24, 2025
7177c2d
Simplify logic for global, local, server, default
jeltz Apr 22, 2025
7ed3115
Get rid of global_status enum
jeltz Apr 22, 2025
bb000ef
Simplify superuser check for pg_tde_set_*_key_using_*_key_provider()
jeltz Apr 22, 2025
23786e9
Move all pg_tde related tests into contrib/pg_tde
jeltz Apr 25, 2025
3f51a90
WIP: PG-1442 Enable encryption of catalog tables
jeltz Feb 11, 2025
ba8d862
WIP: PG-1442 Ugly fix
jeltz Feb 12, 2025
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
3 changes: 3 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
#
# $ git log --pretty=format:"%H # %cd%n# %s" $PGINDENTGITHASH -1 --date=iso

71da1f03f2f0ff18ed11e4ba6b07b6bd56705a5d # 2025-04-22 11:40:24 +0200
# Run pgperltidy

c739ae9e288c095cfe1b91ce27a2f2c075ed5da4 # 2024-08-26 16:16:09 -0700
# Fix identation.

Expand Down
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
# Order is important; the last matching pattern takes the most precedence.

* @dutow @dAdAbird
/contrib/pg_tde/documentation/ @nastena1606
/contrib/pg_tde/documentation/ @nastena1606 @Andriciuc
/.github/ @artemgavrilov
45 changes: 45 additions & 0 deletions .github/codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
codecov:
strict_yaml_branch: TDE_REL_17_STABLE
fixes:
- "src/::contrib/pg_tde/src/" # move path for codecov file mappings e.g., "src/" => "contrib/pg_tde/src/"
coverage:
status:
project:
default:
target: 90%
threshold: 1%
base: auto
comment:
layout: "header, diff, components"
component_management:
default_rules:
statuses:
- type: project
target: auto
branches:
- "TDE_REL_17_STABLE"
individual_components:
- component_id: access
paths:
- contrib/pg_tde/src/access/**
- component_id: catalog
paths:
- contrib/pg_tde/src/catalog/**
- component_id: common
paths:
- contrib/pg_tde/src/common/**
- component_id: encryption
paths:
- contrib/pg_tde/src/encryption/**
- component_id: keyring
paths:
- contrib/pg_tde/src/keyring/**
- component_id: src
paths:
- contrib/pg_tde/src/*.c
- component_id: smgr
paths:
- contrib/pg_tde/src/smgr/**
- component_id: transam
paths:
- contrib/pg_tde/src/transam/**
56 changes: 56 additions & 0 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Code coverage
on:
pull_request:
push:
branches:
- TDE_REL_17_STABLE

jobs:
collect:
name: Collect and upload
runs-on: ubuntu-22.04
steps:
- name: Clone repository
uses: actions/checkout@v4
with:
submodules: recursive

- name: Install dependencies
run: ci_scripts/ubuntu-deps.sh

- name: Build postgres
run: ci_scripts/make-build.sh debug --enable-coverage

- name: Setup kmip and vault
run: ci_scripts/setup-keyring-servers.sh

- name: Test postgres with TDE to generate coverage
run: ci_scripts/make-test.sh --tde-only

- name: Collect coverage data
run: find . -type f -name "*.c" ! -path '*libkmip*' | xargs -t gcov -abcfu
working-directory: contrib/pg_tde

- name: Upload coverage data to codecov.io
uses: codecov/codecov-action@v5
with:
verbose: true
token: ${{ secrets.CODECOV_TOKEN }}
working-directory: contrib/pg_tde
files: "*.c.gcov"

- name: Report on test fail
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: coverage-testlog-tde
path: |
build/testrun/
contrib/pg_tde/t/
contrib/pg_tde/results
contrib/pg_tde/regression.diffs
contrib/pg_tde/regression.out
contrib/pg_tde/*.gcov
retention-days: 3


7 changes: 5 additions & 2 deletions .github/workflows/pgindent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ defaults:
jobs:
check:
name: Check
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- name: Clone repository
uses: actions/checkout@v4
Expand All @@ -26,6 +26,9 @@ jobs:

- name: Update typedefs
run: ci_scripts/dump-typedefs.sh

- name: Run pgindent
run: ci_scripts/run-pgindent.sh --check --diff

- name: Run pgperltidy
run: ci_scripts/run-pgperltidy.sh --assert-tidy --standard-error-output
3 changes: 3 additions & 0 deletions .github/workflows/psp-matrix.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: PSP
on:
pull_request:
push:
branches:
- TDE_REL_17_STABLE
workflow_dispatch:

jobs:
Expand Down
42 changes: 28 additions & 14 deletions .github/workflows/psp-reusable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
- name: Build postgres
run: src/ci_scripts/${{ inputs.build_script }}-build.sh ${{ inputs.build_type }}

- name: 'Tar files'
- name: Archive pginst to artifact tar file
run: tar -czf artifacts.tar src pginst

- name: Upload build artifacts
Expand All @@ -57,7 +57,7 @@ jobs:
name: ${{ env.artifact_name }}
path: .

- name: 'Untar files'
- name: Extract artifact file
run: tar -xzf artifacts.tar

- name: Install dependencies
Expand All @@ -73,13 +73,20 @@ jobs:
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: testlog-ubuntu-${{ inputs.ubuntu_version }}.04-meson-${{ inputs.build_type }}
name: log-test-${{ inputs.os }}-${{ inputs.build_script }}-${{ inputs.build_type }}
path: |
src/build/testrun/
src/contrib/*/t/
src/contrib/*/results
src/contrib/*/log
src/contrib/*/regression.diffs
src/contrib/*/regression.out
src/contrib/*/results
src/contrib/*/tmp_check
src/contrib/*/t/results
src/src/test/*/log
src/src/test/*/regression.diffs
src/src/test/*/regression.out
src/src/test/*/results
src/src/test/*/tmp_check
retention-days: 3

test_tde:
Expand All @@ -95,27 +102,34 @@ jobs:
name: ${{ env.artifact_name }}
path: .

- name: 'Untar files'
- name: Extract artifact file
run: tar -xzf artifacts.tar

- name: Install dependencies
run: src/ci_scripts/ubuntu-deps.sh
run: src/ci_scripts/ubuntu-deps.sh

- name: Setup kmip and vault
run: src/ci_scripts/setup-keyring-servers.sh
- name: Test postgres with TDE
run: src/ci_scripts/${{ inputs.build_script }}-test-tde.sh --continue

- name: Test postgres with TDE as default access method
run: src/ci_scripts/${{ inputs.build_script }}-test-global-tde.sh --continue

- name: Report on test fail
uses: actions/upload-artifact@v4
if: ${{ failure() }}
with:
name: testlog-tde-${{ inputs.os }}-${{ inputs.build_script }}-${{ inputs.build_type }}
name: log-test-global-tde-${{ inputs.os }}-${{ inputs.build_script }}-${{ inputs.build_type }}
path: |
src/build/testrun/
src/contrib/*/t/
src/contrib/*/results
src/contrib/*/log
src/contrib/*/regression.diffs
src/contrib/*/regression.out
src/contrib/*/results
src/contrib/*/tmp_check
src/contrib/*/t/results
src/src/test/*/log
src/src/test/*/regression.diffs
src/src/test/*/regression.out
src/src/test/*/results
src/src/test/*/tmp_check
retention-days: 3
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
### Code coverage for [pg_tde](https://github.com/percona/postgres/tree/TDE_REL_17_STABLE/contrib/pg_tde): [![codecov](https://codecov.io/github/percona/postgres/graph/badge.svg?token=Wow78BMYdP)](https://codecov.io/github/percona/postgres)

Percona Server for PostgreSQL
=============================

Expand Down
4 changes: 2 additions & 2 deletions ci_scripts/backup/pg_basebackup_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ setup_tde_heap(){
sudo -u "$PG_USER" psql -p $PG_PORT -c "DROP DATABASE IF EXISTS $DB_NAME;"
sudo -u "$PG_USER" psql -p $PG_PORT -c "CREATE DATABASE $DB_NAME;"
sudo -u "$PG_USER" psql -d "$DB_NAME" -p "$PG_PORT" -c "CREATE EXTENSION IF NOT EXISTS pg_tde;"
sudo -u "$PG_USER" psql -d "$DB_NAME" -p "$PG_PORT" -c "SELECT pg_tde_add_key_provider_file('file-vault','$KEYLOCATION');"
sudo -u "$PG_USER" psql -d "$DB_NAME" -p "$PG_PORT" -c "SELECT pg_tde_set_principal_key('test-db-master-key','file-vault');"
sudo -u "$PG_USER" psql -d "$DB_NAME" -p "$PG_PORT" -c "SELECT pg_tde_add_database_key_provider_file('file-vault','$KEYLOCATION');"
sudo -u "$PG_USER" psql -d "$DB_NAME" -p "$PG_PORT" -c "SELECT pg_tde_set_key_using_database_key_provider('test-db-master-key','file-vault');"
sudo -u "$PG_USER" psql -p $PG_PORT -c "ALTER DATABASE $DB_NAME SET default_table_access_method='tde_heap';"
sudo -u "$PG_USER" psql -p $PG_PORT -c "SELECT pg_reload_conf();"
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/bash
set -e

# This script is used to configure a TDE server for testing purposes.
export TDE_MODE=1

SCRIPT_DIR="$(cd -- "$(dirname "$0")" >/dev/null 2>&1; pwd -P)"
INSTALL_DIR="$SCRIPT_DIR/../../pginst"
source $SCRIPT_DIR/env.sh

cd "$SCRIPT_DIR/.."

source "$SCRIPT_DIR/env.sh"
export TDE_MODE=1
export PATH=$INSTALL_DIR/bin:$PATH
export DATA_DIR=$INSTALL_DIR/data
export PGDATA="${1:-$DATA_DIR}"
Expand Down
25 changes: 3 additions & 22 deletions ci_scripts/dump-typedefs.sh
Original file line number Diff line number Diff line change
@@ -1,33 +1,14 @@
#!/bin/bash

SCRIPT_DIR="$(cd -- "$(dirname "$0")" >/dev/null 2>&1; pwd -P)"
cd "$SCRIPT_DIR/../"

if ! test -f src/backend/postgres; then
echo "src/backend/postgres doesn't exists, run make-build.sh first in debug mode"
exit 1
fi
cd "$SCRIPT_DIR/.."

if ! test -f contrib/pg_tde/pg_tde.so; then
echo "contrib/pg_tde/pg_tde.so doesn't exists, run make-build.sh first in debug mode"
exit 1
fi

objdump -W src/backend/postgres |\
egrep -A3 DW_TAG_typedef |\
perl -e ' while (<>) { chomp; @flds = split;next unless (1 < @flds);\
next if $flds[0] ne "DW_AT_name" && $flds[1] ne "DW_AT_name";\
next if $flds[-1] =~ /^DW_FORM_str/;\
print $flds[-1],"\n"; }' |\
sort | uniq > percona.typedefs

objdump -W contrib/pg_tde/pg_tde.so |\
egrep -A3 DW_TAG_typedef |\
perl -e ' while (<>) { chomp; @flds = split;next unless (1 < @flds);\
next if $flds[0] ne "DW_AT_name" && $flds[1] ne "DW_AT_name";\
next if $flds[-1] =~ /^DW_FORM_str/;\
print $flds[-1],"\n"; }' |\
sort | uniq > tde.typedefs
src/tools/find_typedef contrib/pg_tde > pg_tde.typedefs

# Combine with original typedefs
cat percona.typedefs tde.typedefs src/tools/pgindent/typedefs.list | sort | uniq > combined.typedefs
cat pg_tde.typedefs src/tools/pgindent/typedefs.list | sort -u > combined.typedefs
3 changes: 3 additions & 0 deletions ci_scripts/env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash

export PERCONA_SERVER_VERSION=17.4.1
14 changes: 12 additions & 2 deletions ci_scripts/make-build.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
#!/bin/bash

export TDE_MODE=1
ENABLE_COVERAGE=

for arg in "$@"
do
case "$arg" in
--enable-coverage)
ENABLE_COVERAGE="--enable-coverage"
shift;;
esac
done

SCRIPT_DIR="$(cd -- "$(dirname "$0")" >/dev/null 2>&1; pwd -P)"
INSTALL_DIR="$SCRIPT_DIR/../../pginst"
source "$SCRIPT_DIR/env.sh"

cd "$SCRIPT_DIR/.."

Expand All @@ -12,5 +22,5 @@ if [ "$1" = "debugoptimized" ]; then
export CXXFLAGS="-O2"
fi

./configure --enable-debug --enable-cassert --enable-tap-tests --prefix=$INSTALL_DIR
./configure --prefix="$INSTALL_DIR" --enable-debug --enable-cassert --enable-tap-tests $ENABLE_COVERAGE
make install-world -j
18 changes: 10 additions & 8 deletions ci_scripts/make-test-tde.sh → ci_scripts/make-test-global-tde.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
#!/bin/bash

set -e
ADD_FLAGS=

export TDE_MODE=1
for arg in "$@"
do
case "$arg" in
--continue)
ADD_FLAGS="-k"
shift;;
esac
done

SCRIPT_DIR="$(cd -- "$(dirname "$0")" >/dev/null 2>&1; pwd -P)"
source $SCRIPT_DIR/configure-tde-server.sh

ADD_FLAGS=

if [ "$1" = "--continue" ]; then
ADD_FLAGS="-k"
fi
source "$SCRIPT_DIR/configure-global-tde.sh"

EXTRA_REGRESS_OPTS="--extra-setup=$SCRIPT_DIR/tde_setup.sql" make -s installcheck-world $ADD_FLAGS
25 changes: 20 additions & 5 deletions ci_scripts/make-test.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
#!/bin/bash

export TDE_MODE=1
set -e
TDE_ONLY=0

SCRIPT_DIR="$(cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P)"
INSTALL_DIR="$SCRIPT_DIR/../../pginst"
for arg in "$@"
do
case "$arg" in
--tde-only)
TDE_ONLY=1
shift;;
esac
done

cd "$SCRIPT_DIR/.."
SCRIPT_DIR="$(cd -- "$(dirname "$0")" >/dev/null 2>&1; pwd -P)"
source "$SCRIPT_DIR/env.sh"

make -s check-world
if [ "$TDE_ONLY" -eq 1 ];
then
cd "$SCRIPT_DIR/../contrib/pg_tde"
make -s check
else
cd "$SCRIPT_DIR/.."
make -s check-world
fi
Loading
Loading